Model generation method, multi-label classification method, device and electronic device

By constructing and repeatedly training a multi-label classification model based on vulnerable scenarios, the problem of low multi-label classification accuracy in computer vision is solved, and the model's recognition ability in scenarios where multiple categories appear simultaneously is improved.

CN114758168BActive Publication Date: 2024-10-29GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210248006.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-14
Publication Date
2024-10-29
Estimated Expiration
2042-03-14

AI Technical Summary

Technical Problem

Existing multi-label classification technology has low accuracy in the field of computer vision. Especially when multiple categories appear in the image at the same time, it is difficult for the model to accurately identify them.

Method used

By obtaining the vulnerable scenes of the image (misrecognized or missed recognition scenes), a vulnerable scene training set and a test set are constructed, and the multi-label classification model is repeatedly trained until the target recognition accuracy is achieved and the model's recognition ability is improved.

Benefits of technology

It significantly improves the recognition accuracy of multi-label classification models, especially in scenarios where multiple categories appear simultaneously, and enhances the model's ability to recognize vulnerable scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114758168B_ABST
    Figure CN114758168B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a model generation method, a multi-label classification method, a device and an electronic device. The method includes: obtaining a disadvantaged scenario of the multi-label classification model to be optimized; obtaining a disadvantaged scenario training set and a disadvantaged scenario test set based on multiple labels corresponding to the disadvantaged scenario; in the current training process, training the multi-label classification model to be optimized based on the first data set to obtain a trained multi-label classification model corresponding to the current training process; evaluating the trained multi-label classification model based on the disadvantaged scenario test set to obtain an evaluation result; if the evaluation result meets the target condition, the trained multi-label classification model is used as the target multi-label classification model, and if the evaluation result does not meet the target condition, the next training process is entered. Through the above method, the recognition accuracy of the target multi-label classification model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and more specifically, to a model generation method, a multi-label classification method, a device, and an electronic device. Background Art

[0002] With the continuous development of artificial intelligence technology, multi-label classification has become an important task in the field of computer vision. However, in related methods, the accuracy of multi-label classification still needs to be improved. Summary of the invention

[0003] In view of the above problems, the present application proposes a model generation method, a multi-label classification method, a device and an electronic device to improve the above problems.

[0004] In a first aspect, the present application provides a model generation method, the method comprising: obtaining a vulnerable scene of a multi-label classification model to be optimized, the vulnerable scene being a scene in which the corresponding image is misidentified or missed; obtaining a vulnerable scene training set and a vulnerable scene test set based on multiple labels corresponding to the vulnerable scene; in the current training process, training the multi-label classification model to be optimized based on a first data set to obtain a trained multi-label classification model corresponding to the current training process, the first data set comprising the vulnerable scene training set and an initial training set, the initial training set being a data set used to generate the multi-label classification model to be optimized; evaluating the trained multi-label classification model based on the vulnerable scene test set to obtain an evaluation result, the evaluation result characterizing the recognition accuracy of the trained multi-label classification model for the multiple vulnerable scenes; if the evaluation result meets the target condition, using the trained multi-label classification model as the target multi-label classification model; if the evaluation result does not meet the target condition, entering the next training process, obtaining new training data corresponding to the vulnerable scene based on the vulnerable scene test set, and using the trained multi-label classification model as the multi-label classification model to be optimized corresponding to the next training process.

[0005] In a second aspect, the present application provides a multi-label classification method, the method comprising: obtaining an image to be classified; inputting the image to be classified into a target multi-label classification model obtained based on the above method to obtain a classification result of the image to be classified.

[0006] In a third aspect, the present application provides a model generation device, which includes: a weak scene acquisition unit, used to acquire a weak scene of a multi-label classification model to be optimized, wherein the weak scene is a scene in which the corresponding image is misidentified or missed; a data set acquisition unit, used to acquire a weak scene training set and a weak scene test set based on multiple labels corresponding to the weak scene; a model generation unit, used to train the multi-label classification model to be optimized based on a first data set during the current training process to obtain a multi-label classification model that has been trained corresponding to the current training process, wherein the first data set includes the weak scene training set and an initial training set, and the initial training set is used for Generate a data set for the multi-label classification model to be optimized; evaluate the trained multi-label classification model based on the vulnerable scenario test set to obtain an evaluation result, wherein the evaluation result represents the recognition accuracy of the trained multi-label classification model for the multiple vulnerable scenarios; if the evaluation result meets the target condition, use the trained multi-label classification model as the target multi-label classification model; if the evaluation result does not meet the target condition, enter the next training process, obtain new training data corresponding to the vulnerable scenario based on the vulnerable scenario test set, and use the trained multi-label classification model as the multi-label classification model to be optimized corresponding to the next training process.

[0007] In a fourth aspect, the present application provides a multi-label classification device, which includes: an image to be classified acquisition unit, used to acquire the image to be classified; and a classification result acquisition unit, used to input the image to be classified into a target multi-label classification model obtained based on the above method to obtain a classification result of the image to be classified.

[0008] In a fifth aspect, the present application provides an electronic device comprising one or more processors and a memory; one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the above-mentioned method.

[0009] In a sixth aspect, the present application provides a computer-readable storage medium, in which a program code is stored, wherein the above method is executed when the program code is run.

