A training method, device, equipment and medium for an image classification network model

By using unlabeled sample images in the image classification network model for self-supervised training of the feature extraction sub-model, and combining labeled sample data for training of the classification sub-model, the problems of high training cost and long iteration cycle in the existing technology are solved. , realizing high-performance image classification network model training.

CN113762508BActive Publication Date: 2024-10-22JINGDONG KUNPENG (JIANGSU) TECH CO LTD
View PDF 11 Cites 0 Cited by

Patent Information

Application Number
CN202111038731.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-06
Publication Date
2024-10-22
Estimated Expiration
2041-09-06

AI Technical Summary

Technical Problem

In the training process of image classification network models in the existing technology, the model performance is limited by the quantity of sample data and the quality of annotation, resulting in high data collection and annotation costs, long cycles, and difficulty in iteration.

Method used

Through the sample image comparison method, the feature extraction sub-model is trained based on the unlabeled sample image, and the similarity between the positive sample image and the negative sample image is used to meet the preset convergence conditions to obtain the target feature extraction sub-model, and then the labeled sample image is input To carry out classification sub-model training, the loss function is used to meet the preset convergence conditions to complete the training of the image classification network model.

Benefits of technology

It is possible to train a high-performance image classification network model with a small amount of labeled sample data, reducing the labeling cost and improving the model's background discrimination ability and classification accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113762508B_ABST
    Figure CN113762508B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention discloses a training method, device, equipment and medium for an image classification network model. The image classification network model includes: a feature extraction submodel and a classification submodel corresponding to at least one category. The training method includes: training the feature extraction submodel based on unlabeled sample images by sample image comparison, the unlabeled sample images including a first sample image pair consisting of a positive sample image and a negative sample image; inputting the labeled sample images into the trained target feature extraction submodel to obtain a target feature map, and inputting the target feature map and the label category corresponding to the labeled sample image into the classification submodel to obtain a predicted category of the labeled sample image; when the loss function determined by the label category and the predicted category meets a preset convergence condition, the classification submodel training is completed, and the training of the image classification network model is completed, thereby reducing the labeling cost and ensuring the high performance of the model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to computer technology, and in particular to a training method, device, equipment and medium for an image classification network model. Background Art

[0002] With the rapid development of deep learning technology, deep learning-based image classification network models can be used to identify and classify objects in images.

[0003] Currently, before using an image classification network model, the image classification network model is usually trained in a supervised manner so that the trained image classification network model can accurately perform image processing operations.

[0004] However, in the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:

[0005] In the supervised training process of image classification network models, the performance of the model is limited by the amount of sample data collected and the quality of annotation. In order to obtain a high-performance image classification network model, it is often necessary to use a large amount of labeled data to train the model, which makes the labor cost of data collection and annotation very high, and the long cycle is not conducive to model iteration. Summary of the invention

[0006] The embodiments of the present invention provide a method, apparatus, device and medium for training an image classification network model to reduce the labeling cost and ensure the high performance of the image classification network model.

[0007] In a first aspect, an embodiment of the present invention provides a method for training an image classification network model, wherein the image classification network model includes: a feature extraction sub-model and a classification sub-model corresponding to at least one category, and the training method includes:

[0008] The feature extraction sub-model is trained based on unlabeled sample images by a sample image comparison method, wherein the unlabeled sample images include a first sample image pair consisting of a positive sample image and a negative sample image;

[0009] When the image similarity between the positive sample image and the negative sample image in the first sample image pair meets a preset convergence condition, the feature extraction sub-model training is completed to obtain a target feature extraction sub-model;

[0010] Inputting the labeled sample image into the target feature extraction sub-model to obtain a target feature map, and inputting the target feature map and the label category corresponding to the labeled sample image into the classification sub-model to obtain a predicted category of the labeled sample image;

[0011] When the loss function determined by the label category and the predicted category meets the preset convergence condition, the classification sub-model training is completed, and the training of the image classification network model is completed.

[0012] In a second aspect, an embodiment of the present invention further provides a training device for an image classification network model, wherein the image classification network model comprises: a feature extraction sub-model and a classification sub-model corresponding to at least one category, and the training device comprises:

[0013] A feature extraction sub-model training module is used to train the feature extraction sub-model based on unlabeled sample images by sample image comparison, wherein the unlabeled sample images include a first sample image pair consisting of a positive sample image and a negative sample image; when the image similarity between the positive sample image and the negative sample image in the first sample image pair meets a preset convergence condition, the feature extraction sub-model training is completed to obtain a target feature extraction sub-model;

[0014] The classification sub-model training module is used to input the labeled sample image into the target feature extraction sub-model to obtain the target feature map, and input the label category corresponding to the target feature map and the labeled sample image into the classification sub-model to obtain the predicted category of the labeled sample image; when the loss function determined by the label category and the predicted category meets the preset convergence condition, the classification sub-model training is completed and the training of the image classification network model is completed.

[0015] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:

[0016] one or more processors;

[0017] A memory for storing one or more programs;

[0018] When the one or more programs are executed by the one or more processors, the one or more processors implement the training method of the image classification network model provided by any embodiment of the present invention.

[0019] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a training method for an image classification network model as provided in any embodiment of the present invention.

[0020] The embodiments of the above invention have the following advantages or beneficial effects:

[0021] Through the sample image comparison method, the feature extraction sub-model in the image classification network model is trained based on the unlabeled sample image, that is, the first sample image pair composed of the positive sample image and the negative sample image. When the image similarity between the positive sample image and the negative sample image in the first sample image pair meets the preset convergence condition, the feature extraction sub-model training is completed and the target feature extraction sub-model is obtained. Therefore, the feature extraction sub-model can be trained in a self-supervised manner to complete the learning of a large amount of unlabeled sample data, so that the feature extraction sub-model can accurately extract feature information. After the feature extraction sub-model training is completed and the target feature extraction sub-model is obtained, the labeled sample image is input into the target feature extraction sub-model. Sub-model, obtain the target feature map, and input the label category corresponding to the target feature map and the labeled sample image into the classification sub-model to obtain the predicted category of the labeled sample image. When the loss function determined by the label category and the predicted category meets the preset convergence condition, the training of the classification sub-model is completed, and the training of the image classification network model is completed. Therefore, the classification sub-model in the image classification network model can be trained based on a small number of labeled sample images, so that the classification sub-model can accurately classify based on the feature information extracted by the trained target feature extraction sub-model, thereby ensuring the high performance of the image classification network model, and only a small amount of sample data needs to be labeled, which greatly reduces the labeling cost. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 is a flowchart of a training method for an image classification network model provided in Embodiment 1 of the present invention;

