A deep learning-based image recognition model training method and system

By pre-training the model, dynamically adjusting sample acquisition and loss value thresholds, constructing sample pairs and conducting iterative training, the problem of inaccurate recognition of image recognition models between different classification targets is solved, and the accuracy and generalization ability of the model are improved.

CN118506113BActive Publication Date: 2024-10-01WUHAN SHUJUSUDA NETWORK TECH CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202410968651.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-19
Publication Date
2024-10-01
Estimated Expiration
2044-07-19

AI Technical Summary

Technical Problem

Existing image recognition models have poor recognition accuracy between different classification targets. It is necessary to develop an image recognition model training method based on deep learning to improve the performance and accuracy of the model.

Method used

Pre-train the image recognition model through pre-training samples, calculate the multi-classification evaluation index setting acquisition probability, dynamically adjust the sample acquisition and loss value thresholds, construct sample pairs, calculate the comprehensive loss and perform backpropagation training until the loss value converges. To achieve adaptation, we focus on sample selection and model training.

Benefits of technology

It improves the performance of the model for each classification target, improves the accuracy and generalization ability of the target recognition process, reduces classification errors, and is suitable for classification tasks in the real world.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118506113B_ABST
    Figure CN118506113B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of computer technology, and to a method and system for training an image recognition model based on deep learning, the method comprising selecting pre-training samples to pre-train an image recognition model; calculating multi-classification evaluation indicators of the pre-trained image recognition model corresponding to multiple classification targets, and setting the acquisition probability of the corresponding classification target according to the multi-classification evaluation indicators; using the pre-training model to detect samples in a training sample set to determine the loss value and predicted classification of the sample, determining the focus of the sample according to the size of the loss value of the sample and the consistency between the predicted classification and the true classification, and calculating the selection probability of the sample, and selecting the sample according to the selection probability to construct a sample pair; and performing back-propagation training on the image recognition model according to the comprehensive loss of the sample pair. According to the scheme of the present invention, the problem of inaccurate recognition between different classification targets by the current image recognition model is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology. More specifically, the present invention relates to a method and system for training an image recognition model based on deep learning. Background Art

[0002] Image is a very important information carrier. The generation and update of image recognition technology has become a very important development direction at present, and it has shown good development prospects. Image recognition technology has been widely used in information collection, medical treatment and product safety, and has played a very important role.

[0003] The technology of using computers to process, analyze and understand images to identify various different patterns of targets and objects is a practical application of deep learning algorithms. Deep learning models can usually achieve high accuracy in image recognition tasks, especially after training on large-scale data sets. By continuously optimizing the training method, the recognition accuracy of the model can be further improved, making it more reliable in practical applications. In order to improve model performance and reduce resource consumption. It is necessary to design a method for training deep learning image recognition models.

[0004] At present, the patent application document with publication number CN112036509A discloses a method and device for training an image recognition model. The method determines the actual recognition label of the current training image by using multiple initial image recognition models to respectively recognize the current training image and obtain multiple predicted recognition labels. Using each predicted recognition label and actual recognition label, a loss function of each initial image recognition model is constructed respectively. Using the loss function of each initial image recognition model, the initial image recognition model corresponding to the loss function is trained respectively to obtain multiple trained target image recognition models.

[0005] However, the above method only involves constructing a loss function through the predicted recognition label and the actual recognition label between a single sample to realize the recognition process of different classification targets. This method requires a large number of training samples and a complex model structure, and the accuracy of the recognition results is still poor. In order to solve the problem of inaccurate recognition between different classification targets by the current image recognition model, it is necessary to develop an image recognition model training method based on deep learning. Summary of the invention

[0006] In order to solve the problem of inaccurate recognition of different classification targets by the above-mentioned image recognition model, the present invention provides solutions in the following aspects.