[0010] The present application provides a model generation method, a multi-label classification method, an apparatus, an electronic device, and a storage medium. After obtaining a vulnerable scene in which an image corresponding to a multi-label classification model to be optimized has misidentified or missed identification, a vulnerable scene training set and a vulnerable scene test set are obtained based on multiple labels corresponding to the vulnerable scene; in the current training process, the multi-label classification model to be optimized is trained based on the vulnerable scene training set and an initial training set used to generate the multi-label classification model to be optimized to obtain a trained multi-label classification model corresponding to the current training process; the trained multi-label classification model is evaluated based on the vulnerable scene test set to obtain an evaluation result characterizing the recognition accuracy of the trained multi-label classification model for the multiple vulnerable scenes; if the evaluation result meets the target condition, the trained multi-label classification model is used as the target multi-label classification model; if the evaluation result does not meet the target condition, the next training process is entered, new training data corresponding to the vulnerable scene is obtained based on the vulnerable scene test set, and the trained multi-label classification model is used as the multi-label classification model to be optimized corresponding to the next training process. Through the above method, training data for disadvantaged scenarios (disadvantaged scenario training set, new training data corresponding to disadvantaged scenarios) and disadvantaged scenario test set can be obtained based on multiple labels corresponding to the disadvantaged scenarios of the multi-label classification model to be optimized. In each training process, the multi-label classification model to be optimized is trained based on the training data of the disadvantaged scenarios and the initial data set, and the above training process is repeated multiple times to obtain the target multi-label classification model, thereby improving the recognition accuracy of the target multi-label classification model. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0012] Figure 1 A flow chart of a model generation method proposed in an embodiment of the present application is shown;

[0013] Figure 2 A schematic diagram of a vulnerable scene acquisition proposed in this application is shown;

[0014] Figure 3 Shows this application Figure 1 A flowchart of an embodiment of S120;

[0015] Figure 4 A schematic diagram showing the acquisition of the disadvantaged scenario training set proposed in this application is shown;

[0016] Figure 5 Shows this application Figure 1 A flowchart of an embodiment of S140;

[0017] Figure 6 A flow chart of a model generation method proposed in another embodiment of the present application is shown;

[0018] Figure 7 A flowchart of a multi-label classification method proposed in this application is shown;

[0019] Figure 8 A structural block diagram of a model generation device proposed in an embodiment of the present application is shown;

[0020] Fig. 9 A structural block diagram of a multi-label classification device proposed in an embodiment of the present application is shown;

[0021] Fig.10 A structural block diagram of an electronic device proposed in this application is shown;

[0022] Fig.11 It is a storage unit of an embodiment of the present application for storing or carrying program codes for implementing the model generation method and the multi-label classification method according to the embodiment of the present application. DETAILED DESCRIPTION

[0023] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0024] With the continuous development of artificial intelligence technology, multi-label classification has begun to become an important task in the field of computer vision.

[0025] However, the inventors found in related research that the accuracy of multi-label classification needs to be improved. For example, the neural network model can accurately classify "people" and "dogs" respectively, but when "people" and "dogs" appear in the same scene, it may not be able to recognize "people".

[0026] Therefore, the inventors proposed a model generation method, a multi-label classification method, a device and an electronic device in the present application. After obtaining a vulnerable scene in which an image corresponding to the multi-label classification model to be optimized has misidentified or missed identification, a vulnerable scene training set and a vulnerable scene test set are obtained based on multiple labels corresponding to the vulnerable scene. In the current training process, the multi-label classification model to be optimized is trained based on the vulnerable scene training set and the initial training set used to generate the multi-label classification model to be optimized to obtain a trained multi-label classification model corresponding to the current training process. The trained multi-label classification model is evaluated based on the vulnerable scene test set to obtain an evaluation result characterizing the recognition accuracy of the trained multi-label classification model for the multiple vulnerable scenes. If the evaluation result meets the target condition, the trained multi-label classification model is used as the target multi-label classification model. If the evaluation result does not meet the target condition, the next training process is entered, new training data corresponding to the vulnerable scene is obtained based on the vulnerable scene test set, and the trained multi-label classification model is used as the multi-label classification model to be optimized corresponding to the next training process. Through the above method, training data for disadvantaged scenarios (disadvantaged scenario training set, new training data corresponding to disadvantaged scenarios) and disadvantaged scenario test set can be obtained based on multiple labels corresponding to the disadvantaged scenarios of the multi-label classification model to be optimized. In each training process, the multi-label classification model to be optimized is trained based on the training data of the disadvantaged scenarios and the initial data set, and the above training process is repeated multiple times to obtain the target multi-label classification model, thereby improving the recognition accuracy of the target multi-label classification model.

[0027] See also Figure 1 The present application provides a model generation method, which is applied to electronic equipment, and the method comprises:

[0028] S110: Acquire a weak scenario of the multi-label classification model to be optimized, where the weak scenario is a scenario where the corresponding image is misidentified or missed.

[0029] Among them, the multi-label classification model to be optimized can be a multi-label classification model that has been pre-trained and put into practical application (such as: applied to an application with multi-classification recognition function), and the multi-label classification model can be a network model such as EffientNet. In an embodiment of the present application, the scene can be understood as the content represented by the image. The misidentification scene can be a scene in which the category of part of the content in the corresponding image is mistakenly identified as other categories, and the missed recognition scene can be a scene in which the category of part of the content in the corresponding image is not identified. The category corresponding to the content in the image can be represented by a label.

[0030] As a method, in the actual application process, the weak scenarios of the multi-label classification model to be optimized can be obtained based on the user's feedback results. For example, Figure 2 As shown, in the actual application process, the user can Figure 2 The image to be identified in the image is input into the multi-label classification model to be optimized to obtain the recognition result corresponding to the image to be identified. The recognition result can be the label of the content included in the image to be identified. If the label corresponding to the recognition result is: woman, dog, grass, tree, house, sky, it can be shown that the multi-label classification model to be optimized is completely correct in recognition; if the label corresponding to the recognition result is: man, dog, grass, tree, house, sky, then the multi-label classification model to be optimized will mistakenly identify the woman in the image to be identified as a man. If the user finds that there is an error in the recognition of the image content, the error can be reported to the application, and the application can be based on Based on the reported error, the scene corresponding to the image to be identified (a scene including women, dogs, grass, trees, houses, and sky) is determined to be an erroneous identification scene of the multi-label classification model to be optimized; if the labels corresponding to the recognition results are: dog, grass, tree, house, and sky, the multi-label classification model to be optimized does not identify the woman in the image to be identified. If the user finds that there is an error in the recognition of the image content, the error can be reported to the application. The application can then determine, based on the reported error, that the scene corresponding to the image to be identified (a scene including women, dogs, grass, trees, houses, and sky) is a missed identification scene of the multi-label classification model to be optimized.

[0031] S120: Acquire a disadvantaged scenario training set and a disadvantaged scenario test set based on the multiple labels corresponding to the disadvantaged scenarios.

[0032] Among them, as one method, you can first obtain multiple images including multiple labels from the initial test set or the network based on multiple labels, then obtain a disadvantaged scene test set based on the multiple images including multiple labels, and then obtain a disadvantaged scene training set based on the disadvantaged scene test set.

[0033] The initial test set may be an image data set used to evaluate the recognition accuracy of the multi-label classification model to be optimized, and each image content in each image of the initial test set corresponds to a correct label. Optionally, the multiple labels corresponding to the disadvantaged scene in step S110 may be matched with the multiple labels corresponding to each image in the initial test set, and a disadvantaged scene test set may be obtained based on the images in the initial test set that have been successfully matched, and then a disadvantaged scene training set may be obtained based on the disadvantaged scene test set.

[0034] Optionally, crawler technology can be used to obtain images whose corresponding labels are the same as multiple labels corresponding to the vulnerable scenes from the network to obtain a vulnerable scene test set, and then a vulnerable scene training set is obtained based on the vulnerable scene test set.

[0035] Optionally, images with the same labels as the multiple labels corresponding to the disadvantaged scenes can be simultaneously obtained based on the initial test set or the network to obtain a disadvantaged scene test set, and then a disadvantaged scene training set can be obtained based on the disadvantaged scene test set.

[0036] As another method, after obtaining multiple labels corresponding to the disadvantaged scenes through step S110, the area occupied by the image content corresponding to each of the multiple labels in the image with misidentification or omission is obtained, and the label whose area occupied by the corresponding image content meets the target condition is used as the target label, and then the disadvantaged scene training set and the disadvantaged scene test set are obtained based on the target label.

[0037] Among them, the target condition can be to sort the area occupied by the image content corresponding to multiple labels corresponding to a certain image in order from large to small, and the area occupied by the corresponding image content is ranked in the first K (K is a positive integer) labels.

[0038] Optionally, multiple images including multiple target labels can be obtained from the initial test set or the network based on the target label, and then a disadvantaged scene test set is obtained based on the multiple images including the multiple target labels, and then a disadvantaged scene training set is obtained based on the disadvantaged scene test set.

[0039] For example, Figure 2 The multiple labels corresponding to the vulnerable scenes are: woman, dog, grass, tree, house, sky, and the value of K can be set to three. Figure 2 It can be seen that the areas occupied by women, dogs, and grass rank in the top three. Therefore, women, dogs, and grass can be used as target labels, and a disadvantaged scene training set and a disadvantaged scene test set can be obtained based on the target labels.

[0040] In an embodiment of the present application, a target label can be obtained by further screening multiple labels corresponding to the vulnerable scene according to the size of the area occupied by the image content corresponding to each of the multiple labels, so that the main content of the vulnerable scene can be determined based on the target label without limiting the secondary content of the vulnerable scene, thereby increasing the data of the vulnerable scene test set and training set that can be obtained, improving the generalization ability of the target multi-label classification model, and thus improving the recognition accuracy of the target multi-label classification model.

[0041] Optionally, after obtaining the vulnerable scene test set, the vulnerable scene test set can be re-labeled with the scene as the label. For example, when a woman is mistakenly identified as a man in a multi-label scene including a woman, a dog, grass, a tree, a house, and a sky, the label corresponding to the vulnerable scene test set may only include a man, and other content may not be marked; when a woman is not identified in a multi-label scene including a woman, a dog, grass, a tree, a house, and a sky, the label corresponding to the vulnerable scene may only include a woman, and other content may not be marked.

[0042] In an embodiment of the present application, by re-labeling the weak scenario test set with scenes as labels, a weak scenario test set with scenes as units can be formed, so that the trained multi-label classification model can directly identify the scenes, effectively solving the problems of misidentification and missed identification in weak scenarios.

[0043] Optional, such as Figure 3 As shown, a disadvantaged scenario training set is obtained based on a disadvantaged scenario test set, including:

[0044] S121: Acquire multiple unlabeled images and feature codes corresponding to each of the multiple unlabeled images to obtain an image feature library.

[0045] Among them, as a way, Figure 4 As shown, multiple public unlabeled images can be obtained from the Internet through crawler technology, and the obtained multiple unlabeled images are respectively input into a model with feature extraction function for feature extraction, and the 1*d features output by the last convolutional layer of the model are used as the feature coding of each unlabeled image, d can represent the dimension of the feature, so as to obtain the feature coding corresponding to each of the multiple unlabeled images, and store the multiple feature codings to obtain an image feature library.

