CN112348040B - Model training method, device and equipment - Google Patents

Model training method, device and equipment Download PDF

Info

Publication number
CN112348040B
CN112348040B CN201910724582.0A CN201910724582A CN112348040B CN 112348040 B CN112348040 B CN 112348040B CN 201910724582 A CN201910724582 A CN 201910724582A CN 112348040 B CN112348040 B CN 112348040B
Authority
CN
China
Prior art keywords
data
target
model
uncalibrated
sample data
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.)
Active
Application number
CN201910724582.0A
Other languages
Chinese (zh)
Other versions
CN112348040A (en
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.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital 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 Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN201910724582.0A priority Critical patent/CN112348040B/en
Publication of CN112348040A publication Critical patent/CN112348040A/en
Application granted granted Critical
Publication of CN112348040B publication Critical patent/CN112348040B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/80Analysis of captured images to determine intrinsic or extrinsic camera parameters, i.e. camera calibration

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • General Engineering & Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Image Analysis (AREA)

Abstract

The invention provides a model training method, device and equipment, wherein the method comprises the following steps: selecting uncalibrated data from a sample data set, wherein the sample data set comprises calibrated data and uncalibrated data, and the target category in the calibrated data comprises the target category in the uncalibrated data; inputting the selected uncalibrated data into a model for target recognition to obtain a predicted target recognition result of each uncalibrated data input into the model; the model is obtained by training according to calibrated data in the sample data set; determining target uncalibrated data to be calibrated from uncalibrated data input to the model according to the identification result of each predicted target, and calibrating the target uncalibrated data in the sample data set according to the identification result of the predicted target of each target uncalibrated data to obtain calibrated data; and training a target model according to the calibrated data in the sample data set and the model. The calibration efficiency can be improved, and the model training efficiency is further improved.

Description

Model training method, device and equipment
Technical Field
The present invention relates to the field of machine vision, and in particular, to a model training method, apparatus and device.
Background
With the development of society and the progress of technology, the number of monitoring video devices is increasing, and meanwhile, the application of technologies such as target recognition, search and the like in the monitoring video is increasing, and the technologies are usually realized by means of a trained model. A sample dataset is needed to enable training of the model.
Currently, all sample data in a sample data set needs to be manually calibrated. For example, in the case of calibration, a calibration person is required to determine whether the targets in the two images are the same target, and the same label is calibrated by the same target. However, under the influence of factors such as different cameras, target attitude change, illumination change, shielding and the like, targets in the image are not easy to distinguish, so that the task amount is heavy when sample data are all calibrated manually, and particularly for hundred thousand or even millions of data calibration tasks, the calibration efficiency is low, and the model training efficiency is low.
Disclosure of Invention
In view of the above, the invention provides a model training method, device and equipment, which can improve the calibration efficiency and further improve the model training efficiency.
The first aspect of the present invention provides a model training method, including:
selecting uncalibrated data from a sample data set, wherein the sample data set comprises calibrated data and uncalibrated data, and the target category in the calibrated data comprises the target category in the uncalibrated data;
Inputting the selected uncalibrated data into a model for target recognition to obtain a predicted target recognition result of each uncalibrated data input into the model; the model is obtained by training according to calibrated data in the sample data set;
determining target uncalibrated data to be calibrated from uncalibrated data input to the model according to the identification result of each predicted target, and calibrating the target uncalibrated data in the sample data set according to the identification result of the predicted target of each target uncalibrated data to obtain calibrated data;
and training a target model according to the calibrated data in the sample data set and the model.
In accordance with one embodiment of the present invention,
the predicted target recognition result at least comprises: confidence that the target belongs to the prediction category;
and determining target uncalibrated data to be calibrated from uncalibrated data input to the model according to the identification result of each predicted target, wherein the method comprises the following steps of:
checking whether the number of uncalibrated data input to the model is smaller than a preset number;
if yes, determining all the input data as target uncalibrated data;
if not, selecting the previous preset number of uncalibrated data from the input uncalibrated data according to the order of the confidence coefficient from large to small as the target uncalibrated data.
According to one embodiment of the present invention, the predicted target recognition result includes at least: predicting a category;
calibrating the target uncalibrated data in the sample data set according to the predicted target identification result of each target uncalibrated data, including:
and determining the label of the target uncalibrated data according to the predicted category in the predicted target recognition result of the target uncalibrated data aiming at each target uncalibrated data, and marking the label on the target uncalibrated data in the sample data set to obtain calibrated data.
According to one embodiment of the invention, training a target model from calibrated data in the sample dataset and the model includes:
training the model according to calibrated data in the sample dataset;
and checking whether the set training ending condition is met currently, if not, returning to the operation of selecting uncalibrated data from the sample data set, and if so, determining the model as a target model.
According to one embodiment of the present invention, checking whether the set training end condition is currently satisfied includes:
acquiring test sample data acquired by different camera equipment;
testing whether the performance of the model meets the preset performance requirement or not by using the obtained test sample data;
If yes, determining that the set training ending condition is met currently;
if not, determining that the set training ending condition is not met currently.
According to one embodiment of the present invention, testing whether the performance of the model meets a preset performance requirement using the acquired test sample data includes:
grouping the acquired test sample data, wherein each group comprises two test sample data acquired from different camera equipment, and acquiring a preset similarity corresponding to each group of test sample data;
inputting each test sample data to a model respectively, so that characteristic information is extracted from the input test sample data by the model;
and calculating the similarity between the characteristic information of each group of two test sample data, if the similarity between the characteristic information of one group of two test sample data is not matched with the corresponding preset similarity, determining that the performance of the model does not meet the preset performance requirement, otherwise, determining that the performance of the model meets the preset performance requirement.
A second aspect of the present invention provides a model training apparatus comprising:
a selection module, configured to select uncalibrated data from a sample data set, where the sample data set includes calibrated data and uncalibrated data, and a target class in the calibrated data includes a target class in the uncalibrated data;
The prediction module is used for inputting the selected uncalibrated data into the model for target recognition to obtain a predicted target recognition result of each uncalibrated data input into the model; the model is obtained by training according to calibrated data in the sample data set;
the calibration module is used for determining target uncalibrated data to be calibrated from uncalibrated data input to the model according to the identification result of each predicted target, and calibrating the target uncalibrated data in the sample data set according to the identification result of the predicted target of each target uncalibrated data to obtain calibrated data;
and the training module is used for training a target model according to the calibrated data in the sample data set and the model.
In accordance with one embodiment of the present invention,
the predicted target recognition result at least comprises: confidence that the target belongs to the prediction category;
the calibration module is specifically configured to, when determining target uncalibrated data to be calibrated from uncalibrated data input to the model according to each predicted target recognition result:
checking whether the number of uncalibrated data input to the model is smaller than a preset number;
If yes, determining all the input data as target uncalibrated data;
if not, selecting the previous preset number of uncalibrated data from the input uncalibrated data according to the order of the confidence coefficient from large to small as the target uncalibrated data.
According to one embodiment of the present invention, the predicted target recognition result includes at least: predicting a category;
the calibration module is specifically configured to, when calibrating target uncalibrated data in the sample data set according to a predicted target identification result of each target uncalibrated data:
and determining the label of the target uncalibrated data according to the predicted category in the predicted target recognition result of the target uncalibrated data aiming at each target uncalibrated data, and marking the label on the target uncalibrated data in the sample data set to obtain calibrated data.
According to one embodiment of the present invention, the training module is specifically configured to, when training the target model according to the calibrated data in the sample data set and the model:
training the model according to calibrated data in the sample dataset;
and checking whether the set training ending condition is met currently, if not, returning to the operation of selecting uncalibrated data from the sample data set, and if so, determining the model as a target model.
According to one embodiment of the present invention, the training module checks whether the set training end condition is currently satisfied, and is specifically configured to:
acquiring test sample data acquired by different camera equipment;
testing whether the performance of the model meets the preset performance requirement or not by using the obtained test sample data;
if yes, determining that the set training ending condition is met currently;
if not, determining that the set training ending condition is not met currently.
According to an embodiment of the present invention, when the training module uses the obtained test sample data to test whether the performance of the model meets the preset performance requirement, the training module is specifically configured to:
grouping the acquired test sample data, wherein each group comprises two test sample data acquired from different camera equipment, and acquiring a preset similarity corresponding to each group of test sample data;
inputting each test sample data to a model respectively, so that characteristic information is extracted from the input test sample data by the model;
and calculating the similarity between the characteristic information of each group of two test sample data, if the similarity between the characteristic information of one group of two test sample data is not matched with the corresponding preset similarity, determining that the performance of the model does not meet the preset performance requirement, otherwise, determining that the performance of the model meets the preset performance requirement.
A third aspect of the invention provides an electronic device comprising a processor and a memory; the memory stores a program that can be called by the processor; the processor executes the program to implement the model training method according to the foregoing embodiment.
The embodiment of the invention has the following beneficial effects:
in the embodiment of the invention, only a small amount of data is required to be calibrated in advance as calibrated data in a sample data set, a model is trained according to the calibrated data in the sample data set, a large amount of uncalibrated data can be used as uncalibrated images in the sample data set, uncalibrated data is selected from the sample data set in the model training process, and a model is utilized to predict a predicted target recognition result of the selected calibrated data, and as target categories in the calibrated data comprise target categories in the uncalibrated data, the model can predict various target categories in the uncalibrated data; according to the method, target uncalibrated data to be calibrated in the sample data set is determined according to the predicted target recognition result to calibrate, calibration of uncalibrated data in the sample data set is achieved, the training sample size is increased, and therefore a target model can be trained according to calibrated data in the sample data set and the model.
Drawings
FIG. 1 is a flow chart of a model training method according to an embodiment of the invention;
FIG. 2 is a block diagram of a model training apparatus according to an embodiment of the present invention;
fig. 3 is a block diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the invention. Rather, they are merely examples of apparatus and methods consistent with aspects of the invention as detailed in the accompanying claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any or all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used herein to describe various devices, these information should not be limited by these terms. These terms are only used to distinguish one device from another of the same type. For example, a first device could also be termed a second device, and, similarly, a second device could also be termed a first device, without departing from the scope of the present invention. The word "if" as used herein may be interpreted as "at … …" or "at … …" or "responsive to a determination", depending on the context.
In order to make the description of the present invention clearer and more concise, some technical terms of the present invention are explained below:
neural network: a technique for simulating the abstraction of brain structure features that a network system is formed by complex connection of a great number of simple functions, which can fit extremely complex functional relation, and generally includes convolution/deconvolution operation, activation operation, pooling operation, addition, subtraction, multiplication and division, channel merging and element rearrangement. Training the network with specific input data and output data, adjusting the connections therein, and allowing the neural network to learn the mapping between the fitting inputs and outputs.
The model training method according to the embodiment of the present invention is described in more detail below, but is not limited thereto. Referring to FIG. 1, in one embodiment, a model training method includes the steps of:
s100: selecting uncalibrated data from a sample data set, wherein the sample data set comprises calibrated data and uncalibrated data, and the target category in the calibrated data comprises the target category in the uncalibrated data;
s200: inputting the selected uncalibrated data into a model for target recognition to obtain a predicted target recognition result of each uncalibrated data input into the model; the model is obtained by training according to calibrated data in the sample data set;
s300: determining target uncalibrated data to be calibrated from uncalibrated data input to the model according to the identification result of each predicted target, and calibrating the target uncalibrated data in the sample data set according to the identification result of the predicted target of each target uncalibrated data to obtain calibrated data;
s400: and training a target model according to the calibrated data in the sample data set and the model.
The execution subject of the model training method in the embodiment of the invention can be an electronic device, and further can be a processor of the electronic device. The electronic device may be a computer, a mobile terminal, or the like, and the specific type is not limited as long as the electronic device has a certain data processing capability.
In step S100, uncalibrated data is selected from a sample data set, the sample data set including calibrated data and uncalibrated data, the target class in the calibrated data including the target class in the uncalibrated data.
The sample data set is a collection of calibrated and uncalibrated data, in other words, one portion of the data in the sample data set has been calibrated and another portion of the data has not been calibrated. Since model training typically requires a large amount of sample data, the sample data set may contain a plurality of calibrated data and a plurality of uncalibrated data, the specific number is not limited.
The calibrated data, i.e. the data of the calibrated tag, with the tag describing the target class in the calibrated data, may be manually calibrated by manually identifying the target class of the data and calibrating. Uncalibrated data is data that is not labeled, and is not labeled.
The targets may be persons, vehicles or non-vehicles, etc., and sample datasets may be acquired containing more diverse target categories in order to ensure that the trained models identify more target categories.
The method comprises the steps of taking images containing various target categories collected from different camera equipment as an original sample data set, selecting a small number of data from the original sample data set for calibration, and obtaining the sample data set, wherein the number of calibrated data in the sample data set is smaller than that of uncalibrated data, so that most of calibration work can be automatically completed by the electronic equipment. When a small amount of data is selected from the original sample data set for calibration, a specified amount of data can be randomly selected from the original sample data set for calibration, or data meeting the set requirement can be selected from the original sample data set for calibration.
The target class in the calibrated data contains the target class in the uncalibrated data. For example, if the target class in all calibrated data includes A, B, C, D, then the target class in all uncalibrated data is any one or several of A, B, C, D. In this manner, after training the model with calibrated data, the target classes may be identified A, B, C, D so that predictions may be made for various target classes in the uncalibrated data.
Each time uncalibrated data is selected from the sample data set, all uncalibrated data remaining in the sample data set may be selected. Of course, only a few uncalibrated data may be selected at a time, and the specific number of selections is not limited.
In step S200, the selected uncalibrated data is input into the model for target recognition, and a predicted target recognition result of each uncalibrated data input into the model is obtained; the model is trained from calibrated data in the sample dataset.
The model is trained from calibrated data in the sample dataset. The calibrated data in the sample data set can be directly used for training a model, and the model is trained by utilizing the calibrated data, so that parameters of the model are optimized to a certain degree, and the model has certain target recognition capability. However, if the training sample size is insufficient, the recognition performance of the model fails to meet the set requirements, and further training is required.
Training the model from calibrated data in the sample dataset may be performed in the following manner: and inputting the calibrated data in the sample data set into the initial model so that the initial model can perform target recognition on the input calibrated data, comparing the recognition result with the labels in the input calibrated image, and optimizing the initial model according to the comparison result, wherein the optimized initial model is used as the model. It is to be understood that the training patterns herein are merely examples and are not particularly limited thereto.
The initial model may be built from some neural network algorithm framework. When the neural network is not trained, the parameters of the neural network can be initialization parameters, and the network parameters of the neural network are continuously optimized along with the training of one time, so that a model meeting the requirements is finally obtained.
The model has a certain target recognition capability. And inputting the selected uncalibrated data into the model so as to carry out target recognition on each piece of input uncalibrated data by the model and obtain a predicted target recognition result. Thus, the predicted target recognition result of each piece of uncalibrated data input to the model can be obtained.
The predicted target recognition result may include a predicted category of the target predicted in the uncalibrated data, a confidence that the target belongs to the predicted category, and the like. Of course, the predicted target recognition result may also include other information, which is not particularly limited.
In step S300, target uncalibrated data to be calibrated is determined from uncalibrated data input to the model according to each predicted target recognition result, and target uncalibrated data in the sample data set is calibrated according to the predicted target recognition result of each target uncalibrated data, so as to obtain calibrated data.
And each piece of uncalibrated data input to the model has a corresponding predicted target recognition result. The predicted target recognition result may be used to determine information required for calibrating the corresponding uncalibrated data, for example, a predicted category in the predicted target recognition result may be used as the content of the uncalibrated data tag.
When a large amount of uncalibrated data is selected at a time and input into the model for prediction, some predicted target recognition results with lower reliability may appear, especially when the recognition performance of the model is poor, the prediction error rate is higher, so in this embodiment, target uncalibrated data to be calibrated is determined from the uncalibrated data input into the model according to each predicted target recognition result.
Some predicted target recognition results with higher reliability can be selected from the predicted target recognition results, and uncalibrated data corresponding to the selected predicted target recognition results is determined as target uncalibrated data to be calibrated. For example, the reliability of the predicted target recognition result can be determined according to the confidence in the predicted target recognition result, and uncalibrated data with higher confidence in the predicted target recognition result is determined as target uncalibrated data. Of course, the manner in which the target uncalibrated data is determined is not limited.
When each target uncalibrated data is calibrated, the target uncalibrated data in the sample data set can be calibrated according to the predicted target identification result of the target uncalibrated data, in other words, the target uncalibrated data in the sample data set becomes calibrated data. For example, the sample data set includes two uncalibrated data of N1 and N2 selected to be input into the model, and N1 and N2 are determined as target uncalibrated data, then N1 in the sample data set is calibrated according to the predicted target recognition result of N1 to obtain M1, N2 in the sample data set is calibrated according to the predicted target recognition result of N2 to obtain M2, so that two uncalibrated data of M1 and M2 are more in the sample data set, and two uncalibrated data of N1 and N2 are less.
Thus, through step S300, the number of calibrated data in the sample data set is increased compared to before step S300 is performed, in other words, the sample size for training is increased.
In step S400, a target model is trained according to the calibrated data in the sample data set and the model.
After the target uncalibrated data is calibrated, training the model according to the calibrated data in the sample data set; the trained model may be used directly as the target model, or alternatively, the operation of selecting uncalibrated data from the sample dataset may be returned until the target model is trained. Of course, how to train the target model based on the calibrated data in the sample dataset and the model is not limited.
As the number of calibrated data in the sample data set is increased and the number of samples used for training is increased, the performance of the trained target model is higher, and the target model with the performance meeting the requirement is finally obtained.
Alternatively, the target model may be used in the process of pedestrian retrieval to assist in determining whether the pedestrians in the two images are the same pedestrian. The target model comprises a feature extraction layer and a classification layer, when the target model is used, two images are respectively input into the target model, feature extraction is carried out on the input images by using the feature extraction layer of the target model to obtain feature information, then the similarity between the feature information of the two images is calculated, and if the similarity meets the requirement (for example, reaches a specified value), the pedestrians in the two images can be determined to be the same pedestrian.
Of course, other uses are possible after the training of the target model is completed. For example, an image to be identified may be input into the object model to identify a category of the object in the image, or the like, by the object model.
In the embodiment of the invention, only a small amount of data is required to be calibrated in advance as calibrated data in a sample data set, a model is trained according to the calibrated data in the sample data set, a large amount of uncalibrated data can be used as uncalibrated images in the sample data set, uncalibrated data is selected from the sample data set in the model training process, and a model is utilized to predict a predicted target recognition result of the selected calibrated data, and as target categories in the calibrated data comprise target categories in the uncalibrated data, the model can predict various target categories in the uncalibrated data; according to the method, target uncalibrated data to be calibrated in the sample data set is determined according to the predicted target recognition result to calibrate, calibration of uncalibrated data in the sample data set is achieved, the training sample size is increased, and therefore a target model can be trained according to calibrated data in the sample data set and the model.
In one embodiment, the above method flow may be performed by a model training apparatus, and as shown in fig. 2, the model training apparatus 100 may include 4 modules: a selection module 101, a prediction module 102, a calibration module 103, and a training module 104. The selection module 101 is configured to perform the step S100, the prediction module 102 is configured to perform the step S200, the calibration module 103 is configured to perform the step S300, and the training module 104 is configured to perform the step S400.
In one embodiment, the predicted target recognition result includes at least: confidence that the target belongs to the prediction category;
in step S300, the determining, according to the identification result of each predicted target, target uncalibrated data to be calibrated from uncalibrated data input to the model includes:
s301: checking whether the number of uncalibrated data input to the model is smaller than a preset number;
s302: if yes, determining all the input data as target uncalibrated data;
s303: if not, selecting the preset number of data from the input data according to the order of the confidence coefficient from large to small as the target uncalibrated data.
The model may identify a plurality of target classes, all of which are identified in the calibrated data used to train the model. And when the model identifies uncalibrated data to obtain a predicted target identification result, calculating the confidence coefficient of the input uncalibrated data belonging to each target category, wherein the higher the confidence coefficient is, the greater the probability of belonging to the category is, the target category with the highest confidence coefficient can be used as the predicted category, and the predicted target identification result can comprise the predicted category and the confidence coefficient of the target belonging to the predicted category.
In this embodiment, if the number of uncalibrated data input into the model at this time is greater than or equal to the preset number K, K uncalibrated data are selected as target uncalibrated data from the uncalibrated data, and if the number of uncalibrated data is less than K, all uncalibrated data input into the model at this time are determined as target uncalibrated data. The value of K is not limited and may be 1 or more.
When K pieces of uncalibrated data are selected as target uncalibrated data, all pieces of uncalibrated data which are input can be ordered according to the order of confidence in the predicted target recognition result from high to low, and the K pieces of uncalibrated data which are positioned in front are selected as target uncalibrated data (the more the confidence is positioned in front, the more reliable the predicted target recognition result is indicated).
In one embodiment, the predicted target recognition result includes at least: predicting a category;
in step S300, calibrating the target uncalibrated data in the sample data set according to the predicted target recognition result of each target uncalibrated data, including:
and determining the label of the target uncalibrated data according to the predicted category in the predicted target recognition result of the target uncalibrated data aiming at each target uncalibrated data, and marking the label on the target uncalibrated data in the sample data set to obtain calibrated data.
Therefore, each piece of target uncalibrated data in the sample data set determined at the time can be marked with a label of the target uncalibrated data, and the target uncalibrated data with the label is calibrated data.
When marking, a preset marking tool can be adopted to mark target uncalibrated data, and the marking is not particularly limited. The contents of the tag of the target uncalibrated data may include, for example: the predicted category in the predicted target recognition result of the target uncalibrated data.
In one embodiment, in step S400, training a target model according to the calibrated data in the sample data set and the model may include:
s401: training the model according to calibrated data in the sample dataset;
s402: and checking whether the set training ending condition is met currently, if not, returning to the operation of selecting uncalibrated data from the sample data set, and if so, determining the model as a target model.
In step S401, training the model according to the calibrated data in the sample data set may be achieved in the following manner: and inputting the calibrated data in the sample data set into the model so that the model can perform target identification on the input calibrated data, comparing the identification result with the labels in the input calibrated data, and optimizing the model according to the comparison result.
In step S402, it is checked whether the set training end condition is currently satisfied, and if not, the operation of selecting uncalibrated data from the sample data set is returned to perform a new iteration. Through multiple iterations, the number of calibrated data in the sample data set can be increased continuously, namely the sample size for model training is increased continuously step by step, the recognition performance of the model is also improved continuously until the set training ending condition is met currently, and the model is determined to be a target model.
The training end conditions may be varied. For example, in one example, the recognition performance of the model is tested, and if the recognition performance meets the set requirement, the training ending condition is indicated to be met currently, and the iteration can be ended; in another example, if there is no uncalibrated data in the sample dataset, indicating that the training end condition has been met currently, the iteration may be ended; in yet another example, an iteration number threshold may be set, the current iteration number is calculated, and when the current iteration number reaches the iteration number threshold, it is indicated that the training end condition is currently satisfied, and the iteration may be ended.
The above examples are not limiting, and the iteration may be ended without returning to operation as long as the set training end condition is currently satisfied.
In one embodiment, in step S402, checking whether the set training end condition is currently satisfied includes:
s4021: acquiring test sample data acquired by different camera equipment;
s4022: testing whether the performance of the model meets the preset performance requirement or not by using the obtained test sample data;
s4023: if yes, determining that the set training ending condition is met currently;
s4024: if not, determining that the set training ending condition is not met currently.
The number of acquired test sample data is not limited, and required test sample data can be acquired from different image pickup apparatuses, and a plurality of test sample data can be acquired from each image pickup apparatus. Targets may be included in each test sample data, and different test samples may include different targets or the same target, as desired.
When the performance of the model meets the preset performance requirement or not through the obtained test sample data, the target category of the target in the test sample data can be identified through the model, and whether the performance of the model meets the preset performance requirement or not is judged based on the identification result. For example, under the condition that the recognition results are accurate (the recognized target category is the same as the real category of the target), the performance of the model can be determined to meet the preset performance requirement.
The test sample data of the same target acquired by different camera devices can have some differences under the influence of the environment and the equipment. Testing the model by using test sample data acquired by different camera equipment, if the performance of the model meets the preset performance requirement, the method shows that the resolution of the model to the targets in the data is not influenced by the different camera equipment, and the current condition of meeting the set training ending condition is determined, so that the training of the model can be ended; otherwise, determining that the set training ending condition is not met currently, and continuing training the model is needed.
In this embodiment, whether the performance of the test sample data test model acquired by using different image capturing devices meets the preset performance requirement or not is tested, and training is finished when the performance meets the preset performance requirement, so that it can be ensured that the trained target model is not affected by different image capturing devices when the target in the data is identified.
In one embodiment, in step S4022, testing whether the performance of the model meets the preset performance requirement using the acquired test sample data includes:
s40221: grouping the acquired test sample data, wherein each group comprises two test sample data acquired from different camera equipment, and acquiring a preset similarity corresponding to each group of test sample data;
S40222: inputting each test sample data to a model respectively, so that characteristic information is extracted from the input test sample data by the model;
s40223: and calculating the similarity between the characteristic information of each group of two test sample data, if the similarity between the characteristic information of one group of two test sample data is not matched with the corresponding preset similarity, determining that the performance of the model does not meet the preset performance requirement, otherwise, determining that the performance of the model meets the preset performance requirement.
In step S40221, the acquired test sample data are grouped, so that each group of test sample data includes two test sample data acquired from different image capturing devices, and thus, the two test sample data acquired from different image capturing devices can be used for testing each time, and whether the performance of the target model is different from device to device is checked.
In all test sample data sets, there may be a same target in two test sample data of a partial set, and a different target in two test sample data of another partial set. The corresponding preset similarity may be greater, such as 90%, when the targets in the test sample data of a group are the same, and smaller, such as 10%, when the targets in the test sample data of a group are different.
In step S40222, each test sample data is input to a model, respectively, so that the model extracts feature information from the input test sample data.
The model may include a feature extraction layer, but may also include other layers such as a classification layer. In this embodiment, only the feature extraction layer of the model extracts feature information from the input test sample data, so that feature information of each test sample data can be obtained, and the feature information is used for describing a target in the test sample data.
In step S40223, the similarity between the feature information of each set of two test sample data is calculated. The manner of calculating the similarity is not particularly limited, and may be, for example, a manner of calculating a euclidean distance, a cosine distance, or the like.
Checking whether the similarity of each group is matched with the corresponding preset similarity of the group, for example, the preset similarity is 90%, if the calculated similarity is 90%, or is near 90%, for example, 85% -95%, the description is matched, otherwise, the description is not matched; as another example, if the predetermined similarity is 10%, then if the calculated similarity is 10%, or is around 10%, such as 5% -15%, the description is a match, otherwise it is not.
If all the similarity checking results are matched, namely the similarity between the characteristic information of each group of two test sample data is matched with the corresponding preset similarity, determining that the performance of the model meets the preset performance requirement, and finishing training. If one checking result is not matched, namely the similarity between the characteristic information of a group of two test sample data is not matched with the corresponding preset similarity, the performance of the model is determined to not meet the preset performance requirement.
The present invention also provides a model training apparatus, referring to fig. 2, the model training apparatus 100 includes:
a selection module 101, configured to select uncalibrated data from a sample data set, where the sample data set includes calibrated data and uncalibrated data, and a target class in the calibrated data includes a target class in the uncalibrated data;
the prediction module 102 is configured to input the selected uncalibrated data into a model for target recognition, and obtain a predicted target recognition result of each uncalibrated data input into the model; the model is obtained by training according to calibrated data in the sample data set;
the calibration module 103 is configured to determine target uncalibrated data to be calibrated from uncalibrated data input to the model according to each predicted target recognition result, and calibrate the target uncalibrated data in the sample data set according to the predicted target recognition result of each target uncalibrated data to obtain calibrated data;
The training module 104 is configured to train a target model according to the calibrated data in the sample data set and the model.
In one embodiment of the present invention, in one embodiment,
the predicted target recognition result at least comprises: confidence that the target belongs to the prediction category;
the calibration module is specifically configured to, when determining target uncalibrated data to be calibrated from uncalibrated data input to the model according to each predicted target recognition result:
checking whether the number of uncalibrated data input to the model is smaller than a preset number;
if yes, determining all the input data as target uncalibrated data;
if not, selecting the previous preset number of uncalibrated data from the input uncalibrated data according to the order of the confidence coefficient from large to small as the target uncalibrated data.
In one embodiment, the predicted target recognition result includes at least: predicting a category;
the calibration module is specifically configured to, when calibrating target uncalibrated data in the sample data set according to a predicted target identification result of each target uncalibrated data:
and determining the label of the target uncalibrated data according to the predicted category in the predicted target recognition result of the target uncalibrated data aiming at each target uncalibrated data, and marking the label on the target uncalibrated data in the sample data set to obtain calibrated data.
In one embodiment, the training module is specifically configured to, when training the target model according to the calibrated data in the sample data set and the model:
training the model according to calibrated data in the sample dataset;
and checking whether the set training ending condition is met currently, if not, returning to the operation of selecting uncalibrated data from the sample data set, and if so, determining the model as a target model.
In one embodiment, the training module checks whether the set training end condition is currently satisfied, specifically for:
acquiring test sample data acquired by different camera equipment;
testing whether the performance of the model meets the preset performance requirement or not by using the obtained test sample data;
if yes, determining that the set training ending condition is met currently;
if not, determining that the set training ending condition is not met currently.
In one embodiment, the training module is specifically configured to, when using the obtained test sample data to test whether the performance of the model meets the preset performance requirement:
grouping the acquired test sample data, wherein each group comprises two test sample data acquired from different camera equipment, and acquiring a preset similarity corresponding to each group of test sample data;
Inputting each test sample data to a model respectively, so that characteristic information is extracted from the input test sample data by the model;
and calculating the similarity between the characteristic information of each group of two test sample data, if the similarity between the characteristic information of one group of two test sample data is not matched with the corresponding preset similarity, determining that the performance of the model does not meet the preset performance requirement, otherwise, determining that the performance of the model meets the preset performance requirement.
The implementation process of the functions and roles of each unit in the above device is specifically shown in the implementation process of the corresponding steps in the above method, and will not be described herein again.
For the device embodiments, reference is made to the description of the method embodiments for the relevant points, since they essentially correspond to the method embodiments. The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements.
The invention also provides an electronic device, which comprises a processor and a memory; the memory stores a program that can be called by the processor; wherein the processor, when executing the program, implements the model training method as described in the foregoing embodiments.
The embodiment of the model training device can be applied to electronic equipment. Taking software implementation as an example, the device in a logic sense is formed by reading corresponding computer program instructions in a nonvolatile memory into a memory by a processor of an electronic device where the device is located for operation. In terms of hardware, as shown in fig. 3, fig. 3 is a hardware structure diagram of an electronic device where the model training apparatus 100 according to an exemplary embodiment of the present invention is located, and in addition to the processor 510, the memory 530, the interface 520, and the nonvolatile memory 540 shown in fig. 3, the electronic device where the apparatus 100 is located in the embodiment may further include other hardware according to the actual functions of the electronic device, which will not be described herein.
The foregoing description of the preferred embodiments of the invention is not intended to be limiting, but rather to enable any modification, equivalent replacement, improvement or the like to be made within the spirit and principles of the invention.

Claims (7)

1. A method of model training, comprising:
selecting uncalibrated data from a sample data set, wherein the sample data set comprises calibrated data and uncalibrated data, and the target category in the calibrated data comprises the target category in the uncalibrated data; wherein the sample dataset comprises data that is an image;
Inputting the selected uncalibrated data into a model for target recognition to obtain a predicted target recognition result of each uncalibrated data input into the model; the model is obtained by training according to calibrated data in the sample data set;
determining target uncalibrated data to be calibrated from uncalibrated data input to the model according to the identification result of each predicted target, and calibrating the target uncalibrated data in the sample data set according to the identification result of the predicted target of each target uncalibrated data to obtain calibrated data;
training a target model according to the calibrated data in the sample data set and the model, including: training the model according to calibrated data in the sample dataset; checking whether the current training ending condition is met, if not, returning to the operation of selecting uncalibrated data from the sample data set, and if so, determining the model as a target model;
wherein the checking whether the set training ending condition is satisfied currently includes: acquiring test sample data acquired by different camera equipment; testing whether the performance of the model meets the preset performance requirement or not by using the obtained test sample data; if yes, determining that the set training ending condition is met currently; if not, determining that the set training ending condition is not met currently;
The testing whether the performance of the model meets the preset performance requirement by using the obtained test sample data comprises the following steps: grouping the acquired test sample data, wherein each group comprises two test sample data acquired from different camera equipment, and acquiring a preset similarity corresponding to each group of test sample data; inputting each test sample data to a model respectively, so that characteristic information is extracted from the input test sample data by the model; and calculating the similarity between the characteristic information of each group of two test sample data, if the similarity between the characteristic information of one group of two test sample data is not matched with the corresponding preset similarity, determining that the performance of the model does not meet the preset performance requirement, otherwise, determining that the performance of the model meets the preset performance requirement.
2. The model training method of claim 1,
the predicted target recognition result at least comprises: confidence that the target belongs to the prediction category;
and determining target uncalibrated data to be calibrated from uncalibrated data input to the model according to the identification result of each predicted target, wherein the method comprises the following steps of:
checking whether the number of uncalibrated data input to the model is smaller than a preset number;
If yes, determining all the input data as target uncalibrated data;
if not, selecting the previous preset number of uncalibrated data from the input uncalibrated data according to the order of the confidence coefficient from large to small as the target uncalibrated data.
3. The model training method of claim 1, wherein the predicted target recognition result includes at least: predicting a category;
calibrating the target uncalibrated data in the sample data set according to the predicted target identification result of each target uncalibrated data, including:
and determining the label of the target uncalibrated data according to the predicted category in the predicted target recognition result of the target uncalibrated data aiming at each target uncalibrated data, and marking the label on the target uncalibrated data in the sample data set to obtain calibrated data.
4. A model training device, comprising:
a selection module, configured to select uncalibrated data from a sample data set, where the sample data set includes calibrated data and uncalibrated data, and a target class in the calibrated data includes a target class in the uncalibrated data; wherein the sample dataset comprises data that is an image;
The prediction module is used for inputting the selected uncalibrated data into the model for target recognition to obtain a predicted target recognition result of each uncalibrated data input into the model; the model is obtained by training according to calibrated data in the sample data set;
the calibration module is used for determining target uncalibrated data to be calibrated from uncalibrated data input to the model according to the identification result of each predicted target, and calibrating the target uncalibrated data in the sample data set according to the identification result of the predicted target of each target uncalibrated data to obtain calibrated data;
the training module is used for training a target model according to the calibrated data in the sample data set and the model, and comprises the following steps: training the model according to calibrated data in the sample dataset; checking whether the current training ending condition is met, if not, returning to the operation of selecting uncalibrated data from the sample data set, and if so, determining the model as a target model;
wherein the checking whether the set training ending condition is satisfied currently includes: acquiring test sample data acquired by different camera equipment; testing whether the performance of the model meets the preset performance requirement or not by using the obtained test sample data; if yes, determining that the set training ending condition is met currently; if not, determining that the set training ending condition is not met currently;
The testing whether the performance of the model meets the preset performance requirement by using the obtained test sample data comprises the following steps: grouping the acquired test sample data, wherein each group comprises two test sample data acquired from different camera equipment, and acquiring a preset similarity corresponding to each group of test sample data; inputting each test sample data to a model respectively, so that characteristic information is extracted from the input test sample data by the model; and calculating the similarity between the characteristic information of each group of two test sample data, if the similarity between the characteristic information of one group of two test sample data is not matched with the corresponding preset similarity, determining that the performance of the model does not meet the preset performance requirement, otherwise, determining that the performance of the model meets the preset performance requirement.
5. The model training apparatus of claim 4 wherein,
the predicted target recognition result at least comprises: confidence that the target belongs to the prediction category;
the calibration module is specifically configured to, when determining target uncalibrated data to be calibrated from uncalibrated data input to the model according to each predicted target recognition result:
Checking whether the number of uncalibrated data input to the model is smaller than a preset number;
if yes, determining all the input data as target uncalibrated data;
if not, selecting the previous preset number of uncalibrated data from the input uncalibrated data according to the order of the confidence coefficient from large to small as the target uncalibrated data.
6. The model training apparatus of claim 4 wherein said predicted target recognition result comprises at least: predicting a category;
the calibration module is specifically configured to, when calibrating target uncalibrated data in the sample data set according to a predicted target identification result of each target uncalibrated data:
and determining the label of the target uncalibrated data according to the predicted category in the predicted target recognition result of the target uncalibrated data aiming at each target uncalibrated data, and marking the label on the target uncalibrated data in the sample data set to obtain calibrated data.
7. An electronic device, comprising a processor and a memory; the memory stores a program that can be called by the processor; wherein the processor, when executing the program, implements a model training method as claimed in any one of claims 1-3.
CN201910724582.0A 2019-08-07 2019-08-07 Model training method, device and equipment Active CN112348040B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910724582.0A CN112348040B (en) 2019-08-07 2019-08-07 Model training method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910724582.0A CN112348040B (en) 2019-08-07 2019-08-07 Model training method, device and equipment

Publications (2)

Publication Number Publication Date
CN112348040A CN112348040A (en) 2021-02-09
CN112348040B true CN112348040B (en) 2023-08-29

Family

ID=74366567

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910724582.0A Active CN112348040B (en) 2019-08-07 2019-08-07 Model training method, device and equipment

Country Status (1)

Country Link
CN (1) CN112348040B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103927530A (en) * 2014-05-05 2014-07-16 苏州大学 Acquiring method, application method and application system of final classifier
CN107403201A (en) * 2017-08-11 2017-11-28 强深智能医疗科技(昆山)有限公司 Tumour radiotherapy target area and jeopardize that organ is intelligent, automation delineation method
WO2018137357A1 (en) * 2017-01-24 2018-08-02 北京大学 Target detection performance optimization method
CN109376796A (en) * 2018-11-19 2019-02-22 中山大学 Image classification method based on active semi-supervised learning
CN109460795A (en) * 2018-12-17 2019-03-12 北京三快在线科技有限公司 Classifier training method, apparatus, electronic equipment and computer-readable medium
CN109582793A (en) * 2018-11-23 2019-04-05 深圳前海微众银行股份有限公司 Model training method, customer service system and data labeling system, readable storage medium storing program for executing
WO2019075771A1 (en) * 2017-10-20 2019-04-25 Huawei Technologies Co., Ltd. Self-training method and system for semi-supervised learning with generative adversarial networks
CN109740549A (en) * 2019-01-08 2019-05-10 西安电子科技大学 SAR image object detection system and method based on semi-supervised CNN
CN109829483A (en) * 2019-01-07 2019-05-31 鲁班嫡系机器人(深圳)有限公司 Defect recognition model training method, device, computer equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9202140B2 (en) * 2008-09-05 2015-12-01 Siemens Medical Solutions Usa, Inc. Quotient appearance manifold mapping for image classification
CN109784391B (en) * 2019-01-04 2021-01-05 杭州比智科技有限公司 Multi-model-based sample labeling method and device

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103927530A (en) * 2014-05-05 2014-07-16 苏州大学 Acquiring method, application method and application system of final classifier
WO2018137357A1 (en) * 2017-01-24 2018-08-02 北京大学 Target detection performance optimization method
CN107403201A (en) * 2017-08-11 2017-11-28 强深智能医疗科技(昆山)有限公司 Tumour radiotherapy target area and jeopardize that organ is intelligent, automation delineation method
WO2019075771A1 (en) * 2017-10-20 2019-04-25 Huawei Technologies Co., Ltd. Self-training method and system for semi-supervised learning with generative adversarial networks
CN109376796A (en) * 2018-11-19 2019-02-22 中山大学 Image classification method based on active semi-supervised learning
CN109582793A (en) * 2018-11-23 2019-04-05 深圳前海微众银行股份有限公司 Model training method, customer service system and data labeling system, readable storage medium storing program for executing
CN109460795A (en) * 2018-12-17 2019-03-12 北京三快在线科技有限公司 Classifier training method, apparatus, electronic equipment and computer-readable medium
CN109829483A (en) * 2019-01-07 2019-05-31 鲁班嫡系机器人(深圳)有限公司 Defect recognition model training method, device, computer equipment and storage medium
CN109740549A (en) * 2019-01-08 2019-05-10 西安电子科技大学 SAR image object detection system and method based on semi-supervised CNN

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
单样本的低分辨率单目标人脸识别算法;薛杉;朱虹;吴文欢;;仪器仪表学报(03);全文 *

Also Published As

Publication number Publication date
CN112348040A (en) 2021-02-09

Similar Documents

Publication Publication Date Title
CN109784391B (en) Multi-model-based sample labeling method and device
US9811760B2 (en) Online per-feature descriptor customization
CN110264444B (en) Damage detection method and device based on weak segmentation
US20110134221A1 (en) Object recognition system using left and right images and method
CN105303179A (en) Fingerprint identification method and fingerprint identification device
CN110717881A (en) Wafer defect identification method and device, storage medium and terminal equipment
CN112307868B (en) Image recognition method, electronic device, and computer-readable medium
CN110807491A (en) License plate image definition model training method, definition detection method and device
CN109285105A (en) Method of detecting watermarks, device, computer equipment and storage medium
KR102476679B1 (en) Apparatus and method for object detection
CN110135505B (en) Image classification method and device, computer equipment and computer readable storage medium
CN112183166A (en) Method and device for determining training sample and electronic equipment
CN111008576B (en) Pedestrian detection and model training method, device and readable storage medium
CN113239227B (en) Image data structuring method, device, electronic equipment and computer readable medium
CN112633255A (en) Target detection method, device and equipment
CN116492634B (en) Standing long jump testing method based on image visual positioning
CN113780145A (en) Sperm morphology detection method, sperm morphology detection device, computer equipment and storage medium
CN112668462A (en) Vehicle loss detection model training method, vehicle loss detection device, vehicle loss detection equipment and vehicle loss detection medium
CN112364974A (en) Improved YOLOv3 algorithm based on activation function
CN117372528B (en) Visual image positioning method for modularized assembly of mobile phone shell
CN112348040B (en) Model training method, device and equipment
CN115858846B (en) Skier image retrieval method and system based on deep learning
CN112287905A (en) Vehicle damage identification method, device, equipment and storage medium
CN116452802A (en) Vehicle loss detection method, device, equipment and storage medium
US11755688B2 (en) Apparatus and method for generating training data for a machine learning system

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
GR01 Patent grant
GR01 Patent grant