A training method, apparatus, computer equipment, and medium for an image classification model.

By dynamically adjusting the loss parameters and the number of iterations during the iterative training of the image classification model, the problem of low accuracy of image classification models on imbalanced noisy image datasets is solved, and higher classification accuracy is achieved.

CN116630677BActive Publication Date: 2025-10-28SHENZHEN INTELLIFUSION TECHNOLOGIES CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211710460.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-29
Publication Date
2025-10-28
Estimated Expiration
2042-12-29

AI Technical Summary

Technical Problem

Existing image classification models have low classification accuracy when faced with imbalanced and noisy image datasets.

Method used

The image classification model is iteratively trained by acquiring the images to be classified and their class labels from the training set until a well-trained image classification model is obtained that meets the preset training conditions. During the iterative training process, the class probability prediction vector is determined and dynamically adjusted according to the number of iterations and the loss adjustment parameters to improve the reliability and accuracy of the model's total loss.

Benefits of technology

It improves the classification accuracy of image classification models on imbalanced noisy image datasets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116630677B_ABST
    Figure CN116630677B_ABST
Patent Text Reader

Abstract

This invention relates to the field of image classification technology, and more particularly to a training method, apparatus, computer device, and medium for an image classification model. The method acquires images to be classified and their category labels from a training set; obtains a category probability estimation vector for the images to be classified based on an image classification model; determines a category probability prediction vector; calculates a first model loss based on the category probability estimation vector and category labels; determines a loss adjustment parameter based on the number of iterations and a first mapping relationship between the number of iterations and the loss adjustment parameter; calculates a second model loss based on the category probability estimation vector, the category probability prediction vector, and the loss adjustment parameter; calculates the total model loss based on the first and second model losses; repeatedly iterates and trains the image classification model; and dynamically adjusts the second model loss using the loss adjustment parameter, thereby improving the reliability and accuracy of the second model loss and ultimately improving the accuracy of the image classification model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image classification technology, and in particular to a training method, apparatus, computer equipment, and medium for an image classification model. Background Technology

[0002] In recent years, machine learning algorithms, represented by deep learning, have achieved remarkable success in image classification, relying on pre-collected, high-quality, and large-scale supervised image datasets. However, image datasets in real-world applications are often of varying quality, with the most typical problem being label noise, i.e., incorrect image labeling. Deep learning techniques, despite their strong fitting capabilities, often exhibit significant overfitting issues when learning classification models from such low-quality labeled data, failing to achieve good generalization performance on test data.

[0003] Data selection and label correction are the most frequently used key techniques for handling such problems. Data selection techniques primarily assess the image quality within the data to selectively choose images or to varying degrees suppress / amplify their role in training. Label correction techniques require identifying image samples with incorrect labels, correcting their labels, and reusing them in training. In recent years, various data sample selection and label correction methods with different approaches have emerged. However, most of these methods are only suitable for cases where image data is evenly distributed. When faced with imbalanced image data, the classification accuracy of image classification models is low.

[0004] Therefore, how to improve the classification accuracy of image classification models on imbalanced noisy image datasets has become an urgent problem to be solved. Summary of the Invention

[0005] In view of this, embodiments of the present invention provide a training method, apparatus, computer device and medium for an image classification model, in order to solve the problem that the classification accuracy of existing image classification model training methods is low when facing imbalanced noisy image datasets.

[0006] In a first aspect, embodiments of the present invention provide a method for training an image classification model, the method comprising:

[0007] Obtain the images to be classified in the training set and the category label of each image to be classified, initialize the number of iterations, iteratively train the image classification model, and obtain the trained image classification model.

[0008] The iterative training process includes:

[0009] The image to be classified is input into the image classification model to obtain the category probability estimation vector of the image to be classified.

[0010] Determine the class probability prediction vector for this iteration of training;

[0011] The first model loss is calculated based on the category probability estimation vector and the corresponding category label;

[0012] Based on the number of iterations and the first mapping relationship between the number of iterations and the loss adjustment parameter, the loss adjustment parameter for this iteration of training is determined, and the second model loss is calculated based on the class probability estimation vector, the class probability prediction vector and the loss adjustment parameter.

[0013] The total model loss of the image classification model is calculated based on the first model loss and the second model loss, and the image classification model is trained based on the total model loss.

[0014] Update the iteration count and repeat the iterative training process until the preset convergence condition is met.

[0015] Optionally, determining the category probability prediction vector for this iteration of training includes:

[0016] The vector adjustment parameters are determined based on the number of iterations and the second mapping relationship between the number of iterations and the vector adjustment parameters;

[0017] For the first iteration of training, the class probability prediction vector for this iteration is obtained based on the class probability estimation vector, the preset class probability vector, and the vector adjustment parameters.

[0018] For the k-th iteration of training, k = 2, 3, ..., the class probability prediction vector for the k-th iteration is obtained based on the class probability estimation vector, the class probability prediction vector determined in the (k-1)-th iteration of training, and the vector adjustment parameters.

[0019] Optionally, the vector adjustment parameters include a first vector adjustment parameter and a second vector adjustment parameter, and the second mapping relationship includes a first vector adjustment parameter mapping function and a second vector adjustment parameter mapping function;

[0020] The step of determining the vector adjustment parameter based on the number of iterations and the second mapping relationship between the number of iterations and the vector adjustment parameter includes:

[0021] Determine a first vector adjustment parameter mapping function between the number of iterations and the first vector adjustment parameter, and determine a second vector adjustment parameter mapping function between the number of iterations and the second vector adjustment parameter;

[0022] The number of iterations in the first vector adjustment parameter mapping function is linearly positively correlated with the first vector adjustment parameter, and the number of iterations in the second vector adjustment parameter mapping function is linearly negatively correlated with the second vector adjustment parameter.

[0023] Substitute the number of iterations into the first vector adjustment parameter mapping function to determine the first vector adjustment parameter;

[0024] Substitute the number of iterations into the second vector adjustment parameter mapping function to determine the second vector adjustment parameter.

[0025] Secondly, embodiments of the present invention provide a training apparatus for an image classification model, the training apparatus for the image classification model comprising:

[0026] The model training module is used to obtain the images to be classified in the training set and the category label of each image to be classified, initialize the number of iterations, iteratively train the image classification model, and repeat the following iterative training module until the preset convergence condition is met to obtain the trained image classification model.

[0027] The iterative training module includes:

[0028] The vector estimation submodule is used to input the image to be classified into the image classification model to obtain the category probability estimation vector of the image to be classified.

[0029] The vector prediction submodule is used to determine the class probability prediction vector for this iteration of training;

[0030] The first loss calculation submodule is used to calculate the first model loss based on the category probability estimation vector and the corresponding category label;

[0031] The second loss calculation submodule is used to determine the loss adjustment parameter for the current iteration training based on the number of iterations and the first mapping relationship between the number of iterations and the loss adjustment parameter, and to calculate the second model loss based on the class probability estimation vector, the class probability prediction vector and the loss adjustment parameter.

[0032] A model training sub-model is used to calculate the total model loss of the image classification model based on the first model loss and the second model loss, and to train the image classification model based on the total model loss;

[0033] The iteration count update submodule is used to update the iteration count.

[0034] Optionally, the vector prediction submodule includes:

[0035] The vector adjustment parameter determination unit is used to determine the vector adjustment parameter based on the number of iterations and the second mapping relationship between the number of iterations and the vector adjustment parameter;

[0036] The first vector prediction unit is used to obtain the class probability prediction vector for the current iteration based on the class probability estimation vector, the preset class probability vector, and the vector adjustment parameters for the first iteration of training.

[0037] The second vector prediction unit is used to obtain the class probability prediction vector for the kth iteration, starting from the kth iteration training (k = 2, 3, ...), based on the class probability estimation vector, the class probability prediction vector determined in the (k-1)th iteration training, and the vector adjustment parameters.