[0046] Optionally, the model with feature extraction function can be a multi-classification model to be optimized, or other trained models containing feature extraction networks (such as VGG16, ResNet, etc.).

[0047] Optionally, the number of unlabeled images obtained can be as large as possible (for example, 4 million), so that a large amount of image data can be used to train the multi-classification model to be optimized, thereby improving the recognition accuracy of the target multi-classification model.

[0048] Optionally, the contents of the acquired unlabeled images may also be different, so that an image feature library containing a variety of vulnerable scenes can be generated based on multiple unlabeled images containing different contents acquired at one time, and then a large amount of image data can be available for training the optimized multi-classification model for a variety of vulnerable scenes, thereby improving the efficiency of data addition during the training data optimization process.

[0049] S122: Select one or more images from the disadvantaged scene test set, and obtain feature codes corresponding to the one or more images to obtain feature codes corresponding to the disadvantaged scene.

[0050] Among them, as a way, Figure 4 As shown, one or more images can be randomly selected from the disadvantaged scene test set, and the obtained one or more images are respectively input into the model with feature extraction function in step S121 for feature extraction, and the 1*d feature output by the last convolutional layer of the model is used as the feature code of each image, d can represent the dimension of the feature, and the above multiple feature codes are used as the feature codes corresponding to the disadvantaged scenes.

[0051] S123: Matching the feature codes corresponding to the multiple unlabeled images with the feature codes corresponding to the disadvantaged scenes based on a rearrangement algorithm, so as to obtain multiple target images similar to the disadvantaged scenes from the multiple unlabeled images, and automatically annotating the multiple target images, so as to obtain the disadvantaged scene training set based on the annotated multiple target images.

[0052] Among them, as a way, Figure 4 As shown, the feature codes corresponding to the multiple unlabeled images in step S121 can be reordered in descending order according to the similarity (such as Euclidean distance, cosine distance, etc.) with the feature codes corresponding to the disadvantaged scenes through a reordering algorithm, and the unlabeled image feature codes ranked in the top N (N is a positive integer) positions are selected, and then the selected top N unlabeled image feature codes are respectively searched for their neighbors. If the neighbor search result of an unlabeled image feature code includes the feature code corresponding to the disadvantaged scene, the image corresponding to the unlabeled image feature code can be automatically annotated with multiple labels that are the same as the disadvantaged scene, and the annotated image can be manually reviewed. If the review is passed, the image can be used as the target image, and then a disadvantaged scene training set is obtained based on multiple target images that have passed the review.

[0053] In the embodiment of the present application, by matching the feature codes corresponding to the plurality of unlabeled images with the feature codes corresponding to the disadvantaged scene through a rearrangement algorithm, a plurality of images similar to the disadvantaged scene can be obtained, and a disadvantaged scene training set can be obtained based on the plurality of similar images, so as to train the multi-label classification model to be optimized, thereby improving the recognition accuracy of the target multi-label classification model for the disadvantaged scene.

[0054] S130: During the current training process, the multi-label classification model to be optimized is trained based on a first data set to obtain a trained multi-label classification model corresponding to the current training process, wherein the first data set includes the disadvantaged scenario training set and an initial training set, and the initial training set is a data set used to generate the multi-label classification model to be optimized.

[0055] As one method, during the current training process, multiple images in the first data set can be respectively input into the multi-label classification model to be optimized for training to obtain a trained multi-label classification model corresponding to the current training process.

[0056] S140: Evaluate the trained multi-label classification model based on the vulnerable scenario test set to obtain an evaluation result, wherein the evaluation result represents the recognition accuracy of the trained multi-label classification model for the multiple vulnerable scenarios.

[0057] Among them, the vulnerable scenario may include multiple sub-scenarios, and the vulnerable scenario test set may include a test set corresponding to each sub-scenario, as a way, such as Figure 5 As shown, the trained multi-label classification model is evaluated based on the weak scenario test set to obtain an evaluation result, including:

[0058] S141: Inputting the test sets corresponding to the multiple sub-scenarios into the trained multi-label classification model respectively to obtain the multi-label classification results corresponding to the test sets.

[0059] Among them, the test sets corresponding to the multiple sub-scenes can include multiple sub-scene images, and the multiple sub-scene images can be input into the trained multi-label classification model to obtain the multi-label classification results corresponding to the multiple sub-scene images.

[0060] S142: If the sub-scene is a missed recognition scene, the trained multi-label classification model is evaluated based on a first preset algorithm to obtain the evaluation result, and the missed recognition scene is a scene with missed recognition image category information.

[0061] As a method, the evaluation result can be obtained based on the number of images correctly identified in the test set corresponding to the missed recognition scene that contain the missed recognition image category information and the total number of images contained in the test set corresponding to the missed recognition scene. The calculation formula of the first preset algorithm is as follows:

[0062]

[0063] Among them, X may represent the number of images that are correctly identified in the test set corresponding to the missed recognition scene, and Y may represent the total number of images contained in the test set corresponding to the missed recognition scene. Exemplarily, the image category information contained in the test set corresponding to the missed recognition scene may be women, and the total number of images in the test set corresponding to the missed recognition scene may be 50. Through step S142, the multi-label classification results corresponding to each of the 50 images can be obtained. Assuming that it can be determined based on the classification results that 30 images of women are correctly identified by the trained multi-label classification model, the evaluation result at this time is: P = 30 / 50 = 0.6.

[0064] S143: If the sub-scene is a misidentified scene, the trained multi-label classification model is evaluated based on a second preset algorithm to obtain an evaluation result, and the misidentified scene is a scene with misidentified image category information.

[0065] Among them, as a method, a reference evaluation result of the misidentified scene can be obtained based on the number of images that are not correctly identified in the test set corresponding to the misidentified scene and the total number of images contained in the test set corresponding to the misidentified scene. The reference evaluation result can characterize the degree of misidentification of the misidentified scene by the trained multi-label classification model; the evaluation result is obtained based on the preset value and the reference evaluation result. The calculation formula of the second preset algorithm is as follows:

[0066]

[0067] Among them, 1 can represent a preset value, X can represent the number of images that are not correctly identified in the test set corresponding to the misidentified scene, which contain misidentified image category information, and Y can represent the total number of images contained in the test set corresponding to the misidentified scene. Exemplarily, the misidentified image category information contained in the test set corresponding to the misidentified scene may be women. In this case, the label of the misidentified scene can be set to men. The total number of images in the test set corresponding to the missed recognition scene can be 50. Through step S142, the multi-label classification results corresponding to each of the 50 images can be obtained. Assuming that based on the classification results, it can be determined that there are 10 images of women who are identified as men by the trained multi-label classification model, then the evaluation result at this time is: P = 1-10 / 50 = 0.8.

[0068] In the embodiment of the present application, the first preset algorithm and the second preset algorithm can more intuitively and accurately reflect the recognition accuracy of the trained multi-label classification model for vulnerable scenarios.

[0069] S150: If the evaluation result meets the target condition, the trained multi-label classification model is used as the target multi-label classification model. If the evaluation result does not meet the target condition, the next training process is entered, and new training data corresponding to the disadvantaged scenario is obtained based on the disadvantaged scenario test set, and the trained multi-label classification model is used as the multi-label classification model to be optimized corresponding to the next training process.

[0070] Among them, the target condition can be that the evaluation result corresponding to the disadvantaged scene is 90% or above. As a way, if the evaluation result does not meet the target condition, enter the next training process. In the next training process, one or more images different from step S122 can be reselected from the disadvantaged scene test set, and then new training data corresponding to the disadvantaged scene can be re-acquired according to the method in step S123, and the new training data and the first data set in step 130 are used as the first data set corresponding to the next training process, and the trained multi-label classification model is used as the multi-label classification model to be optimized corresponding to the next training process.

[0071] The present embodiment provides a model generation method. After obtaining a vulnerable scene in which an image corresponding to a multi-label classification model to be optimized has misidentified or missed identification, a vulnerable scene training set and a vulnerable scene test set are obtained based on multiple labels corresponding to the vulnerable scene. In the current training process, the multi-label classification model to be optimized is trained based on the vulnerable scene training set and an initial training set used to generate the multi-label classification model to be optimized to obtain a trained multi-label classification model corresponding to the current training process. The trained multi-label classification model is evaluated based on the vulnerable scene test set to obtain an evaluation result characterizing the recognition accuracy of the trained multi-label classification model for the multiple vulnerable scenes. If the evaluation result meets the target condition, the trained multi-label classification model is used as the target multi-label classification model. If the evaluation result does not meet the target condition, the next training process is entered, new training data corresponding to the vulnerable scene is obtained based on the vulnerable scene test set, and the trained multi-label classification model is used as the multi-label classification model to be optimized corresponding to the next training process. Through the above method, training data for disadvantaged scenarios (disadvantaged scenario training set, new training data corresponding to disadvantaged scenarios) and disadvantaged scenario test set can be obtained based on multiple labels corresponding to the disadvantaged scenarios of the multi-label classification model to be optimized. In each training process, the multi-label classification model to be optimized is trained based on the training data of the disadvantaged scenarios and the initial data set, and the above training process is repeated multiple times to obtain the target multi-label classification model, thereby improving the recognition accuracy of the target multi-label classification model.

[0072] See also Figure 6The present application provides a model generation method, which is applied to electronic equipment, and the method comprises:

[0073] S210: Obtaining a weak scenario of the multi-label classification model to be optimized, where the weak scenario is a scenario where the corresponding image is misidentified or missed.

[0074] S220: Acquire multiple images including the multiple labels from an initial test set or a network based on the multiple labels, and obtain the disadvantaged scenario test set based on the multiple images including the multiple labels.

[0075] The vulnerable scenario may include multiple sub-scenarios, and the vulnerable scenario test set may include a test set corresponding to each sub-scenario.

[0076] S230: Evaluate the multi-label classification model to be optimized based on the test sets corresponding to each of the multiple sub-scenarios to obtain an evaluation result of the multi-label classification model to be optimized, wherein the evaluation result represents the recognition accuracy of the multi-label classification model to be optimized for each of the multiple sub-scenarios.

[0077] As one approach, the multi-label classification model to be optimized may be evaluated according to the method in step S140 based on the test sets corresponding to the multiple sub-scenarios to obtain an evaluation result of the multi-label classification model to be optimized.

[0078] S240: Compare the recognition accuracy corresponding to each of the plurality of sub-scenes with a preset target to obtain a target sub-scene, where the target sub-scene is a sub-scene whose recognition accuracy is lower than the preset target.

[0079] As one approach, the preset target may be that the evaluation result is less than 50%.

[0080] S250: Acquire the disadvantaged scenario training set based on the test set corresponding to the target sub-scenario.

[0081] As one approach, after obtaining the target sub-scenario, a disadvantaged scenario training set may be obtained according to the method in step S120 based on the test set corresponding to the target sub-scenario.

[0082] S260: During the current training process, the multi-label classification model to be optimized is trained based on a first data set to obtain a trained multi-label classification model corresponding to the current training process, wherein the first data set includes the disadvantaged scenario training set and an initial training set, and the initial training set is a data set used to generate the multi-label classification model to be optimized.

[0083] S270: Evaluate the trained multi-label classification model based on the vulnerable scenario test set to obtain an evaluation result, wherein the evaluation result represents the recognition accuracy of the trained multi-label classification model for the multiple vulnerable scenarios.

[0084] S280: If the evaluation result meets the target condition, the trained multi-label classification model is used as the target multi-label classification model. If the evaluation result does not meet the target condition, the next training process is entered, and new training data corresponding to the disadvantaged scenario is obtained based on the disadvantaged scenario test set, and the trained multi-label classification model is used as the multi-label classification model to be optimized corresponding to the next training process.

[0085] A model generation method provided in this embodiment can obtain training data (weak scene training set, new training data corresponding to the weak scene) and weak scene test set for the weak scene based on multiple labels corresponding to the weak scene of the multi-label classification model to be optimized through the above method, and in each training process, the multi-label classification model to be optimized is trained based on the training data of the weak scene and the initial data set, and the above training process is repeated multiple times to obtain the target multi-label classification model, thereby improving the recognition accuracy of the target multi-label classification model. In addition, in this embodiment, after obtaining the test set corresponding to multiple sub-scenarios, the target sub-scenario of the multi-label classification model to be optimized can be determined based on the evaluation results that characterize the recognition accuracy of the multi-label classification model to be optimized for each of the multiple sub-scenarios, and the weak scene training set is obtained based on the test set corresponding to the target sub-scenario, so that the multi-label classification model to be optimized can be trained based on the weak scene training set corresponding to the target sub-scenario, thereby improving the recognition accuracy of the target multi-label classification model.

[0086] See also Figure 7 The present application provides a multi-label classification method, which is applied to electronic devices, and the method includes:

[0087] S310: Obtain an image to be classified.

[0088] As one method, a user may obtain an image to be classified through an image acquisition device (such as a camera), and upload the image to be classified to an application including a target multi-label classification model, thereby obtaining the image to be classified.

[0089] S320: Inputting the image to be classified into the target multi-label classification model obtained based on the above method to obtain a classification result of the image to be classified.

[0090] As one method, the classified image can be input into the target multi-label classification model obtained based on the above method, and the classification result of the image to be classified can be obtained based on the output result of the target multi-label classification model.

[0091] A multi-label classification method provided in this embodiment can obtain training data for disadvantaged scenarios (disadvantaged scenario training set, new training data corresponding to disadvantaged scenarios) and disadvantaged scenario test set based on multiple labels corresponding to the disadvantaged scenarios of the multi-label classification model to be optimized in the above manner, and in each training process, the multi-label classification model to be optimized is trained based on the training data of the disadvantaged scenarios and the initial data set, and the above training process is repeated multiple times to obtain the target multi-label classification model, thereby improving the recognition accuracy of the target multi-label classification model.

[0092] See also Figure 8 The present application provides a model generation device 600, which runs on an electronic device. The device 600 includes:

[0093] The weak scene acquisition unit 610 is used to acquire weak scenes of the multi-label classification model to be optimized, wherein the weak scenes are scenes where the corresponding images are misidentified or missed.

[0094] The data set acquisition unit 620 is used to acquire a disadvantaged scenario training set and a disadvantaged scenario test set based on multiple labels corresponding to the disadvantaged scenarios.

[0095] The model generation unit 630 is used to train the multi-label classification model to be optimized based on the first data set during the current training process to obtain a trained multi-label classification model corresponding to the current training process, wherein the first data set includes the disadvantaged scenario training set and the initial training set, and the initial training set is a data set used to generate the multi-label classification model to be optimized; the trained multi-label classification model is evaluated based on the disadvantaged scenario test set to obtain an evaluation result, wherein the evaluation result represents the recognition accuracy of the trained multi-label classification model for the multiple disadvantaged scenarios; if the evaluation result meets the target condition, the trained multi-label classification model is used as the target multi-label classification model; if the evaluation result does not meet the target condition, the next training process is entered, new training data corresponding to the disadvantaged scenario is obtained based on the disadvantaged scenario test set, and the trained multi-label classification model is used as the multi-label classification model to be optimized corresponding to the next training process.

[0096] See also Fig. 9 The present application provides a multi-label classification device 800, which runs on an electronic device. The device 800 includes:

[0097] The image to be classified acquiring unit 810 is used to acquire the image to be classified.

[0098] The classification result acquisition unit 820 is used to input the image to be classified into the target multi-label classification model obtained based on the above method to obtain the classification result of the image to be classified.

[0099] The following will be combined Fig.10 An electronic device provided by the present application is described.

[0100] See also Fig.10 Based on the above model generation method, multi-label classification method, and apparatus, the embodiment of the present application also provides another electronic device 100 that can execute the above model generation method and multi-label classification method. The electronic device 100 includes one or more (only one is shown in the figure) processors 102 and a memory 104 coupled to each other. The memory 104 stores a program that can execute the content of the above embodiments, and the processor 102 can execute the program stored in the memory 104.

