CN113762286A - Data model training method, device, equipment and medium - Google Patents

Data model training method, device, equipment and medium Download PDF

Info

Publication number
CN113762286A
CN113762286A CN202111088635.8A CN202111088635A CN113762286A CN 113762286 A CN113762286 A CN 113762286A CN 202111088635 A CN202111088635 A CN 202111088635A CN 113762286 A CN113762286 A CN 113762286A
Authority
CN
China
Prior art keywords
sample
training
contour
samples
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111088635.8A
Other languages
Chinese (zh)
Inventor
黄哲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An International Smart City Technology Co Ltd
Original Assignee
Ping An International Smart City Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An International Smart City Technology Co Ltd filed Critical Ping An International Smart City Technology Co Ltd
Priority to CN202111088635.8A priority Critical patent/CN113762286A/en
Publication of CN113762286A publication Critical patent/CN113762286A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Computation (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computational Linguistics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Evolutionary Biology (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Image Analysis (AREA)

Abstract

The application relates to the technical field of artificial intelligence, and discloses a data model training method, a device, a medium and equipment, wherein the method comprises the following steps: acquiring an initial picture set; identifying and respectively carrying out contour labeling on the target objects; establishing a virtual coordinate system in each initial image sample, and carrying out coordinate alignment on the contour center of the target contour and the midpoint of the image; taking the initial picture sample after the coordinates are aligned as a first training sample, and training based on the first training sample to obtain a first data model; taking the first training sample with the confidence coefficient parameter larger than a preset confidence threshold value as a satisfactory sample, taking the first training sample with the confidence coefficient parameter not larger than the confidence threshold value as an unsatisfactory sample, and removing the unsatisfactory sample; acquiring a supplementary training sample, and acquiring a second training sample according to the supplementary training sample and the satisfactory sample; training the first data model through a second training sample to obtain a second data model; thereby improving the training efficiency of the model.

Description

Data model training method, device, equipment and medium
Technical Field
The present application relates to the field of artificial intelligence technologies, and in particular, to a data model training method, apparatus, device, and medium.
Background
In deep learning training samples based on yolov3, part of training samples may be too poor, for example, problems of smear, shading, unclear and the like exist, or a part of scenes have a sample shortage, which results in insufficient training samples, which may result in low model accuracy after training, and the doping of poor samples may also result in too high complexity during training.
Aiming at the inferior quality of part of training samples, the traditional method is to manually examine the pictures of the whole samples and screen out unqualified samples, and whether the pictures are qualified or not and also has subjective components; aiming at the problem of sample scarcity, the method mainly comprises the steps of manually screening high-quality samples, making more samples in a keras data enhancement mode, a tilting mode, a mirror surface mode and the like, or using a public data set, a network access acquisition mode and the like. However, both of the above two processing methods require a lot of manpower and time, resulting in low model training efficiency.
Disclosure of Invention
The application mainly aims to provide a data model training method, a data model training device, a data model training medium and data model training equipment, and aims to solve the technical problem that the training efficiency of a model in the prior art is low.
In order to achieve the above object, the present application provides a data model training method, including:
acquiring an initial picture set, wherein the initial picture set comprises a plurality of initial picture samples;
identifying a target object in each initial picture sample, and respectively carrying out contour labeling on the target object to obtain a target contour;
respectively establishing a virtual coordinate system in each initial image sample, calculating the image midpoint of the initial image sample according to the virtual coordinate system, and carrying out coordinate alignment on the contour center of the target contour and the image midpoint;
taking the initial picture sample after the coordinates are aligned as a first training sample, and training based on the first training sample to obtain a first data model;
respectively calculating confidence coefficient parameters of the first training samples, taking the first training samples with the confidence coefficient parameters larger than a preset confidence threshold value as satisfied samples, taking the first training samples with the confidence coefficient parameters not larger than the confidence threshold value as unsatisfied samples, and removing the unsatisfied samples;
responding to a sample supplement instruction, acquiring a supplement training sample, and obtaining a second training sample according to the supplement training sample and the satisfactory sample;
and training the first data model through the second training sample to obtain a second data model.
Further, the coordinate alignment of the contour center of the target contour and the center point in the image includes:
when a plurality of target contours exist in the initial picture sample, copying the initial picture sample to obtain a plurality of copied picture samples;
and respectively selecting a different target contour from each copied picture sample, and carrying out coordinate alignment on the contour center of the selected target contour and the picture midpoint of the copied picture sample.
Further, the performing contour labeling on the target objects respectively to obtain target contours includes:
respectively identifying a first contour point and a second contour point of the outermost side of the target object in the first direction;
respectively identifying a third contour point and a fourth contour point of the target object on the outermost sides in a second direction, wherein the first direction and the second direction are perpendicular to each other;
respectively making straight lines parallel to the second direction through the first contour point and the second contour point, and respectively making straight lines parallel to the first direction through the third contour point and the fourth contour point;
and identifying an area surrounded by all the straight lines, and taking a frame of the area as the target contour.
Further, the performing contour labeling on the target objects respectively to obtain target contours includes:
identifying an outer contour of the target object;
carrying out contour labeling on pixels adjacent to the outer side of the outer contour along the outer contour;
and taking the marked pixels as the target contour.
Further, before the coordinate alignment of the contour center of the target contour and the midpoint of the image, the method further includes:
calculating the area ratio of the target contour in the initial picture sample;
if the area ratio is smaller than a preset area ratio, amplifying the target contour and the picture inside the target contour until the area ratio is not smaller than the preset area ratio.
Further, the obtaining a second training sample according to the supplementary training sample and the satisfaction sample includes:
performing first enhancement processing on the satisfactory samples to obtain a plurality of first enhancement samples, wherein the first enhancement processing comprises at least one of translation, rotation and mirror surface turning;
taking the supplemental training sample and the first enhancement sample as the second training sample.
Further, the obtaining a second training sample according to the supplementary training sample and the satisfaction sample includes:
performing second enhancement processing on the satisfactory samples to obtain a plurality of second enhancement samples, wherein the second enhancement processing comprises at least one of binarization, brightness adjustment and contrast adjustment;
taking the supplemental training sample and the second enhancement sample as the second training sample.
The application also provides a data model training device, including:
the image set acquisition module is used for acquiring an initial image set, wherein the initial image set comprises a plurality of initial image samples;
the contour identification module is used for identifying a target object in each initial picture sample and respectively carrying out contour labeling on the target object to obtain a target contour;
the coordinate alignment module is used for respectively establishing a virtual coordinate system in each initial image sample, calculating the image midpoint of the initial image sample according to the virtual coordinate system, and performing coordinate alignment on the contour center of the target contour and the image midpoint;
the first model training module is used for taking the initial picture sample after the coordinates are aligned as a first training sample and training the initial picture sample based on the first training sample to obtain a first data model;
the sample screening module is used for respectively calculating confidence coefficient parameters of the first training samples, taking the first training samples with the confidence coefficient parameters larger than a preset confidence threshold value as satisfied samples, taking the first training samples with the confidence coefficient parameters not larger than the confidence threshold value as unsatisfied samples, and removing the unsatisfied samples;
the sample supplementing module is used for responding to a sample supplementing instruction, acquiring a supplementing training sample, and obtaining a second training sample according to the supplementing training sample and the satisfactory sample;
and the second model training module is used for training the first data model through the second training sample to obtain a second data model.
The present application also proposes a computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the method of any one of the above mentioned items when executing the computer program.
The present application also proposes a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method of any of the above.
According to the data model training method, the device, the medium and the equipment, a learning basis is provided for data model training through a plurality of different initial picture samples in advance; by identifying the target object in each initial picture sample and respectively carrying out contour labeling on the target object, the attention degree of training is improved, and the problem of low model accuracy caused by other noises in the initial picture samples is avoided; establishing a virtual coordinate system, and carrying out coordinate alignment on the target contour and the midpoint of the picture according to the virtual coordinate system to obtain a pixel part which just comprises a target object and a part of background environment taking the target object as the center, thereby further improving the attention of the model to the target object and the background environment nearby the target object; training through the first training sample to obtain a first data model, so that the summarizing capability of the target object characteristics under different background environments can be improved after the data model is trained; through calculating the confidence coefficient parameter of each first training, samples with high quality, namely satisfactory samples, are distinguished, and samples with low quality, namely unsatisfactory samples, are removed, so that sample screening is realized, and the condition that the training effect is poor, such as under-fitting and the like, is avoided while the complexity of subsequent training of a data model is greatly increased due to the participation of inferior samples in training; by obtaining the supplementary training sample and obtaining the second training sample according to the supplementary training sample and the satisfactory sample, the number and the diversity of the samples are improved, and the training effect of the data model is improved; after the supplemented second training sample is obtained, the first data model can be trained again, and the influence of unsatisfactory samples existing in the first training process on the secondary training process is avoided.
Drawings
FIG. 1 is a schematic flow chart illustrating a data model training method according to an embodiment of the present application;
FIG. 2 is a schematic flow chart illustrating a data model training method according to an embodiment of the present application;
FIG. 3 is a block diagram illustrating an exemplary data model training apparatus according to an embodiment of the present disclosure;
fig. 4 is a block diagram illustrating a structure of a computer device according to an embodiment of the present application.
The implementation, functional features and advantages of the objectives of the present application will be further explained with reference to the accompanying drawings.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
Referring to fig. 1, in order to achieve the above object, the present application provides a data model training method, including:
s1: acquiring an initial picture set, wherein the initial picture set comprises a plurality of initial picture samples;
s2: identifying a target object in each initial picture sample, and respectively carrying out contour labeling on the target object to obtain a target contour;
s3: respectively establishing a virtual coordinate system in each initial image sample, calculating the image midpoint of the initial image sample according to the virtual coordinate system, and carrying out coordinate alignment on the contour center of the target contour and the image midpoint;
s4: taking the initial picture sample after the coordinates are aligned as a first training sample, and training based on the first training sample to obtain a first data model;
s5: respectively calculating confidence coefficient parameters of the first training samples, taking the first training samples with the confidence coefficient parameters larger than a preset confidence threshold value as satisfied samples, taking the first training samples with the confidence coefficient parameters not larger than the confidence threshold value as unsatisfied samples, and removing the unsatisfied samples;
s6: responding to a sample supplement instruction, acquiring a supplement training sample, and obtaining a second training sample according to the supplement training sample and the satisfactory sample;
s7: and training the first data model through the second training sample to obtain a second data model.
In the embodiment, a learning basis is provided for data model training by presetting a plurality of different initial picture samples; by identifying the target object in each initial picture sample and respectively carrying out contour labeling on the target object, the attention degree of training is improved, and the problem of low model accuracy caused by other noises in the initial picture samples is avoided; establishing a virtual coordinate system, and carrying out coordinate alignment on the target contour and the midpoint of the picture according to the virtual coordinate system to obtain a pixel part which just comprises a target object and a part of background environment taking the target object as the center, thereby further improving the attention of the model to the target object and the background environment nearby the target object; training through the first training sample to obtain a first data model, so that the summarizing capability of the target object characteristics under different background environments can be improved after the data model is trained; through calculating the confidence coefficient parameter of each first training, samples with high quality, namely satisfactory samples, are distinguished, and samples with low quality, namely unsatisfactory samples, are removed, so that sample screening is realized, and the condition that the training effect is poor, such as under-fitting and the like, is avoided while the complexity of subsequent training of a data model is greatly increased due to the participation of inferior samples in training; by obtaining the supplementary training sample and obtaining the second training sample according to the supplementary training sample and the satisfactory sample, the number and the diversity of the samples are improved, and the training effect of the data model is improved; after the supplemented second training sample is obtained, the first data model can be trained again, and the influence of unsatisfactory samples existing in the first training process on the secondary training process is avoided.
With respect to step S1, the present embodiment may acquire and process the related picture data based on artificial intelligence technology. Among them, Artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result. The artificial intelligence infrastructure generally includes technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a robot technology, a biological recognition technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and the like.
Specifically, the embodiment is applied to the field of model training, in particular to deep learning training based on yolov 3; generally speaking, in order to make the neural network model suitable for more environments, in the process of establishing the model, the neural network model needs to be trained, so that the model learns various environments according to different training samples, and therefore, when the neural network model is trained, a certain number of training samples need to be obtained in advance. In a specific embodiment, if the data model is used for vehicle license plate recognition, the initial image sample to be acquired should be a license plate image including a plurality of different colors, sizes and environments; if the model is used for vehicle contour recognition, the initial picture samples to be acquired should be vehicle pictures including different models and environments, and the embodiment does not limit the initial picture samples. In this embodiment, a learning basis is provided for data model training by pre-sampling a plurality of different initial image samples.
For step S2, in the training process of the data model, not every detail in the initial image sample is often an object to be trained and learned, and if the original initial image is directly subjected to data model training, it is likely that the model learns unnecessary features, thereby causing a problem of low recognition accuracy of the final model. In a specific embodiment, one initial picture sample may generally include one or more target objects, for example, when the target object is a vehicle, images of multiple vehicles may exist in one initial picture sample, and in order to improve the number and diversity of the target objects, in this embodiment, each target object in each initial picture sample is identified, and each target object is respectively subjected to contour labeling, so that the attention degree of training is improved, and the problem of low model accuracy caused by other noises in the initial picture sample is avoided.
In step S3, because the initial picture sample has different shooting angles and distances, the problem that the target object is not located in the center of the picture often exists, and if the initial picture sample is directly trained by using the picture of the target object in the target contour, it may cause that the data model obtained by training cannot be comprehensively analyzed in combination with the background environment, i.e. the capability of the data model to summarize the characteristics of the target object in different background environments is weakened, therefore, in this embodiment, a virtual coordinate system is established in the initial picture sample, the picture midpoint coordinate of the initial picture sample is calculated according to the coordinate system, the center coordinate of the target contour is calculated, finally the virtual coordinate system and the boundary of the initial picture sample are made to be stationary, the pixel portion of the initial picture sample is moved, so that the center coordinate of the target contour overlaps the picture midpoint coordinate, at this time, with respect to the boundary of the initial picture sample, the target object is exactly located at the center of the whole initial picture sample, and the part defined by the boundary of the initial picture sample at this time exactly includes the target object and the part of the background environment with the target object as the center. The invention obtains the pixel part which just comprises the target object and the partial background environment taking the target object as the center by establishing the virtual coordinate system and aligning the target outline and the midpoint of the picture according to the virtual coordinate system, thereby further improving the attention of the model to the target object and the background environment nearby the target object.
In step S4, a pixel portion including the target object and a portion of the background environment centered on the target object is obtained through coordinate alignment, and the pixel portion is used as a first training sample and is trained through the first training sample to obtain a first data model, so that the capability of summarizing the characteristics of the target object in different background environments can be improved after the data model is trained.
For step S5, the confidence parameter may be calculated by Mean Average Precision (mapp) algorithm; specifically, a first training sample is input into a preset confidence prediction model for confidence prediction, an mAP algorithm is built in the confidence prediction model, B _ GT represents an actual frame (GT) of the first training sample, B _ p represents a frame predicted by the first data model for the first training sample, and the intersection ratio IOU of the first training sample and the frame predicted by the first data model is calculated by adopting mAP according to the following formula:
Figure BDA0003266705810000071
taking the IOU as the confidence coefficient parameter, wherein the first training sample with the IOU larger than the confidence threshold value max _ IOU is a satisfactory sample, namely, the actual frame of the sample is basically consistent with the predicted frame; the first training sample with the IOU not greater than the confidence threshold value max _ IOU is an unsatisfactory sample, namely, the difference between the actual frame and the predicted frame of the sample is larger; according to the method, the confidence coefficient parameters of each first training are calculated, so that samples with high quality, namely satisfactory samples, are distinguished, and samples with low quality, namely unsatisfactory samples, are removed, so that sample screening is realized, and the condition that the training effect is poor, such as under-fitting and the like, is avoided while the complexity of subsequent training of a data model is greatly increased due to the fact that inferior samples participate in training.
For step S6, because some unsatisfactory samples with poor quality are deleted in step S5, if the remaining satisfactory samples are directly used to perform subsequent training on the first data model, the problem that the samples are not rich enough and the model is over-fitted may occur, and therefore, the training samples need to be supplemented. In this embodiment, the supplementary training sample is obtained manually according to the sample supplementary instruction or automatically obtained from the database by re-obtaining the supplementary training sample. According to the invention, the supplementary training sample is obtained, and the second training sample is obtained according to the supplementary training sample and the satisfactory sample, so that the number and diversity of samples are improved, and the training effect of the data model is improved.
For step S7, after the supplemented second training sample is obtained, the first data model may be retrained, so as to avoid the influence of the unsatisfactory sample existing in the first training process on the second training process, thereby improving the accuracy of the second data model prediction; in a specific implementation manner, if the prediction result of the training staff on the second data model is still unsatisfied, the above steps may be performed again, that is, the satisfactory samples and the unsatisfactory samples are sorted again by the mAP algorithm, supplementary training samples are obtained, and the next model is performed according to the satisfactory samples sorted again and the supplementary training samples supplemented again until the model meets the requirements of the training staff.
In one embodiment, referring to fig. 2, the coordinate aligning S3 the contour center of the target contour with the center point in the picture includes:
s31: when a plurality of target contours exist in the initial picture sample, copying the initial picture sample to obtain a plurality of copied picture samples;
s32: and respectively selecting a different target contour from each copied picture sample, and carrying out coordinate alignment on the contour center of the selected target contour and the picture midpoint of the copied picture sample.
In the embodiment, the plurality of target outlines in one initial picture are copied and respectively aligned, so that the richness of the sample is improved, and the problem of material loss is avoided.
For step S31, one initial picture sample may include one or more target objects, and when the initial picture sample includes a plurality of target objects, target contours respectively marked on the plurality of target objects may appear, and if only one of the target contours is selected for coordinate alignment, the problem of missing training material may be caused.
For step S32, in this embodiment, when an initial image sample includes N target contours, the initial image sample is copied N-1 times to obtain N samples that are the same as the initial image sample, and at this time, a different target contour is respectively selected from each sample to perform coordinate alignment, so as to obtain N training samples in which the target object is located at the center of the image, thereby improving the richness of the samples and avoiding the problem of material loss.
In one embodiment, the performing contour labeling on the target objects respectively to obtain target contours S2 includes:
s21: respectively identifying a first contour point and a second contour point of the outermost side of the target object in the first direction;
s22: respectively identifying a third contour point and a fourth contour point of the target object on the outermost sides in a second direction, wherein the first direction and the second direction are perpendicular to each other;
s23: respectively making straight lines parallel to the second direction through the first contour point and the second contour point, and respectively making straight lines parallel to the first direction through the third contour point and the fourth contour point;
s24: and identifying an area surrounded by all the straight lines, and taking a frame of the area as the target contour.
In the embodiment, the outline points of the target object on the outermost sides in four mutually perpendicular directions are identified, and a rectangular area is enclosed by the outline points, so that the target outline containing the complete target object is obtained, and the outline center is convenient to locate.
For step S22, in order to facilitate labeling of the target object, in this embodiment, four points on the outermost sides in two perpendicular directions are selected as positioning points of the target contour, and the points on the outermost sides in the two directions are respectively made into straight lines, so that the contour of the target object body can be defined in an area surrounded by the straight lines, and since the first direction and the second direction are perpendicular to each other, the four straight lines finally form a rectangle, i.e., the center of the contour of the target contour can be conveniently and quickly found.
In one embodiment, the performing contour labeling on the target objects respectively to obtain target contours S2 includes:
s25: identifying an outer contour of the target object;
s26: carrying out contour labeling on pixels adjacent to the outer side of the outer contour along the outer contour;
s27: and taking the marked pixels as the target contour.
In the embodiment, the marking is carried out in a mode of identifying the external contour, so that the accuracy of positioning the irregular object is improved.
For step S27, since the target object is not necessarily a relatively round or uniform pattern in the specific implementation process, taking the target object as a fruit as an example, if the target object is an object such as a banana, if the rectangular outline marking manner in S21-S24 is directly adopted, the outline center of the target outline is far from the center of the target object, so that the outline marking may be performed by direct tracing in this embodiment, which can improve the accuracy of the outline marking of the target object with a special shape.
In one embodiment, before the coordinate aligning S3 the contour center of the target contour with the center point in the picture, the method further includes:
s301: calculating the area ratio of the target contour in the initial picture sample;
s302: if the area ratio is smaller than a preset area ratio, amplifying the target contour and the picture inside the target contour until the area ratio is not smaller than the preset area ratio.
In the embodiment, the target object with a small area is subjected to equal-scale amplification processing, so that the attention of the data model to the target object is improved, and the training accuracy is improved.
In step S302, in the actual sample collection, there may be a problem that the shooting distance is long, so that the target object is small in the whole screen, and the target object area is small, which may result in poor training effect of the data model. Therefore, in the embodiment, the target object with a relatively small area is subjected to the equal-scale amplification processing, so that the attention of the data model to the target object is improved, and the training accuracy is improved.
In one embodiment, the deriving a second training sample S6 from the supplemental training sample and the satisfaction sample includes:
s61: performing first enhancement processing on the satisfactory samples to obtain a plurality of first enhancement samples, wherein the first enhancement processing comprises at least one of translation, rotation and mirror surface turning;
s62: taking the supplemental training sample and the first enhancement sample as the second training sample.
The embodiment improves the number and the richness of the samples by processing the satisfied samples such as translation, rotation, mirror surface turning and the like.
For step S61, in different embodiments, the sample stock of some scenes is small, the acquisition difficulty is high, and the picture queried on the internet does not meet the training requirement, which may result in a situation where the samples are not rich enough, so that the model is over-fitted, and at this time, the satisfactory samples are processed in a data enhancement manner, that is, more relevant samples are created through some high-quality samples. Specifically, the translation, rotation, and mirror inversion may be used alone, or may be combined in any number and then subjected to enhancement processing, so as to further improve the richness of the sample.
In one embodiment, the deriving a second training sample S6 from the supplemental training sample and the satisfaction sample includes:
s63: performing second enhancement processing on the satisfactory samples to obtain a plurality of second enhancement samples, wherein the second enhancement processing comprises at least one of binarization, brightness adjustment and contrast adjustment;
s64: taking the supplemental training sample and the second enhancement sample as the second training sample.
This embodiment is through carrying out processes such as binarization, brightness control, contrast regulation to satisfied sample to the quantity and the richness of sample have been improved, so that the multiple light environment of sample simulation and weather environment have improved the practical meaning of sample.
For step S63, day and night can be simulated by adjusting the brightness value, rainy weather or foggy weather can be simulated by adjusting the contrast, and the sensitivity of the model to the contour is improved by the binarized sample, so that the practical significance of the sample is improved, and the accuracy of the second data model in identifying the real picture is improved.
Referring to fig. 3, the present application further proposes a data model training apparatus, including:
the image set obtaining module 100 is configured to obtain an initial image set, where the initial image set includes a plurality of initial image samples;
the contour identification module 200 is configured to identify a target object in each initial picture sample, and perform contour labeling on the target object respectively to obtain a target contour;
a coordinate alignment module 300, configured to respectively establish a virtual coordinate system in each initial image sample, calculate an image midpoint of the initial image sample according to the virtual coordinate system, and perform coordinate alignment between the contour center of the target contour and the image midpoint;
the first model training module 400 is configured to use the initial image sample after the coordinates are aligned as a first training sample, and train based on the first training sample to obtain a first data model;
the sample screening module 500 is configured to calculate confidence parameters of the first training samples, use the first training samples with the confidence parameters larger than a preset confidence threshold as satisfied samples, use the first training samples with the confidence parameters not larger than the confidence threshold as unsatisfied samples, and remove the unsatisfied samples;
a sample supplement module 600, configured to respond to a sample supplement instruction, obtain a supplement training sample, and obtain a second training sample according to the supplement training sample and the satisfactory sample;
the second model training module 700 is configured to train the first data model through the second training sample to obtain a second data model.
In the embodiment, a learning basis is provided for data model training by presetting a plurality of different initial picture samples; by identifying the target object in each initial picture sample and respectively carrying out contour labeling on the target object, the attention degree of training is improved, and the problem of low model accuracy caused by other noises in the initial picture samples is avoided; establishing a virtual coordinate system, and carrying out coordinate alignment on the target contour and the midpoint of the picture according to the virtual coordinate system to obtain a pixel part which just comprises a target object and a part of background environment taking the target object as the center, thereby further improving the attention of the model to the target object and the background environment nearby the target object; training through the first training sample to obtain a first data model, so that the summarizing capability of the target object characteristics under different background environments can be improved after the data model is trained; through calculating the confidence coefficient parameter of each first training, samples with high quality, namely satisfactory samples, are distinguished, and samples with low quality, namely unsatisfactory samples, are removed, so that sample screening is realized, and the condition that the training effect is poor, such as under-fitting and the like, is avoided while the complexity of subsequent training of a data model is greatly increased due to the participation of inferior samples in training; by obtaining the supplementary training sample and obtaining the second training sample according to the supplementary training sample and the satisfactory sample, the number and the diversity of the samples are improved, and the training effect of the data model is improved; after the supplemented second training sample is obtained, the first data model can be trained again, and the influence of unsatisfactory samples existing in the first training process on the secondary training process is avoided.
In one embodiment, the coordinate alignment module 300 is further configured to:
when a plurality of target contours exist in the initial picture sample, copying the initial picture sample to obtain a plurality of copied picture samples;
and respectively selecting a different target contour from each copied picture sample, and carrying out coordinate alignment on the contour center of the selected target contour and the picture midpoint of the copied picture sample.
In one embodiment, the contour identification module 200 is further configured to:
respectively identifying a first contour point and a second contour point of the outermost side of the target object in the first direction;
respectively identifying a third contour point and a fourth contour point of the target object on the outermost sides in a second direction, wherein the first direction and the second direction are perpendicular to each other;
respectively making straight lines parallel to the second direction through the first contour point and the second contour point, and respectively making straight lines parallel to the first direction through the third contour point and the fourth contour point;
and identifying an area surrounded by all the straight lines, and taking a frame of the area as the target contour.
In one embodiment, the contour identification module 200 is further configured to:
identifying an outer contour of the target object;
carrying out contour labeling on pixels adjacent to the outer side of the outer contour along the outer contour;
and taking the marked pixels as the target contour.
In one embodiment, the coordinate alignment module 300 is further configured to:
calculating the area ratio of the target contour in the initial picture sample;
if the area ratio is smaller than a preset area ratio, amplifying the target contour and the picture inside the target contour until the area ratio is not smaller than the preset area ratio.
In one embodiment, the sample supplement module 600 is further configured to:
performing first enhancement processing on the satisfactory samples to obtain a plurality of first enhancement samples, wherein the first enhancement processing comprises at least one of translation, rotation and mirror surface turning;
taking the supplemental training sample and the first enhancement sample as the second training sample.
In one embodiment, the sample supplement module 600 is further configured to:
performing second enhancement processing on the satisfactory samples to obtain a plurality of second enhancement samples, wherein the second enhancement processing comprises at least one of binarization, brightness adjustment and contrast adjustment;
taking the supplemental training sample and the second enhancement sample as the second training sample.
Referring to fig. 4, a computer device, which may be a server and whose internal structure may be as shown in fig. 4, is also provided in the embodiment of the present application. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the computer designed processor is used to provide computational and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used for storing data such as a data model training method and the like. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a data model training method. The data model training method comprises the following steps: acquiring an initial picture set, wherein the initial picture set comprises a plurality of initial picture samples; identifying a target object in each initial picture sample, and respectively carrying out contour labeling on the target object to obtain a target contour; respectively establishing a virtual coordinate system in each initial image sample, calculating the image midpoint of the initial image sample according to the virtual coordinate system, and carrying out coordinate alignment on the contour center of the target contour and the image midpoint; taking the initial picture sample after the coordinates are aligned as a first training sample, and training based on the first training sample to obtain a first data model; respectively calculating confidence coefficient parameters of the first training samples, taking the first training samples with the confidence coefficient parameters larger than a preset confidence threshold value as satisfied samples, taking the first training samples with the confidence coefficient parameters not larger than the confidence threshold value as unsatisfied samples, and removing the unsatisfied samples; responding to a sample supplement instruction, acquiring a supplement training sample, and obtaining a second training sample according to the supplement training sample and the satisfactory sample; and training the first data model through the second training sample to obtain a second data model.
An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, the computer program, when executed by a processor, implementing a data model training method, including the steps of: acquiring an initial picture set, wherein the initial picture set comprises a plurality of initial picture samples; identifying a target object in each initial picture sample, and respectively carrying out contour labeling on the target object to obtain a target contour; respectively establishing a virtual coordinate system in each initial image sample, calculating the image midpoint of the initial image sample according to the virtual coordinate system, and carrying out coordinate alignment on the contour center of the target contour and the image midpoint; taking the initial picture sample after the coordinates are aligned as a first training sample, and training based on the first training sample to obtain a first data model; respectively calculating confidence coefficient parameters of the first training samples, taking the first training samples with the confidence coefficient parameters larger than a preset confidence threshold value as satisfied samples, taking the first training samples with the confidence coefficient parameters not larger than the confidence threshold value as unsatisfied samples, and removing the unsatisfied samples; responding to a sample supplement instruction, acquiring a supplement training sample, and obtaining a second training sample according to the supplement training sample and the satisfactory sample; and training the first data model through the second training sample to obtain a second data model.
In the data model training method, a learning basis is provided for data model training by presetting a plurality of different initial picture samples; by identifying the target object in each initial picture sample and respectively carrying out contour labeling on the target object, the attention degree of training is improved, and the problem of low model accuracy caused by other noises in the initial picture samples is avoided; establishing a virtual coordinate system, and carrying out coordinate alignment on the target contour and the midpoint of the picture according to the virtual coordinate system to obtain a pixel part which just comprises a target object and a part of background environment taking the target object as the center, thereby further improving the attention of the model to the target object and the background environment nearby the target object; training through the first training sample to obtain a first data model, so that the summarizing capability of the target object characteristics under different background environments can be improved after the data model is trained; through calculating the confidence coefficient parameter of each first training, samples with high quality, namely satisfactory samples, are distinguished, and samples with low quality, namely unsatisfactory samples, are removed, so that sample screening is realized, and the condition that the training effect is poor, such as under-fitting and the like, is avoided while the complexity of subsequent training of a data model is greatly increased due to the participation of inferior samples in training; by obtaining the supplementary training sample and obtaining the second training sample according to the supplementary training sample and the satisfactory sample, the number and the diversity of the samples are improved, and the training effect of the data model is improved; after the supplemented second training sample is obtained, the first data model can be trained again, and the influence of unsatisfactory samples existing in the first training process on the secondary training process is avoided.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium provided herein and used in the examples may include non-volatile and/or volatile memory. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), double-rate SDRAM (SSRSDRAM), Enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and bus dynamic RAM (RDRAM).
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, apparatus, article, or method that includes the element.
The above description is only a preferred embodiment of the present application, and not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings of the present application, or which are directly or indirectly applied to other related technical fields, are also included in the scope of the present application.

Claims (10)

1. A method for training a data model, the method comprising:
acquiring an initial picture set, wherein the initial picture set comprises a plurality of initial picture samples;
identifying a target object in each initial picture sample, and respectively carrying out contour labeling on the target object to obtain a target contour;
respectively establishing a virtual coordinate system in each initial image sample, calculating the image midpoint of the initial image sample according to the virtual coordinate system, and carrying out coordinate alignment on the contour center of the target contour and the image midpoint;
taking the initial picture sample after the coordinates are aligned as a first training sample, and training based on the first training sample to obtain a first data model;
respectively calculating confidence coefficient parameters of the first training samples, taking the first training samples with the confidence coefficient parameters larger than a preset confidence threshold value as satisfied samples, taking the first training samples with the confidence coefficient parameters not larger than the confidence threshold value as unsatisfied samples, and removing the unsatisfied samples;
responding to a sample supplement instruction, acquiring a supplement training sample, and obtaining a second training sample according to the supplement training sample and the satisfactory sample;
and training the first data model through the second training sample to obtain a second data model.
2. The data model training method of claim 1, wherein the coordinate aligning the contour center of the target contour with the picture midpoint comprises:
when a plurality of target contours exist in the initial picture sample, copying the initial picture sample to obtain a plurality of copied picture samples;
and respectively selecting a different target contour from each copied picture sample, and carrying out coordinate alignment on the contour center of the selected target contour and the picture midpoint of the copied picture sample.
3. The data model training method of claim 1, wherein the performing contour labeling on the target objects respectively to obtain target contours comprises:
respectively identifying a first contour point and a second contour point of the outermost side of the target object in the first direction;
respectively identifying a third contour point and a fourth contour point of the target object on the outermost sides in a second direction, wherein the first direction and the second direction are perpendicular to each other;
respectively making straight lines parallel to the second direction through the first contour point and the second contour point, and respectively making straight lines parallel to the first direction through the third contour point and the fourth contour point;
and identifying an area surrounded by all the straight lines, and taking a frame of the area as the target contour.
4. The data model training method of claim 1, wherein the performing contour labeling on the target objects respectively to obtain target contours comprises:
identifying an outer contour of the target object;
carrying out contour labeling on pixels adjacent to the outer side of the outer contour along the outer contour;
and taking the marked pixels as the target contour.
5. The data model training method of claim 1, wherein before the coordinate aligning the contour center of the target contour with the center point in the picture, the method further comprises:
calculating the area ratio of the target contour in the initial picture sample;
if the area ratio is smaller than a preset area ratio, amplifying the target contour and the picture inside the target contour until the area ratio is not smaller than the preset area ratio.
6. The data model training method of claim 1, wherein the deriving a second training sample from the supplemental training sample and the satisfaction sample comprises:
performing first enhancement processing on the satisfactory samples to obtain a plurality of first enhancement samples, wherein the first enhancement processing comprises at least one of translation, rotation and mirror surface turning;
taking the supplemental training sample and the first enhancement sample as the second training sample.
7. The data model training method of claim 1, wherein the deriving a second training sample from the supplemental training sample and the satisfaction sample comprises:
performing second enhancement processing on the satisfactory samples to obtain a plurality of second enhancement samples, wherein the second enhancement processing comprises at least one of binarization, brightness adjustment and contrast adjustment;
taking the supplemental training sample and the second enhancement sample as the second training sample.
8. A data model training apparatus, comprising:
the image set acquisition module is used for acquiring an initial image set, wherein the initial image set comprises a plurality of initial image samples;
the contour identification module is used for identifying a target object in each initial picture sample and respectively carrying out contour labeling on the target object to obtain a target contour;
the coordinate alignment module is used for respectively establishing a virtual coordinate system in each initial image sample, calculating the image midpoint of the initial image sample according to the virtual coordinate system, and performing coordinate alignment on the contour center of the target contour and the image midpoint;
the first model training module is used for taking the initial picture sample after the coordinates are aligned as a first training sample and training the initial picture sample based on the first training sample to obtain a first data model;
the sample screening module is used for respectively calculating confidence coefficient parameters of the first training samples, taking the first training samples with the confidence coefficient parameters larger than a preset confidence threshold value as satisfied samples, taking the first training samples with the confidence coefficient parameters not larger than the confidence threshold value as unsatisfied samples, and removing the unsatisfied samples;
the sample supplementing module is used for responding to a sample supplementing instruction, acquiring a supplementing training sample, and obtaining a second training sample according to the supplementing training sample and the satisfactory sample;
and the second model training module is used for training the first data model through the second training sample to obtain a second data model.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the method of any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method of any one of claims 1 to 7.
CN202111088635.8A 2021-09-16 2021-09-16 Data model training method, device, equipment and medium Pending CN113762286A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111088635.8A CN113762286A (en) 2021-09-16 2021-09-16 Data model training method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111088635.8A CN113762286A (en) 2021-09-16 2021-09-16 Data model training method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN113762286A true CN113762286A (en) 2021-12-07

Family

ID=78796063

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111088635.8A Pending CN113762286A (en) 2021-09-16 2021-09-16 Data model training method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN113762286A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114972222A (en) * 2022-05-13 2022-08-30 徕卡显微系统科技(苏州)有限公司 Cell information statistical method, device, equipment and computer readable storage medium
CN116071621A (en) * 2023-03-15 2023-05-05 中汽智联技术有限公司 Training sample generation and verification method, device and medium for perception algorithm

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104240180A (en) * 2014-08-08 2014-12-24 沈阳东软医疗系统有限公司 Method and device for achieving automatic adjusting of images
CN109753975A (en) * 2019-02-02 2019-05-14 杭州睿琪软件有限公司 Training sample obtaining method and device, electronic equipment and storage medium
CN109840588A (en) * 2019-01-04 2019-06-04 平安科技(深圳)有限公司 Neural network model training method, device, computer equipment and storage medium
CN109951628A (en) * 2017-12-21 2019-06-28 广东欧珀移动通信有限公司 Model building method, photographic method, device, storage medium and terminal
CN111210024A (en) * 2020-01-14 2020-05-29 深圳供电局有限公司 Model training method and device, computer equipment and storage medium
CN112163634A (en) * 2020-10-14 2021-01-01 平安科技(深圳)有限公司 Example segmentation model sample screening method and device, computer equipment and medium
KR20210094482A (en) * 2020-01-20 2021-07-29 베이징 바이두 넷컴 사이언스 앤 테크놀로지 코., 엘티디. Method for training generative network, method for generating near-infrared image and apparatuses

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104240180A (en) * 2014-08-08 2014-12-24 沈阳东软医疗系统有限公司 Method and device for achieving automatic adjusting of images
CN109951628A (en) * 2017-12-21 2019-06-28 广东欧珀移动通信有限公司 Model building method, photographic method, device, storage medium and terminal
CN109840588A (en) * 2019-01-04 2019-06-04 平安科技(深圳)有限公司 Neural network model training method, device, computer equipment and storage medium
CN109753975A (en) * 2019-02-02 2019-05-14 杭州睿琪软件有限公司 Training sample obtaining method and device, electronic equipment and storage medium
CN111210024A (en) * 2020-01-14 2020-05-29 深圳供电局有限公司 Model training method and device, computer equipment and storage medium
KR20210094482A (en) * 2020-01-20 2021-07-29 베이징 바이두 넷컴 사이언스 앤 테크놀로지 코., 엘티디. Method for training generative network, method for generating near-infrared image and apparatuses
CN112163634A (en) * 2020-10-14 2021-01-01 平安科技(深圳)有限公司 Example segmentation model sample screening method and device, computer equipment and medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王忆勤: "《中医面诊与计算机辅助诊断》", 30 November 2010, 上海科学技术出版社, pages: 178 - 197 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114972222A (en) * 2022-05-13 2022-08-30 徕卡显微系统科技(苏州)有限公司 Cell information statistical method, device, equipment and computer readable storage medium
CN116071621A (en) * 2023-03-15 2023-05-05 中汽智联技术有限公司 Training sample generation and verification method, device and medium for perception algorithm
CN116071621B (en) * 2023-03-15 2023-06-23 中汽智联技术有限公司 Training sample generation and verification method, device and medium for perception algorithm

Similar Documents

Publication Publication Date Title
CN108960245B (en) Tire mold character detection and recognition method, device, equipment and storage medium
CN113762286A (en) Data model training method, device, equipment and medium
CN111368758B (en) Face ambiguity detection method, face ambiguity detection device, computer equipment and storage medium
CN112270251B (en) Self-adaptive multi-sensor data fusion method and system based on mutual information
CN108921057B (en) Convolutional neural network-based prawn form measuring method, medium, terminal equipment and device
CN111753692B (en) Target object extraction method, product detection method, device, computer and medium
WO2022089143A1 (en) Method for generating analog image, and electronic device and storage medium
CN111738036B (en) Image processing method, device, equipment and storage medium
CN113205507B (en) Visual question answering method, system and server
CN114170227B (en) Product surface defect detection method, device, equipment and storage medium
CN112750113B (en) Glass bottle defect detection method and device based on deep learning and linear detection
CN114639021B (en) Training method of target detection model and target dividing method
CN111444911B (en) Training method and device of license plate recognition model and license plate recognition method and device
CN113343873A (en) Signal lamp identification method, device, equipment, medium and product
CN115797314A (en) Part surface defect detection method, system, equipment and storage medium
CN115884480A (en) Multi-optical-axis tripod head lamp control method and device based on image processing and storage medium
CN111340025A (en) Character recognition method, character recognition device, computer equipment and computer-readable storage medium
CN111435445A (en) Training method and device of character recognition model and character recognition method and device
CN116797602A (en) Surface defect identification method and device for industrial product detection
CN112733723A (en) Vehicle type identification method and terminal
CN116596903A (en) Defect identification method, device, electronic equipment and readable storage medium
CN116612272A (en) Intelligent digital detection system for image processing and detection method thereof
CN112115737A (en) Vehicle orientation determining method and device and vehicle-mounted terminal
CN116958019A (en) Defect detection method and device based on machine vision and storage medium
CN110751163A (en) Target positioning method and device, computer readable storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination