CN113240125A - Model training method and device, labeling method and device, equipment and storage medium - Google Patents

Model training method and device, labeling method and device, equipment and storage medium Download PDF

Info

Publication number
CN113240125A
CN113240125A CN202110288564.XA CN202110288564A CN113240125A CN 113240125 A CN113240125 A CN 113240125A CN 202110288564 A CN202110288564 A CN 202110288564A CN 113240125 A CN113240125 A CN 113240125A
Authority
CN
China
Prior art keywords
image
label
labeled
model
data set
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.)
Granted
Application number
CN202110288564.XA
Other languages
Chinese (zh)
Other versions
CN113240125B (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.)
Shenyan Technology Beijing Co ltd
Original Assignee
Shenyan Technology Beijing 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 Shenyan Technology Beijing Co ltd filed Critical Shenyan Technology Beijing Co ltd
Publication of CN113240125A publication Critical patent/CN113240125A/en
Application granted granted Critical
Publication of CN113240125B publication Critical patent/CN113240125B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • 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/24Classification techniques

Landscapes

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

Abstract

The application provides a model training method and device, a labeling method and device, electronic equipment and a computer readable storage medium, wherein the model training method comprises the following steps: acquiring a training data set; training a preset deep learning model according to a training data set to obtain a first model; taking the value of i as 1; inputting an image to be marked into an ith model to obtain label information of the image to be marked, detecting whether the image to be marked meets an ith preset condition, and if so, putting the image to be marked and the label information thereof into a training data set; training the ith model according to the updated training data set to obtain an (i + 1) th model; and detecting whether an iteration ending condition is met, if not, adding the value of i together for model iteration, and if so, outputting an i +1 model. The method can realize model iteration, and the prediction accuracy of the model can be gradually improved in the iteration process.

Description

Model training method and device, labeling method and device, equipment and storage medium
Technical Field
The present application relates to the field of deep learning technologies, and in particular, to a model training method and apparatus, a labeling method and apparatus, an electronic device, and a computer-readable storage medium.
Background
With the continuous progress of the artificial intelligence technology, the application of the deep learning technology in various industries is more and more prominent. The supervised training of the deep learning model requires a large amount of training data, the quality of the data determines the upper limit of the model, the generation of the training data is inseparable from the data label, and the data label is used as an important ring in the machine learning engineering and is the basis for constructing the AI pyramid. The cost of manual labeling is high, and the accuracy of intelligent labeling is insufficient, so that the prediction accuracy of the trained model is limited.
Disclosure of Invention
The application aims to provide a model training method and device, a labeling method and device, an electronic device and a computer readable storage medium, so that model iteration can be realized, and the prediction accuracy of a model can be gradually improved in the iteration process.
The purpose of the application is realized by adopting the following technical scheme:
in a first aspect, the present application provides a model training method, including: s1: acquiring a training data set, wherein the training data set comprises a plurality of images and label information of each image; s2: training a preset deep learning model according to the training data set to obtain a first model; s3: taking the value of i as 1; s4: executing the following processing for each image to be labeled which is not put into the training data set in the image group to be labeled: inputting the image to be marked into the ith model to obtain label information of the image to be marked, detecting whether the image to be marked meets an ith preset condition, and if the image to be marked meets the ith preset condition, putting the image to be marked and the label information thereof into the training data set; s5: training the ith model according to the updated training data set to obtain an (i + 1) th model; s6: and detecting whether an iteration ending condition is met, if the iteration ending condition is not met, adding the value of i and executing S4, and if the iteration ending condition is met, outputting the (i + 1) th model. The technical scheme has the advantages that the preset depth model can be trained according to the training data set to obtain a first model, the image to be marked is predicted on the basis of the first model, if corresponding preset conditions are met, the image to be marked and label information of the image can be put into the training data set, the current model is trained by using the updated training data set to obtain a new model, on one hand, the (i + 1) th model can be obtained by training the (i) th model by continuously updating the training data set, so that model iteration is realized, and the prediction accuracy of the deep learning model can be gradually improved; on the other hand, whether the (i + 1) th model meets the iteration ending condition or not can be judged, if the (i + 1) th model does not meet the iteration ending condition, the (i + 1) th model can be trained continuously until the iteration ending condition is met, and if the (i + 1) th model meets the iteration ending condition, the (i + 1) th model can be output to finish the training of the model.
In some optional embodiments, the acquiring the training data set comprises: detecting whether a given deep learning model exists; when the given deep learning model is detected to be absent, acquiring a labeled image group and label information thereof, and putting the labeled image group and the label information thereof into the training data set; when the given deep learning model is detected to exist, all the images to be labeled in the image group to be labeled are input into the given deep learning model to obtain the label information of all the images to be labeled, and partial images and the label information of the partial images are put into the training data set. The technical scheme has the advantages that whether a given deep learning model exists or not can be detected, and on one hand, if the given deep learning model does not exist, a labeled image group and label information thereof can be put into a training data set; on the other hand, if the partial image exists, the given deep learning model can be used for predicting the image to be labeled, and the partial image and the corresponding label information are selected from the image to be labeled and are put into the training data set. When the image to be annotated is selected, the partial image with higher confidence coefficient can be preferentially selected.
In some optional embodiments, the acquiring the labeled image group and the label information thereof includes: receiving an annotation operation, wherein the annotation operation is an operation of setting at least one label for one image to be annotated in the image group to be annotated; and responding to the labeling operation, taking out the image to be labeled from the image group to be labeled and putting the image to be labeled into the image group to be labeled as a new labeled image, and determining the set label as the label of the new labeled image to obtain the label information of the new labeled image. The technical scheme has the advantages that when the given deep learning model does not exist, the image to be labeled in the image group to be labeled can be labeled manually to obtain a new labeled image and corresponding label information, and therefore the new labeled image and the corresponding label information are put into a training data set.
In some optional embodiments, the ith preset condition includes at least one of: the confidence coefficient of the label with the highest confidence coefficient in all the labels of the image to be labeled is greater than the ith preset confidence coefficient; will s1To snSorting in descending order, skArranged at front biPercent, recording all images to be labeled, which are not put into the training data set, in the image group to be labeled as a set A, wherein the set A comprises a first image to be labeled to an nth image to be labeled, the image to be labeled is a kth image to be labeled, and recording confidence degrees of labels with highest confidence degrees among all labels of a jth image to be labeled as sjN is the number of all the images to be marked in the set A, j and k are positive integers not greater than n, biIs a positive number less than 100. The technical scheme has the advantages that the ith preset condition can be that the confidence coefficient of the label with the highest confidence coefficient in all labels of the current image to be annotated is greater than the ith preset confidence coefficient; the ith preset condition may also be to pair s in order from large to small1To snSequencing, wherein the confidence coefficient s of the label with the highest confidence coefficient in all the labels of the current image to be labeledkArranged at front bi% regardless of confidence s of the label with highest confidence in the current image to be annotatedkWhether the confidence coefficient is greater than the ith preset confidence coefficient or not can be selected from the set Ai% confidence of label is higher for image to be annotated.
In some optional embodiments, the end iteration condition comprises at least one of: the number of the images to be marked which are not put into the training data set is not more than a first preset number; the number of images in the training data set is not less than a second preset number; i is not less than a preset value; an operation to end the iteration is received. The technical scheme has the advantages that on one hand, when any one or two of the situation that the number of the images to be labeled which are not put into the training data set is not more than the first preset number and the situation that the sum of the number of the labeled images and the number of the images to be labeled in the training data set is not less than the second preset number occur, the number of the images in the training data set is large, the prediction accuracy of the current model is high, and the current model can be used as a deep learning model corresponding to a target image; on one hand, when i is not less than the preset value, the current model is subjected to multiple iterations, and the prediction accuracy is high; on the other hand, the end of iteration can be manually selected, and the current model is used as the deep learning model corresponding to the target image.
In some optional embodiments, the (i + 1) th model is used for image classification or image detection. The technical scheme has the advantages that the (i + 1) th model can be formed by training a large amount of data, the accuracy of the predicted image is high, and the model can be used for image classification or image detection.
In a second aspect, the present application provides a labeling method, the method comprising: acquiring a deep learning model corresponding to a target image; inputting the target image into a deep learning model corresponding to the target image to obtain at least one label with the highest confidence as a label of the target image; the obtaining of the deep learning model corresponding to the target image includes: s1: acquiring a training data set, wherein the training data set comprises a plurality of images and label information of each image; s2: training a preset deep learning model according to the training data set to obtain a first model; s3: taking the value of i as 1; s4: executing the following processing for each image to be labeled which is not put into the training data set in the image group to be labeled: inputting the image to be marked into the ith model to obtain label information of the image to be marked, detecting whether the image to be marked meets an ith preset condition, and if the image to be marked meets the ith preset condition, putting the image to be marked and the label information thereof into the training data set; s5: training the ith model according to the updated training data set to obtain an (i + 1) th model; s6: and detecting whether an iteration ending condition is met, if the iteration ending condition is not met, adding the values of i together and executing S4, and if the iteration ending condition is met, determining the (i + 1) th model as a deep learning model corresponding to the target image. The technical scheme has the advantages that on one hand, a preset depth model can be trained according to a training data set to obtain a first model, an image to be marked is predicted on the basis of the first model, if corresponding preset conditions are met, the image to be marked and label information of the image can be put into the training data set, the current model is trained by using the updated training data set to obtain a new model, the training data set is continuously updated, the (i + 1) th model can be obtained through training of the (i) th model, model iteration is realized, and the prediction accuracy of the deep learning model can be gradually improved; by judging whether the (i + 1) th model meets the iteration ending condition or not, if the (i + 1) th model does not meet the iteration ending condition, the (i + 1) th model can be continuously trained until the iteration ending condition is met, and if the (i + 1) th model meets the iteration ending condition, the (i + 1) th model can be used as a deep learning model corresponding to the target image and used for predicting the target image; on the other hand, the target image can be predicted by using the deep learning model corresponding to the target image to obtain the labels corresponding to the target image, and at least one label with the highest confidence coefficient can be selected as the label of the target image, so that the intelligent labeling function is realized.
In some optional embodiments, the method further comprises: inputting a current image into an image detection model to obtain a detection tag group corresponding to the current image and a bounding box corresponding to each detection tag in the detection tag group, wherein the number of the detection tags in the detection tag group is not less than 1; for each detection label in the detection label group, acquiring a target image corresponding to the detection label according to the current image and the boundary frame of the detection label to obtain a label of the target image corresponding to the detection label; and obtaining the label of the current image according to the labels of the target images corresponding to all the detection labels. The technical scheme has the advantages that the detection label group corresponding to the current image and the boundary frame corresponding to each detection label can be obtained by using the image detection model, and the target image corresponding to each detection label is obtained according to the current image and the boundary frame corresponding to each detection label, so that the target image is predicted by using the corresponding deep learning model, and the label of the target image corresponding to the detection label is obtained.
In some optional embodiments, the obtaining the label of the current image according to the labels of the target images corresponding to all the detection labels includes: regarding each detection label in the detection label group, taking a label of a target image corresponding to the detection label as a label to be detected; acquiring association parameters of the label to be detected and all existing labels of the current image aiming at each label to be detected; when detecting that the correlation parameter is larger than a preset correlation parameter, determining the label to be detected as the label of the current image; and when the correlation parameter is not larger than the preset correlation parameter, determining that the label to be detected is not used as the label of the current image. The technical scheme has the advantages that the correlation degree of the label to be detected and all existing labels of the current image can be judged according to the preset correlation parameters, so that whether the label to be detected is used as the label of the current image or not is determined, when the correlation parameters of the label to be detected and all existing labels are larger than the preset correlation parameters, the correlation of the label to be detected and all existing labels is larger, the label to be detected can be used as the label of the current image, when the correlation parameters of the label to be detected and all existing labels are not larger than the preset correlation parameters, the correlation of the label to be detected and all existing labels is smaller, and the label to be detected does not need to be used as the label of the current image.
In some optional embodiments, the obtaining the association parameters of the tag to be tested and all existing tags of the current image includes: when the number of all existing labels of the current image is more than 1, acquiring the association degree of the label to be detected and each existing label and the weight corresponding to each association degree; and acquiring the association parameters according to the association degree of the to-be-detected label and each existing label and the weight corresponding to each association degree. The technical scheme has the advantages that when the number of all existing labels of the current image is larger than 1, the association parameters can be obtained according to the association degree of the label to be detected and each existing label and the weight corresponding to each association degree, so that the association degree of the label to be detected and all existing labels of the current image is judged.
In a third aspect, the present application provides a model training apparatus, the apparatus comprising: an initial module, configured to obtain a training data set, where the training data set includes a plurality of images and label information of each image; the first model module is used for training a preset deep learning model according to the training data set to obtain a first model; the value taking module is used for taking the value of i as 1; the module to be labeled is used for executing the following processing on each image to be labeled which is not put into the training data set in the image group to be labeled: inputting the image to be marked into the ith model to obtain label information of the image to be marked, detecting whether the image to be marked meets an ith preset condition, and if the image to be marked meets the ith preset condition, putting the image to be marked and the label information thereof into the training data set; the model iteration module is used for training the ith model according to the updated training data set to obtain an (i + 1) th model; and the iteration detection module is used for detecting whether an iteration ending condition is met, adding the value of i and calling the module to be labeled if the iteration ending condition is not met, and outputting the (i + 1) th model if the iteration ending condition is met.
In some optional embodiments, the initialization module comprises: the existing detection unit is used for detecting whether a given deep learning model exists or not; the first acquisition unit is used for acquiring a labeled image group and label information thereof when detecting that the given deep learning model does not exist, and putting the labeled image group and the label information thereof into the training data set; and the second acquisition unit is used for inputting all the images to be labeled in the image group to be labeled into the given deep learning model to obtain the label information of all the images to be labeled and putting the partial images and the label information thereof in the images to be labeled into the training data set when the given deep learning model is detected to exist.
In some optional embodiments, the first obtaining unit includes: the operation receiving subunit is configured to receive an annotation operation, where the annotation operation is an operation of setting at least one label for one to-be-annotated image in the to-be-annotated image group; and the image moving subunit is used for responding to the labeling operation, taking out the image to be labeled from the image group to be labeled and putting the image to be labeled into the labeled image group as a new labeled image, and determining the set label as the label of the new labeled image to obtain the label information of the new labeled image.
In some optional embodiments, the ith preset condition includes at least one of: the confidence coefficient of the label with the highest confidence coefficient in all the labels of the image to be labeled is greater than the ith preset confidence coefficient; will s1To snSorting in descending order, skArranged at front biPercent, recording all images to be labeled, which are not put into the training data set, in the image group to be labeled as a set A, wherein the set A comprises a first image to be labeled to an nth image to be labeled, the image to be labeled is a kth image to be labeled, and recording confidence degrees of labels with highest confidence degrees among all labels of a jth image to be labeled as sjN is the number of all the images to be marked in the set A, j and k are positive integers not greater than n, biIs a positive number less than 100.
In some optional embodiments, the end iteration condition comprises at least one of: the number of the images to be marked which are not put into the training data set is not more than a first preset number; the number of images in the training data set is not less than a second preset number; i is not less than a preset value; an operation to end the iteration is received.
In some optional embodiments, the (i + 1) th model is used for image classification or image detection.
In a fourth aspect, the present application provides an annotation apparatus, comprising: the model training module is used for acquiring a deep learning model corresponding to the target image; the image input module is used for inputting the target image into a deep learning model corresponding to the target image to obtain at least one label with the highest confidence degree as a label of the target image; wherein the model training module comprises: an initial unit, configured to acquire a training data set, where the training data set includes a plurality of images and label information of each image; the first model unit is used for training a preset deep learning model according to the training data set to obtain a first model; the value taking unit is used for taking the value of i as 1; the to-be-labeled unit is used for executing the following processing on each to-be-labeled image which is not put into the training data set in the to-be-labeled image group: inputting the image to be marked into the ith model to obtain label information of the image to be marked, detecting whether the image to be marked meets an ith preset condition, and if the image to be marked meets the ith preset condition, putting the image to be marked and the label information thereof into the training data set; the model iteration unit is used for training the ith model according to the updated training data set to obtain an (i + 1) th model; and the iteration detection unit is used for detecting whether an iteration ending condition is met, adding the value of i and calling the unit to be labeled if the iteration ending condition is not met, and determining the (i + 1) th model as the deep learning model corresponding to the target image if the iteration ending condition is met.
In some optional embodiments, the apparatus further comprises: the detection tag module is used for inputting a current image into an image detection model to obtain a detection tag group corresponding to the current image and a boundary frame corresponding to each detection tag in the detection tag group, wherein the number of the detection tags in the detection tag group is not less than 1; a target image tag module, configured to, for each detection tag in the detection tag group, obtain a target image corresponding to the detection tag according to the current image and a bounding box of the detection tag, and obtain a tag of the target image corresponding to the detection tag; and the current image label module is used for obtaining the label of the current image according to the labels of the target images corresponding to all the detection labels.
In some optional embodiments, the current image tag module comprises: the to-be-detected label unit is used for regarding each detection label in the detection label group, and taking a label of a target image corresponding to the detection label as the to-be-detected label; the correlation unit to be tested is used for acquiring correlation parameters of the label to be tested and all existing labels of the current image aiming at each label to be tested; the first determining unit is used for determining the label to be detected as the label of the current image when the correlation parameter is detected to be larger than a preset correlation parameter; and the second determining unit is used for determining that the label to be detected is not used as the label of the current image when the correlation parameter is not larger than the preset correlation parameter.
In some optional embodiments, the association unit under test includes: the association degree subunit is configured to, when the number of all existing tags in the current image is greater than 1, obtain association degrees of the tag to be detected and each existing tag and a weight corresponding to each association degree; and the association parameter subunit is used for acquiring the association parameters according to the association degree of the to-be-detected label and each existing label and the weight corresponding to each association degree.
In a fifth aspect, the present application provides an electronic device comprising a memory and a processor, the memory storing a computer program, the processor implementing the steps of any of the above methods when executing the computer program.
In a sixth aspect, the present application provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of any of the methods described above.
Drawings
The present application is further described below with reference to the drawings and examples.
FIG. 1 is a schematic flow chart diagram illustrating a model training method according to an embodiment of the present disclosure;
FIG. 2 is a schematic flow chart of acquiring a training data set according to an embodiment of the present application;
fig. 3 is a schematic flowchart of a process for acquiring a labeled image group and tag information thereof according to an embodiment of the present application;
FIG. 4 is a schematic flow chart of an annotation method according to an embodiment of the present application;
fig. 5 is a schematic flowchart of obtaining a deep learning model according to an embodiment of the present application;
FIG. 6 is a schematic flow chart of an annotation method according to an embodiment of the present application;
fig. 7 is a schematic flowchart of obtaining a label of a current image according to an embodiment of the present application;
fig. 8 is a schematic flowchart of acquiring a correlation parameter according to an embodiment of the present disclosure;
FIG. 9 is a schematic structural diagram of a model training apparatus according to an embodiment of the present disclosure;
FIG. 10 is a schematic structural diagram of an initial module provided by an embodiment of the present application;
fig. 11 is a schematic structural diagram of a first obtaining unit provided in an embodiment of the present application;
FIG. 12 is a schematic structural diagram of a labeling apparatus according to an embodiment of the present application;
FIG. 13 is a schematic structural diagram of a model training module according to an embodiment of the present disclosure;
FIG. 14 is a schematic structural diagram of a labeling apparatus according to an embodiment of the present application;
FIG. 15 is a schematic structural diagram of a current image tag module according to an embodiment of the present disclosure;
fig. 16 is a schematic structural diagram of an association unit to be tested according to an embodiment of the present disclosure;
fig. 17 is a block diagram of an electronic device according to an embodiment of the present application;
fig. 18 is a schematic structural diagram of a program product for implementing a model training method and a labeling method according to an embodiment of the present application.
Detailed Description
The present application is further described with reference to the accompanying drawings and the detailed description, and it should be noted that, in the present application, the embodiments or technical features described below may be arbitrarily combined to form a new embodiment without conflict.
Referring to fig. 1, the present application provides a model training method, which may include steps S1 to S6.
S1: a training data set is obtained, the training data set including a plurality of images and label information for each of the images.
Referring to fig. 2, in a specific embodiment, the step S1 may include steps S11 to S13.
Step S11: it is detected whether a given deep learning model is present. The given deep learning model can be a deep learning model corresponding to the type identifier of the target image, and can also be a preset deep learning model, wherein the type identifier can be a manually set custom category. For example, when a labeling task is issued, an administrator gives 1000 pictures and corresponding custom categories, such as fish, and the administrator can also customize tags for the labeling administrator to label, where the custom tags are goldfish, carp, shark, and the like. In this step, it may also be detected whether there is a label of the model in the system that can cover the labeling task, for example: the labels of models in the system comprise bicycles, pedestrians, cars, trucks and buses, and if the labeling task needs to label the pedestrians and the bicycles, the models existing in the system can be used as a given deep learning model to predict the labeling task.
Step S12: and when the given deep learning model is detected to be absent, acquiring a labeled image group and label information thereof, and putting the labeled image group and the label information thereof into the training data set.
Referring to fig. 3, in a specific embodiment, the method for acquiring the labeled image group and the label information thereof in step S12 may include steps S21 to S22.
Step S21: and receiving an annotation operation, wherein the annotation operation is an operation of setting at least one label for one image to be annotated in the image group to be annotated.
Step S22: and responding to the labeling operation, taking out the image to be labeled from the image group to be labeled and putting the image to be labeled into the image group to be labeled as a new labeled image, and determining the set label as the label of the new labeled image to obtain the label information of the new labeled image.
Therefore, when the given deep learning model does not exist, the image to be labeled in the image group to be labeled can be labeled manually to obtain a new labeled image and corresponding label information, and the new labeled image and the corresponding label information are put into a training data set.
Step S13: when the given deep learning model is detected to exist, all the images to be labeled in the image group to be labeled are input into the given deep learning model to obtain the label information of all the images to be labeled, and partial images and the label information of the partial images are put into the training data set.
Therefore, whether a given deep learning model exists can be detected, on one hand, if not, the labeled image group and the label information thereof can be put into a training data set; on the other hand, if the partial image exists, the given deep learning model can be used for predicting the image to be labeled, and the partial image and the corresponding label information are selected from the image to be labeled and are put into the training data set. When the image to be annotated is selected, the partial image with higher confidence coefficient can be preferentially selected.
S2: and training a preset deep learning model according to the training data set to obtain a first model.
S3: the value of i is taken as 1.
S4: executing the following processing for each image to be labeled which is not put into the training data set in the image group to be labeled: and inputting the image to be marked into the ith model to obtain label information of the image to be marked, detecting whether the image to be marked meets an ith preset condition, and if the image to be marked meets the ith preset condition, putting the image to be marked and the label information thereof into the training data set. The label information of the image to be labeled is used for indicating the label prediction condition of the image to be labeled. When the trained model is used for image classification, the label information of the image to be labeled can comprise a label and a confidence thereof; when the trained model is used for image detection, the label information of the image to be labeled is divided into two conditions, wherein the position information of the boundary frame, the label and the confidence coefficient of the label are output in the first condition, and the label is not output in the second condition.
In a specific embodiment, the ith preset condition may include at least one of:
the confidence coefficient of the label with the highest confidence coefficient in all the labels of the image to be labeled is greater than the ith preset confidence coefficient; the preset confidence may be a preset confidence, the first preset confidence may be consistent with the ith preset confidence, the first preset confidence may not be completely consistent with the ith preset confidence, and the ith preset confidence is, for example, 95%;
will s1To snSorting in descending order, skArranged at front biPercent, recording all images to be labeled, which are not put into the training data set, in the image group to be labeled as a set A, wherein the set A comprises a first image to be labeled to an nth image to be labeled, the image to be labeled is a kth image to be labeled, and recording confidence degrees of labels with highest confidence degrees among all labels of a jth image to be labeled as sjN is the number of all the images to be marked in the set A, j and k are positive integers not greater than n, biIs a positive number less than 100. For example, n is 1000, the current image to be annotated is the 567 th image to be annotated, biIs 30, b1To bnMay or may not remain uniform, s1To s1000Respectively, is a value between 0 and 100%, s56783% for s1To s1000After sorting from large to small, s567Is arranged atAnd if the current image to be annotated meets the ith preset condition, judging whether the current image to be annotated meets the ith preset condition or not.
Therefore, the ith preset condition can be that the confidence coefficient of the label with the highest confidence coefficient in all the labels of the current image to be annotated is greater than the ith preset confidence coefficient; the ith preset condition may also be to pair s in order from large to small1To snSequencing, wherein the confidence coefficient s of the label with the highest confidence coefficient in all the labels of the current image to be labeledkArranged at front bi% regardless of confidence s of the label with highest confidence in the current image to be annotatedkWhether the confidence coefficient is greater than the ith preset confidence coefficient or not can be selected from the set Ai% confidence of label is higher for image to be annotated.
S5: and training the ith model according to the updated training data set to obtain an (i + 1) th model.
S6: and detecting whether an iteration ending condition is met, if the iteration ending condition is not met, adding the value of i and executing S4, and if the iteration ending condition is met, outputting the (i + 1) th model.
Therefore, a preset depth model can be trained according to a training data set to obtain a first model, an image to be labeled is predicted on the basis of the first model, if corresponding preset conditions are met, the image to be labeled and label information of the image can be put into the training data set, the current model is trained by using the updated training data set to obtain a new model, on one hand, the (i + 1) th model can be obtained by training the (i) th model by continuously updating the training data set, model iteration is realized, and the prediction accuracy of the deep learning model can be gradually improved; on the other hand, whether the (i + 1) th model meets the iteration ending condition or not can be judged, if the (i + 1) th model does not meet the iteration ending condition, the (i + 1) th model can be trained continuously until the iteration ending condition is met, and if the (i + 1) th model meets the iteration ending condition, the (i + 1) th model can be output to finish the training of the model.
In a specific embodiment, the end iteration condition may include at least one of: the number of the images to be marked which are not put into the training data set is not more than a first preset number; the number of images in the training data set is not less than a second preset number; i is not less than a preset value; an operation to end the iteration is received. The first predetermined number and the second predetermined number may be predetermined numbers, the first predetermined number is, for example, 10 or 0, the second predetermined number is, for example, 800 or 1000, and the predetermined value may be a predetermined value, and the predetermined value is, for example, 3, 8, or 100.
Therefore, on one hand, when the number of the images to be labeled which are not put into the training data set is not more than any one or two of the first preset number and the second preset number, wherein the sum of the number of the labeled images and the number of the images to be labeled in the training data set is not less than the second preset number, the number of the images in the training data set is large, the prediction accuracy of the current model is high, and the current model can be used as a deep learning model corresponding to the target image; on one hand, when i is not less than the preset value, the current model is subjected to multiple iterations, and the prediction accuracy is high; on the other hand, the end of iteration can be manually selected, and the current model is used as the deep learning model corresponding to the target image.
In a specific embodiment, the (i + 1) th model can be used for image classification or image detection.
Thus, the (i + 1) th model can be trained from a large amount of data, the accuracy of a predicted image is high, and pattern classification or image detection can be performed using the model.
Referring to fig. 4-5, an embodiment of the present application further provides a labeling method, which may include steps S101 to S102.
Step S101: and obtaining a deep learning model corresponding to the target image.
Wherein the step S101 includes steps S1-S6.
S1: a training data set is obtained, the training data set including a plurality of images and label information for each of the images.
S2: and training a preset deep learning model according to the training data set to obtain a first model.
S3: the value of i is taken as 1.
S4: executing the following processing for each image to be labeled which is not put into the training data set in the image group to be labeled: and inputting the image to be marked into the ith model to obtain label information of the image to be marked, detecting whether the image to be marked meets an ith preset condition, and if the image to be marked meets the ith preset condition, putting the image to be marked and the label information thereof into the training data set.
S5: training the ith model according to the updated training data set to obtain an (i + 1) th model;
s6: and detecting whether an iteration ending condition is met, if the iteration ending condition is not met, adding the values of i together and executing S4, and if the iteration ending condition is met, determining the (i + 1) th model as a deep learning model corresponding to the target image.
Step S102: and inputting the target image into a deep learning model corresponding to the target image to obtain at least one label with the highest confidence as a label of the target image.
Therefore, on one hand, a preset depth model can be trained according to a training data set to obtain a first model, an image to be labeled is predicted on the basis of the first model, if corresponding preset conditions are met, the image to be labeled and label information of the image can be put into the training data set, the current model is trained by using the updated training data set to obtain a new model, the training data set is continuously updated, an i +1 model can be obtained through the i model training, model iteration is realized, and the prediction accuracy of the deep learning model can be gradually improved; by judging whether the (i + 1) th model meets the iteration ending condition or not, if the (i + 1) th model does not meet the iteration ending condition, the (i + 1) th model can be continuously trained until the iteration ending condition is met, and if the (i + 1) th model meets the iteration ending condition, the (i + 1) th model can be used as a deep learning model corresponding to the target image and used for predicting the target image; on the other hand, the target image can be predicted by using the deep learning model corresponding to the target image to obtain the labels corresponding to the target image, and at least one label with the highest confidence coefficient can be selected as the label of the target image, so that the intelligent labeling function is realized.
Referring to fig. 6, in a specific embodiment, the method may further include steps S103 to S105.
Step S103: inputting a current image into an image detection model to obtain a detection tag group corresponding to the current image and a bounding box corresponding to each detection tag in the detection tag group, wherein the number of the detection tags in the detection tag group is not less than 1. The current image is, for example, an image including a house, a person, a car, a traffic light, and the detection tags in the detection tag group may include a house, a person, a car, a traffic light, and the like.
Step S104: and aiming at each detection label in the detection label group, acquiring a target image corresponding to the detection label according to the current image and the boundary frame of the detection label, and acquiring the label of the target image corresponding to the detection label.
Step S105: and obtaining the label of the current image according to the labels of the target images corresponding to all the detection labels.
For example, a current image includes roses and a cauchy dog, the current image is input into an image detection model to obtain two detection labels of the flowers and the dogs and corresponding boundary frames of the two detection labels, the image in the boundary frame is determined as a first target image according to the detection label of the flowers and the boundary frame of the detection label, and the first target image is input into a flower image classification model to obtain the label of the roses; the method for obtaining the label of the corgi dog is similar to the method described above, and details are not repeated here, because the second target image is determined according to the detection label of the dog and the bounding box thereof, and the label of the corgi dog is obtained based on the dog image classification model corresponding to the dog. In conclusion, labels corresponding to the two current images of the roses and the coxiella globosa can be obtained.
Therefore, the detection label group corresponding to the current image and the boundary frame corresponding to each detection label can be obtained by using the image detection model, and the target image corresponding to each detection label is obtained according to the current image and the boundary frame corresponding to each detection label, so that the target image is predicted by using the corresponding deep learning model, and the label of the target image corresponding to the detection label is obtained.
Referring to fig. 7, in a specific embodiment, the step S105 may include steps S201 to S204.
Step S201: and regarding each detection label in the detection label group, taking the label of the target image corresponding to the detection label as a label to be detected.
Step S202: and acquiring the correlation parameters of the to-be-detected label and all existing labels of the current image aiming at each to-be-detected label.
Referring to fig. 8, in a specific embodiment, the step S202 may include steps S301 to S302.
Step S301: and when the number of all the existing labels of the current image is more than 1, acquiring the association degree of the label to be detected and each existing label and the weight corresponding to each association degree. The weight corresponding to each degree of association may be determined by the confidence of each existing label, and the weight corresponding to each degree of association may be consistent with the corresponding confidence. The degree of association and the corresponding weight may both be expressed in percentages.
Step S302: and acquiring the association parameters according to the association degree of the to-be-detected label and each existing label and the weight corresponding to each association degree. The relevance parameter may be the sum of the products of each relevance degree and the corresponding weight.
Therefore, when the number of all existing labels of the current image is greater than 1, the association parameters can be obtained according to the association degree of the to-be-detected label and each existing label and the weight corresponding to each association degree, and therefore the association degree of the to-be-detected label and all existing labels of the current image is judged.
Step S203: and when the correlation parameter is detected to be larger than a preset correlation parameter, determining the label to be detected as the label of the current image. The preset correlation parameter may be a preset correlation parameter, for example, 80%.
For example, the following steps are carried out: the existing labels of the current image are respectively: the confidence degrees of the rose, the Chinese rose and the tulip are 78%, 16% and 1% in sequence, the to-be-predicted label is a bee, the association degrees of the to-be-predicted label and the 3 existing labels are 98%, 99% and 97% in sequence, the corresponding weights are 78%, 16% and 1% in sequence, the association parameter is 93%, the preset association parameter is 80%, the association parameter is larger than the preset association parameter, and the bee is determined to be used as the label of the current image.
Step S204: and when the correlation parameter is not larger than the preset correlation parameter, determining that the label to be detected is not used as the label of the current image.
For example, the following steps are carried out: the existing labels of the current image are respectively: the confidence degrees of the rose, the Chinese rose and the tulip are 78%, 16% and 1% in sequence, the label to be predicted is glacier, the association degrees of the label to be predicted and the 3 existing labels are 0.2%, 0.1% and 0.15% in sequence, the corresponding weights are 78%, 16% and 1% in sequence, the association parameter is 0.17%, the preset association parameter is 80%, and the association parameter is smaller than the preset association parameter, so that the glacier is determined not to be the label of the current image.
Therefore, the correlation degree of the label to be detected and all existing labels of the current image can be judged according to the preset correlation parameters, whether the label to be detected is used as the label of the current image or not is determined, when the correlation parameters of the label to be detected and all existing labels are larger than the preset correlation parameters, the correlation of the label to be detected and all existing labels is larger, the label to be detected can be used as the label of the current image, when the correlation parameters of the label to be detected and all existing labels are not larger than the preset correlation parameters, the correlation of the label to be detected and all existing labels is smaller, and the label to be detected does not need to be used as the label of the current image.
Referring to fig. 9, an embodiment of the present application further provides a model training apparatus, and a specific implementation manner of the model training apparatus is consistent with the implementation manner and the achieved technical effect described in the embodiment of the model training method, and details of a part of the implementation manner and the achieved technical effect are not repeated.
The device comprises: an initial module 11, configured to obtain a training data set, where the training data set includes a plurality of images and label information of each image; the first model module 12 is configured to train a preset deep learning model according to the training data set to obtain a first model; a value module 13, configured to take the value i as 1; a to-be-labeled module 14, configured to execute the following processing for each to-be-labeled image that is not put in the training data set in the to-be-labeled image group: inputting the image to be marked into the ith model to obtain label information of the image to be marked, detecting whether the image to be marked meets an ith preset condition, and if the image to be marked meets the ith preset condition, putting the image to be marked and the label information thereof into the training data set; the model iteration module 15 is configured to train the ith model according to the updated training data set to obtain an (i + 1) th model; and the iteration detection module 16 is configured to detect whether an iteration ending condition is met, add the value of i together to call the module to be labeled if the iteration ending condition is not met, and output the (i + 1) th model if the iteration ending condition is met.
Referring to fig. 10, in a specific embodiment, the initialization module 11 may include: an existing detection unit 21, which may be used to detect whether a given deep learning model exists; a first obtaining unit 22, configured to, when it is detected that the given deep learning model does not exist, obtain a labeled image group and label information thereof, and place the labeled image group and label information thereof in the training data set; the second obtaining unit 23 may be configured to, when it is detected that the given deep learning model exists, input all the images to be labeled in the image group to be labeled into the given deep learning model to obtain label information of all the images to be labeled, and place partial images and label information thereof in all the images to be labeled into the training data set.
Referring to fig. 11, in a specific embodiment, the first obtaining unit 22 may include: an operation receiving subunit 31, configured to receive an annotation operation, where the annotation operation may be an operation of setting at least one label for one to-be-annotated image in the to-be-annotated image group; the image moving subunit 32 may be configured to, in response to the tagging operation, take the image to be tagged out of the image group to be tagged and put the image group to be tagged into a new tagged image, and determine the set tag as the tag of the new tagged image, so as to obtain the tag information of the new tagged image.
In a specific embodiment, the ith preset condition may include at least one of: the confidence coefficient of the label with the highest confidence coefficient in all the labels of the image to be labeled is greater than the ith preset confidence coefficient; will s1To snSorting in descending order, skArranged at front biPercent, recording all images to be labeled, which are not put into the training data set, in the image group to be labeled as a set A, wherein the set A comprises a first image to be labeled to an nth image to be labeled, the image to be labeled is a kth image to be labeled, and recording confidence degrees of labels with highest confidence degrees among all labels of a jth image to be labeled as sjN is the number of all the images to be marked in the set A, j and k are positive integers not greater than n, biIs a positive number less than 100.
In a specific embodiment, the end iteration condition may include at least one of: the number of the images to be marked which are not put into the training data set is not more than a first preset number; the number of images in the training data set is not less than a second preset number; i is not less than a preset value; an operation to end the iteration is received.
In a specific embodiment, the (i + 1) th model can be used for image classification or image detection.
Referring to fig. 12 to 13, an embodiment of the present application further provides a labeling apparatus, and a specific implementation manner of the labeling apparatus is consistent with the implementation manner and the achieved technical effect described in the embodiment of the labeling method, and details are not repeated.
The device comprises: the model training module 101 is used for acquiring a deep learning model corresponding to a target image; an image input module 102, configured to input the target image into a deep learning model corresponding to the target image, and obtain at least one tag with a highest confidence as a tag of the target image; wherein the model training module 101 comprises: an initial unit 1011, configured to obtain a training data set, where the training data set includes a plurality of images and label information of each image; a first model unit 1012, configured to train a preset deep learning model according to the training data set, so as to obtain a first model; a value unit 1013 configured to take the value i as 1; a to-be-labeled unit 1014, configured to execute the following processing for each to-be-labeled image that is not put in the training data set in the to-be-labeled image group: inputting the image to be marked into the ith model to obtain label information of the image to be marked, detecting whether the image to be marked meets an ith preset condition, and if the image to be marked meets the ith preset condition, putting the image to be marked and the label information thereof into the training data set; a model iteration unit 1015, configured to train the ith model according to the updated training data set, to obtain an (i + 1) th model; an iteration detection unit 1016, configured to detect whether an iteration ending condition is met, add the value of i together to call the unit to be labeled if the iteration ending condition is not met, and determine the (i + 1) th model as the deep learning model corresponding to the target image if the iteration ending condition is met.
Referring to fig. 14, in a specific embodiment, the apparatus may further include: the detection tag module 103 may be configured to input a current image into an image detection model, to obtain a detection tag group corresponding to the current image and a bounding box corresponding to each detection tag in the detection tag group, where the number of detection tags in the detection tag group may be not less than 1; the target image tag module 104 may be configured to, for each detection tag in the detection tag group, obtain a target image corresponding to the detection tag according to the current image and a bounding box of the detection tag, and obtain a tag of the target image corresponding to the detection tag; the current image tag module 105 may be configured to obtain a tag of the current image according to tags of target images corresponding to all the detection tags.
Referring to fig. 15, in a specific embodiment, the current image tag module 105 may include: the tag unit 1051 to be detected may be configured to, for each detection tag in the detection tag group, use a tag of the target image corresponding to the detection tag as a tag to be detected; the to-be-detected association unit 1052 may be configured to obtain, for each to-be-detected tag, association parameters between the to-be-detected tag and all existing tags in the current image; a first determining unit 1053, configured to determine, when it is detected that the association parameter is greater than a preset association parameter, that the tag to be detected is a tag of the current image; the second determining unit 1054 may be configured to determine that the tag to be tested is not a tag of the current image when it is detected that the association parameter is not greater than the preset association parameter.
Referring to fig. 16, in a specific embodiment, the association unit 1052 to be tested may include: the association degree subunit 1052a may be configured to, when the number of all existing tags in the current image is greater than 1, obtain an association degree between the tag to be detected and each existing tag and a weight corresponding to each association degree; the association parameter subunit 1052b may be configured to obtain the association parameter according to the association degree between the to-be-detected tag and each existing tag and the weight corresponding to each association degree.
Referring to fig. 17, an embodiment of the present application further provides an electronic device 200, where the electronic device 200 includes at least one memory 210, at least one processor 220, and a bus 230 connecting different platform systems.
The memory 210 may include readable media in the form of volatile memory, such as Random Access Memory (RAM)211 and/or cache memory 212, and may further include Read Only Memory (ROM) 213.
The memory 210 further stores a computer program, and the computer program can be executed by the processor 220, so that the processor 220 executes the steps of the model training method and the labeling method in the embodiment of the present application, and the specific implementation manner of the method is consistent with the implementation manner and the achieved technical effect described in the embodiments of the model training method and the labeling method, and some contents are not described again.
Memory 210 may also include a program/utility 214 having a set (at least one) of program modules 215, including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Accordingly, processor 220 may execute the computer programs described above, as well as may execute programs/utilities 214.
Bus 230 may be a local bus representing one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or any other type of bus structure.
The electronic device 200 may also communicate with one or more external devices 240, such as a keyboard, pointing device, Bluetooth device, etc., and may also communicate with one or more devices capable of interacting with the electronic device 200, and/or with any devices (e.g., routers, modems, etc.) that enable the electronic device 200 to communicate with one or more other computing devices. Such communication may be through input/output (I/O) interface 250. Also, the electronic device 200 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the Internet) via the network adapter 260. The network adapter 260 may communicate with other modules of the electronic device 200 via the bus 230. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 200, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage platforms, to name a few.
The embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium is used for storing a computer program, and when the computer program is executed, the steps of the model training method and the labeling method in the embodiment of the present application are implemented, and a specific implementation manner of the computer program is consistent with the implementation manner and the achieved technical effect described in the embodiments of the model training method and the labeling method, and some contents are not described again.
Fig. 18 shows a program product 300 for implementing the model training method provided in this embodiment, which may employ a portable compact disc read only memory (CD-ROM) and include program codes, and may be executed on a terminal device, such as a personal computer. However, the program product 300 of the present invention is not so limited, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. Program product 300 may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable storage medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable storage medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing. Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
The foregoing description and drawings are only for purposes of illustrating the preferred embodiments of the present application and are not intended to limit the present application, which is, therefore, to the contrary, the intention is to cover all modifications, equivalents, and alternatives falling within the spirit and scope of the present application.

Claims (22)

1. A method of model training, the method comprising:
s1: acquiring a training data set, wherein the training data set comprises a plurality of images and label information of each image;
s2: training a preset deep learning model according to the training data set to obtain a first model;
s3: taking the value of i as 1;
s4: executing the following processing for each image to be labeled which is not put into the training data set in the image group to be labeled: inputting the image to be marked into the ith model to obtain label information of the image to be marked, detecting whether the image to be marked meets an ith preset condition, and if the image to be marked meets the ith preset condition, putting the image to be marked and the label information thereof into the training data set;
s5: training the ith model according to the updated training data set to obtain an (i + 1) th model;
s6: and detecting whether an iteration ending condition is met, if the iteration ending condition is not met, adding the value of i and executing S4, and if the iteration ending condition is met, outputting the (i + 1) th model.
2. The model training method of claim 1, wherein the obtaining a training data set comprises:
detecting whether a given deep learning model exists;
when the given deep learning model is detected to be absent, acquiring a labeled image group and label information thereof, and putting the labeled image group and the label information thereof into the training data set;
when the given deep learning model is detected to exist, all the images to be labeled in the image group to be labeled are input into the given deep learning model to obtain the label information of all the images to be labeled, and partial images and the label information of the partial images are put into the training data set.
3. The model training method of claim 2, wherein the obtaining of the labeled image group and the label information thereof comprises:
receiving an annotation operation, wherein the annotation operation is an operation of setting at least one label for one image to be annotated in the image group to be annotated;
and responding to the labeling operation, taking out the image to be labeled from the image group to be labeled and putting the image to be labeled into the image group to be labeled as a new labeled image, and determining the set label as the label of the new labeled image to obtain the label information of the new labeled image.
4. The model training method of claim 1, wherein the ith preset condition comprises at least one of:
the confidence coefficient of the label with the highest confidence coefficient in all the labels of the image to be labeled is greater than the ith preset confidence coefficient;
will s1To snSorting in descending order, skArranged at front biPercent, recording all images to be labeled, which are not put into the training data set, in the image group to be labeled as a set A, wherein the set A comprises a first image to be labeled to an nth image to be labeled, the image to be labeled is a kth image to be labeled, and recording confidence degrees of labels with highest confidence degrees among all labels of a jth image to be labeled as sjN is the number of all the images to be marked in the set A, j and k are positive integers not greater than n, biIs a positive number less than 100.
5. The model training method of claim 1, wherein the end iteration condition comprises at least one of:
the number of the images to be marked which are not put into the training data set is not more than a first preset number;
the number of images in the training data set is not less than a second preset number;
i is not less than a preset value;
an operation to end the iteration is received.
6. The model training method of claim 1, wherein the (i + 1) th model is used for image classification or image detection.
7. A method of labeling, the method comprising:
acquiring a deep learning model corresponding to a target image;
inputting the target image into a deep learning model corresponding to the target image to obtain at least one label with the highest confidence as a label of the target image;
the obtaining of the deep learning model corresponding to the target image includes:
s1: acquiring a training data set, wherein the training data set comprises a plurality of images and label information of each image;
s2: training a preset deep learning model according to the training data set to obtain a first model;
s3: taking the value of i as 1;
s4: executing the following processing for each image to be labeled which is not put into the training data set in the image group to be labeled: inputting the image to be marked into the ith model to obtain label information of the image to be marked, detecting whether the image to be marked meets an ith preset condition, and if the image to be marked meets the ith preset condition, putting the image to be marked and the label information thereof into the training data set;
s5: training the ith model according to the updated training data set to obtain an (i + 1) th model;
s6: and detecting whether an iteration ending condition is met, if the iteration ending condition is not met, adding the values of i together and executing S4, and if the iteration ending condition is met, determining the (i + 1) th model as a deep learning model corresponding to the target image.
8. The annotation method of claim 7, further comprising:
inputting a current image into an image detection model to obtain a detection tag group corresponding to the current image and a bounding box corresponding to each detection tag in the detection tag group, wherein the number of the detection tags in the detection tag group is not less than 1;
for each detection label in the detection label group, acquiring a target image corresponding to the detection label according to the current image and the boundary frame of the detection label to obtain a label of the target image corresponding to the detection label;
and obtaining the label of the current image according to the labels of the target images corresponding to all the detection labels.
9. The labeling method of claim 8, wherein obtaining the label of the current image according to the labels of the target images corresponding to all the detection labels comprises:
regarding each detection label in the detection label group, taking a label of a target image corresponding to the detection label as a label to be detected;
acquiring association parameters of the label to be detected and all existing labels of the current image aiming at each label to be detected;
when detecting that the correlation parameter is larger than a preset correlation parameter, determining the label to be detected as the label of the current image;
and when the correlation parameter is not larger than the preset correlation parameter, determining that the label to be detected is not used as the label of the current image.
10. The labeling method of claim 9, wherein the obtaining of the correlation parameters between the tag to be detected and all existing tags in the current image comprises:
when the number of all existing labels of the current image is more than 1, acquiring the association degree of the label to be detected and each existing label and the weight corresponding to each association degree;
and acquiring the association parameters according to the association degree of the to-be-detected label and each existing label and the weight corresponding to each association degree.
11. A model training apparatus, the apparatus comprising:
an initial module, configured to obtain a training data set, where the training data set includes a plurality of images and label information of each image;
the first model module is used for training a preset deep learning model according to the training data set to obtain a first model;
the value taking module is used for taking the value of i as 1;
the module to be labeled is used for executing the following processing on each image to be labeled which is not put into the training data set in the image group to be labeled: inputting the image to be marked into the ith model to obtain label information of the image to be marked, detecting whether the image to be marked meets an ith preset condition, and if the image to be marked meets the ith preset condition, putting the image to be marked and the label information thereof into the training data set;
the model iteration module is used for training the ith model according to the updated training data set to obtain an (i + 1) th model;
and the iteration detection module is used for detecting whether an iteration ending condition is met, adding the value of i and calling the module to be labeled if the iteration ending condition is not met, and outputting the (i + 1) th model if the iteration ending condition is met.
12. The model training apparatus of claim 11, wherein the initialization module comprises:
the existing detection unit is used for detecting whether a given deep learning model exists or not;
the first acquisition unit is used for acquiring a labeled image group and label information thereof when detecting that the given deep learning model does not exist, and putting the labeled image group and the label information thereof into the training data set;
and the second acquisition unit is used for inputting all the images to be labeled in the image group to be labeled into the given deep learning model to obtain the label information of all the images to be labeled and putting the partial images and the label information thereof in the images to be labeled into the training data set when the given deep learning model is detected to exist.
13. The model training apparatus as claimed in claim 12, wherein the first obtaining unit comprises:
the operation receiving subunit is configured to receive an annotation operation, where the annotation operation is an operation of setting at least one label for one to-be-annotated image in the to-be-annotated image group;
and the image moving subunit is used for responding to the labeling operation, taking out the image to be labeled from the image group to be labeled and putting the image to be labeled into the labeled image group as a new labeled image, and determining the set label as the label of the new labeled image to obtain the label information of the new labeled image.
14. The model training apparatus of claim 11, wherein the ith preset condition comprises at least one of:
the confidence coefficient of the label with the highest confidence coefficient in all the labels of the image to be labeled is greater than the ith preset confidence coefficient;
will s1To snSorting in descending order, skArranged at front biPercent, recording all images to be labeled, which are not put into the training data set, in the image group to be labeled as a set A, wherein the set A comprises a first image to be labeled to an nth image to be labeled, the image to be labeled is a kth image to be labeled, and recording confidence degrees of labels with highest confidence degrees among all labels of a jth image to be labeled as sjN is the number of all the images to be marked in the set A, j and k are positive integers not greater than n, biIs a positive number less than 100.
15. The model training apparatus of claim 11, wherein the end iteration condition comprises at least one of:
the number of the images to be marked which are not put into the training data set is not more than a first preset number;
the number of images in the training data set is not less than a second preset number;
i is not less than a preset value;
an operation to end the iteration is received.
16. The model training apparatus of claim 11, wherein the (i + 1) th model is used for image classification or image detection.
17. A marking device, the device comprising:
the model training module is used for acquiring a deep learning model corresponding to the target image;
the image input module is used for inputting the target image into a deep learning model corresponding to the target image to obtain at least one label with the highest confidence degree as a label of the target image;
wherein the model training module comprises:
an initial unit, configured to acquire a training data set, where the training data set includes a plurality of images and label information of each image;
the first model unit is used for training a preset deep learning model according to the training data set to obtain a first model;
the value taking unit is used for taking the value of i as 1;
the to-be-labeled unit is used for executing the following processing on each to-be-labeled image which is not put into the training data set in the to-be-labeled image group: inputting the image to be marked into the ith model to obtain label information of the image to be marked, detecting whether the image to be marked meets an ith preset condition, and if the image to be marked meets the ith preset condition, putting the image to be marked and the label information thereof into the training data set;
the model iteration unit is used for training the ith model according to the updated training data set to obtain an (i + 1) th model;
and the iteration detection unit is used for detecting whether an iteration ending condition is met, adding the value of i and calling the unit to be labeled if the iteration ending condition is not met, and determining the (i + 1) th model as the deep learning model corresponding to the target image if the iteration ending condition is met.
18. The marking device of claim 17, further comprising:
the detection tag module is used for inputting a current image into an image detection model to obtain a detection tag group corresponding to the current image and a boundary frame corresponding to each detection tag in the detection tag group, wherein the number of the detection tags in the detection tag group is not less than 1;
a target image tag module, configured to, for each detection tag in the detection tag group, obtain a target image corresponding to the detection tag according to the current image and a bounding box of the detection tag, and obtain a tag of the target image corresponding to the detection tag;
and the current image label module is used for obtaining the label of the current image according to the labels of the target images corresponding to all the detection labels.
19. The annotation device of claim 18, wherein the current image tag module comprises:
the to-be-detected label unit is used for regarding each detection label in the detection label group, and taking a label of a target image corresponding to the detection label as the to-be-detected label;
the correlation unit to be tested is used for acquiring correlation parameters of the label to be tested and all existing labels of the current image aiming at each label to be tested;
the first determining unit is used for determining the label to be detected as the label of the current image when the correlation parameter is detected to be larger than a preset correlation parameter;
and the second determining unit is used for determining that the label to be detected is not used as the label of the current image when the correlation parameter is not larger than the preset correlation parameter.
20. The marking device according to claim 19, wherein the correlation unit under test comprises:
the association degree subunit is configured to, when the number of all existing tags in the current image is greater than 1, obtain association degrees of the tag to be detected and each existing tag and a weight corresponding to each association degree;
and the association parameter subunit is used for acquiring the association parameters according to the association degree of the to-be-detected label and each existing label and the weight corresponding to each association degree.
21. An electronic device, characterized in that the electronic device comprises a memory storing a computer program and a processor implementing the steps of the method according to any of claims 1-6, 7-10 when executing the computer program.
22. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 6, 7 to 10.
CN202110288564.XA 2021-01-13 2021-03-18 Model training method and device, labeling method and device, equipment and storage medium Active CN113240125B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110040279 2021-01-13
CN2021100402796 2021-01-13

Publications (2)

Publication Number Publication Date
CN113240125A true CN113240125A (en) 2021-08-10
CN113240125B CN113240125B (en) 2024-05-28

Family

ID=77130340

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110288564.XA Active CN113240125B (en) 2021-01-13 2021-03-18 Model training method and device, labeling method and device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113240125B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113420849A (en) * 2021-08-25 2021-09-21 深圳市信润富联数字科技有限公司 Model online incremental training method, device and medium based on active learning
CN114155412A (en) * 2022-02-09 2022-03-08 北京阿丘科技有限公司 Deep learning model iteration method, device, equipment and storage medium
CN114712712A (en) * 2022-03-31 2022-07-08 苏州景昱医疗器械有限公司 Imaging identification method of stimulation electrode lead and related device
CN114972916A (en) * 2022-05-26 2022-08-30 广州市影擎电子科技有限公司 Fire-fighting escape action detection model training method and detection method thereof
CN117372377A (en) * 2023-10-23 2024-01-09 保定景欣电气有限公司 Broken line detection method and device for monocrystalline silicon ridge line and electronic equipment
CN117726241A (en) * 2024-02-18 2024-03-19 深圳市建匠工程有限公司 Building structure quality detection method, equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9195679B1 (en) * 2011-08-11 2015-11-24 Ikorongo Technology, LLC Method and system for the contextual display of image tags in a social network
CN107967494A (en) * 2017-12-20 2018-04-27 华东理工大学 A kind of image-region mask method of view-based access control model semantic relation figure
US20180268244A1 (en) * 2017-03-14 2018-09-20 Samsung Electronics Co., Ltd. System and method for deep labeling
CN108960232A (en) * 2018-06-08 2018-12-07 Oppo广东移动通信有限公司 Model training method, device, electronic equipment and computer readable storage 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
CN111291618A (en) * 2020-01-13 2020-06-16 腾讯科技(深圳)有限公司 Labeling method, device, server and storage medium
CN111553164A (en) * 2020-04-29 2020-08-18 平安科技(深圳)有限公司 Training method and device for named entity recognition model and computer equipment
CN112001407A (en) * 2020-03-11 2020-11-27 青岛慧拓智能机器有限公司 Model iterative training method and system based on automatic labeling

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9195679B1 (en) * 2011-08-11 2015-11-24 Ikorongo Technology, LLC Method and system for the contextual display of image tags in a social network
US20180268244A1 (en) * 2017-03-14 2018-09-20 Samsung Electronics Co., Ltd. System and method for deep labeling
CN107967494A (en) * 2017-12-20 2018-04-27 华东理工大学 A kind of image-region mask method of view-based access control model semantic relation figure
CN108960232A (en) * 2018-06-08 2018-12-07 Oppo广东移动通信有限公司 Model training method, device, electronic equipment and computer readable storage 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
CN111291618A (en) * 2020-01-13 2020-06-16 腾讯科技(深圳)有限公司 Labeling method, device, server and storage medium
CN112001407A (en) * 2020-03-11 2020-11-27 青岛慧拓智能机器有限公司 Model iterative training method and system based on automatic labeling
CN111553164A (en) * 2020-04-29 2020-08-18 平安科技(深圳)有限公司 Training method and device for named entity recognition model and computer equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
FENGTIAN等: "Multimedia auto-annotation via lavel correlation mining", 《INTERNATIONAL JOURNAL OF HIGH PERFORMANCE COMPUTING AND NETWORKING》, vol. 13, no. 04, pages 427 - 435 *
刘梦迪: "图像自动标注技术研究进展", 《计算机应用 》, vol. 36, no. 08, pages 2274 - 2281 *

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113420849A (en) * 2021-08-25 2021-09-21 深圳市信润富联数字科技有限公司 Model online incremental training method, device and medium based on active learning
CN113420849B (en) * 2021-08-25 2021-11-30 深圳市信润富联数字科技有限公司 Model online incremental training method, device and medium based on active learning
CN114155412A (en) * 2022-02-09 2022-03-08 北京阿丘科技有限公司 Deep learning model iteration method, device, equipment and storage medium
CN114712712A (en) * 2022-03-31 2022-07-08 苏州景昱医疗器械有限公司 Imaging identification method of stimulation electrode lead and related device
WO2023185410A1 (en) * 2022-03-31 2023-10-05 苏州景昱医疗器械有限公司 Imaging identification method for stimulation electrode wire, and related apparatus
CN114972916A (en) * 2022-05-26 2022-08-30 广州市影擎电子科技有限公司 Fire-fighting escape action detection model training method and detection method thereof
CN117372377A (en) * 2023-10-23 2024-01-09 保定景欣电气有限公司 Broken line detection method and device for monocrystalline silicon ridge line and electronic equipment
CN117372377B (en) * 2023-10-23 2024-05-31 保定景欣电气有限公司 Broken line detection method and device for monocrystalline silicon ridge line and electronic equipment
CN117726241A (en) * 2024-02-18 2024-03-19 深圳市建匠工程有限公司 Building structure quality detection method, equipment and storage medium
CN117726241B (en) * 2024-02-18 2024-05-10 深圳市建匠工程有限公司 Building structure quality detection method, equipment and storage medium