[0101] Among them, the processor 102 may include one or more processing cores. The processor 102 uses various interfaces and lines to connect various parts of the entire electronic device 100, and executes various functions and processes data of the electronic device 100 by running or executing instructions, programs, code sets or instruction sets stored in the memory 104, and calling data stored in the memory 104. Optionally, the processor 102 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 102 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 102, but may be implemented separately through a communication chip.

[0102] The memory 104 may include a random access memory (RAM) or a read-only memory (ROM). The memory 104 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 104 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The data storage area may also store data (such as a phone book, audio and video data, chat record data) created by the terminal 100 during use.

[0103] Please refer to Fig.11 , which shows a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable storage medium 1000 stores program codes, which can be called by a processor to execute the method described in the above method embodiment.

[0104] The computer readable storage medium 1000 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable storage medium 1000 includes a non-transitory computer-readable storage medium. The computer readable storage medium 1000 has storage space for program code 1010 that performs any method step in the above method. These program codes can be read from or written to one or more computer program products. The program code 1010 can be compressed, for example, in an appropriate form.

[0105] In summary, the present application provides a model generation method, a multi-label classification method, a device, and an electronic device. After obtaining a vulnerable scene in which an image corresponding to a multi-label classification model to be optimized has misidentified or missed identification, a vulnerable scene training set and a vulnerable scene test set are obtained based on multiple labels corresponding to the vulnerable scene; in the current training process, the multi-label classification model to be optimized is trained based on the vulnerable scene training set and the initial training set used to generate the multi-label classification model to be optimized to obtain a trained multi-label classification model corresponding to the current training process, and the trained multi-label classification model is evaluated based on the vulnerable scene test set to obtain an evaluation result characterizing the recognition accuracy of the trained multi-label classification model for the multiple vulnerable scenes; if the evaluation result meets the target condition, the trained multi-label classification model is used as the target multi-label classification model; if the evaluation result does not meet the target condition, the next training process is entered, new training data corresponding to the vulnerable scene is obtained based on the vulnerable scene test set, and the trained multi-label classification model is used as the multi-label classification model to be optimized corresponding to the next training process. Through the above method, training data for disadvantaged scenarios (disadvantaged scenario training set, new training data corresponding to disadvantaged scenarios) and disadvantaged scenario test set can be obtained based on multiple labels corresponding to the disadvantaged scenarios of the multi-label classification model to be optimized. In each training process, the multi-label classification model to be optimized is trained based on the training data of the disadvantaged scenarios and the initial data set, and the above training process is repeated multiple times to obtain the target multi-label classification model, thereby improving the recognition accuracy of the target multi-label classification model.

[0106] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A model generation method, characterized in that: Applied to electronic equipment, the method comprises: Obtaining a weak scenario of the multi-label classification model to be optimized, wherein the weak scenario is a scenario in which the corresponding image is misidentified or missed; Based on the multiple labels corresponding to the vulnerable scenario, a vulnerable scenario training set and a vulnerable scenario test set are obtained, wherein the vulnerable scenario includes multiple sub-scenarios, and the vulnerable scenario test set includes a test set corresponding to each sub-scenario; In the current training process, the multi-label classification model to be optimized is trained based on the first data set to obtain a trained multi-label classification model corresponding to the current training process, wherein the first data set includes the disadvantaged scenario training set and the initial training set, and the initial training set is a data set used to generate the multi-label classification model to be optimized; The trained multi-label classification model is evaluated based on the vulnerable scenario test set to obtain an evaluation result, wherein the evaluation result represents the recognition accuracy of the trained multi-label classification model for multiple vulnerable scenarios; The evaluating the trained multi-label classification model based on the weak scenario test set to obtain an evaluation result includes: Inputting the test sets corresponding to the multiple sub-scenarios into the trained multi-label classification model respectively to obtain the multi-label classification results corresponding to the test sets; If the sub-scene is a missed recognition scene, the trained multi-label classification model is evaluated based on a first preset algorithm to obtain the evaluation result, and the missed recognition scene is a scene with missed recognition image category information; If the sub-scenario is a misidentified scene, the trained multi-label classification model is evaluated based on a second preset algorithm to obtain an evaluation result, wherein the misidentified scene is a scene with misidentified image category information; If the evaluation result meets the target condition, the trained multi-label classification model is used as the target multi-label classification model. If the evaluation result does not meet the target condition, the next training process is entered, and new training data corresponding to the disadvantaged scenario is obtained based on the disadvantaged scenario test set, and the trained multi-label classification model is used as the multi-label classification model to be optimized corresponding to the next training process.

2. The method according to claim 1, characterized in that The obtaining of a disadvantaged scenario training set and a disadvantaged scenario test set based on a plurality of labels corresponding to the disadvantaged scenarios includes: Acquire multiple images including the multiple labels from an initial test set or a network based on the multiple labels, and obtain the disadvantaged scene test set based on the multiple images including the multiple labels; The disadvantaged scenario training set is obtained based on the disadvantaged scenario test set.

3. The method according to claim 2, characterized in that The obtaining the disadvantaged scenario training set based on the disadvantaged scenario test set includes: Acquire multiple unlabeled images and feature codes corresponding to each of the multiple unlabeled images to obtain an image feature library; Selecting one or more images from the disadvantaged scene test set, and obtaining feature codes corresponding to each of the one or more images to obtain feature codes corresponding to the disadvantaged scene; Based on the rearrangement algorithm, the feature codes corresponding to the multiple unlabeled images are matched with the feature codes corresponding to the disadvantaged scenes to obtain multiple target images similar to the disadvantaged scenes from the multiple unlabeled images, and the multiple target images are automatically annotated to obtain the disadvantaged scene training set based on the annotated multiple target images.