[0023] Figure 2 This is an example of an image classification network model involved in the first embodiment of the present invention;

[0024] Figure 3 This is an example of a feature extraction sub-model training process involved in the first embodiment of the present invention;

[0025] Figure 4 is a flow chart of a training method for an image classification network model provided in Embodiment 2 of the present invention;

[0026] Figure 5 This is an example of an image classification network model involved in the second embodiment of the present invention;

[0027] Figure 6 It is a structural schematic diagram of a training device for an image classification network model provided in Embodiment 3 of the present invention;

[0028] Figure 7 It is a structural schematic diagram of an electronic device provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION

[0029] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0030] Embodiment 1

[0031] Figure 1 This is a flowchart of a training method for an image classification network model provided in Embodiment 1 of the present invention. This embodiment can be applied to the case of training an image classification network model, especially to the case of training an image classification network model for identifying objects in an autonomous driving scene. The method can be executed by a training device for an image classification network model, which can be implemented by software and / or hardware and integrated into an electronic device.

[0032] Figure 2 An example of an image classification network model is given. Figure 2 , the image classification network model in this embodiment may include: a feature extraction sub-model and a classification sub-model corresponding to at least one category. Among them, the feature extraction sub-model can be used to: extract features from the input image, obtain a feature map corresponding to the input image, and input the feature map into the classification sub-model. The classification sub-model can be used to: classify based on the input feature map, predict the category to which the object in the input image belongs, and output the category. By using the image classification network model, the category to which the object in the image belongs can be identified.

[0033] like Figure 1 As shown, the training method of the image classification network model specifically includes the following steps:

[0034] S110 . Training a feature extraction sub-model based on unlabeled sample images by comparing sample images, where the unlabeled sample images include a first sample image pair consisting of a positive sample image and a negative sample image.

[0035] Among them, the feature extraction submodel may refer to a convolutional network structure used to extract image feature information in an image classification network model. For example, the feature extraction submodel may be, but is not limited to: a VGG (Visual Geometry Group) convolutional network model, a ResNet convolutional network model. An unlabeled sample image may refer to a sample image that is directly collected without the need for image annotation. A positive sample image may refer to a scene image in an application scenario. A negative sample image may refer to an image that is completely unrelated to the application scenario. For example, a scene image in an autonomous driving scenario may be used as a positive sample image. Images that are completely unrelated to autonomous driving scenarios, such as indoor scene images and non-road scene images, may be used as negative sample images.

[0036] Specifically, a positive sample image and a negative sample image in the unlabeled sample image can be combined into a first sample image pair and input into the feature extraction sub-model. By comparing the sample images, the feature extraction sub-model can be self-supervised trained, so that the feature extraction sub-model can extract universal feature information from a large number of unlabeled sample images and complete the learning of a large amount of unlabeled data. The self-supervised training method does not require data labeling, so that the feature extraction sub-model can be trained using a large number of unlabeled sample images that are tens or even hundreds of times more than the labeled sample images, so that the trained feature extraction sub-model can have a higher background discrimination ability, which helps the classification sub-model to distinguish between positive and negative samples.

[0037] S120. When the image similarity between the positive sample image and the negative sample image in the first sample image pair meets a preset convergence condition, the feature extraction sub-model training is completed to obtain a target feature extraction sub-model.

[0038] Specifically, the image similarity between the positive sample image and the negative sample image in the first sample image pair can be determined based on the feature map output by the feature extraction sub-model, and the image similarity between the positive sample image and the negative sample image can be 0 as the training target to train the feature extraction sub-model, so that the trained target feature extraction sub-model can have a higher background discrimination ability. For example, the image similarity between the positive sample image and the negative sample image in the first sample image pair can be back-propagated to the feature extraction sub-model, and the weights in the feature extraction sub-model can be adjusted until the training ends when the preset convergence condition is reached, such as when the image similarity is less than the preset similarity or the variation range tends to be stable, or when the number of iterative training times is equal to the preset number, it indicates that the feature extraction sub-model training is completed, and at this time the trained target feature extraction sub-model has a higher background discrimination ability, which helps the classification sub-model to distinguish between positive and negative sample images.

[0039] S130, input the labeled sample image into the target feature extraction sub-model to obtain a target feature map, and input the target feature map and the label category corresponding to the labeled sample image into the classification sub-model to obtain the predicted category of the labeled sample image.

[0040] Among them, the classification sub-model may refer to a network structure in an image classification network model that performs image classification based on image feature information to determine the category to which the items in the image belong. Labeled sample images may refer to sample images corresponding to the categories that need to be identified in the application scenario, and data annotation, i.e. labeling, is required. For example, in an autonomous driving scenario, if objects such as vehicles, pedestrians, and traffic signs need to be identified, images containing vehicles, images containing pedestrians, and images containing traffic signs can be used as sample images and labeled with categories.

[0041] Specifically, the trained target feature extraction sub-model can accurately extract image feature information. At this time, the trained target feature extraction sub-model can be used to supervise the classification sub-model based on a small number of labeled sample images, so that the classification sub-model can accurately identify the category to which the object in the image belongs, thereby ensuring the high performance of the image classification network model. For example, the training process of the classification sub-model may include: inputting the labeled sample image into the target feature extraction sub-model to obtain the output target feature map, and then inputting the target feature map and the label category corresponding to the labeled sample image into the classification sub-model to obtain the predicted category output by the classification sub-model, that is, the predicted category to which the sample object in the labeled sample image belongs.

[0042] S140. When the loss function determined by the label category and the predicted category meets the preset convergence condition, the classification sub-model training is completed, and the training of the image classification network model is completed.

[0043] Specifically, based on the loss function, the training error can be determined according to the output prediction category and the label category corresponding to the labeled sample image, and the training error can be back-propagated to the classification sub-model, and the various network parameters in the classification sub-model can be adjusted until the training ends when the preset convergence conditions are reached. For example, when the training error is less than the preset error or the error variation range tends to be stable, or when the number of iterative training times is equal to the preset number, it indicates that the classification sub-model training is completed, so that the trained classification sub-model can be obtained, and the training of the image classification network model is completed at this time.

[0044] It should be noted that when training the classification sub-model, all network parameters in the target feature extraction sub-model are locked to ensure that the network parameters in the target feature extraction sub-model will not be updated during the training of the classification sub-model.

[0045] It should be noted that, as the core of the image classification network model, the training effect of the feature extraction sub-model directly affects the model performance of the image classification network model. Therefore, this embodiment obtains a high-performance feature extraction sub-model by using a large number of unlabeled sample images to perform self-supervised training on the feature extraction sub-model. After the training of the feature extraction sub-model is completed, only a small number of labeled sample images need to be used to perform supervised training on the classification sub-model to ensure the high performance of the image classification network model. In addition, only a small amount of sample data needs to be labeled, which greatly reduces the labeling cost.

[0046] The technical solution of this embodiment is to train the feature extraction sub-model in the image classification network model based on the unlabeled sample images, that is, the first sample image pair composed of the positive sample image and the negative sample image, by a sample image comparison method. When the image similarity between the positive sample image and the negative sample image in the first sample image pair meets the preset convergence condition, the training of the feature extraction sub-model is completed and the target feature extraction sub-model is obtained. Therefore, the feature extraction sub-model can be trained in a self-supervised manner to complete the learning of a large amount of unlabeled sample data, so that the feature extraction sub-model can accurately extract feature information. After the training of the feature extraction sub-model is completed and the target feature extraction sub-model is obtained, the labeled sample image is input into the target feature extraction sub-model. The target feature extraction submodel is trained to obtain the target feature map, and the label category corresponding to the target feature map and the labeled sample image is input into the classification submodel to obtain the predicted category of the labeled sample image. When the loss function determined by the label category and the predicted category meets the preset convergence condition, the training of the classification submodel is completed, and the training of the image classification network model is completed. Therefore, the classification submodel in the image classification network model can be trained based on a small number of labeled sample images, so that the classification submodel can accurately classify based on the feature information extracted by the trained target feature extraction submodel, thereby ensuring the high performance of the image classification network model, and only a small amount of sample data needs to be labeled, which greatly reduces the labeling cost.

[0047] On the basis of the above technical solution, the unlabeled sample image may further include: a second sample image pair consisting of a positive sample image and an enhanced sample image corresponding to the positive sample image.

[0048] Among them, the enhanced sample image corresponding to the positive sample image may refer to a sample image obtained by randomly transforming the positive sample image. For example, the enhanced sample image is obtained by rotating, translating, scaling or denoising the positive sample image. Exemplarily, in an autonomous driving scene, the positive sample image may refer to an object image related to the autonomous driving scene; the enhanced sample image corresponding to the positive sample image may be a sample image obtained by randomly transforming the positive sample; and the negative sample image may be an object image that is completely unrelated to the autonomous driving scene. For example, a scene image in an autonomous driving scene may be used as a positive sample image. Images that are completely unrelated to the autonomous driving scene, such as indoor scene images and non-road scene images, are used as negative sample images.

[0049] Specifically, a positive sample image in the unlabeled sample image, an enhanced sample image corresponding to the positive sample image, and a negative sample image can be input into the feature extraction sub-model as a set of training data. By performing sample image comparison on the first sample image pair and the second sample image pair, the feature extraction sub-model can be more effectively self-supervised trained, so that the feature extraction sub-model can extract more universal feature information from a large number of unlabeled sample images, complete the learning of a large amount of unlabeled data, further improve the training effect of the feature extraction sub-model, and enable the trained target feature extraction sub-model to have a higher background distinction ability.

[0050] Exemplarily, the training process of the feature extraction sub-model using the unlabeled positive sample image, the enhanced sample image corresponding to the positive sample image, and the negative sample image may include the following steps S111-S114:

[0051] S111, input the positive sample image, the enhanced sample image corresponding to the positive sample image, and the negative sample image into the feature extraction sub-model respectively, and determine the positive feature map corresponding to the positive sample image, the enhanced feature map corresponding to the enhanced sample image, and the negative feature map corresponding to the negative sample image according to the output of the feature extraction sub-model.

[0052] Specifically, Figure 3 An example of the feature extraction sub-model training process is given, such as Figure 3 As shown, a positive sample image and a negative sample image and an enhanced sample image corresponding to the positive sample can be randomly selected from the unlabeled sample images, and the image sizes of the three sample images can be unified, for example, unified to 224*224*3. The three sample images can be input into the same feature extraction sub-model one by one, or the three sample images can be simultaneously input into three feature extraction sub-models with shared weights, that is, the three feature extraction sub-models have exactly the same weights, and are essentially one feature extraction sub-model, so as to improve the training efficiency, as shown in FIG. Figure 3According to the output of the feature extraction sub-model, the positive feature map corresponding to the positive sample image, the enhanced feature map corresponding to the enhanced sample image, and the negative feature map corresponding to the negative sample image can be obtained.

[0053] S112: Determine the image similarity between the positive sample image and the negative sample image in the first sample image pair according to the positive feature map and the negative feature map.

[0054] Specifically, the image similarity between the positive sample image and the negative sample image can be determined based on the positive feature map and the negative feature map by using a similarity calculation method such as cosine distance.

[0055] Exemplarily, S112 may include: performing a flattening operation on the positive feature map and the negative feature map to determine a positive feature vector corresponding to the positive feature map and a negative feature vector corresponding to the negative feature map; and determining the image similarity between the positive sample image and the negative sample image in the first sample image pair based on the positive feature vector and the negative feature vector.

[0056] Specifically, Figure 3 As shown in FIG. 1 , the positive feature map and the negative feature map can be flattened to flatten the height and width of the three-dimensional image, that is, to reduce the three-dimensional image information to two-dimensional vector information. For example, the feature map size is (64, 32, 128), and after the flattening operation, it becomes (2048, 128). Thus, the positive feature vector V corresponding to the positive feature map can be obtained by the flattening operation. + The negative eigenvector V corresponding to the negative eigenmap - The image similarity between the positive sample image and the enhanced sample image can be determined based on the positive feature vector and the enhanced feature vector by using a similarity calculation method such as cosine distance.

[0057] S113. Determine the image similarity between the positive sample image and the enhanced sample image in the second sample image pair according to the positive feature map and the enhanced feature map.

[0058] Specifically, the image similarity between the positive sample image and the enhanced sample image can be determined based on the positive feature map and the enhanced feature map by using a similarity calculation method such as cosine distance.

[0059] Exemplarily, S113 may include: performing a flattening operation on the positive feature map and the enhanced feature map to determine a positive feature vector corresponding to the positive feature map and an enhanced feature vector corresponding to the enhanced feature map; and determining the image similarity between the positive sample image and the enhanced sample image in the first sample image pair based on the positive feature vector and the enhanced feature vector.

[0060] Specifically, Figure 3As shown in FIG. 1 , the positive feature map and the enhanced feature map can be flattened to flatten the height and width of the three-dimensional image, that is, to reduce the three-dimensional image information to two-dimensional vector information. For example, the feature map size is (64, 32, 128), and after the flattening operation, it becomes (2048, 128). Thus, the positive feature vector V corresponding to the positive feature map can be obtained by the flattening operation. + The enhanced feature vector V corresponding to the enhanced feature map + The image similarity between the positive sample image and the enhanced sample image can be determined based on the positive feature vector and the enhanced feature vector by using a similarity calculation method such as cosine distance.

[0061] S114. Determine the total training error based on the image similarity between the positive sample image and the negative sample image and the image similarity between the positive sample image and the enhanced sample image, and back-propagate the total training error to the feature extraction sub-model, adjust the weights in the feature extraction sub-model, and terminate the training when a preset convergence condition is reached to obtain the target feature extraction sub-model.

[0062] Specifically, Figure 3 As shown, the image similarity between the positive sample image and the negative sample image, as well as the image similarity between the positive sample image and the enhanced sample image can be input into the sample metric, and the preset loss function is used to calculate the loss size of the feature extraction sub-model output, that is, the total training error, and the total training error is back-propagated to the feature extraction sub-model, and the weights in the feature extraction sub-model are adjusted until the training ends when the preset convergence condition is reached. For example, when the total training error is less than the preset error or the error variation range tends to be stable, or the number of iterative training times is equal to the preset number, it indicates that the feature extraction sub-model training is completed. At this time, the trained feature extraction sub-model has a higher background distinction ability, which helps the classification sub-model to distinguish between positive and negative samples.

[0063] Exemplarily, "determining the total training error according to the image similarity between the positive sample image and the negative sample image and the image similarity between the positive sample image and the enhanced sample image" in S114 may include: determining the total training error according to the image similarity between the positive sample image and the negative sample image and the image similarity between the positive sample image and the enhanced sample image based on the ternary loss function.

[0064] Specifically, the image similarity between the positive sample image and the negative sample image and the image similarity between the positive sample image and the enhanced sample image are input into the ternary loss function to obtain the total training error. Therefore, the image similarity between the positive sample image and the enhanced sample image is 100% and the image similarity between the positive sample image and the negative sample image is 0 as the training target, and the feature extraction sub-model is trained, so that the trained target feature extraction sub-model can have a higher background distinction ability, thereby further improving the performance of the image classification network model.

[0065] On the basis of the above technical solutions, after S140, it can also include: obtaining a target image to be processed; inputting the target image into an image classification network model after training, and obtaining the target category to which the target object in the target image belongs based on the output of the image classification network model.

[0066] Specifically, by inputting the target image to be processed into the image classification network model after training, the target category to which the target object in the target image belongs can be obtained according to the output of the image classification network model, thereby using a high-performance image classification network model to ensure the accuracy of image processing.

[0067] Embodiment 2

[0068] Figure 4 A flowchart of a training method for an image classification network model provided in Embodiment 2 of the present invention. Based on the above embodiments, this embodiment further optimizes the classification sub-model, and on this basis, describes in detail the training process of the classification sub-model. The explanations of the terms that are the same or corresponding to the above embodiments are not repeated here.

[0069] Figure 5 An example of an image classification network model is given. Figure 5 As shown, the classification sub-model in this embodiment may include: an encoding network module and an independent branch network module corresponding to each category. Each branch network module is used to: perform prediction processing on the feature map output by the feature extraction sub-model, determine the confidence that the object in the input image belongs to the current category, and input the confidence into the encoding network module. The encoding network module can be used to: bit-wise splice the confidence output by each branch network module, determine the target category based on the splicing result, and output the target category as the final classification result.

[0070] Each category corresponds to an independent branch network module, so that the branch network module can be used to predict the confidence that the object in the input image belongs to the category, and its range is [0, 1]. Each branch network module can be composed of several convolutional layers, batch normalization layers, nonlinear activation layers (such as Relu activation function) and sigmoid function mapping layers.

[0071] Specifically, the specific use process of the image classification network model is as follows: the input image is input into the feature extraction submodel in the image classification network model for feature extraction, and the obtained feature map is input into the branch network module corresponding to each category, so that each branch network module can process the input feature map in parallel, thereby reducing the performance loss caused by the increase in the number of branches. Each branch network module inputs the confidence that the object in the predicted input image belongs to the current category into the encoding network module, and the encoding network module splices the input confidences bit by bit, and the splicing order corresponds to the category corresponding to each branch network module, and the category corresponding to the position with the highest confidence can be output as the target category, so as to obtain the final classification result.

[0072] like Figure 4 As shown, the training method of the image classification network model provided in this embodiment specifically includes the following steps:

[0073] S410 . Training a feature extraction sub-model based on unlabeled sample images by comparing sample images, where the unlabeled sample images include a first sample image pair consisting of a positive sample image and a negative sample image.

[0074] S420: When the image similarity between the positive sample image and the negative sample image in the first sample image pair meets a preset convergence condition, the feature extraction sub-model training is completed to obtain a target feature extraction sub-model.

[0075] S430, input the labeled sample image into the target feature extraction sub-model to obtain a target feature map, and input the target feature map and the label category corresponding to the labeled sample image into the classification sub-model to obtain the predicted category of the labeled sample image.

[0076] Specifically, based on the above-mentioned related description, the image classification network model can be used to obtain the predicted category to which the sample object in the labeled sample image belongs.

[0077] S440. Determine the training error based on the predicted category and the label category corresponding to the labeled sample image, and back-propagate the training error to each branch network module, adjust the network parameters in each branch network module, and complete the training when the preset convergence condition is reached, thereby completing the training of the image classification network model.

[0078] Specifically, the training error can be back-propagated to each branch network module in the classification sub-model, and the network parameters of each branch network module can be adjusted until the training ends when the preset convergence condition is reached. For example, when the training error is less than the preset error or the error variation range tends to be stable, or the number of iterative training times is equal to the preset number, it can be determined that the training of each branch network module is completed. Since the encoding network module does not need to be trained, when the training of each branch network module is completed, it indicates that the training of the classification sub-model is completed, and the training of the image classification network model is completed at this time.

[0079] It should be noted that when training each branch network module in the classification sub-model, all network parameters in the target feature extraction sub-model are locked to ensure that the network parameters in the target feature extraction sub-model will not be updated during the training of each branch network module.

[0080] The technical solution of this embodiment, by setting up a classification sub-model including an encoding network module and an independent branch network module corresponding to each category, can enable each branch network module to process the input feature map in parallel, thereby reducing the performance loss caused by the increase in the number of branches and further improving the performance of the image classification network model.

[0081] Based on the above technical solution, the method also includes: if a new category is added, a new branch network module is added in parallel with the existing branch network module in the classification sub-model after the training is completed, and the new branch network module is incrementally trained based on the new category sample images corresponding to the new category.

[0082] Specifically, the classification sub-model in this embodiment can dynamically add branch network modules. When it is necessary to use the existing image classification network model to identify new categories, a new branch network module can be added to the classification sub-model after the training is completed, and the network structure of the newly added branch network module can be the same as the network structure of the existing branch network module. By incrementally training the new branch network module based on the new category sample images corresponding to the new category, an image classification network model that can identify new categories can be obtained, thereby completing incremental learning.

[0083] It should be noted that when the image classification network model learns new categories, it can only perform incremental training on the newly added branch network module, without retraining the image classification network model from scratch, which shortens the model training time and speeds up the model iteration cycle. The image classification network model in this embodiment can have the ability of persistent learning, that is, the image classification network model can learn new categories while maintaining the ability to recognize old categories.

[0084] Exemplarily, incremental training of a new branch network module based on a new category sample image corresponding to a new category may include:

[0085] The sample images in the sample set corresponding to the new category are input into the image classification network model after the new branch network module is added, wherein the positive sample images in the sample set are the new category sample images corresponding to the new category, and the negative sample images are the other category sample images corresponding to other categories; according to the output of the new branch network module in the image classification network model, the confidence that the sample object in the sample image belongs to the new category is determined; the training error is determined according to the confidence, and the training error is back-propagated to the new branch network module, and the network parameters in the new branch network module are adjusted until the training ends when the preset convergence conditions are reached.

[0086] Specifically, the new category sample images corresponding to the new category can be used as positive sample images, and the other category sample images corresponding to other categories learned by the model can be used as negative sample images. In addition, negative sample images in unlabeled sample images can also be obtained to perform incremental training on the new branch network module. In order to balance the impact of the difference in the number of positive and negative sample images, the Binary Focal function can be used as the loss function to determine the training error. For example, the Binary Focal function can be expressed as follows:

[0087] L=-α t (1-P t ) γ log(P t )

[0088]

[0089] Among them, P t The confidence that the sample object in the sample image output by the new branch network module belongs to the new category. y represents the input sample image. When the input sample image is a positive sample image, that is, y is equal to 1, the coefficient α in the Focal function t is α; when the input sample image is a negative sample image, that is, y is equal to 1, the coefficient α in the Focal function t When there are fewer negative sample images, α can be set to 0.5 and γ to 1. When there are more negative sample images, α can be set to 0.25 and γ to 2, so as to balance the impact of the difference in the number of positive and negative sample images on the performance of the image classification network model.

[0090] This embodiment adjusts the various network parameters in the new branch network module by back-propagating the training error to the new branch network module until the training ends when the preset convergence condition is reached. For example, the incremental training of the new branch network module can be determined to be completed when the training error is less than the preset error or the error variation range tends to be stable, or the number of iterative training times is equal to the preset number.

[0091] It should be noted that when training a new branch network module in the classification sub-model, all network parameters in the target feature extraction sub-model and all network parameters in other branch network modules are locked to ensure that the network parameters in the target feature extraction sub-model and other branch network modules will not be updated during the training of the new branch network module, thereby avoiding catastrophic forgetting in incremental learning, so that the image classification network model can learn new categories while maintaining the ability to recognize old categories.

[0092] On the basis of the above-mentioned technical solutions, the method also includes: if new sample images corresponding to existing categories are added, the new sample images and existing sample images corresponding to existing categories are used as positive sample images, and other category sample images corresponding to other categories are used as negative sample images, and incremental training is performed on the branch network modules corresponding to the existing categories.

[0093] Specifically, when a new sample image corresponding to an existing category is obtained, it is necessary to use the new sample image to perform incremental training on the branch network module corresponding to the existing category so that the branch network module can have the ability to recognize the new sample image. For example, for the vehicle category, assuming that only car images were used as sample images to train the branch network module corresponding to this category, if new sample images such as truck images or bicycle images that belong to the vehicle category but have not been learned before are currently obtained, it is necessary to use these new sample images to perform incremental training on the branch network module corresponding to this category, so that the trained branch network module can classify truck images or bicycle images into the vehicle category. The image classification network model in this embodiment can have the ability of persistent learning.

[0094] Exemplarily, the incremental training process of the branch network module corresponding to the existing category includes: taking the new sample image and the representative sample image corresponding to the existing category learned before as the positive sample image, taking the sample images of other categories corresponding to other categories learned by the model as the negative sample image, and also obtaining the negative sample image in the unlabeled sample image. Select a sample image from these sample image sets and input it into the image classification network model, and determine the confidence that the sample object in the sample image belongs to the existing category according to the output of the branch network module corresponding to the existing category in the image classification network model; determine the training error according to the confidence, and back-propagate the training error to the branch network module corresponding to the existing category, adjust the network parameters in the branch network module corresponding to the existing category, and end the training when the preset convergence condition is reached. In order to balance the influence of the difference in the number of positive and negative sample images, the above-mentioned Binary Focal function can also be used as the loss function to determine the training error, and the incremental training of the branch network module corresponding to the existing category can be determined when the training error is less than the preset error or the error variation range tends to be stable, or the number of iterative training times is equal to the preset number.

[0095] It should be noted that when training the branch network modules corresponding to the current existing categories in the classification sub-model, all network parameters in the target feature extraction sub-model and all network parameters in the branch network modules corresponding to other existing categories are locked to ensure that the network parameters in the target feature extraction sub-model and the branch network modules corresponding to other existing categories will not be updated during the training of the branch network modules corresponding to the current existing categories, thereby avoiding catastrophic forgetting in incremental learning, and through incremental learning, the diversity of categories can be increased to ensure recognition accuracy.

[0096] The following is an embodiment of a training device for an image classification network model provided in an embodiment of the present invention. The device and the training method for an image classification network model in the above-mentioned embodiments belong to the same inventive concept. For details not described in detail in the embodiment of the training device for an image classification network model, reference can be made to the embodiment of the training method for an image classification network model in the above-mentioned embodiment.

[0097] Embodiment 3

[0098] Figure 6This is a schematic diagram of the structure of a training device for an image classification network model provided in the third embodiment of the present invention. This embodiment is applicable to the case of training an image classification network model, and in particular, it can be used in an autonomous driving scenario to train an image classification network model for identifying objects in a scene. The image classification network model in this embodiment may include: a feature extraction submodel and a classification submodel corresponding to at least one category. Among them, the feature extraction submodel can be used to: extract features from an input image, obtain a feature map corresponding to the input image, and input the feature map into the classification submodel. The classification submodel can be used to: perform classification based on the input feature map, determine the category to which the object in the input image belongs, and output the category. By using the image classification network model, the category to which the object in the image belongs can be identified.

[0099] like Figure 6 As shown, the training device of the image classification network model in this embodiment specifically includes: a feature extraction sub-model training module 610 and a classification sub-model training module 620.

[0100] Among them, the feature extraction sub-model training module 610 is used to train the feature extraction sub-model based on the unlabeled sample image by comparing the sample images, and the unlabeled sample image includes a first sample image pair consisting of a positive sample image and a negative sample image; when the image similarity between the positive sample image and the negative sample image in the first sample image pair meets the preset convergence condition, the feature extraction sub-model training is completed to obtain the target feature extraction sub-model; the classification sub-model training module 620 is used to input the labeled sample image into the target feature extraction sub-model to obtain the target feature map, and input the label category corresponding to the target feature map and the labeled sample image into the classification sub-model to obtain the predicted category of the labeled sample image; when the loss function determined by the label category and the predicted category meets the preset convergence condition, the classification sub-model training is completed to complete the training of the image classification network model.

[0101] The technical solution of this embodiment is to train the feature extraction sub-model in the image classification network model based on the unlabeled sample images, that is, the first sample image pair composed of the positive sample image and the negative sample image, by a sample image comparison method. When the image similarity between the positive sample image and the negative sample image in the first sample image pair meets the preset convergence condition, the training of the feature extraction sub-model is completed and the target feature extraction sub-model is obtained. Therefore, the feature extraction sub-model can be trained in a self-supervised manner to complete the learning of a large amount of unlabeled sample data, so that the feature extraction sub-model can accurately extract feature information. After the training of the feature extraction sub-model is completed and the target feature extraction sub-model is obtained, the labeled sample image is input into the target feature extraction sub-model. The target feature extraction submodel is trained to obtain the target feature map, and the label category corresponding to the target feature map and the labeled sample image is input into the classification submodel to obtain the predicted category of the labeled sample image. When the loss function determined by the label category and the predicted category meets the preset convergence condition, the training of the classification submodel is completed, and the training of the image classification network model is completed. Therefore, the classification submodel in the image classification network model can be trained based on a small number of labeled sample images, so that the classification submodel can accurately classify based on the feature information extracted by the trained target feature extraction submodel, thereby ensuring the high performance of the image classification network model, and only a small amount of sample data needs to be labeled, which greatly reduces the labeling cost.

[0102] Optionally, the unlabeled sample image further includes: a second sample image pair consisting of a positive sample image and an enhanced sample image corresponding to the positive sample image.

[0103] Optionally, the feature extraction sub-model training module 610 includes:

[0104] A feature map determination submodule is used to input the positive sample image, the enhanced sample image corresponding to the positive sample image, and the negative sample image into the feature extraction submodel respectively, and determine the positive feature map corresponding to the positive sample image, the enhanced feature map corresponding to the enhanced sample image, and the negative feature map corresponding to the negative sample image according to the output of the feature extraction submodel;

[0105] A first similarity determination submodule, used to determine the image similarity between the positive sample image and the negative sample image in the first sample image pair according to the positive feature map and the negative feature map;

[0106] A second similarity determination submodule, used to determine the image similarity between the positive sample image and the enhanced sample image in the second sample image pair according to the positive feature map and the enhanced feature map;

[0107] The error propagation submodule is used to determine the total training error based on the image similarity between the positive sample image and the negative sample image and the image similarity between the positive sample image and the enhanced sample image, and back-propagate the total training error to the feature extraction submodel, adjust the weights in the feature extraction submodel, and terminate the training when the preset convergence condition is reached to obtain the target feature extraction submodel.

[0108] Optionally, the first similarity determination submodule is specifically configured to:

[0109] The positive feature map and the negative feature map are flattened to determine a positive feature vector corresponding to the positive feature map and a negative feature vector corresponding to the negative feature map; and the image similarity between the positive sample image and the negative sample image in the first sample image pair is determined according to the positive feature vector and the negative feature vector.

[0110] Optionally, the error propagation submodule is specifically used to:

[0111] Based on the ternary loss function, the total training error is determined according to the image similarity between the positive sample image and the negative sample image, and the image similarity between the positive sample image and the enhanced sample image.

[0112] Optionally, the positive sample image is an object image related to the autonomous driving scene; the enhanced sample image corresponding to the positive sample image is a sample image obtained by randomly transforming the positive sample; and the negative sample image is an object image that is completely unrelated to the autonomous driving scene.

[0113] Optionally, the classification sub-model includes: an encoding network module and an independent branch network module corresponding to each category;

[0114] Each branch network module is used to: perform prediction processing on the feature map output by the feature extraction sub-model, determine the confidence that the object in the input image belongs to the current category, and input the confidence into the encoding network module;

[0115] The encoding network module is used to: bit-wise splice the confidences output by each branch network module, determine the target category based on the splicing result, and output the target category as the final classification result.

[0116] Optionally, the device further comprises:

[0117] The first incremental training module is used to add a new branch network module in parallel with the existing branch network module in the classification sub-model after the training is completed if a new category is added, and to perform incremental training on the new branch network module based on the new category sample images corresponding to the new category.

[0118] Optionally, the first incremental training module is specifically used to:

[0119] The sample images in the sample set corresponding to the new category are input into the image classification network model after the new branch network module is added, wherein the positive sample images in the sample set are the new category sample images corresponding to the new category, and the negative sample images are the other category sample images corresponding to other categories; according to the output of the new branch network module in the image classification network model, the confidence that the sample object in the sample image belongs to the new category is determined; the training error is determined according to the confidence, and the training error is back-propagated to the new branch network module, and the network parameters in the new branch network module are adjusted until the training ends when the preset convergence conditions are reached.

[0120] Optionally, the device further comprises:

[0121] The second incremental training module is used to, if new sample images corresponding to existing categories are added, use the new sample images and existing sample images corresponding to existing categories as positive sample images, and use other category sample images corresponding to other categories as negative sample images, to perform incremental training on the branch network modules corresponding to the existing categories.

[0122] Optionally, the device further comprises:

[0123] A target image acquisition module is used to acquire the target image to be processed after the training of the image classification network model is completed;

[0124] The target category acquisition module is used to input the target image into the image classification network model after training, and obtain the target category to which the target object in the target image belongs based on the output of the image classification network model.

[0125] The training device for the image classification network model provided in the embodiment of the present invention can execute the training method for the image classification network model provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the training method for the image classification network model.

[0126] It is worth noting that in the embodiment of the training device for the above-mentioned image classification network model, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.

[0127] Embodiment 4

[0128] Figure 7 7 is a block diagram of an exemplary electronic device 12 suitable for implementing the embodiment of the present invention. The electronic device 12 shown in 7 is only an example and should not bring any limitation to the function and scope of use of the embodiment of the present invention.

[0129] As shown in FIG. 7 , the electronic device 12 is implemented as a general purpose computing device. The components of the electronic device 12 may include, but are not limited to, one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components (including the system memory 28 and the processing unit 16).

[0130] Bus 18 represents 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 a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

[0131] The electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 12, including volatile and non-volatile media, removable and non-removable media.

[0132] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media (not shown in FIG7 , commonly referred to as a "hard drive"). Although not shown in FIG7 , a disk drive for reading and writing to a removable non-volatile disk (such as a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (such as a CD-ROM, DVD-ROM or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data media interfaces. The system memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of various embodiments of the present invention.

[0133] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 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 may include an implementation of a network environment. Program modules 42 generally perform the functions and / or methods of the embodiments described herein.

[0134] The electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), may communicate with one or more devices that enable a user to interact with the electronic device 12, and / or may communicate with any device that enables the electronic device 12 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed via an input / output (I / O) interface 22. Furthermore, the electronic device 12 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 via a bus 18. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0135] The processing unit 16 executes various functional applications and data processing by running the program stored in the system memory 28, for example, implementing a training method for an image classification network model provided in an embodiment of the present invention, the method comprising:

[0136] The feature extraction sub-model is trained based on the unlabeled sample images by comparing the sample images, where the unlabeled sample images include a first sample image pair consisting of a positive sample image and a negative sample image;

[0137] When the image similarity between the positive sample image and the negative sample image in the first sample image pair meets the preset convergence condition, the feature extraction sub-model training is completed to obtain the target feature extraction sub-model;

[0138] Input the labeled sample image into the target feature extraction sub-model to obtain the target feature map, and input the target feature map and the label category corresponding to the labeled sample image into the classification sub-model to obtain the predicted category of the labeled sample image;

[0139] When the loss function determined by the sample label and the predicted label is satisfied, the classification sub-model training is completed and the training of the image classification model is completed.

[0140] Of course, those skilled in the art can understand that the processor can also implement the technical solution of the training method of the image classification network model provided by any embodiment of the present invention.

[0141] Embodiment 5

[0142] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the training method steps of the image classification network model provided in any embodiment of the present invention are implemented.

[0143] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.

[0144] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0145] The program code embodied on the computer readable 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.

[0146] Computer program code for performing the operations of the present invention may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0147] It should be understood by those skilled in the art that the modules or steps of the present invention described above can be implemented by a general-purpose computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, optionally, they can be implemented by a program code executable by a computer device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0148] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A training method for an image classification network model, characterized in that: The image classification network model includes: a feature extraction sub-model and a classification sub-model corresponding to at least one category, and the training method includes: The feature extraction sub-model is trained based on unlabeled sample images by a sample image comparison method, wherein the unlabeled sample images include a first sample image pair consisting of a positive sample image and a negative sample image; When the image similarity between the positive sample image and the negative sample image in the first sample image pair meets a preset convergence condition, the feature extraction sub-model training is completed to obtain a target feature extraction sub-model; Inputting the labeled sample image into the target feature extraction sub-model to obtain a target feature map, and inputting the target feature map and the label category corresponding to the labeled sample image into the classification sub-model to obtain the predicted category of the labeled sample image; wherein, when training the classification sub-model, all network parameters in the target feature extraction sub-model are locked; When the loss function determined by the label category and the predicted category meets the preset convergence condition, the classification sub-model training is completed, and the training of the image classification network model is completed.