[0038] Optionally, the vector adjustment parameters include a first vector adjustment parameter and a second vector adjustment parameter, the second mapping relationship includes a first vector adjustment parameter mapping function and a second vector adjustment parameter mapping function, and the vector adjustment parameter determining unit includes:

[0039] The vector adjustment parameter determination subunit is used to determine a first vector adjustment parameter mapping function between the number of iterations and the first vector adjustment parameter, and to determine a second vector adjustment parameter mapping function between the number of iterations and the second vector adjustment parameter;

[0040] The correlation determination subunit is used to determine that the number of iterations in the first vector adjustment parameter mapping function is linearly positively correlated with the first vector adjustment parameter, and the number of iterations in the second vector adjustment parameter mapping function is linearly negatively correlated with the second vector adjustment parameter.

[0041] The first vector adjustment parameter determination subunit is used to substitute the number of iterations into the first vector adjustment parameter mapping function to determine the first vector adjustment parameter;

[0042] The second vector adjustment parameter determination subunit is used to substitute the number of iterations into the second vector adjustment parameter mapping function to determine the second vector adjustment parameter.

[0043] Thirdly, embodiments of the present invention provide a computer device, the computer device including a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the training method of the image classification model as described in the first aspect.

[0044] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the training method for the image classification model as described in the first aspect.

[0045] The beneficial effects of Embodiment 1 of this invention compared with the prior art are as follows: By acquiring the images to be classified in the training set and the category labels of each image to be classified, the number of iterations is initialized, and the image classification model is iteratively trained. The iterative training process is repeated until the iterative training meets the preset training conditions, and a trained image classification model is obtained. Specifically, the images to be classified are input into the image classification model to obtain the category probability estimation vector of the images to be classified, and the category probability prediction vector for this iteration is determined. Then, the first model loss is calculated based on the category probability estimation vector and the corresponding category label. The loss adjustment parameter for this iteration is determined based on the number of iterations and the first mapping relationship between the number of iterations and the loss adjustment parameter. The second model loss is calculated based on the category probability estimation vector, the category probability prediction vector, and the loss adjustment parameter. The second model loss is dynamically adjusted through the loss adjustment parameter, which improves the reliability and accuracy of the second model loss. The total model loss of the image classification model is calculated based on the first model loss and the second model loss. The image classification model is trained based on the total model loss, and the number of iterations is updated, which improves the reliability of iterative training of the image classification model and thus improves the accuracy of the image classification model.

[0046] The beneficial effects of Embodiment 2 of the present invention compared with the prior art are as follows: when the iterative training of the image classification model reaches the preset conditions, the entropy of each image to be classified is calculated. Based on the category label of the image to be classified and the entropy of the image to be classified, the image to be classified is divided into clean sample images and noisy sample images. The category label of the noisy sample images is updated with random values. The corrected category label is determined based on the category label of the clean sample images and the updated category label of the noisy sample images. Then, the image classification model is iteratively trained based on the corrected category label. By improving the symmetry of the category labels of the training set, the training effect of the image classification model is improved, thereby improving the accuracy of the image classification model. Attached Figure Description

[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0048] Figure 1 This is a schematic diagram of an application environment for a training method for an image classification model provided in Embodiment 1 of the present invention;

[0049] Figure 2This is a flowchart illustrating the iterative training process in the training method of an image classification model provided in Embodiment 1 of the present invention.

[0050] Figure 3 This is a flowchart illustrating a training method for an image classification model provided in Embodiment 2 of the present invention;

[0051] Figure 4 This is a schematic diagram of the iterative training module in a training device for an image classification model provided in Embodiment 4 of the present invention;

[0052] Figure 5 This is a schematic diagram of the structure of a computer device provided in Embodiment 5 of the present invention. Detailed Implementation

[0053] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of the invention. However, those skilled in the art will understand that the invention can be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods are omitted so as not to obscure the description of the invention with unnecessary detail.

[0054] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.

[0055] It should also be understood that the term “and / or” as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0056] As used in this specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if [described condition or event] is detected" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once [described condition or event] is detected," or "in response to detection of [described condition or event]."

[0057] Furthermore, in the description of this invention and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0058] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of the invention include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0059] The embodiments of this invention can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that utilize digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.

[0060] Foundational technologies in artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.

[0061] It should be understood that the sequence number of each step in the following embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0062] To illustrate the technical solution of the present invention, specific embodiments are described below.

[0063] The image classification model training method provided in Embodiment 1 of this invention can be applied to, for example... Figure 1In this application environment, the client communicates with the server. The client includes, but is not limited to, handheld computers, desktop computers, laptops, ultra-mobile personal computers (UMPCs), netbooks, cloud computing devices, and personal digital assistants (PDAs). The server can be a standalone server or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0064] Embodiment 1 of the present invention provides a training method for an image classification model, which can be applied to... Figure 1 For clients using this model, the training method for the image classification model may include the following steps:

[0065] Step S21: Obtain the images to be classified in the training set and the category label of each image to be classified, initialize the number of iterations, iteratively train the image classification model, repeat the following iterative training process until the iterative training meets the preset training conditions, and obtain the trained image classification model.

[0066] In this training set, each image to be classified corresponds to a category label, which indicates the preset category to which the image belongs. However, in actual image classification tasks, the training set contains label noise—that is, category labels that do not match the actual category of the corresponding image. This causes existing image classification models to suffer from low accuracy when trained on low-quality training sets due to the influence of these noisy labels.

[0067] In this embodiment, images to be classified from the training set with label noise are obtained as training samples, and the category label of each image to be classified is obtained. The image classification model is iteratively trained. After initializing the number of iterations, the iterative training process is repeated until the iterative training meets the preset training conditions, and a trained image classification model is obtained.

[0068] In the training process of the image classification model, the number of iterations can be initialized to zero to facilitate the statistical counting of training iterations. Preset training conditions can be either reaching the target number of iterations or the convergence of the total loss of the image classification model, meaning that further iterative training can no longer improve the accuracy of the image classification model, at which point training is stopped, and the trained image classification model is obtained.

[0069] In this embodiment, the image classification task can be in scenarios such as gait analysis, video surveillance, and sports science, classifying human postures in images to be classified. Correspondingly, the category labels are various human posture categories such as stationary, walking, running, squatting, and jumping, and the image classification model is a human posture classification model. Alternatively, it can be in scenarios such as product audience analysis and population aging analysis, classifying facial attributes in images to be classified. Correspondingly, the category labels are various facial attribute categories such as male, female, child, youth, middle-aged, and elderly, and the image classification model is a facial attribute classification model. Alternatively, it can be in scenarios such as teaching evaluation, product sales, and personnel interviews, classifying human emotions in images to be classified. Correspondingly, the category labels are various human emotions such as happy, nervous, sad, disgusted, and bored, and the image classification model is a human emotion classification model. Alternatively, it can be in scenarios such as renting, decorating, and buying a house, classifying room styles in images to be classified. Correspondingly, the category labels are various room styles such as pastoral, minimalist, classical, new Chinese, Mediterranean, and Southeast Asian, and the image classification model is a room style classification model.

[0070] This embodiment takes the classification of human poses in images as an example. The images to be classified in the training set include human pose images of various postures, and the category labels are various human pose categories such as stationary, walking, running, squatting, and jumping. Since it is difficult to avoid labeling errors when annotating the category labels, some human pose images will be labeled as incorrect human pose categories, making the training set in this embodiment a noisy human pose image dataset.

[0071] When training the human pose classification model, human pose images from a noisy human pose image dataset are used as training samples, and the category label of each human pose image is obtained. The human pose classification model is iteratively trained. After initializing the number of iterations, the iterative training process is repeated until the iterative training meets the preset training conditions, and a well-trained human pose classification model is obtained.

[0072] The steps described above—obtaining the images to be classified in the training set and the category label of each image, initializing the number of iterations, iteratively training the image classification model, repeating the iterative training process until the iterative training meets the preset training conditions, and obtaining a trained image classification model—improv the accuracy of the image classification model by iteratively training the image classification model using the images to be classified in the training set and their category labels until the iterative training meets the preset training conditions.

[0073] See Figure 2This is a flowchart illustrating the iterative training process in an image classification model training method according to Embodiment 1 of the present invention. The iterative training process S22 of the image classification model training method includes:

[0074] Step S221: Input the image to be classified into the image classification model to obtain the category probability estimation vector of the image to be classified.

[0075] The image classification model can extract and analyze features from the input image to be classified to obtain the category probability estimation vector of the image to be classified. This category probability estimation vector is composed of the probability that the image to be classified belongs to each preset category.

[0076] In this embodiment, the number of images to be classified is denoted as N, the number of preset categories is denoted as S, the preset target number of iterations is denoted as M, and the probability that the i-th (i=1,2,...,N) image to be classified belongs to the s-th (k=1,2,...,S) preset category in the k-th (k=1,2,...,M)-th iteration of training is denoted as... Then, in the k-th iteration of training, the probability estimate vector of the i-th image to be classified is composed of the probabilities of the image belonging to each preset category, which can be denoted as:

[0077] This embodiment takes the classification of human poses in the image to be classified as an example. The human pose image is input into the human pose classification model to obtain the category probability estimation vector of the human pose image. The category probability estimation vector is composed of the probability that the human pose image belongs to each human pose category.

[0078] The above steps involve inputting the image to be classified into the image classification model to obtain the probability estimation vector of the image category. Through feature extraction and feature analysis of the image to be classified by the image classification model, a probability estimation vector representing the probability that the image to be classified belongs to each preset category is obtained, which can be used as the training basis for the image classification model.

[0079] Step S222: Determine the class probability prediction vector for this iteration of training.

[0080] In the iterative training process, in addition to obtaining the class probability estimation vector of the image to be classified in the current iteration, this embodiment also determines the class probability prediction vector of the current iteration. This class probability prediction vector is fused with the class probability estimation vectors of the current iteration and all previous iterations to memorize the class probability estimation vectors of all iterations, so as to improve the accuracy of the image classification model.

[0081] Since the iterative training process can analyze and learn the images to be classified and their category labels, optimize the parameters of the image classification model, and improve the accuracy of the image classification model, the reliability of the image classification model is low in the early stage of iterative training. As the number of iterations increases, the reliability of the image classification model gradually increases.

[0082] Therefore, in this embodiment, the class probability prediction vector is determined by fusing the class probability estimation vectors of the current iteration training and all previous iteration training. As the number of iterations increases, the proportion of the fused class probability estimation vectors of the current iteration training gradually increases, while the proportion of the fused class probability estimation vectors of all previous iteration training gradually decreases, thus obtaining a class probability prediction vector with high reliability and accuracy.

[0083] This embodiment takes the classification of human pose in the image to be classified as an example. During the iterative training process, as the number of iterations increases, the fusion ratio of the class probability estimation vector of the current iteration gradually increases, while the fusion ratio of the class probability estimation vector of all previous iterations gradually decreases. The class probability estimation vectors of the current iteration and all previous iterations are fused together based on the fusion ratio to determine the class probability prediction vector, which is used to memorize the class probability estimation vectors of all iterations to improve the accuracy of the human pose classification model.

[0084] Optionally, the class probability prediction vector for this iteration of training includes:

[0085] The vector adjustment parameters are determined based on the number of iterations and the second mapping relationship between the number of iterations and the vector adjustment parameters;

[0086] For the first iteration of training, the class probability prediction vector for this iteration is obtained based on the class probability estimation vector, the preset class probability vector, and the vector adjustment parameters.

[0087] For the k-th iteration of training, k = 2, 3, ..., the class probability prediction vector for the k-th iteration is obtained based on the class probability estimation vector, the class probability prediction vector determined in the (k-1)-th iteration of training, and the vector adjustment parameters.

[0088] The category probability prediction vector includes two parts: the category probability estimation vector of the current training iteration and the category probability estimation vectors of all previous training iterations. When the current training iteration is the first training iteration, only the category probability estimation vector of the first training iteration is obtained. Therefore, in order to facilitate the unified calculation of the category probability prediction vector, this embodiment sets a preset category probability vector as the category probability estimation vector of all previous training iterations for calculation.

[0089] In one embodiment, in order not to affect the calculation result of the category probability estimation vector, the preset category probability vector can be set as a zero vector.

[0090] In this embodiment, a vector adjustment parameter is set to calculate the class probability prediction vector of the current iteration training. The vector adjustment parameter includes a first vector adjustment parameter to characterize the fusion ratio of the class probability estimation vector of the current iteration training, and a second vector adjustment parameter to characterize the fusion ratio of the class probability estimation vectors of all previous iteration training.

[0091] Specifically, in this embodiment, a second mapping relationship between the number of iterations and the vector adjustment parameter is obtained. This second mapping relationship includes a linear positive correlation between the number of iterations and the first vector adjustment parameter, and a linear negative correlation between the number of iterations and the second vector adjustment parameter. The first vector adjustment parameter and the second vector adjustment parameter can then be determined based on the number of iterations and the second mapping relationship between the number of iterations and the vector adjustment parameter.

[0092] For the first iteration of training, the first vector adjustment parameter and the second vector adjustment parameter can be used as the fusion weights of the class probability estimation vector and the preset class probability vector in the first iteration of training, respectively. The class probability estimation vector and the preset class probability vector in the first iteration of training are fused to obtain the class probability prediction vector for this iteration.

[0093] For the k-th iteration training, k = 1, 2, ..., M, where M is the preset target number of iterations, since the class probability prediction vector of the (k-1)-th iteration training is obtained by fusing the class probability estimation vector of the (k-1)-th iteration training and the class probability estimation vectors of all iterations before the (k-1)-th iteration training, the first vector adjustment parameter and the second vector adjustment parameter can be used as the fusion weights of the class probability estimation vector in the k-th iteration training and the class probability prediction vector in the (k-1)-th iteration training, respectively. The class probability estimation vector in the k-th iteration training and the class probability prediction vector in the (k-1)-th iteration training are fused to obtain the class probability prediction vector in the k-th iteration training.

[0094] For example, let the preset class probability be P0, and let β be the first vector adjustment parameter in the k-th iteration of training. 1k Let β be the second vector adjustment parameter in the k-th iteration of training. 2k Then, the class probability prediction vector for the i-th image to be classified in the first iteration of training is:

[0095]

[0096] In the formula, T i1 Let β be the predicted class probability vector for the i-th image to be classified in the first iteration of training. 11 β is the first vector adjustment parameter in the first iteration of training. 21 The parameters for adjusting the second vector during the first iteration of training are as follows: P0 is the probability estimate vector for the i-th image to be classified in the first iteration of training, where P0 is the preset class probability.

[0097] Then, the class probability prediction vector for the i-th image to be classified in the k-th iteration of training is:

[0098]

[0099] In the formula, T i k Let β be the class probability prediction vector of the i-th image to be classified in the k-th iteration of training. 1k β is the first vector adjustment parameter in the k-th iteration of training. 2k This is the second vector adjustment parameter in the k-th iteration of training. T is the probability estimate vector for the i-th image to be classified in the k-th iteration of training. k-1 This is the class probability prediction vector for the i-th image to be classified during the (k-1)-th iteration of training.