4. The method according to claim 1, characterized in that: The obtaining of a disadvantaged scenario training set and a disadvantaged scenario test set based on a plurality of labels corresponding to the disadvantaged scenarios includes: Obtaining the area occupied by the image content corresponding to each of the multiple labels in the misidentified or missed image, and taking the label whose area occupied by the corresponding image content meets the target condition as the target label; The disadvantaged scenario training set and the disadvantaged scenario test set are obtained based on the target label.

5. The method according to claim 1, characterized in that The step of evaluating the trained multi-label classification model based on the first preset algorithm to obtain an evaluation result includes: The evaluation result is obtained based on the number of images that are correctly identified in the test set corresponding to the missed recognition scene and contain the missed recognition image category information and the total number of images contained in the test set corresponding to the missed recognition scene; The evaluating the trained multi-label classification model based on the second preset algorithm to obtain an evaluation result includes: Based on the number of images that are not correctly identified and the total number of images included in the test set corresponding to the misidentified scene and that contain the misidentified image category information, a reference evaluation result of the misidentified scene is obtained, wherein the reference evaluation result represents the degree of misidentification of the misidentified scene by the trained multi-label classification model; Based on the preset value and the reference evaluation result, the evaluation result is obtained.

6. The method according to claim 1, characterized in that The disadvantaged scenario includes a plurality of sub-scenarios, the disadvantaged scenario test set includes a test set corresponding to each sub-scenario, and the method of obtaining a disadvantaged scenario training set and a disadvantaged scenario test set based on a plurality of labels corresponding to the disadvantaged scenario includes: Acquire multiple images including the multiple labels from an initial test set or a network based on the multiple labels, and obtain the disadvantaged scene test set based on the multiple images including the multiple labels; The multi-label classification model to be optimized is evaluated based on the test sets corresponding to the multiple sub-scenarios to obtain an evaluation result of the multi-label classification model to be optimized, wherein the evaluation result represents the recognition accuracy of the multi-label classification model to be optimized for each of the multiple sub-scenarios; Comparing the recognition accuracy corresponding to each of the plurality of sub-scenes with a preset target respectively, to obtain a target sub-scene, wherein the target sub-scene is a sub-scene whose recognition accuracy is lower than the preset target; The disadvantaged scenario training set is obtained based on the test set corresponding to the target sub-scenario.

7. A multi-label classification method, characterized in that: Applied to electronic equipment, the method comprises: Get the image to be classified; The image to be classified is input into a target multi-label classification model obtained based on the method of any one of claims 1 to 6 to obtain a classification result of the image to be classified.

8. A model generation device, characterized in that: Running on an electronic device, the device comprises: A weak scene acquisition unit, used to acquire weak scenes of the multi-label classification model to be optimized, wherein the weak scenes are scenes where the corresponding images are misidentified or missed; A data set acquisition unit, used to acquire a disadvantaged scenario training set and a disadvantaged scenario test set based on a plurality of labels corresponding to the disadvantaged scenario, wherein the disadvantaged scenario includes a plurality of sub-scenarios, and the disadvantaged scenario test set includes a test set corresponding to each sub-scenario; A model generation unit is used to train the multi-label classification model to be optimized based on a first data set during the current training process to obtain a trained multi-label classification model corresponding to the current training process, wherein the first data set includes the disadvantaged scenario training set and an initial training set, and the initial training set is a data set used to generate the multi-label classification model to be optimized; based on the disadvantaged scenario test set, the trained multi-label classification model is evaluated to obtain an evaluation result, and the evaluation result represents the recognition accuracy of the trained multi-label classification model for a variety of disadvantaged scenarios; the evaluation of the trained multi-label classification model based on the disadvantaged scenario test set to obtain an evaluation result comprises: inputting the test sets corresponding to the multiple sub-scenarios into the trained multi-label classification model respectively to obtain the test sets corresponding to the test sets. multi-label classification result; if the sub-scene is a missed recognition scene, the trained multi-label classification model is evaluated based on the first preset algorithm to obtain the evaluation result, and the missed recognition scene is a scene with missed recognition image category information; if the sub-scene is a misrecognition scene, the trained multi-label classification model is evaluated based on the second preset algorithm to obtain an evaluation result, and the misrecognition scene is a scene with misrecognition image category information; if the evaluation result meets the target condition, the trained multi-label classification model is used as the target multi-label classification model; if the evaluation result does not meet the target condition, the next training process is entered, new training data corresponding to the disadvantaged scene is obtained based on the disadvantaged scene test set, and the trained multi-label classification model is used as the multi-label classification model to be optimized corresponding to the next training process.

9. A multi-label classification device, characterized in that: Running on an electronic device, the device comprises: An image acquisition unit to be classified, used for acquiring an image to be classified; A classification result acquisition unit is used to input the image to be classified into a target multi-label classification model obtained based on any one of the methods of claims 1-6 to obtain a classification result of the image to be classified.

10. An electronic device, characterized in that: including one or more processors and memory; One or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the method according to any one of claims 1 to 7.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program code, wherein when the program code is run, the method according to any one of claims 1 to 7 is executed.

Citation Information

Patent Citations

  • Image multi-label classification method, image multi-label classification device, equipment and medium

    CN111126514A

  • Multi-label scene image classification method and device based on transfer learning

    CN111275107A