Also Published As

Publication number Publication date
CN113240125B (en) 2024-05-28

Similar Documents

Publication Publication Date Title
CN113240125B (en) Model training method and device, labeling method and device, equipment and storage medium
CN108416003B (en) Picture classification method and device, terminal and storage medium
CN109325213B (en) Method and device for labeling data
CN111832447B (en) Building drawing component identification method, electronic equipment and related product
CN112508078B (en) Image multitasking multi-label recognition method, system, equipment and medium
CN109992484B (en) Network alarm correlation analysis method, device and medium
CN110781818B (en) Video classification method, model training method, device and equipment
CN112613569A (en) Image recognition method, and training method and device of image classification model
CN113159091A (en) Data processing method and device, electronic equipment and storage medium
CN112529020A (en) Animal identification method, system, equipment and storage medium based on neural network
CN112784157A (en) Training method of behavior prediction model, behavior prediction method, device and equipment
CN113239950A (en) Labeling method, labeling device, electronic equipment and storage medium
CN112069498A (en) SQL injection detection model construction method and detection method
CN111291803B (en) Image grading granularity migration method, system, equipment and medium
CN110909768B (en) Method and device for acquiring marked data
CN113870846B (en) Speech recognition method, device and storage medium based on artificial intelligence
CN113204698B (en) News subject term generation method, device, equipment and medium
CN113139051B (en) Text classification model training method, text classification method, device and medium
CN110704650B (en) OTA picture tag identification method, electronic equipment and medium
CN112070093B (en) Method for generating image classification model, image classification method, device and equipment
CN113239883A (en) Method and device for training classification model, electronic equipment and storage medium
CN116306663B (en) Semantic role labeling method, device, equipment and medium
CN112287144A (en) Picture retrieval method, equipment and storage medium
CN113705692A (en) Emotion classification method and device based on artificial intelligence, electronic equipment and medium
CN110633370A (en) Generation method, system, electronic device and medium of OTA hotel label

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