[0100] This embodiment takes into account the relationship between the reliability of the image classification model and the number of iterations. By obtaining the second mapping relationship between the number of iterations and the vector adjustment parameters, the vector adjustment parameters are determined. These parameters are then used to fuse the class probability estimation vector from the current iteration training with the class probability estimation vectors from all previous iterations to obtain the class probability prediction vector, thereby improving the accuracy of the class probability prediction vector. Furthermore, considering the differences between the first iteration training and other iteration training, the class probability prediction vector is adaptively fused and calculated, further improving the reliability and accuracy of the class probability prediction vector.

[0101] Optionally, the vector adjustment parameters include a first vector adjustment parameter and a second vector adjustment parameter, and the second mapping relationship includes a first vector adjustment parameter mapping function and a second vector adjustment parameter mapping function;

[0102] Based on the number of iterations and the second mapping relationship between the number of iterations and the vector adjustment parameters, the vector adjustment parameters are determined as follows:

[0103] Determine a first vector adjustment parameter mapping function between the number of iterations and the first vector adjustment parameter, and determine a second vector adjustment parameter mapping function between the number of iterations and the second vector adjustment parameter;

[0104] The number of iterations in the first vector adjustment parameter mapping function is linearly positively correlated with the first vector adjustment parameter, and the number of iterations in the second vector adjustment parameter mapping function is linearly negatively correlated with the second vector adjustment parameter.

[0105] Substitute the number of iterations into the mapping function of the first vector adjustment parameter to determine the first vector adjustment parameter;

[0106] Substitute the number of iterations into the second vector adjustment parameter mapping function to determine the second vector adjustment parameter.

[0107] The number of iterations is linearly positively correlated with the first vector adjustment parameter, and the number of iterations is an integer in the range [1, M], where M is the preset target number of iterations. The range of the first vector adjustment parameter and the second vector adjustment parameter [x1, x2] can be set according to the actual situation. For example, the range of the first vector adjustment parameter and the second vector adjustment parameter can be set to [0.1, 0.9] according to the actual situation.

[0108] The first vector adjustment parameter mapping function is:

[0109]

[0110] In the formula, β 1k Let x1 be the lower limit of the first vector adjustment parameter in the k-th iteration of training, x2 be the upper limit of the first vector adjustment parameter, M be the preset target iteration number, and k be the iteration number.

[0111] The second vector adjustment parameter mapping function is:

[0112]

[0113] In the formula, β 2k x1 is the lower limit of the first vector adjustment parameter in the k-th iteration of training, x2 is the upper limit of the first vector adjustment parameter, M is the preset target iteration number, and k is the iteration number.

[0114] Substituting the number of iterations into the first vector adjustment parameter mapping function determines the first vector adjustment parameter, and substituting the number of iterations into the second vector adjustment parameter mapping function determines the second vector adjustment parameter, thus determining the vector adjustment parameter.

[0115] This embodiment takes into account the relationship between the reliability of the image classification model and the number of iterations, and obtains a second mapping function between the number of iterations and the vector adjustment parameters. By substituting the number of iterations into the second mapping function, the vector adjustment parameters are determined, and the second mapping function can be set according to the actual situation, which improves the convenience and practicality of vector adjustment parameter calculation.

[0116] The steps described above for determining the category probability prediction vector for this iteration of training involve fusing the category probability estimation vectors from this iteration and all previous iterations to determine the category probability prediction vector. Furthermore, considering the relationship between the reliability of the image classification model and the number of iterations, the fusion ratio of the category probability estimation vector from this iteration and the fusion ratio of the category probability estimation vectors from all previous iterations are adaptively adjusted, thereby improving the reliability and accuracy of the category probability prediction vector.

[0117] Step S223: Calculate the first model loss based on the category probability estimation vector and the corresponding category label.

[0118] Here, the category label is used to represent the preset category to which the corresponding image to be classified belongs, and the category probability estimation vector is used to represent the probability that the corresponding image to be classified belongs to each preset category. The accuracy of the image classification model in this iteration of training can be characterized by measuring the similarity between the category probability estimation vector and the corresponding category label.

[0119] Correspondingly, the greater the similarity between the category probability estimation vector and the corresponding category label, the smaller the loss of the first model.

[0120] This embodiment takes the classification of human poses in the image to be classified as an example. The accuracy of the human pose classification model in this iteration of training is characterized by measuring the similarity between the category probability estimation vector and the corresponding category label.

[0121] Optionally, the first model loss is calculated based on the class probability estimation vector and the corresponding class label, including:

[0122] Determine the corresponding category label vector based on the category label;

[0123] Calculate the cross-entropy between the class probability estimate vector and the corresponding class label vector for each image to be classified;

[0124] Calculate the mean of the cross-entropy of all images to be classified, and determine the mean of the cross-entropy as the first model loss.

[0125] To facilitate similarity calculation, the following steps are taken: First, the corresponding category label vector is determined based on the category labels. Then, the cross-entropy between the category probability estimate vector and the corresponding category label vector of each image to be classified is calculated. This cross-entropy measures the similarity between the two vectors; conversely, the smaller the cross-entropy, the greater the similarity between the two vectors. Finally, the mean of the cross-entropy for all images to be classified is calculated, and this mean is used as the first model loss to characterize the accuracy of the image classification model.

[0126] For example, when the category label determines that the image to be classified belongs to the s-th preset category, the category label vector corresponding to the ith image to be classified can be denoted as Y. i = (0, ..., 1, ..., 0), where Y i The element at position s has a value of y. is =1, and the value of the element at other positions is 0.

[0127] Then, calculate the class probability estimate vector of the i-th image to be classified in the k-th iteration of training. and category label vector Y i The cross-entropy between them is:

[0128]

[0129] In the formula, This is the class probability estimation vector for the i-th image to be classified during the k-th iteration of training. and category label vector Y i The cross-entropy between them, where S is the number of preset categories, and y is the number of categories. is Y is the category label vector corresponding to the i-th image to be classified. i The value of the element at the s-th position in the array. This is the class probability estimation vector corresponding to the i-th image to be classified in the k-th iteration of training. The value of the element at the s-th position in the array.

[0130] Then the class probability estimation vector of the i-th image to be classified in the k-th iteration of training. and category label vector Y i The smaller the cross-entropy, the greater the similarity between the class probability estimation vector of the i-th image to be classified and its corresponding class label in the k-th iteration of training.

[0131] Then, the mean of the cross-entropy between the class probability estimation vector and the class label vector of the N images to be classified in the k-th iteration of training is calculated, and the first model loss of the image classification model in the k-th iteration of training is obtained as follows:

[0132]

[0133] In the formula, Let l be the loss of the first model in the k-th iteration of training, N be the number of images to be classified, and l be the loss of the first model. i This is the class probability estimation vector for the i-th image to be classified during the k-th iteration of training. and category label vector Y i Cross-entropy between them.

[0134] This embodiment measures the similarity between the class probability estimation vector and the class label of each image to be classified by calculating the cross entropy between the class probability estimation vector and the class label vector of each image to be classified. The first model loss is calculated based on the similarity between the class probability estimation vector and the class label of all images to be classified, thereby improving the reliability and accuracy of the first model loss.

[0135] The steps described above for calculating the first model loss based on the category probability estimation vector and the corresponding category label measure the classification accuracy of the image classification model by the similarity between the category probability estimation vector and the corresponding category label, thereby improving the classification accuracy of the image classification model.

[0136] Step S224: Determine the loss adjustment parameter for this iteration training based on the number of iterations and the first mapping relationship between the number of iterations and the loss adjustment parameter, and calculate the second model loss based on the class probability estimation vector, the class probability prediction vector and the loss adjustment parameter.

[0137] In this embodiment, due to the presence of label noise in the training set, the deep neural network first fits the image to be classified with the correct label in the early learning stage and memorizes the incorrect labels. The class probability prediction vector obtained in this embodiment integrates the memory information from all iterative training processes.

[0138] Therefore, in this embodiment, a regularization term is preset to perform regularization calculation on the category probability prediction vector and the category probability estimation vector to obtain the second model loss for training the image classification model. This is used to reduce the image classification model's memory of incorrect labels and improve the accuracy of the image classification model.

[0139] Furthermore, during iterative training, as the number of iterations increases, the reliability of the image classification model gradually increases, while the first model loss gradually decreases. The first model loss is calculated based on cross-entropy. Due to the inherent properties of logarithms, the first model loss suffers from a gradient problem. As the number of iterations increases, this gradient problem becomes increasingly severe, leading to a gradual decrease in the accuracy of the first model loss.

[0140] Therefore, in order to improve the reliability and accuracy of the total model loss, this embodiment sets the proportion of the first model loss in the total model loss to decrease, while the proportion of the second model loss in the total model loss increases.

[0141] Specifically, this embodiment obtains the first mapping relationship between the number of iterations and the loss adjustment parameter, and determines the loss adjustment parameter based on the number of iterations and the first mapping relationship. Then, it performs regularization calculation on the category probability estimation vector and the category probability prediction vector, and determines the second model loss in combination with the loss adjustment parameter. As the number of iterations increases, the proportion of the second model loss in the total model loss gradually increases, while reducing the image classification model's memory of incorrect labels and improving the reliability and accuracy of the second model loss.

[0142] This embodiment takes the classification of human pose in images to be classified as an example. During the iterative training process, the first mapping relationship between the number of iterations and the loss adjustment parameter is obtained. The loss adjustment parameter is determined based on the number of iterations and the first mapping relationship. Then, the class probability estimation vector and the class probability prediction vector are regularized and calculated. Combined with the loss adjustment parameter, the second model loss is determined so that as the number of iterations increases, the proportion of the second model loss in the total model loss gradually increases. At the same time, the human pose classification model's memory of incorrect labels is reduced, and the reliability and accuracy of the second model loss are improved.

[0143] Optionally, the loss adjustment parameters are determined based on the number of iterations and a first mapping relationship between the number of iterations and the loss adjustment parameters, including:

[0144] The number of iterations is linearly positively correlated with the loss adjustment parameter, and the first mapping function between the number of iterations and the loss adjustment parameter is determined.

[0145] Substitute the number of iterations into the first mapping function to determine the loss adjustment parameter.

[0146] The first mapping relationship between the number of iterations and the loss adjustment parameter is a linear positive correlation. The number of iterations is an integer in the range [1, M], where M is the preset target number of iterations. The range of the loss adjustment parameter [z1, z2] can be set according to the actual situation. For example, the range of the loss adjustment parameter can be set to [1, 10] according to the actual situation.

[0147] In this embodiment, the first mapping function between the number of iterations and the loss adjustment parameter is:

[0148]

[0149] In the formula, λ kZ is the loss adjustment parameter in the k-th iteration of training, z1 is the lower limit of the first vector adjustment parameter, z2 is the upper limit of the first vector adjustment parameter, M is the preset target iteration number, and k is the iteration number.

[0150] Substituting the number of iterations into the first mapping function will determine the loss adjustment parameter.

[0151] This embodiment takes into account that regularization can reduce the image classification model's memory of incorrect labels, and that the gradient problem in the first model loss becomes more and more serious as the number of iterations increases. It determines the linear positive correlation between the loss adjustment parameter and the number of iterations, and then obtains the corresponding first mapping function. By substituting the number of iterations into the first mapping function to determine the loss adjustment parameter, the reliability and accuracy of the loss adjustment parameter are improved.

[0152] Optionally, the second model loss is calculated based on the class probability estimation vector, the class probability prediction vector, and the loss adjustment parameters, including:

[0153] Calculate the inner product between the estimated class probability vector and the predicted class probability vector for each image to be classified, calculate the difference between the inner product and the preset value, take the logarithm of the difference, and obtain the sub-loss for each image to be classified.

[0154] Calculate the mean of the sub-losses for all images to be classified, and then calculate the second model loss based on the loss adjustment parameter and the mean of the sub-losses.

[0155] The inner product between vectors can measure the similarity between two vectors. In this embodiment, the inner product between the estimated category probability vector and the predicted category probability vector of each image to be classified is calculated. The larger the inner product, the greater the similarity between the estimated category probability vector and the predicted category probability vector of the corresponding image to be classified.

[0156] Then, the difference between the inner product and the preset value is calculated. In this embodiment, since the sum of the element values ​​of the category probability estimation vector and the sum of the element values ​​of the category probability prediction vector are both 1, the inner product between the category probability estimation vector and the category probability prediction vector of each image to be classified is less than 1. Therefore, the preset value is set to α = 1. Correspondingly, the calculated difference is in the range of [0, 1].

[0157] Then, the logarithm of the difference is taken to obtain the sub-loss for each image to be classified. Correspondingly, the smaller the sub-loss, the greater the similarity between the estimated class probability vector and the predicted class probability vector of the corresponding image. The mean of the sub-losses for all images to be classified is calculated, and the loss adjustment parameter is used as the adjustment parameter for the mean of the sub-losses to calculate the second model loss.

[0158] For example, to obtain the loss adjustment parameter λ in the k-th iteration of training. k Then, based on the class probability estimation vector, class probability prediction vector, and loss adjustment parameter λ... k The calculated loss for the second model is:

[0159]

[0160] In the formula, L2 is the second model loss in the k-th iteration of training, N is the number of images to be classified, and λ k This is the loss adjustment parameter in the k-th iteration of training. Let T be the class probability estimate vector of the i-th image to be classified in the k-th iteration of training. i k Let α be the category probability prediction vector of the i-th image to be classified in the k-th iteration of training, and let α be a preset value. In this embodiment, the preset value α = 1 is taken.

[0161] This embodiment measures the similarity between the estimated and predicted class probabilities of each image to be classified by calculating the inner product between the estimated and predicted class probabilities of each image and taking the logarithm of the difference between the inner product and a preset value. Then, the loss of the second model is dynamically adjusted by using the loss adjustment parameter as the adjustment parameter of the mean of the sub-losses of all images to be classified, thereby improving the reliability and accuracy of the second model loss.

[0162] The steps described above, which determine the loss adjustment parameter based on the number of iterations and the first mapping relationship between the number of iterations and the loss adjustment parameter, and calculate the second model loss based on the class probability estimation vector, class probability prediction vector, and loss adjustment parameter, take into account that regularization can reduce the image classification model's memory of incorrect labels, and that the gradient problem in the first model loss becomes more and more serious as the number of iterations increases. The first mapping relationship between the number of iterations and the loss adjustment parameter is obtained, improving the reliability and accuracy of the loss adjustment parameter. Simultaneously, the similarity between the class probability estimation vector and the class probability prediction vector of the image to be classified is measured, and the second model loss is dynamically adjusted through the loss adjustment parameter, further improving the reliability and accuracy of the second model loss.

[0163] Step S225: Calculate the total model loss of the image classification model based on the first model loss and the second model loss, and train the image classification model based on the total model loss.

[0164] The first model loss and the second model loss can be used to measure the classification accuracy of the image classification model. The proportion of the second model loss in the total model loss is dynamically adjusted by the loss adjustment parameter. The sum of the first model loss and the second model loss is determined as the total model loss of the image classification model, and the image classification model is trained based on the total model loss.

[0165] The smaller the total loss of the model, the higher the classification accuracy of the image classification model. In this embodiment, the parameters of the image classification model are corrected according to the gradient descent method until the iterative training meets the preset training conditions, that is, the number of iterative training reaches the target number of iterations, or until the total loss of the model converges, and a well-trained image classification model is obtained.

[0166] This embodiment takes the classification of human pose in the image to be classified as an example. The proportion of the second model loss in the total model loss is dynamically adjusted by the loss adjustment parameter. The sum of the first model loss and the second model loss is determined as the total model loss of the human pose classification model. The parameters of the human pose classification model are corrected according to the gradient descent method until the iterative training meets the preset training conditions, that is, the number of iterations reaches the target number of iterations, or until the total model loss converges, and a well-trained human pose classification model is obtained.

[0167] The above steps, which calculate the total model loss of the image classification model based on the first model loss and the second model loss, and train the image classification model based on the total model loss, determine the sum of the first model loss and the second model loss as the total model loss of the image classification model to measure the classification accuracy of the image classification model. By training the image classification model with the total model loss, the classification accuracy of the image classification model is improved.

[0168] Step S226: Update the number of iterations and repeat the iterative training process until the preset convergence condition is met.

[0169] In this model, the class probability prediction vector of the image to be classified and the loss adjustment parameter are both related to the number of iterations. This makes the total loss of the model related to the number of iterations. After completing one iteration of training, the number of iterations is increased by one and the number of iterations is updated to ensure the reliability of iterative training of the image classification model. The iterative training process is repeated until the preset convergence condition is met to obtain a well-trained image classification model.

[0170] This embodiment takes the classification of human poses in the image to be classified as an example. During the training process of the human pose classification model, the number of iterations is updated and the iterative training process is repeated until the preset convergence condition is met, and a well-trained human pose classification model is obtained.

[0171] The steps described above for updating the number of iterations ensure the correlation between the total model loss and the number of iterations, thus improving the reliability of iterative training of image classification models.

[0172] This embodiment acquires the images to be classified in the training set and the category labels of each image, initializes the number of iterations, and iteratively trains the image classification model. This iterative training process is repeated until the preset training conditions are met, resulting in a trained image classification model. Specifically, the images to be classified are input into the image classification model to obtain the category probability estimation vector of the images and determine the category probability prediction vector for this iteration. Then, the first model loss is calculated based on the category probability estimation vector and the corresponding category label. The loss adjustment parameter for this iteration is determined based on the number of iterations and the first mapping relationship between the number of iterations and the loss adjustment parameter. The second model loss is calculated based on the category probability estimation vector, the category probability prediction vector, and the loss adjustment parameter. The second model loss is dynamically adjusted using the loss adjustment parameter, improving its reliability and accuracy. The total model loss of the image classification model is calculated based on the first and second model losses. The image classification model is trained based on this total model loss, and the number of iterations is updated, improving the reliability of the iterative training and thus increasing the accuracy of the image classification model.

[0173] See Figure 3 This is a flowchart illustrating a training method for an image classification model provided in Embodiment 2 of the present invention. In this training method, when the iterative training of the image classification model reaches a preset condition, the labels of the images to be classified in the training set are corrected, and the image classification model is iteratively trained with the corrected category labels to improve the classification accuracy of the image classification model on an imbalanced noisy image dataset.

[0174] Specifically, the training method for this image classification model may further include the following steps:

[0175] Step S31: When the iterative training of the image classification model reaches the preset conditions, calculate the entropy of each image to be classified, and divide the images to be classified into clean sample images and noisy sample images according to the category label of the image to be classified and the entropy of the image to be classified.

[0176] In this embodiment, the training set contains noisy labels, and the image classification model performs better under symmetrical noise. Therefore, this embodiment divides the image to be classified into clean sample images and noisy sample images, uses the noisy sample images as the label correction object, and corrects the asymmetric noise to symmetrical noise to improve the accuracy of the image classification model.

[0177] Since information entropy can measure the degree of uncertainty of an image to be classified, the greater the information entropy of the image to be classified, the greater the probability that the image to be classified is a noisy sample image. Therefore, in this embodiment, when the iterative training of the image classification model reaches the preset conditions, the entropy of each image to be classified is calculated to divide the image to be classified.

[0178] The preset condition can be that the number of iterations reaches the target number of iterations or the total model loss converges, at which point training stops, resulting in a trained image classification model. To further improve the accuracy of the image classification model, the entropy of each image to be classified is calculated, and images with the same category label are grouped together. The images in each group are then sorted according to their corresponding entropy values. Within each group, a preset proportion of images are selected in descending order of entropy and classified as noise sample images. The remaining images in each group are classified as clean sample images. This preset proportion can be set according to actual conditions; in this embodiment, it can be set to 20%.

[0179] This embodiment takes the classification of human poses in images to be classified as an example. When the iterative training of the human pose classification model reaches the preset conditions, the entropy of each human pose image is calculated. Based on the category label of the human pose image and the entropy of the human pose image, the human pose images are divided into clean human pose sample images and noisy human pose sample images.

[0180] The steps described above, which involve calculating the entropy of each image to be classified when the iterative training of the image classification model reaches the preset conditions, and dividing the image to be classified into clean sample images and noisy sample images based on the category label and entropy of the image to be classified, improve the accuracy of determining noisy sample images by calculating the entropy of the image to be classified and selecting a preset proportion of noisy sample images from the images to be classified with the same category label according to the magnitude of the entropy.

[0181] Step S32: Update the category label of the noisy sample image with a random value, and determine the corrected category label based on the category label of the clean sample image and the updated category label of the noisy sample image.

[0182] In order to improve the symmetry of the labels of the noise sample images, this embodiment updates the category labels of the noise sample images according to random values, so that the category labels of the noise sample images conform to the same data distribution.

[0183] Then, the class labels of the clean sample images and the updated class labels of the noisy sample images are determined as the corrected class labels, thereby improving the symmetry of the corrected class labels.

[0184] This embodiment takes the classification of human poses in images to be classified as an example. The category labels of noisy human pose sample images are updated according to random values ​​so that the category labels of noisy human pose sample images conform to the same data distribution. Then, the category labels of clean human pose sample images and the updated category labels of noisy human pose sample images are determined as the corrected category labels, thereby improving the symmetry of the corrected category labels.

[0185] The steps described above—updating the category label of the noisy sample image with random values ​​and determining the corrected category label based on the category label of the clean sample image and the updated category label of the noisy sample image—improve the symmetry of the corrected category label.

[0186] Step S32: Iteratively train the image classification model based on the corrected category labels.

[0187] Among them, the modified category labels have higher symmetry compared with the original category labels. Iterative training of the image classification model based on the modified category labels can further improve the training effect of the image classification model and improve the accuracy of the image classification model.

[0188] This embodiment takes the classification of human poses in images to be classified as an example. Based on the corrected category labels, the human pose classification model is iteratively trained to further improve the training effect of the human pose classification model and improve the accuracy of the human pose classification model.

[0189] The process of iteratively training the image classification model is described in Example 1 and will not be repeated here.

[0190] The steps described above for iteratively training the image classification model based on the corrected category labels further improve the accuracy of the image classification model.

[0191] This embodiment calculates the entropy of each image to be classified when the iterative training of the image classification model reaches a preset condition. Based on the class label and entropy of the image to be classified, the image is divided into clean sample images and noisy sample images. The class label of the noisy sample images is updated with a random value. The corrected class label is determined based on the class label of the clean sample images and the updated class label of the noisy sample images. Then, the image classification model is iteratively trained based on the corrected class label. By improving the symmetry of the class labels in the training set, the training effect of the image classification model is improved, thereby improving the accuracy of the image classification model.

[0192] Embodiment 3 of the present invention provides an image classification method. This image classification method uses the image classification model trained in Embodiment 1 or Embodiment 2 of the present invention to classify images, and may include the following steps:

[0193] The system acquires the image to be classified in the image classification task, inputs the image to be classified into the trained image classification model, outputs the class probability estimation vector of the image to be classified, and determines the image class of the image to be classified based on the class probability estimation vector of the image to be classified.