2. The method according to claim 1, characterized in that The unlabeled sample image further includes: a second sample image pair consisting of the positive sample image and an enhanced sample image corresponding to the positive sample image.

3. The method according to claim 2, characterized in that The feature extraction sub-model is trained based on the unlabeled sample image, and when the image similarity between the positive sample image and the negative sample image in the first sample image pair meets a preset convergence condition, the feature extraction sub-model training is completed to obtain a target feature extraction sub-model, including: Inputting the positive sample image, the enhanced sample image corresponding to the positive sample image and the negative sample image into the feature extraction sub-model respectively, and determining the positive feature map corresponding to the positive sample image, the enhanced feature map corresponding to the enhanced sample image and the negative feature map corresponding to the negative sample image according to the output of the feature extraction sub-model; Determining, according to the positive feature map and the negative feature map, an image similarity between the positive sample image and the negative sample image in the first sample image pair; Determining, according to the positive feature map and the enhanced feature map, an image similarity between the positive sample image and the enhanced sample image in the second sample image pair; According to the image similarity between the positive sample image and the negative sample image and the image similarity between the positive sample image and the enhanced sample image, the total training error is determined, and the total training error is back-propagated to the feature extraction sub-model, and the weights in the feature extraction sub-model are adjusted until the training ends when a preset convergence condition is reached, thereby obtaining a target feature extraction sub-model.

4. The method according to claim 3, characterized in that The determining, according to the positive feature map and the negative feature map, the image similarity between the positive sample image and the negative sample image in the first sample image pair comprises: Performing a flattening operation on the positive feature map and the negative feature map to determine a positive feature vector corresponding to the positive feature map and a negative feature vector corresponding to the negative feature map; The image similarity between the positive sample image and the negative sample image in the first sample image pair is determined according to the positive feature vector and the negative feature vector.

5. The method according to claim 3, characterized in that: The determining of the total training error according to the image similarity between the positive sample image and the negative sample image and the image similarity between the positive sample image and the enhanced sample image comprises: Based on the ternary loss function, a total training error is determined according to the image similarity between the positive sample image and the negative sample image and the image similarity between the positive sample image and the enhanced sample image.

6. The method according to claim 2, characterized in that The positive sample image is an object image related to the autonomous driving scene; the enhanced sample image corresponding to the positive sample image is a sample image obtained by randomly transforming the positive sample; and the negative sample image is an object image that is completely unrelated to the autonomous driving scene.

7. The method according to claim 1, characterized in that The classification sub-model includes: an encoding network module and an independent branch network module corresponding to each category; Each of the branch network modules is used to: perform prediction processing on the feature map output by the feature extraction sub-model, determine the confidence that the object in the input image belongs to the current category, and input the confidence into the encoding network module; The encoding network module is used to: bit-wise splice the confidences output by each of the branch network modules, determine the target category according to the splicing result, and output the target category as the final classification result.

8. The method according to claim 7, characterized in that The method further comprises: If a new category is added, a new branch network module is added in parallel with the existing branch network module in the classification sub-model after the training is completed, and the new branch network module is incrementally trained based on the new category sample images corresponding to the new category.

9. The method according to claim 8, characterized in that The incremental training of the new branch network module based on the new category sample images corresponding to the new category includes: Inputting sample images in the sample set corresponding to the new category into the image classification network model after adding the new branch network module, wherein the positive sample images in the sample set are sample images of the new category corresponding to the new category, and the negative sample images are sample images of other categories corresponding to other categories; Determining the confidence that the sample object in the sample image belongs to a new category according to the output of the new branch network module in the image classification network model; A training error is determined according to the confidence level, and the training error is back-propagated to the new branch network module, and network parameters in the new branch network module are adjusted until the training ends when a preset convergence condition is reached.

10. The method according to claim 7, characterized in that The method further comprises: If new sample images corresponding to existing categories are added, the new sample images and the existing sample images corresponding to the existing categories are used as positive sample images, and other category sample images corresponding to other categories are used as negative sample images, and incremental training is performed on the branch network modules corresponding to the existing categories.

11. The method according to any one of claims 1 to 10, characterized in that: After completing the training of the image classification network model, it also includes: Obtaining a target image to be processed; The target image is input into the trained image classification network model, and the target category to which the target object in the target image belongs is obtained according to the output of the image classification network model.

12. A training device for an image classification network model, characterized in that: The image classification network model includes: a feature extraction sub-model and a classification sub-model corresponding to at least one category, and the training device includes: A feature extraction sub-model training module is used to train the feature extraction sub-model based on unlabeled sample images by sample image comparison, wherein the unlabeled sample images include a first sample image pair consisting of a positive sample image and a negative sample image; when the image similarity between the positive sample image and the negative sample image in the first sample image pair meets a preset convergence condition, the feature extraction sub-model training is completed to obtain a target feature extraction sub-model; The classification sub-model training module is used to input the labeled sample image into the target feature extraction sub-model to obtain the target feature map, and input the label category corresponding to the target feature map and the labeled sample image into the classification sub-model to obtain the predicted category of the labeled sample image; wherein, when training the classification sub-model, all network parameters in the target feature extraction sub-model are locked; when the loss function determined by the label category and the predicted category meets the preset convergence condition, the classification sub-model training is completed, and the training of the image classification network model is completed.

13. An electronic device, characterized in that: The electronic device comprises: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the training method of the image classification network model as described in any one of claims 1-11.

14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, it implements the training method of the image classification network model as described in any one of claims 1-11.

Citation Information

Patent Citations

  • Data processing method and device, medium and computing equipment

    CN109934249A

  • Training method and device of neural network model for sample classification

    CN110689048A

  • Model training method, image feature extraction method and target detection method and device

    CN112232384A

  • Image management method and device, terminal and storage medium

    CN112329785A

  • Picture matching method and device, electronic equipment and storage medium

    CN112650867A