[0007] In a first aspect, the present invention provides a method for training an image recognition model based on deep learning, comprising: selecting pre-training samples to pre-train an image recognition model, wherein the pre-training samples include one or more groups of accurately annotated label data in a training sample set; calculating multi-classification evaluation indicators of the pre-trained image recognition model corresponding to multiple classification targets, and setting the acquisition probability of the corresponding classification target according to the multi-classification evaluation indicator, wherein the acquisition probability is negatively correlated with the size of the multi-classification evaluation indicator; using the pre-training model to detect samples in the training sample set to determine the loss value and predicted classification of the sample, determining the focus of the sample according to the size of the loss value of the sample and the consistency between the predicted classification and the true classification, calculating the sample selection probability according to the product of the acquisition probability of the classification target and the focus, and selecting samples according to the selection probability to construct sample pairs; calculating the comprehensive loss of the sample pair, and performing back-propagation training on the image recognition model according to the comprehensive loss, and iteratively training the image recognition model until the loss value converges.

[0008] In the solution of the present invention, by dynamically adjusting steps such as sample acquisition and loss value threshold setting, sample pairs are constructed, the comprehensive loss of the sample pairs is calculated, and the model is trained iteratively to achieve an adaptive process that focuses on sample selection and model training, thereby effectively improving the performance of the model for each classification target and improving the accuracy of the target recognition process.

[0009] In one embodiment, the multi-classification evaluation index is the F1 value, and the acquisition probability of the corresponding classification target is set according to the multi-classification evaluation index, including: setting a higher acquisition weight for the classification target with a low F1 value, and setting a lower acquisition probability for the classification target with a high F1 value.

[0010] In the above scheme of the present invention, by calculating the F1 value, the accuracy and recall rate of the model can be effectively balanced, thereby realizing dynamic adjustment of the sample acquisition probability, which can enable the model to learn more effectively during the training process and converge to a better state in a shorter time, thereby improving the performance of the overall model.

[0011] In one embodiment, the calculation formula for obtaining the probability is: ; In the formula, Indicates The probability of obtaining a classification target, Indicates The F1 value of the classification target.

[0012] In one embodiment, the focus of attention of the sample is determined based on the size of the loss value of the sample and the consistency between the predicted classification and the true classification, including: comparing the loss value of the sample with a set loss value threshold to obtain a comparison result; determining the consistency between the predicted classification and the true classification; and determining the focus of attention of the sample based on the comparison result and the consistency.

[0013] In the scheme of the present invention, by setting the loss value threshold and judging the consistency between the predicted classification and the true classification, the focus of the sample is calculated, and the samples that are most helpful to improving the model performance can be screened out, so that the model pays more attention to challenging or error-prone samples, thereby better improving the training effect of the model.

[0014] In one embodiment, the focus of the sample is determined according to the comparison result and the consistency, including: in response to the loss value of the sample being less than the loss value threshold and the predicted classification being consistent with the true classification, the focus of the sample is recorded as 0; in response to the loss value of the sample being greater than the loss value threshold and the predicted classification being inconsistent with the true classification, the focus of the sample is recorded as 0; in response to the loss value of the sample being greater than the loss value threshold and the predicted classification being consistent with the true classification, the focus of the sample is recorded as 1; in response to the loss value of the sample being less than the loss value threshold and the predicted classification being inconsistent with the true classification, the focus of the sample is recorded as 1.

[0015] In the scheme of the present invention, by setting a loss value threshold and judging the consistency between the predicted classification and the true classification, the focus of the sample can be quantified. On the one hand, the samples that are most helpful to improving the model performance can be screened out, so that the model pays more attention to challenging or error-prone samples, thereby better improving the training effect of the model. On the other hand, it is convenient to calculate the comprehensive loss of the model, thereby achieving more effective training.

[0016] In one embodiment, samples are selected according to the selection probability to construct a sample pair, including: randomly selecting a sample as a first sample according to the selection probability, and determining a classification target corresponding to the first sample as the first classification target; calculating the difficulty of distinguishing the first classification target from other classification targets, wherein the difficulty of distinguishing is the probability value of the first classification target being predicted as other classification targets; selecting the classification target corresponding to the maximum value of the difficulty of distinguishing as the second classification target; randomly selecting a second sample according to the second classification target and the corresponding selection probability, and taking the first sample and the second sample as a sample pair.

[0017] In the solution of the present invention, by calculating the probability of obtaining the classification target and the probability of selecting the sample by the focus of attention, and constructing the sample pair, the relationship between different classification targets can be incorporated into the training process to improve the performance of the model on the classification task. By calculating the comprehensive loss of different classification targets, the model can be prompted to better distinguish different classification targets and reduce classification errors. This method helps to improve the generalization ability of the model, making it more suitable for classification tasks in the real world.

[0018] In one embodiment, calculating the comprehensive loss of the sample pair includes: inputting the sample pair into an image recognition model to obtain a cross entropy loss value of the first sample, a cross entropy loss value of the second sample, and a binary contrast loss of the two samples; calculating the sum of the cross entropy loss value of the first sample, the cross entropy loss value of the second sample, and the binary contrast loss of the two samples as the comprehensive loss.

[0019] In one embodiment, the calculation formula of the comprehensive loss is: ; In the formula, is comprehensive loss; is the cross entropy loss value of the first sample; The cross entropy loss value of the second sample; It is the maximum value operation; is the set similarity threshold; is the Euclidean distance between two classification targets in a sample pair.

[0020] In one embodiment, the image recognition model is iteratively trained until the loss value converges, including: each time a set number of training times is completed, the probability of obtaining the classification target, the probability of selecting the sample, the focus of the sample is updated, the constructed sample pairs are updated, and iterative training is performed.

[0021] In a second aspect, the present invention also provides an image recognition model training system based on deep learning, comprising a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, an image recognition model training method based on deep learning according to one or more of the foregoing embodiments is implemented.

[0022] The beneficial effects of the present invention are as follows: by dynamically adjusting sample acquisition, sample weight allocation and loss function adjustment for each classification target, on the one hand, the relationship between different classification targets can be incorporated into the training process, thereby improving the classification performance of the system; on the other hand, the comprehensive loss of different classification targets is dynamically adjusted, thereby effectively reducing the classification error of the model and improving the accuracy of the recognition results of the image recognition model. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:

[0024] Figure 1 is a flowchart of a deep learning-based image recognition model training method according to an embodiment of the present invention;

[0025] Figure 2 It is a structural diagram of an image recognition model training system based on deep learning in an embodiment of the present invention. DETAILED DESCRIPTION

[0026] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0027] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0028] Figure 1 1 is a flowchart of a deep learning-based image recognition model training method 100 according to an embodiment of the present invention.

[0029] like Figure 1 As shown, at step S101, the model is pre-trained. Specifically, a pre-training sample is selected to pre-train the image recognition model, wherein the pre-training sample includes one or more groups of accurately annotated label data in the training sample set.

[0030] At step S102, the acquisition probability of the classification target is calculated. Specifically, the multi-classification evaluation index of the pre-trained image recognition model corresponding to the multiple classification targets is calculated, and the acquisition probability of the corresponding classification target is set according to the multi-classification evaluation index, wherein the acquisition probability is negatively correlated with the size of the multi-classification evaluation index. The multi-classification evaluation index includes WA (weighted accuracy), UAR (unweighted average recall), F1 value (the harmonic mean of precision and recall), etc. The F1 value is used in the present invention, that is, the harmonic mean of precision and recall. In some embodiments, a higher acquisition weight can be set for a classification target with a low F1 value, and a lower acquisition probability can be set for a classification target with a high F1 value.

[0031] The calculation formula for obtaining the probability is: ; In the formula, Indicates The probability of obtaining a classification target, Indicates The F1 value of the classification target.

[0032] Step S103: Construct sample pairs. Specifically, the pre-trained image recognition model is used to detect samples in the training sample set to determine the loss value and predicted classification of the sample, the focus of the sample is determined according to the size of the loss value of the sample and the consistency between the predicted classification and the true classification, the sample selection probability is calculated according to the product of the acquisition probability of the classification target and the focus, and the sample is selected according to the selection probability to construct the sample pair.

[0033] In some embodiments, the loss value of the sample is compared with a set loss value threshold to obtain a comparison result. Determine the consistency between the predicted classification and the true classification. Determine the focus of the sample based on the comparison result and the consistency. In an application scenario, the quantitative result of the focus can be obtained by comparing the result and the consistency between the predicted classification and the true classification. For example, the focus can be marked with 0 or 1. In response to the loss value of the sample being less than the loss value threshold and the predicted classification being consistent with the true classification, the focus of the sample is recorded as 0; in response to the loss value of the sample being greater than the loss value threshold and the predicted classification being inconsistent with the true classification, the focus of the sample is recorded as 0; in response to the loss value of the sample being greater than the loss value threshold and the predicted classification being consistent with the true classification, the focus of the sample is recorded as 1; in response to the loss value of the sample being less than the loss value threshold and the predicted classification being inconsistent with the true classification, the focus of the sample is recorded as 1.

[0034] Furthermore, when constructing a sample pair, a sample can be selected in combination with the selection probability of the sample determined above. In this solution, sample selection is performed in combination with the degree of difficulty in distinguishing. In some embodiments, a sample can be randomly selected as a first sample based on the selection probability, and the classification target corresponding to the first sample can be determined as the first classification target. The degree of difficulty in distinguishing between the first classification target and other classification targets is calculated, where the degree of difficulty in distinguishing is the probability value that the first classification target is predicted to be other classification targets. In order to improve the classification effect in the present invention, the classification target corresponding to the maximum value of the degree of difficulty in distinguishing is selected as the second classification target. A second sample is randomly selected based on the second classification target and the corresponding selection probability, and the first sample and the second sample are used as a sample pair.

[0035] Step S104: Calculate loss and iterate training. Specifically, calculate the comprehensive loss of the sample pair, and perform back propagation training on the image recognition model according to the comprehensive loss, and iterate the image recognition model until the loss value converges.

[0036] In some embodiments, the sample pair can be input into the image recognition model to obtain the cross entropy loss value of the first sample, the cross entropy loss value of the second sample, and the binary contrast loss of the two samples. The binary contrast loss can be calculated by a similarity threshold and the Euclidean distance of the two classification targets in the sample pair. The sum of the cross entropy loss value of the first sample, the cross entropy loss value of the second sample, and the binary contrast loss of the two samples is calculated as the comprehensive loss.

[0037] The calculation formula for comprehensive loss is: ; In the formula, is comprehensive loss; is the cross entropy loss value of the first sample; The cross entropy loss value of the second sample; It is the maximum value operation; is the set similarity threshold; is the Euclidean distance between two classification targets in a sample pair.

[0038] After each set number of training times, the probability of obtaining the classification target, the probability of selecting samples, the focus of the samples are updated, the constructed sample pairs are updated, and iterative training is performed.

[0039] Next, the solution of the present invention will be described in detail with reference to specific embodiments.

[0040] Step S1: Select some accurately labeled label samples from the training sample set to pre-train the image recognition model. Specifically, use a small number of correctly labeled samples to lightly pre-train the model. Use a set of accurately labeled label data to lightly pre-train the model. Among them, the number of samples for light pre-training is set according to actual conditions, but at least includes sample data for each classification target. The pre-training process can help the model converge to a good state faster without spending too much time, thereby reducing the time and resource cost of fine-tuning or training on specific tasks.

[0041] Step S2: Calculate the F1 value of each classification target for the lightly pre-trained network model, and set the acquisition weight of the corresponding classification target according to the F1 value of each classification target.

[0042] Step S21: For the lightly pre-trained model, calculate the F1 value of each classification target.

[0043] Step S22, setting acquisition weights according to the F1 value of each classification target: setting higher acquisition weights for classification targets with low F1 values, and setting lower acquisition weights for classification targets with high F1 values.

[0044] Step S23: When the next sample is obtained and input into the model for training, the classification target with a low F1 value will have a higher acquisition probability. The acquisition probability is set by the F1 value of the current classification target. The operation process is as follows:

[0045] For example, in a task with n categorical targets, the F1 score for the i-th categorical target is The calculation process of obtaining the probability of the i-th classification target is as follows: ;in: Indicates The probability of obtaining a classification target.

[0046] Step S3: Calculate the loss value of the sample and set the loss value threshold. Determine whether the loss value of the current sample is greater than the set loss value threshold, and further determine whether the predicted classification of the current sample is consistent with the actual classification. By judging the loss value and the predicted result, calculate the focus of the sample.

[0047] Step S31: After obtaining the light pre-training model and completing the adaptive adjustment setting of the model data acquisition, randomly select a sample and input it into the light pre-training model to calculate and determine whether the loss value of the sample is greater than the set loss value threshold and whether the predicted classification is consistent with the true classification. The setting of the loss value threshold can be adjusted by experience.

[0048] Step S32: Pre-select the focus sample set by setting the loss value threshold and judging the consistency between the predicted classification and the true classification. There are four situations and corresponding processing methods:

[0049] A. If the loss value of the current sample is less than the loss value threshold, and the predicted classification of the current sample is consistent with the true classification, then the sample is directly ignored, and only the samples with large loss values ​​are focused on, and the focus of the samples of this class is recorded as 0.

[0050] B. If the loss value of the current sample is greater than the loss value threshold, and the predicted classification of the current sample is inconsistent with the true classification, the sample label is ignored and the focus of the sample of this class is recorded as 0.

[0051] C. If the loss value of the current sample is greater than the loss value threshold, and the predicted classification of the current sample is consistent with the true classification, then the current sample is recorded, the current sample is taken as the focus sample, and the focus degree of the sample of this class is recorded as 1.

[0052] D. If the loss value of the current sample is less than the loss value threshold, and the predicted classification of the current sample is inconsistent with the true classification, then the current sample is recorded, the current sample is taken as the focus sample, and the focus degree of the sample of this class is recorded as 1.

[0053] Step S33: reselect a sample and execute the process in a loop until the number of recorded focused samples reaches a certain number, thereby preselecting a focused sample set. The number of focused sample sets can be adjusted and set according to actual conditions.

[0054] Step S4: Calculate the probability of sample selection based on the probability of obtaining the classification target and the focus, construct sample pairs, calculate the comprehensive loss of the sample pairs, and train the model once. When the set number of training times is reached, update the parameters, and iterate the model training until the loss value converges to a certain degree, and obtain the trained image recognition model.

[0055] Step S41: Calculate the probability of sample selection.

[0056] According to the probability of obtaining the classification target calculated in step S2 and the focus of the sample calculated in step S3, the probability of selecting each sample in the sample set is calculated. The sample selection probability has the following calculation process: ;in, The probability of sample selection; is the focus of the sample, .

[0057] Step S42: construct sample pairs.

[0058] First, a sample is randomly selected as the first sample according to the probability of the sample being selected. For the classification target in the selected first sample, the difficulty of distinguishing from other classification targets is calculated according to the first classification target, and the maximum value of the difficulty of distinguishing between the first classification target and other classification targets is selected. A classification target is selected as the second classification target, and then a sample is randomly selected as the second sample according to the selected second classification target and the probability of the sample being selected, and the first sample and the second sample are used as a sample pair.

[0059] For example, the difficulty of distinguishing a categorical target from other categorical targets is calculated as follows: There are 100 The sample set of the classification target is input into the lightly pre-trained model. The categorical target is predicted by the model as The number of classification targets is 30; The categorical target is predicted by the model as The number of classification targets is 20; The categorical target is predicted by the model as The number of classification targets is 0; The categorical target is predicted by the model as The number of classification targets is 50. Classification target and The difficulty of distinguishing the classification target is 0.3; Classification target and The difficulty of distinguishing the classification target is 0.2; Classification target and The difficulty of distinguishing the classification target is 0; Classification target and The difficulty of classification target is 0.5.

[0060] Step S43: Calculate the comprehensive loss.

[0061] For a sample pair, the comprehensive loss is finally calculated based on the cross entropy loss value of the first sample, the cross entropy loss value of the second sample, and the binary contrast loss of the two samples.

[0062] (1) Input the first sample and the second sample into the network model in sequence to obtain the feature vectors of the first sample and the second sample, as well as the cross entropy loss value of the first sample and the second sample. Calculate the Euclidean distance between the two samples based on the feature vectors of the first sample and the second sample:

[0063]

[0064] in: Represents the Euclidean distance between two samples; is the dimension of the feature vector; For the The feature vector of the classification target Quantity; For the The feature vector of the classification target A quantity.

[0065] (2) Set the similarity threshold and calculate the binary contrast loss of the two samples. Calculate the cross entropy loss value of the first sample, the cross entropy loss value of the second sample, and the sum of the binary contrast losses of the two samples, and use the sum as the comprehensive loss. The setting of the similarity threshold can be adjusted according to the actual situation on site. The calculation process for the comprehensive loss is as follows: ;in: is comprehensive loss; is the cross entropy loss value of the first sample; The cross entropy loss value of the second sample; It is the maximum value operation; is the set similarity threshold; is the Euclidean distance between two classification targets in a sample pair.

[0066] (3) Perform back propagation once based on the comprehensive and loss values ​​and perform training once.

[0067] Step S44: End the training of the current batch model. After completing the set 10 training times, update the probability of obtaining the classification target, the probability of selecting the sample, the focus of the sample, and the constructed sample pairs. The set number of training times can be adjusted according to the actual situation.

[0068] Step S45: iteratively train the image recognition model until the loss value converges to a certain level.

[0069] The above solution realizes the adaptive selection of samples in combination with the focus objects during the training process, focusing on sample selection, thereby realizing an effective model training process and improving the performance of the model for each classification target. By dynamically adjusting the sample acquisition loss value and other steps, sample pairs can be constructed, and the comprehensive loss of sample pairs can be calculated, and model training can be iterated to ensure the accuracy of the image recognition model when identifying different targets.

[0070] Figure 2 It is a structural diagram of an image recognition model training system based on deep learning in an embodiment of the present invention.

[0071] The present invention also provides an image recognition model training system based on deep learning. Figure 2 As shown, the system includes a processor and a memory, wherein the memory stores computer program instructions. When the computer program instructions are executed by the processor, an image recognition model training method based on deep learning as described above is implemented.

[0072] The system also includes other components familiar to those skilled in the art, such as a communication bus and a communication interface, whose configuration and functions are known in the art and thus will not be described in detail here.

[0073] In the present invention, the aforementioned memory may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, apparatus or device. For example, a computer-readable storage medium may be any appropriate magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory RRAM (Resistive Random Access Memory), a dynamic random access memory DRAM (Dynamic Random Access Memory), a static random access memory SRAM (Static Random-Access Memory), an enhanced dynamic random access memory EDRAM (Enhanced Dynamic Random Access Memory), a high-bandwidth memory HBM (High-Bandwidth Memory), a hybrid memory cube HMC (Hybrid Memory Cube), etc., or any other medium that can be used to store the required information and can be accessed by an application, a module, or both. Any such computer storage medium may be part of a device or accessible or connectable to a device. Any application or module described in the present invention may be implemented using computer-readable / executable instructions that may be stored or otherwise maintained by such a computer-readable medium.

[0074] In the description of this specification, "plurality" or "several" means at least two, such as two, three or more, etc., unless otherwise clearly and specifically defined.

[0075] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, various alternatives to the embodiments of the present invention described herein may be employed.

Claims

1. A deep learning-based image recognition model training method, characterized in that: include: Selecting pre-training samples to pre-train the image recognition model, wherein the pre-training samples include one or more groups of accurately annotated label data in the training sample set; Calculate the multi-classification evaluation index of the pre-trained image recognition model corresponding to multiple classification targets, and set the acquisition probability of the corresponding classification target according to the multi-classification evaluation index, where the acquisition probability is negatively correlated with the size of the multi-classification evaluation index; The samples in the training sample set are tested using the pre-trained model to determine the loss value and predicted classification of the samples, the focus of the samples is determined according to the size of the loss value of the samples and the consistency between the predicted classification and the true classification, the selection probability of the samples is calculated according to the product of the acquisition probability of the classification target and the focus, and the samples are selected according to the selection probability to construct a sample pair, including: randomly selecting a sample as the first sample according to the selection probability, and determining the classification target corresponding to the first sample as the first classification target; calculating the difficulty of distinguishing the first classification target from other classification targets, wherein the difficulty of distinguishing is the probability value of the first classification target being predicted as other classification targets; selecting the classification target corresponding to the maximum value of the difficulty of distinguishing as the second classification target; randomly selecting a second sample according to the second classification target and the corresponding selection probability, and taking the first sample and the second sample as a sample pair; The comprehensive loss of the sample pairs is calculated, and the image recognition model is back-propagated and trained according to the comprehensive loss. The image recognition model is iteratively trained until the loss value converges.

2. The image recognition model training method based on deep learning according to claim 1, characterized in that: The multi-classification evaluation index is the F1 value, and the acquisition probability of the corresponding classification target is set according to the multi-classification evaluation index, including: Set a higher acquisition weight for the classification target with a low F1 value, and set a lower acquisition probability for the classification target with a high F1 value.

3. The image recognition model training method based on deep learning according to claim 2, characterized in that: The calculation formula for obtaining the probability is: ; In the formula, Indicates The probability of obtaining a classification target, Indicates The F1 value of the classification target.

4. The image recognition model training method based on deep learning according to claim 1, characterized in that: The focus of the sample is determined based on the size of the sample's loss value and the consistency between the predicted classification and the true classification, including: Compare the loss value of the sample with the set loss value threshold to obtain a comparison result; Determine the agreement between the predicted classification and the true classification; The focus of the sample is determined according to the comparison result and the consistency.

5. The image recognition model training method based on deep learning according to claim 4 is characterized in that: Determining the focus of the sample according to the comparison result and the consistency includes: In response to the loss value of the sample being less than the loss value threshold and the predicted classification being consistent with the true classification, the focus of the sample is recorded as 0; In response to the loss value of the sample being greater than the loss value threshold and the predicted classification being inconsistent with the true classification, the focus of the sample is recorded as 0; In response to the loss value of the sample being greater than the loss value threshold and the predicted classification being consistent with the true classification, the focus of the sample is recorded as 1; In response to the loss value of the sample being less than the loss value threshold and the predicted classification being inconsistent with the true classification, the focus of the sample is recorded as 1.

6. The image recognition model training method based on deep learning according to claim 1, characterized in that: Calculate the comprehensive loss of sample pairs, including: Input the sample pair into the image recognition model to obtain the cross entropy loss value of the first sample, the cross entropy loss value of the second sample, and the binary contrast loss of the two samples; The cross entropy loss value of the first sample, the cross entropy loss value of the second sample, and the sum of the binary contrast losses of the two samples are calculated as the comprehensive loss.

7. The image recognition model training method based on deep learning according to claim 6, characterized in that: The calculation formula for comprehensive loss is: ; In the formula, is comprehensive loss; is the cross entropy loss value of the first sample; The cross entropy loss value of the second sample; It is the maximum value operation; is the set similarity threshold; is the Euclidean distance between two classification targets in a sample pair.

8. The image recognition model training method based on deep learning according to claim 1, characterized in that: Iteratively train the image recognition model until the loss value converges, including: After each set number of training times, the probability of obtaining the classification target, the probability of selecting samples, the focus of the samples are updated, the constructed sample pairs are updated, and iterative training is performed.

9. A deep learning-based image recognition model training system, characterized in that: It includes a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, an image recognition model training method based on deep learning according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Method and device for training image recognition model

    CN112036509A

  • Small sample and zero sample image classification method based on metric learning and meta-learning

    CN109961089A

  • Recommendation system neural network training method and device based on feature enhancement

    CN111414539A

  • Target recognition model training method and device and electronic equipment

    CN112990432A

  • Image processing model training method and device, storage medium and electronic equipment

    CN114330744A