[0194] The image categories can be set according to the actual image classification task. For example, in scenarios such as product audience analysis and population aging analysis, the image classification task is to classify the facial attributes of the images to be classified, and the image categories can be set to various facial attribute categories such as male, female, child, youth, middle-aged, and elderly. In scenarios such as gait analysis, video surveillance, and sports science, the image classification task is to classify the human posture of the images to be classified, and the image categories can be set to various human posture categories such as still, walking, running, squatting, and jumping. In scenarios such as teaching evaluation, product sales, and personnel interviews, the image classification task is to classify the emotions of the people in the images to be classified, and the image categories can be set to various emotions such as happy, nervous, sad, disgusted, and bored. In scenarios such as renting, decorating, and buying a house, the image classification task is to classify the room style of the images to be classified, and the image categories can be set to various room styles such as pastoral, minimalist, classical, new Chinese, Mediterranean, and Southeast Asian.

[0195] This embodiment takes the classification of human poses in an image as an example. After obtaining the human pose image to be classified, the human pose image is input into a trained human pose classification model for feature extraction and analysis. The model outputs a category probability estimation vector for the human pose image. This category probability estimation vector represents the probability that the corresponding human pose image belongs to each human pose category. The human pose category corresponding to the highest probability value in the category probability estimation vector can then be determined as the human pose category of the human pose image, thus completing the human pose classification task.

[0196] It is understood that in the specific embodiments of this application, data related to facial images, human body images, room images, etc. are involved. When the embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0197] This embodiment obtains the image classification model trained in Embodiment 1 or Embodiment 2 of the present invention, performs feature extraction and feature analysis on the image to be classified, outputs the category probability estimation vector of the image to be classified, determines the image category of the image to be classified, and improves the classification accuracy of the image to be classified.

[0198] Corresponding to the image classification model training method in the above embodiments, Embodiment 4 of the present invention provides an image classification model training device, which includes:

[0199] The model training module 41 is used to obtain the images to be classified in the training set and the category label of each image to be classified, initialize the number of iterations, and iteratively train the image classification model. The model training module is used to repeatedly execute the following iterative training module until the preset convergence condition is met, and obtain the trained image classification model.

[0200] See Figure 4 This is a structural block diagram of the iterative training module 42 in a training device for an image classification model provided in Embodiment 4 of the present invention. For ease of explanation, only the parts related to the embodiments of the present invention are shown. The iterative training module 42 includes:

[0201] The vector estimation submodule 421 is used to input the image to be classified into the image classification model to obtain the category probability estimation vector of the image to be classified.

[0202] Vector prediction submodule 422 is used to determine the class probability prediction vector for this iteration of training;

[0203] The first loss calculation submodule 423 is used to calculate the first model loss based on the category probability estimation vector and the corresponding category label;

[0204] The second loss calculation submodule 424 is used to determine the loss adjustment parameter for this iteration of training based on the number of iterations and the first mapping relationship between the number of iterations and the loss adjustment parameter, and to calculate the second model loss based on the class probability estimation vector, the class probability prediction vector and the loss adjustment parameter.

[0205] Model training sub-model 425 is used to calculate the total model loss of the image classification model based on the first model loss and the second model loss, and to train the image classification model based on the total model loss.

[0206] The iteration count update submodule 426 is used to update the iteration count.

[0207] Optionally, the above vector prediction submodule 422 includes:

[0208] The vector adjustment parameter determination unit is used to determine the vector adjustment parameter based on the number of iterations and the second mapping relationship between the number of iterations and the vector adjustment parameter;

[0209] The first vector prediction unit is used to obtain the class probability prediction vector for the current iteration based on the class probability estimation vector, the preset class probability vector, and the vector adjustment parameters for the first iteration of training.

[0210] The second vector prediction unit is used to obtain the class probability prediction vector for the kth iteration of training, k = 2, 3, ..., based on the class probability estimation vector, the class probability prediction vector determined in the (k-1)th iteration of training, and the vector adjustment parameters.

[0211] Optionally, the vector adjustment parameters include a first vector adjustment parameter and a second vector adjustment parameter, the second mapping relationship includes a first vector adjustment parameter mapping function and a second vector adjustment parameter mapping function, and the vector adjustment parameter determining unit includes:

[0212] The vector adjustment parameter determination subunit is used to determine a first vector adjustment parameter mapping function between the number of iterations and the first vector adjustment parameter, and to determine a second vector adjustment parameter mapping function between the number of iterations and the second vector adjustment parameter;

[0213] The correlation determination subunit is used to determine that the number of iterations in the first vector adjustment parameter mapping function is linearly positively correlated with the first vector adjustment parameter, and the number of iterations in the second vector adjustment parameter mapping function is linearly negatively correlated with the second vector adjustment parameter.

[0214] The first vector adjustment parameter determination subunit is used to substitute the number of iterations into the first vector adjustment parameter mapping function to determine the first vector adjustment parameter;

[0215] The second vector adjustment parameter determination subunit is used to substitute the number of iterations into the second vector adjustment parameter mapping function to determine the second vector adjustment parameter.

[0216] Optionally, the aforementioned first loss calculation submodule 423 includes:

[0217] The category label vector determination unit is used to determine the corresponding category label vector based on the category label.

[0218] The cross-entropy calculation unit is used to calculate the cross-entropy between the class probability estimation vector and the corresponding class label vector of each image to be classified.

[0219] The first loss calculation unit is used to calculate the mean of the cross-entropy of all images to be classified, and the mean of the cross-entropy is determined as the first model loss.

[0220] Optionally, the second loss calculation submodule 424 mentioned above includes:

[0221] The first mapping function determination unit is used to determine the linear positive correlation between the number of iterations and the loss adjustment parameter, and to determine the first mapping function between the number of iterations and the loss adjustment parameter.

[0222] The loss adjustment parameter determination unit is used to substitute the number of iterations into the first mapping function to determine the loss adjustment parameter.

[0223] Optionally, the second loss calculation submodule 424 mentioned above includes:

[0224] The sub-loss calculation unit is used to calculate the inner product between the class probability estimation vector and the class probability prediction vector of each image to be classified, calculate the difference between the inner product and the preset value, take the logarithm of the difference, and obtain the sub-loss of each image to be classified.

[0225] The second loss calculation unit is used to calculate the mean of the sub-losses of all images to be classified, and to calculate the second model loss based on the loss adjustment parameters and the mean of the sub-losses.

[0226] Optionally, the training device for the above image classification model also includes:

[0227] The image segmentation module is used to calculate the entropy of each image to be classified when the iterative training of the image classification model reaches the preset conditions, and to divide the image to be classified into clean sample images and noisy sample images according to the category label of the image to be classified and the entropy of the image to be classified.

[0228] The label correction module is used to update the category label of the noisy sample image with random values ​​and to determine the corrected category label based on the category label of the clean sample image and the updated category label of the noisy sample image.

[0229] The second iterative training module is used to iteratively train the image classification model based on the corrected category labels.

[0230] Figure 5 This is a schematic diagram of the structure of a computer device provided in Embodiment 5 of the present invention. Figure 5 As shown, the computer device of this embodiment includes: at least one processor ( Figure 5 Only one is shown in the diagram), a memory, and a computer program stored in the memory and capable of running on at least one processor, which, when executing the computer program, implements the steps in any of the above-described model training method embodiments.

[0231] This computer device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that... Figure 5 The examples of computer devices are merely examples and do not constitute a limitation on computer devices. Computer devices may include more or fewer components than shown in the illustration, or combinations of certain components, or different components, such as network interfaces, displays, and input devices.

[0232] The processor referred to can be a CPU, but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.

[0233] Memory includes readable storage media, internal memory, etc., wherein internal memory can be the RAM of a computer device, providing an environment for the operation of the operating system and computer-readable instructions stored in the readable storage media. The readable storage media can be the hard drive of a computer device, or in other embodiments, it can be an external storage device of the computer device, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, memory can include both internal storage units and external storage devices of a computer device. Memory is used to store the operating system, applications, bootloader, data, and other programs, such as program code for computer programs. Memory can also be used to temporarily store data that has been output or will be output.

[0234] Those skilled in the art will understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the functions described above can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this invention. The specific working process of the units and modules in the above device can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here. If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention can implement all or part of the processes in the methods of the above embodiments by instructing related hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the above method embodiments. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. A computer-readable medium can include at least: any entity or device capable of carrying computer program code, a recording medium, a computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.

[0235] The present invention can implement all or part of the processes in the methods of the above embodiments, or it can be accomplished by a computer program product. When the computer program product is run on a computer device, the computer device executes the steps in the above method embodiments.

[0236] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.

[0237] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0238] In the embodiments provided by this invention, it should be understood that the disclosed apparatus / computer devices and methods can be implemented in other ways. For example, the apparatus / computer device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0239] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0240] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. A training method for an image classification model, characterized in that, The training method for the image classification model includes: Obtain the images to be classified in the training set and the category label of each image to be classified, initialize the number of iterations, iteratively train the image classification model, and obtain the trained image classification model. The iterative training process includes: The image to be classified is input into the image classification model to obtain the category probability estimation vector of the image to be classified. Determine the class probability prediction vector for this training iteration, and fuse the class probability estimation vectors of this training iteration and all previous training iterations. The first model loss is calculated based on the category probability estimation vector and the corresponding category label; Based on the number of iterations and the first mapping relationship between the number of iterations and the loss adjustment parameter, the loss adjustment parameter for this iteration of training is determined, and the second model loss is calculated based on the class probability estimation vector, the class probability prediction vector and the loss adjustment parameter. The total model loss of the image classification model is calculated based on the first model loss and the second model loss, and the image classification model is trained based on the total model loss. Update the number of iterations and repeat the iterative training process until the preset convergence condition is met. The determination of the class probability prediction vector for this iteration of training includes: Based on the number of iterations and the second mapping relationship between the number of iterations and the vector adjustment parameter, the vector adjustment parameter is determined. The vector adjustment parameter includes a first vector adjustment parameter for characterizing the fusion ratio of the class probability estimation vectors in the current iteration training, and a second vector adjustment parameter for characterizing the fusion ratio of the class probability estimation vectors in all previous iteration training. For the first iteration of training, the class probability prediction vector for this iteration is obtained based on the class probability estimation vector, the preset class probability vector, and the vector adjustment parameters. The preset class probability vector is used as the class probability estimation vector for all previous iterations of training. For the k-th iteration of training, k=2,3,..., the class probability prediction vector for the k-th iteration is obtained based on the class probability estimation vector, the class probability prediction vector determined in the (k-1)-th iteration of training, and the vector adjustment parameters.

2. The training method for the image classification model according to claim 1, characterized in that, The vector adjustment parameters include a first vector adjustment parameter and a second vector adjustment parameter, and the second mapping relationship includes a first vector adjustment parameter mapping function and a second vector adjustment parameter mapping function; The step of determining the vector adjustment parameter based on the number of iterations and the second mapping relationship between the number of iterations and the vector adjustment parameter includes: Determine a first vector adjustment parameter mapping function between the number of iterations and the first vector adjustment parameter, and determine a second vector adjustment parameter mapping function between the number of iterations and the second vector adjustment parameter; The number of iterations in the first vector adjustment parameter mapping function is linearly positively correlated with the first vector adjustment parameter, and the number of iterations in the second vector adjustment parameter mapping function is linearly negatively correlated with the second vector adjustment parameter. Substitute the number of iterations into the first vector adjustment parameter mapping function to determine the first vector adjustment parameter; Substitute the number of iterations into the second vector adjustment parameter mapping function to determine the second vector adjustment parameter.

3. The training method for the image classification model according to claim 1, characterized in that, The training method for the image classification model also includes: When the iterative training of the image classification model reaches the preset conditions, the entropy of each image to be classified is calculated, and the image to be classified is divided into clean sample images and noisy sample images according to the category label of the image to be classified and the entropy of the image to be classified. The category label of the noisy sample image is updated with a random value, and the corrected category label is determined based on the category label of the clean sample image and the updated category label of the noisy sample image; The image classification model is iteratively trained based on the corrected category labels.

4. The training method for the image classification model according to claim 1, characterized in that, The step of calculating the first model loss based on the category probability estimation vector and the corresponding category label includes: Determine the corresponding category label vector based on the category labels; Calculate the cross-entropy between the category probability estimation vector and the corresponding category label vector for each image to be classified; Calculate the mean of the cross-entropy of all the images to be classified, and determine the mean of the cross-entropy as the loss of the first model.

5. The training method for the image classification model according to claim 1, characterized in that, The step of determining the loss adjustment parameter based on the number of iterations and the first mapping relationship between the number of iterations and the loss adjustment parameter includes: The number of iterations is linearly positively correlated with the loss adjustment parameter, and a first mapping function between the number of iterations and the loss adjustment parameter is determined. Substitute the number of iterations into the first mapping function to determine the loss adjustment parameter.

6. The training method for the image classification model according to claim 1, characterized in that, The calculation of the second model loss based on the class probability estimation vector, the class probability prediction vector, and the loss adjustment parameter includes: Calculate the inner product between the category probability estimation vector and the category probability prediction vector of each image to be classified, calculate the difference between the inner product and a preset value, take the logarithm of the difference, and obtain the sub-loss of each image to be classified. Calculate the mean of the sub-losses for all the images to be classified, and calculate the second model loss based on the loss adjustment parameter and the mean of the sub-losses.

7. A training device for an image classification model, characterized in that, The training device for the image classification model includes: The model training module is used to obtain the images to be classified in the training set and the category label of each image to be classified, initialize the number of iterations, iteratively train the image classification model, and repeat the following iterative training module until the preset convergence condition is met to obtain the trained image classification model. The iterative training module includes: The vector estimation submodule is used to input the image to be classified into the image classification model to obtain the category probability estimation vector of the image to be classified. The vector prediction submodule is used to determine the class probability prediction vector for this iteration of training. This class probability prediction vector is a fusion of the class probability estimation vectors for this iteration of training and all previous iterations of training. The first loss calculation submodule is used to calculate the first model loss based on the category probability estimation vector and the corresponding category label; The second loss calculation submodule is used to determine the loss adjustment parameter for the current iteration training based on the number of iterations and the first mapping relationship between the number of iterations and the loss adjustment parameter, and to calculate the second model loss based on the class probability estimation vector, the class probability prediction vector and the loss adjustment parameter. A model training sub-model is used to calculate the total model loss of the image classification model based on the first model loss and the second model loss, and to train the image classification model based on the total model loss; The iteration count update submodule is used to update the iteration count; The determination of the class probability prediction vector for this iteration of training includes: Based on the number of iterations and the second mapping relationship between the number of iterations and the vector adjustment parameter, the vector adjustment parameter is determined. The vector adjustment parameter includes a first vector adjustment parameter for characterizing the fusion ratio of the class probability estimation vectors in the current iteration training, and a second vector adjustment parameter for characterizing the fusion ratio of the class probability estimation vectors in all previous iteration training. For the first iteration of training, the class probability prediction vector for this iteration is obtained based on the class probability estimation vector, the preset class probability vector, and the vector adjustment parameters. The preset class probability vector is used as the class probability estimation vector for all previous iterations of training. For the k-th iteration of training, k=2,3,..., the class probability prediction vector for the k-th iteration is obtained based on the class probability estimation vector, the class probability prediction vector determined in the (k-1)-th iteration of training, and the vector adjustment parameters.

8. A computer device, characterized in that, The computer device includes a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the training method of the image classification model as described in any one of claims 1 to 6.

9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the training method of the image classification model as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Pornographic picture recognition method and device based on convolutional neural network

    CN110647916A

  • Image classification model training method and device, computer equipment and storage medium

    CN111353542A