Model training method and device, equipment, storage medium and computer program product
Noise label samples are modeled through a deep learning network, and the noise label detection model is trained using simulation data related to the classification model, which solves the problem of poor noise label detection in the existing technology and achieves high accuracy and robustness of noise label detection. Label detection, suitable for multi-task and multi-data scenarios.
Patent Information
- Application Number
- CN202410346106.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-25
- Publication Date
- 2024-10-18
AI Technical Summary
The existing technology is difficult to effectively detect and filter out noise labels during model training, resulting in a decrease in model prediction accuracy, and the robust training scheme fails to directly detect noise labels, resulting in poor detection results.
Model the noise label samples through the deep learning network, train the noise label detection model separately, use the simulation data related to the classification model as training data, learn the characteristics of noise labels and clean labels in the classification model training process, and improve the accuracy of noise label detection. robustness.
Significantly improves the accuracy and robustness of noise label detection, can be used in multi-task, multi-model, and multi-data scenarios, reduces dependence on thresholds, enables real-time streaming decoding and early screening of noise labels, and prevents model over-fitting combine.
Smart Images

Figure CN118797432A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a model training method, device, equipment, storage medium and computer program product. Background Art
[0002] The success of artificial intelligence depends largely on large-scale, credibly labeled training data. Therefore, high-quality training data is crucial for model training. However, in practical applications, noisy labels (NL) are inevitable, where NL refers to incorrect or abnormal labels in training data. NL may cause the model to learn incorrect patterns or rules during training, resulting in a decrease in the accuracy of model predictions.
[0003] In order to reduce the impact of NL on the model, solutions in related technologies usually improve the model's tolerance to NL through robustness training. However, the goal of these solutions is only to reduce the impact of NL and prevent model overfitting. They do not care whether NL can be screened out, or even cannot detect NL, that is, the NL detection effect is poor. Summary of the invention
[0004] In order to solve the technical problems existing in the related technologies, the embodiments of the present application provide a model training method, apparatus, device, storage medium and computer program product.
[0005] To achieve the above purpose, the technical solution of the embodiment of the present application is implemented as follows:
[0006] In a first aspect, an embodiment of the present application provides a model training method, the method comprising:
[0007] Acquire target training data, and train a classification model based on the target training data to obtain simulation data related to the classification model;
[0008] Get the tag type sequence;
[0009] Determining a first loss function based on the label type sequence and simulated data related to the classification model;
[0010] The first loss function is used to update parameters of the first encoder network and the second encoder network until the loss value of the first loss function converges, thereby generating a noise label detection model.
[0011] In a second aspect, an embodiment of the present application further provides a model training device, the device comprising:
[0012] A first acquisition unit, used to acquire target training data;
[0013] A first determining unit, configured to train a classification model based on the target training data to obtain simulation data related to the classification model;
[0014] A second acquisition unit, used to acquire a tag type sequence;
[0015] A second determining unit, configured to determine a first loss function based on the label type sequence and simulated data related to the classification model;
[0016] The first generating unit is used to update the parameters of the first encoder network and the second encoder network by using the first loss function until the loss value of the first loss function converges, thereby generating a noise label detection model.
[0017] In a third aspect, an embodiment of the present application further provides a model training device, comprising: a processor and a memory for storing a computer program that can be run on the processor;
[0018] Wherein, when the processor is used to run the computer program, it executes the steps of the model training method described in the embodiment of the present application.
[0019] In a fourth aspect, an embodiment of the present application further provides a storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the model training method described in the embodiment of the present application are implemented.
[0020] In a fifth aspect, an embodiment of the present application further provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the model training method described in the embodiment of the present application.
[0021] The model training method, device, equipment, storage medium and computer program product provided in the embodiment of the present application obtain target training data, and train the classification model based on the target training data to obtain simulation data related to the classification model; obtain a label type sequence; determine a first loss function based on the label type sequence and the simulation data related to the classification model; use the first loss function to update the parameters of the first encoder network and the second encoder network until the loss value of the first loss function converges to generate a noise label detection model. The model training method of the embodiment of the present application is adopted, and the noise label sample, that is, the target training data itself, is modeled by a deep learning network, and a noise label detection (NLD, Noisy Label Detection) model for noise label detection is trained separately. In the training process of the noise label detection model, the input data or loss value of the classification network is not used as training data, but the simulation data related to the classification model obtained by training the classification model based on the training sample containing the noise label is used as training data. In this way, the characteristics of the noise label sample and the clean label (CL, Clean Label) sample output during the classification model training process can be learned, and the robustness of the noise label detection model is improved, thereby greatly improving the detection effect of the noise label. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 The following is a flow chart of the model training method of the present application embodiment: Figure 1 ;
[0023] Figure 2 The following is a flow chart of the model training method of the present application embodiment: Figure 2 ;
[0024] Figure 3 The following is a flow chart of the model training method of the present application embodiment: Figure 3 ;
[0025] Figure 4 A flowchart of the data preparation stage of an embodiment of the present application;
[0026] Figure 5 A schematic diagram of the process of the NLD model training phase of an embodiment of the present application;
[0027] Figure 6 A flowchart of the practical application stage of an embodiment of the present application;
[0028] Figure 7 A schematic diagram of the structure of the model training device according to an embodiment of the present application;
[0029] Figure 8 This is a schematic diagram of the hardware composition structure of the model training device according to an embodiment of the present application. DETAILED DESCRIPTION
[0030] The present application will be further described in detail below with reference to the accompanying drawings and embodiments.
[0031] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.
[0032] The success of artificial intelligence depends largely on large-scale, credibly labeled training data. Therefore, high-quality training data is crucial for model training. However, NL is inevitable in practical applications. NL refers to the presence of erroneous or abnormal labels in the training data. For example, a photo of a dog is incorrectly labeled as a wolf. This may be due to human labeling errors, data collection problems, or other reasons. It can be seen that NL has a significant impact on the model and may cause the model to be biased, that is, the model learns the wrong patterns or rules during the training process, which greatly reduces the accuracy of the model when predicting.
[0033] The existing solution for NL is generally to conduct robustness training, and reduce the impact of NL on the model through various means to make the model more tolerant to NL. The specific methods can be roughly divided into four categories: 1. Constructing a robust network architecture, such as adding a noise adaptive layer to learn the label transfer matrix, and co-teaching (a new deep learning paradigm for resisting label noise), that is, training two deep neural networks at the same time and cross-updating parameters to reduce model overfitting; 2. Regularization, including explicit regularization such as dropout (random inactivation) regularization, implicit regularization such as data enhancement, can improve the generalization ability of the model and reduce model overfitting; 3. Designing a robust loss function, such as Sub-center ArcFace (subcenter ArcFace) is an improved ArcFace. By introducing additional subcenters, it allows each category to have multiple subcenters. By relaxing the intra-class constraints through the subcenters, the robustness of noisy labels can be effectively improved. ArcFace is a face recognition loss function based on angle cosine. It maximizes the angle cosine value of samples in the same category and infers the angle cosine values of samples in different categories to a fixed interval to achieve optimization in face recognition tasks; 4. Sample selection, such as co-teaching only selects a certain proportion of samples with small loss values to update the network. These samples are usually clean label samples.
[0034] For example, the meta-learning-based label noise monitoring method proposed in the related art uses a meta-network to screen noisy labels, where the input of the meta-network is the loss value and sample feature vector of the current classification network, the output of the meta-network is the weight value for determining whether it is a noise label, and the meta-network parameters are updated with the help of a small number of clean sample sets.
[0035] It can be seen that the solutions in the related art that improve the model's tolerance to NL through robustness training do not directly detect NL, that is, they do not model NL, so the NL detection ability is not strong enough. This is because the goal of these solutions is only to reduce the impact of NL and prevent model overfitting, and they do not care whether NL can be screened out, or even fail to detect NL (such as regularization method), that is, the NL detection effect is poor.
[0036] Based on this, an embodiment of the present application proposes a model training method. In various embodiments of the present application, the noise label sample, i.e., the target training data itself, is modeled through a deep learning network, and a noise label detection model for noise label detection is trained separately. In the training process of the noise label detection model, the input data or loss value of the classification network is not used as training data. Instead, simulated data related to the classification model obtained by training the classification model based on training samples containing noise labels is used as training data. In this way, the characteristics of the output of the noise label samples and the clean label samples during the classification model training process can be learned, thereby improving the robustness of the noise label detection model and greatly improving the detection effect of the noise label.
[0037] The present application embodiment provides a model training method, which is applied to a model training device. Figure 1 The following is a flow chart of the model training method of the present application embodiment: Figure 1 ;like Figure 1 As shown, the model training method includes:
[0038] Step 101: Obtain target training data, and train a classification model based on the target training data to obtain simulation data related to the classification model.
[0039] In an embodiment of the present application, the target training data is a training sample containing a certain proportion of noise labels, and the simulation data related to the classification model includes one or more of the following parameters: the number of iterations of each iteration of the classification model; the accuracy of the classification model; and the output result of the classification layer of the classification model.
[0040] In actual application, the model training device uses clean label (CL) data to generate data with noisy labels, namely, target training data.
[0041] Based on this, in one embodiment, obtaining target training data includes: obtaining original training data; the original training data includes clean label samples, and the clean label samples represent training samples that do not contain noise labels; performing label noise processing on the original training data to obtain the target training data; the target training data represents training samples containing noise labels.
[0042] Here, by performing label noise addition in the clean label sample data, a training sample containing a noise label, that is, the target training data, can be obtained. Specifically, the corresponding noise label is added to the clean label sample data according to the set noise addition ratio to obtain the target training data containing the noise label. Among them, the noise addition ratio can be understood as the proportion of the noise label in the target training data. It should be noted that the noise addition ratio can be pre-set according to actual needs. For example, the noise addition ratio can be set to 30%, which is not limited in the embodiment of the present application.
[0043] Here, the type of noise label contained in the target training data is symmetric noise, for example, it can be a random noise label or an intra-class noise label. Among them, the clean label sample data can be selected from some public data sets of classification tasks, such as image recognition data sets, or speech recognition data sets, which are not limited in the embodiments of the present application.
[0044] In actual application, the classification model is trained using training samples containing noise labels, namely target training data, to obtain the training features of the noise label detection model, namely simulated data related to the classification model. In this way, the model training device can use the simulated data related to the classification model as prior knowledge combined with the label type sequence to input into the deep learning network to realize the training of the noise label detection model.
[0045] Based on this, in one embodiment, the classification model is trained based on the target training data to obtain simulation data related to the classification model, including: extracting features from the target training data to obtain a feature vector of the target training data; based on the feature vector of the target training data, updating the parameters of the classification model using a second loss function until the loss value of the second loss function converges to obtain simulation data related to the classification model; wherein the simulation data related to the classification model includes one or more of the following parameters: the number of iterations of each iteration of the classification model; the accuracy of the classification model; and the output result of the classification layer of the classification model.
[0046] Here, the classification model may include an input layer, an encoding layer and a fully connected layer, wherein the model training device inputs the target training data as input data into the classification model through the input layer, and then extracts features of the target training data through the encoding layer, i.e., encodes, to obtain a feature vector of the target training data, and then classifies the feature vector of the target training data through the fully connected layer to finally obtain a classification result, which is the classification result corresponding to the classification of the above-mentioned training samples containing noise labels.
[0047] Here, the error value is determined according to the training results, the training samples containing noise labels (i.e., the feature vectors of the target training data) and the preset loss function (i.e., the second loss function). When the error value is within the preset threshold range, it is determined that the classification model converges, that is, the loss value of the second loss function converges; when the error value is not within the preset threshold range, the model parameters in the classification model are adjusted or updated until the error value reaches the preset threshold range, and the classification model converges, that is, the loss value of the second loss function converges, thereby obtaining simulation data related to the classification model.
[0048] In an embodiment of the present application, the output result of the classification layer of the classification model may be a classification result obtained by classifying the feature vector of the target training data through a fully connected layer, wherein the fully connected layer is the classification layer, specifically a softmax layer.
[0049] It should be noted that there are multiple options for the network framework of the classification model. As long as it is a model with classification function, such as the residual neural network (ResNet) 34, the more mainstream deep neural network model for voiceprint recognition (ECAPA-TDNN, Emphasized Channel Attention Propagation and Aggregation-Time Delay Neural Network), etc., they are all included in the scope of protection of this application.
[0050] Step 102: Obtain a tag type sequence.
[0051] In actual application, the model training device can obtain a label type sequence by converting the label type of each target training sample.
[0052] Based on this, in one embodiment, obtaining the label type sequence includes: determining the label type of the target training data; the target training data is obtained by performing label noise processing on the original training data, and the original training data includes clean label samples; performing sequence conversion on the label type of the target training data to obtain the label type sequence.
[0053] Here, the label type of the target training data includes one of the following: a noise label type; a clean label type, wherein a clean label refers to a sample whose label is correct. In practical applications, the noise label type can be represented by 1, the clean label type can be represented by 0, and the label type of the target training data can be represented by 1. The value of can be expressed by the following formula (1):
[0054]
[0055] Where i represents the number of the target training sample; Represents the annotation label of the sample; y i Represents the true classification label of the sample.
[0056] It should be noted that the label type sequence is a sequence with a value of 0 or 1. The label type of the target training data can be obtained by the following formula (2): Perform sequence conversion to obtain label type sequence
[0057]
[0058] Among them, the tag type sequence The length is E, e represents the number of epochs in the current training round, m represents the number of iterations in the current iteration, i represents the i-th sample, and the label type sequence It includes multiple elements, express The e-th element of the sequence is simply understood as the clean label CL sample The elements of the sequence are all 0, and the noise label NL sample If the previous element in the sequence If it is 1, all subsequent elements are 1, otherwise it is determined by the sequence function R The sequence is either 0 or 1.
[0059] Here, the probability of the sequence function R is determined by the accuracy Acc of the classification model of the current iteration, where the value of the sequence function R can be 0 or 1. The probability of the sequence function R can be calculated by the following formulas (3) and (4):
[0060]
[0061]
[0062] in, It represents the probability that the sequence function R takes the value of 1 in the mth iteration of the i-th sample; It represents the probability that the sequence function R takes the value of 0 in the mth iteration of the i-th sample; It represents the accuracy of the classification model corresponding to the mth iteration of the ith sample; m represents the number of iterations of the current iteration.
[0063] Step 103: Determine a first loss function based on the label type sequence and simulated data related to the classification model.
[0064] In actual application, the model training device inputs the label type sequence and the simulation data related to the classification model into the deep learning network (including the first encoder network and the second encoder network) respectively, and obtains the corresponding feature information, that is, the label feature and the data feature, so as to determine the first loss function according to the obtained label feature and the data feature. In this way, considering that the features of the noise label are multi-dimensional, and even some dimensional features are implicit, using deep learning to determine whether it is a noise label can better mine the implicit features of the noise label.
[0065] Based on this, in one embodiment, the first loss function is determined based on the simulated data related to the label type sequence and the classification model, including: inputting the label type sequence into the first encoder network to obtain corresponding label features; inputting the simulated data related to the classification model into the second encoder network to obtain corresponding data features; and determining the first loss function based on the label features and the data features.
[0066] In an embodiment of the present application, the first encoder network may be a label encoder network, and the second encoder network may be a feature encoder network. Specifically, after obtaining the label type of each target training sample, the model training device first converts the label type of each target training sample to obtain a label type sequence, and then uses the label type sequence as input data and inputs it into the label encoder network, and extracts features of the label type sequence through the encoding layer of the label encoder network, i.e., encodes it, and obtains label features corresponding to the label type sequence; similarly, after obtaining simulation data related to the classification model, such as the number of iterations of each iteration of the classification model, the accuracy of the classification model, and the output result of the classification layer of the classification model, the model training device first splices the number of iterations of each iteration of the classification model, the accuracy of the classification model, and the output result of the classification layer of the classification model to obtain spliced simulation data, and then uses the spliced simulation data as input data and inputs it into the feature encoder network, and extracts features of the spliced simulation data through the encoding layer of the feature encoder network, i.e., encodes it, and obtains data features corresponding to the spliced simulation data.
[0067] In practical applications, for the number of iterations of the classification model in each iteration of the input data of the feature encoder network, it is usually necessary to positionally encode the number of iterations of the classification model for each iteration, and then fuse the position features obtained by position encoding with the accuracy of the classification model and the output results of the classification layer of the classification model, that is, splicing, to obtain the spliced simulated data.
[0068] Based on this, in one embodiment, the simulated data related to the classification model is input into the second encoder network to obtain corresponding data features, including: when the simulated data related to the classification model includes the number of iterations of each iteration of the classification model, position encoding the number of iterations of each iteration of the classification model to obtain corresponding position features; splicing the position features, the accuracy of the classification model and the output result of the classification layer of the classification model to obtain spliced simulated data; inputting the spliced simulated data into the second encoder network to obtain corresponding data features.
[0069] It should be noted that the first encoder network and the second encoder network can be a transformer model (deep learning model based on attention mechanism) or a recurrent neural network (RNN), which is not limited in the embodiments of the present application. Here, the output of the first encoder network is associated with the historical label, and the output of the second encoder network is associated with the current data features and the historical data features.
[0070] In one embodiment, determining the first loss function based on the label features and the data features includes: inputting the label features and the data features into a joint network to obtain a first prediction result output by the joint network; the first prediction result characterizes a fusion feature of the label features and the data features; and determining the first loss function based on the first prediction result and the label type sequence.
[0071] Here, the joint network is used to perform feature fusion on the label feature and the data feature. In practical application, after obtaining the output results of the first encoder network and the second encoder network, i.e., the label feature and the data feature, the model training device fuses the two features through the joint network to obtain a fused feature, and inputs the fused feature into an activation function, such as a Sigmoid function, to obtain the correct probability calculated by the activation function for the fused feature, and determines the corresponding loss function, i.e., the first loss function, in combination with the correct probability and the label type sequence.
[0072] Step 104: Use the first loss function to update the parameters of the first encoder network and the second encoder network until the loss value of the first loss function converges to generate a noise label detection model.
[0073] Here, the network framework of the noise label detection model can adopt a transformer-transducer structure or an RNN-T (Recurrent Neural Network-Transducer) structure, which is not limited in the embodiments of the present application.
[0074] In actual application, the data used by the noise label detection model in modeling is the output result of the classification layer of the classification model, the number of iterations of each iteration of the classification model and the accuracy of the classification model, rather than the classification task data itself. It can be seen that the noise label detection model learns the common characteristics of noise labels in the classification model training process through a deep learning network and does not rely on a single threshold. Therefore, the solution of obtaining the noise label detection model using the model training method of the present application has cross-task, cross-model and cross-data universality.
[0075] In the actual application stage, real data containing noise labels can be used to train the classification model, and noise label detection can be performed during the classification model training process, that is, streaming detection can be performed using the trained noise label detection model to screen out noise label samples.
[0076] Based on this, in one embodiment, after generating the noise label detection model, the method also includes: obtaining classification task data to be detected; the classification task data to be detected includes one or more category label samples; training the classification model based on the classification task data to be detected, and generating simulation data related to the classification model corresponding to each training round; inputting the simulation data related to the classification model corresponding to each training round into the noise label detection model to obtain a second prediction result; the second prediction result represents the probability of each category label sample being judged as a noise label in the corresponding training round; based on the second prediction result, detecting the noise label from the classification task data to be detected.
[0077] In the embodiment of the present application, the classification task data includes image classification data, audio classification data, text classification data, etc., which are not limited here. The encoder of the noise label detection model can adopt a network framework such as a transformer, RNN or a long short-term memory unit (LSTM, Long Short Term Memory) model, and the decoder of the noise label detection model can adopt a transducer, streaming decoding, and the output result depends on historical information, making full use of the information in the entire training process and reducing the dependence on the threshold. Specifically, the classification task data to be detected containing noise labels is input into the classification model. During the training process of the classification model, the simulation data related to the classification model generated in each training round (epoch), such as the number of iterations of the classification model, the accuracy of the classification model, and the output result of the classification layer (softmax layer) of the classification model, are used as the input data of the noise label detection model to obtain the probability of the category label sample being judged as a noise label in each epoch, that is, the second prediction result. In addition, the probability of the noise label of each epoch also depends on the probability of the noise label of the historical epoch. In this way, the noise label detection method of streaming decoding is adopted, and the characteristics of multiple nodes and multiple dimensions, that is, the probability of the noise labels of all historical epochs, are considered to make full use of the information in the entire training process and improve the accuracy of noise label detection.
[0078] In one embodiment, based on the second prediction result, detecting a noise label from the classification task data to be detected includes: comparing the second prediction result with a probability threshold to obtain a comparison result; when the comparison result indicates that the second prediction result is greater than the probability threshold, determining that the category label sample corresponding to the second prediction result greater than the probability threshold is a noise label.
[0079] Since the noise label may be judged as a clean label and the model is updated in the subsequent epoch. In actual tests, it can be found that the range of noise label loss values in different epochs may be very large, and in some epochs, the loss value can even be comparable to the clean label (very small value). If the noise label is not screened out in time, the noise label sample will experience loss fluctuations to a smaller value, and will be treated as a clean label to update the model parameters, causing the model to overfit the noise label, making it more difficult to distinguish it from the noise label, and falling into a vicious circle. Therefore, it is extremely important to screen out the noise label as early as possible and prevent it from updating the model parameters. However, the related art fails to screen out possible noise labels as early as possible. For this reason, in the model training method of the present application, once a category label sample is judged as a noise label in a certain training round, the noise label is immediately screened out, that is, the noise label is moved from the update data set to the screened data set, and then only the data in the update data set is used to update the model parameters during the training process, and the data in the screened data set does not participate in the process of updating the model parameters.
[0080] Based on this, in one embodiment, the method further includes: determining whether the probability of a category label sample being judged as a noise label under a target training round is greater than a probability threshold; if the probability of the category label sample being judged as a noise label under a target training round is greater than the probability threshold, screening out the category label sample trained under the target training round.
[0081] Here, the probability threshold can be pre-set according to actual needs, such as setting the probability threshold to 0.8, which is not limited in the embodiment of the present application.
[0082] For example, assuming the probability threshold is 0.8, when it is determined that the probability of a category label sample being judged as a noise label in a certain training round, that is, the target training round, is greater than 0.8, then it can be determined that the category label sample is a noise label sample. Then, the noise label sample is screened out, and in subsequent training rounds, the noise label sample will no longer be used to update the model parameters, thereby achieving the purpose of real-time screening of noise labels.
[0083] The present application also provides another model training method, which is applied to a model training device. Figure 2 The following is a flow chart of the model training method of the present application embodiment: Figure 2 ;like Figure 2 As shown, the model training method includes:
[0084] Step 201: Obtain target training data.
[0085] In an embodiment of the present application, the target training data is used to characterize training samples containing noise labels.
[0086] In one embodiment, the obtaining of target training data includes: obtaining original training data; the original training data includes clean label samples, and the clean label samples represent training samples that do not contain noise labels; and performing label noise addition processing on the original training data to obtain the target training data.
[0087] Step 202: Train the classification model based on the target training data to obtain simulation data related to the classification model.
[0088] In one embodiment, the classification model is trained based on the target training data to obtain simulation data related to the classification model, including: extracting features from the target training data to obtain a feature vector of the target training data; based on the feature vector of the target training data, updating the parameters of the classification model using a second loss function until the loss value of the second loss function converges to obtain simulation data related to the classification model; wherein the simulation data related to the classification model includes one or more of the following parameters: the number of iterations of each iteration of the classification model; the accuracy of the classification model; and the output result of the classification layer of the classification model.
[0089] Step 203: Obtain a tag type sequence.
[0090] In one embodiment, obtaining the label type sequence includes: determining the label type of the target training data; the target training data is obtained by performing label noise processing on the original training data, and the original training data includes clean label samples; performing sequence conversion on the label type of the target training data to obtain the label type sequence.
[0091] Step 204: Input the label type sequence into the first encoder network to obtain corresponding label features.
[0092] In an embodiment of the present application, the first encoder network may be a label encoder network, the first encoder network may be a transformer model, or may be an RNN, which is not limited here.
[0093] Step 205: Input the simulated data related to the classification model into the second encoder network to obtain corresponding data features.
[0094] In an embodiment of the present application, the second encoder network may be a feature encoder network, the second encoder network may be a transformer model, or may be an RNN, which is not limited here.
[0095] In one embodiment, the simulated data related to the classification model is input into the second encoder network to obtain corresponding data features, including: when the simulated data related to the classification model includes the number of iterations of each iteration of the classification model, position encoding the number of iterations of each iteration of the classification model to obtain corresponding position features; splicing the position features, the accuracy of the classification model and the output result of the classification layer of the classification model to obtain spliced simulated data; and inputting the spliced simulated data into the second encoder network to obtain corresponding data features.
[0096] Step 206: Input the label feature and the data feature into the joint network to obtain a first prediction result output by the joint network.
[0097] In the embodiment of the present application, the first prediction result represents a fusion feature of the label feature and the data feature.
[0098] Step 207: Determine a first loss function based on the first prediction result and the label type sequence.
[0099] Step 208: Use the first loss function to update the parameters of the first encoder network and the second encoder network until the loss value of the first loss function converges to generate a noise label detection model.
[0100] The present application also provides another model training method, which is applied to a model training device. Figure 3 The following is a flow chart of the model training method of the present application embodiment: Figure 3 ;like Figure 3 As shown, the model training method includes:
[0101] Step 301: Obtain target training data.
[0102] In an embodiment of the present application, the target training data is used to characterize training samples containing noise labels.
[0103] In one embodiment, the obtaining of target training data includes: obtaining original training data; the original training data includes clean label samples, and the clean label samples represent training samples that do not contain noise labels; and performing label noise addition processing on the original training data to obtain the target training data.
[0104] Step 302: Train the classification model based on the target training data to obtain simulation data related to the classification model.
[0105] In one embodiment, the classification model is trained based on the target training data to obtain simulation data related to the classification model, including: extracting features from the target training data to obtain a feature vector of the target training data; based on the feature vector of the target training data, updating the parameters of the classification model using a second loss function until the loss value of the second loss function converges to obtain simulation data related to the classification model; wherein the simulation data related to the classification model includes one or more of the following parameters: the number of iterations of each iteration of the classification model; the accuracy of the classification model; and the output result of the classification layer of the classification model.
[0106] Step 303: Obtain a tag type sequence.
[0107] In one embodiment, obtaining the label type sequence includes: determining the label type of the target training data; the target training data is obtained by performing label noise processing on the original training data, and the original training data includes clean label samples; performing sequence conversion on the label type of the target training data to obtain the label type sequence.
[0108] Step 304: Input the label type sequence into the first encoder network to obtain corresponding label features.
[0109] In an embodiment of the present application, the first encoder network may be a label encoder network, the first encoder network may be a transformer model, or may be an RNN, which is not limited here.
[0110] Step 305: Input the simulated data related to the classification model into the second encoder network to obtain corresponding data features.
[0111] In an embodiment of the present application, the second encoder network may be a feature encoder network, the second encoder network may be a transformer model, or may be an RNN, which is not limited here.
[0112] In one embodiment, the simulated data related to the classification model is input into the second encoder network to obtain corresponding data features, including: when the simulated data related to the classification model includes the number of iterations of each iteration of the classification model, position encoding the number of iterations of each iteration of the classification model to obtain corresponding position features; splicing the position features, the accuracy of the classification model and the output result of the classification layer of the classification model to obtain spliced simulated data; and inputting the spliced simulated data into the second encoder network to obtain corresponding data features.
[0113] Step 306: Input the label feature and the data feature into the joint network to obtain a first prediction result output by the joint network.
[0114] In the embodiment of the present application, the first prediction result represents a fusion feature of the label feature and the data feature.
[0115] Step 307: Determine a first loss function based on the first prediction result and the label type sequence.
[0116] Step 308: Use the first loss function to update the parameters of the first encoder network and the second encoder network until the loss value of the first loss function converges to generate a noise label detection model.
[0117] Step 309: Acquire the classification task data to be detected, and train the classification model based on the classification task data to be detected, and generate simulation data related to the classification model corresponding to each training round.
[0118] In an embodiment of the present application, the classification task data to be detected includes one or more category label samples, and the classification task data includes image classification data, audio classification data, text classification data, etc., which are not limited here.
[0119] Step 310: Input the simulation data related to the classification model corresponding to each training round into the noise label detection model to obtain a second prediction result, and based on the second prediction result, detect the noise label from the classification task data to be detected.
[0120] In the embodiment of the present application, the second prediction result represents the probability that each category label sample is determined to be a noise label in the corresponding training round.
[0121] In one embodiment, based on the second prediction result, detecting a noise label from the classification task data to be detected includes: comparing the second prediction result with a probability threshold to obtain a comparison result; when the comparison result indicates that the second prediction result is greater than the probability threshold, determining that the category label sample corresponding to the second prediction result greater than the probability threshold is a noise label.
[0122] By adopting the technical solution of the embodiment of the present application, the noise label sample, i.e., the target training data itself, is modeled through a deep learning network, and a noise label detection model for noise label detection is trained separately. In the training process of the noise label detection model, the input data or loss value of the classification network is not used as the training data. Instead, the simulated data related to the classification model obtained by training the classification model based on the training samples containing noise labels is used as the training data. In this way, the characteristics of the noise label samples and the clean label samples output during the classification model training process can be learned, and the robustness of the noise label detection model is improved, thereby greatly improving the detection effect of the noise label.
[0123] The present application is described below in conjunction with application examples.
[0124] Most solutions in related technologies are to improve the model's tolerance to NL through robustness training, but most of them have the following disadvantages:
[0125] 1. They do not directly detect NL or build models for NL, so the NL detection capability is not strong enough. The goal of most solutions is only to reduce the impact of NL and prevent model overfitting, and they do not care whether NL can be screened out, or even fail to detect NL.
[0126] 2. Most solutions screen NL through a single node and single dimension threshold. For example, based on the loss value of the current epoch, some data with small loss values are retained to update the model. The current epoch is a single node, and the results of the previous nodes (epochs) are not considered. In fact, throughout the entire training process, NL samples have obvious characteristics. For example, the model usually fits CL samples first, which is manifested as the loss of CL samples decreases significantly in the early stage of training, while the loss of NL samples gradually decreases after the model is overfitted in the later stage of training. Therefore, it is also very important to look at the multi-node (epoch) characteristics of the entire training. NL is judged as a single dimension only by the loss size. In fact, the characteristics of NL are multi-dimensional. For example, in addition to the loss value itself, the range of variation in different epochs is also an important feature. The range of variation of NL is usually greater than that of CL. In addition, the single-dimensional threshold is difficult to determine and has strong sensitivity. If the training data does not match, the effect is often very poor.
[0127] 3. Determine NL only by explicit features. Similar to the discussion on a single dimension in the second point above, the features of NL are multi-dimensional, and even some dimensional features are implicit and difficult to summarize manually.
[0128] 4. Failure to screen out possible NL as early as possible. NL may be judged as CL in subsequent epochs and the model parameters may be updated. In actual tests, it can be found that the range of NL loss values in different epochs may be very large, and in some epochs the loss value may even be comparable to CL. If NL is not screened out in time, the loss of NL samples will fluctuate to a smaller value, and they will be misjudged as CL and the model parameters will be updated, causing the model to overfit NL, making it more difficult to distinguish it from NL, and falling into a vicious cycle. Therefore, it is extremely important to screen out NL as early as possible and prevent it from updating the model parameters.
[0129] 5. Low versatility. Most solutions have low versatility. If you change a batch of data or switch to other classification tasks, the effect will often deteriorate. Especially for solutions that are sensitive to thresholds, if you change the data or application scenario, you need to reset the threshold, and it is usually difficult to find a suitable threshold. In addition, different classification tasks, such as images and speech, have different classification training features. The threshold of image classification tasks is not applicable to speech classification tasks.
[0130] In view of the above technical problems, this application proposes the following solutions:
[0131] 1. From the fundamental point of view, the goal is to detect and screen out NL. Train an NLD model separately, and when training the classification model, screen out NL through the trained NLD model.
[0132] 2. Multi-node (all historical epochs), multi-dimensional, reduce threshold dependence. The encoder of the NLD model uses network frameworks such as transformer, RNN or LSTM, and the decoder of the NLD model uses transducer, streaming decoding, and the output results rely on historical information, making full use of the information in the entire training process and reducing dependence on the threshold.
[0133] 3. Support implicit features. Using deep learning to determine whether it is NL can better discover the implicit features of NL.
[0134] 4. Filter out NL as early as possible. With streaming decoding, once a sample is judged to be NL in a certain epoch, the sample data is immediately moved from the update set to the filter set. After that, only the data in the update set is used to update the model parameters, and the data in the filter set is not involved in the update of the model parameters.
[0135] 5. High versatility. The data used in NL modeling is the softmax layer output of the classification task, not the classification task data itself. The NLD model learns the common features of NL in the classification model training process through deep learning. It does not rely on a single threshold, so it has cross-task, cross-model, and cross-data versatility.
[0136] The technical solution process of this application can be mainly divided into three stages: the first stage is the data preparation stage, that is, obtaining the training data containing NL (corresponding to the aforementioned target training data) and the training features of the NLD model (corresponding to the aforementioned simulation data related to the classification model); the second stage is the NLD model training stage, that is, using simulation data to train the NLD model; the third stage is the actual application stage, that is, using real NL data (corresponding to the aforementioned classification task data to be detected) to train the classification model, and using the trained NLD model for streaming detection to screen out NL samples. The processes of these three stages are described in detail below.
[0137] Phase 1: Data preparation
[0138] Figure 4 Schematic diagram of the process of the data preparation stage of the embodiment of the present application, such as Figure 4 As shown in the figure, in this stage, CL data is first obtained, and then label noise is added to the CL data to generate data containing a certain proportion of NL, that is, data containing NL is generated, and the label type of each sample is obtained. Next, we use the data containing NL to train the classification model and obtain simulation data related to the classification model, such as the number of iterations m of each iteration of the classification model, the accuracy Acc of the classification model, and the output result of the softmax layer of the classification model. The simulation data related to these classification models are saved as input for the NLD model.
[0139] Here, the NL type in the generated data containing NL is symmetric noise (such as random NL, intra-class NL), that is, the probability of samples being converted to other labels is equal, and its conversion probability P can be expressed by the following formula (5):
[0140]
[0141] Where i and j represent the sample numbers, i and j are two different samples; η represents the proportion of NL in the generated data containing NL, which can usually be 1% to 30%; c represents the number of classifications; Represents the annotation label of the sample; y i and j They represent the true classification labels corresponding to sample i and sample j respectively.
[0142] In the classification model training, E and e represent the total number of training rounds (epochs) and the current epoch number, respectively, while M and m represent the total number of training iterations and the current iteration number, respectively, and N is the total number of samples. Among them, each training with a batch size (the number of data samples captured for one training) is an iteration, and an epoch contains multiple iterations. The relationship between M and E can be expressed by the following formula (6):
[0143]
[0144] in, Round down, that is, the number of iterations for each epoch. Round down because the remaining samples are less than the batchsize and are discarded.
[0145] This data preparation phase will be performed multiple times to generate large batches of data. Parameters such as CL data, classification model, NL ratio η, etc. can be changed. Even if these parameters are not changed, the NL samples generated each time are random. Among them, CL data can be selected from some public datasets for classification tasks, such as image recognition datasets, such as VGG-Face, MS-Celeb-1M, MNIST, or speech datasets, such as VoxCeleb, CN-Celeb, etc. There are also many options for classification model frameworks, such as Resnet34, ECAPA-TDNN, etc. Using multiple data, multiple classification tasks, multiple classification models, and multiple NL ratios to generate target training data can improve the robustness of the NLD model.
[0146] Phase 2: NLD model training phase
[0147] This stage uses the data generated in the first stage, that is, the simulated data related to the label type sequence and the classification model to train the NLD model. Figure 5 Schematic diagram of the process of the NLD model training phase of the present application embodiment, such as Figure 5 As shown, first, you need to change the tag type Convert to a tag type sequence is a sequence of length E and value 0 or 1. Its conversion method is shown in the above formula (2), where e and m are the current epoch number and iteration number, i represents the i-th sample, represent The e-th element of the sequence. Simply put, the CL sample The sequence is all 0, NL sample If the previous element in the sequence is 1, all subsequent elements are 1, otherwise the sequence function R is used to determine The sequence is 0 or 1, and the value of R is affected by the Acc of the current iteration. The probability of the specific value of R can be calculated by the above formulas (3) and (4).
[0148] Next, the simulated data related to the classification model saved in the first stage: m, Acc and Concatenate into feature X, as the input of the feature encoder, and get the output h of the feature encoder FE , where m can also be encoded by position to obtain the corresponding position feature, and then the position feature is combined with Acc and Concatenate to form feature X, the position encoding is the same as in transformer, see formula (7). As the input of the label encoder, the output of the label encoder h is obtained LE . The feature encoder and label encoder can be transformer or RNN. Then, the output of the label encoder and the output of the feature encoder are combined to generate J through a joint network, as shown in formula (8). e ) and historical characteristics (X 1 ,X 2 ,...X e-1 ), while the label encoder output is related to the historical label Related.
[0149] Here, formulas (7) and (8) can be expressed as:
[0150]
[0151] in, represents the position encoding of sample i when the number of iterations is m; d represents the dimension of the hidden layer of the model; k represents the dimension index of the position encoding.
[0152]
[0153] in, Represents the fusion features of label features and data features generated by the joint network; Indicates the current feature; Respectively represent historical characteristics; Respectively represent historical labels; Linear represents linear operation.
[0154] The output result of the NLD model is a binary classification (i.e., yes / no is NL), so the Sigmoid function is selected, see formula (9), where represents the correct probability of the e-th element in the prediction sequence of sample i. In formula (10), P(z i / x i) represents the prediction accuracy of the entire sequence of sample i, which is equal to the cumulative multiplication of the accuracy of each element. The loss function loss (corresponding to the first loss function mentioned above) can be obtained by formula (11). Specifically, it is obtained by performing negative logarithmic summation on the prediction accuracy of all sample sequences in the batch of data (n samples).
[0155] Here, formulas (9), (10) and (11) can be expressed as:
[0156]
[0157]
[0158]
[0159] It should be noted that the meaning of each parameter in formula (9), (10) and (11) can be understood by referring to the meaning of the same parameters above, and will not be repeated here.
[0160] The third stage: practical application
[0161] This stage uses the NLD model trained in the second stage to detect NL samples in the actual training data (corresponding to the aforementioned classification task data to be detected). The detection process is streaming and is performed during the classification model training process. Figure 6 Schematic diagram of the actual application process of the present application embodiment. Figure 6 As shown, the data containing NL is input into the classification model. During the training process of the classification model, the softmax layer output result of the classification model generated in each epoch The number of iterations m and the accuracy of the classification model Acc of each iteration are used as the input of the NLD model to obtain the probability y of the sample being judged as NL in the epoch, and the y value of each epoch also depends on the y value of the historical epoch. If y>0.8 of a sample in a certain epoch, it is considered that there is sufficient evidence to identify the sample as a NL sample. In subsequent epochs, the sample is no longer used to update the model parameters, thereby achieving the purpose of screening out NL.
[0162] Compared with the solutions of the related art, the solution of the present application has the following beneficial effects:
[0163] 1. NL is directly modeled through a deep learning network. The training data is not the input data of the classification network, nor the loss value, but the output softmax layer data, the number of iterations of each model iteration, and the accuracy of the classification model. The characteristics of the NL and CL samples output during the classification network training process can be learned, and the NLD effect is better.
[0164] 2. The network architecture of the NLD model uses transformer-transducer or RNN-T. The judgment of whether it is NL in each epoch also depends on the historical value, which can make full use of the information in the entire training process.
[0165] 3. Deep learning can learn more implicit features, can determine NL through multi-dimensional features, and has minimal dependence on thresholds.
[0166] 4. In actual applications, streaming decoding is used. There is no need to wait until the training is completed to determine NL. NL can be detected in real time during the classification training process, and NL can be screened out as early as possible to prevent NL overfitting.
[0167] 5. High versatility. The training data of the simulated NLD model itself comes from multi-task, multi-model, and multi-datasets. The NLD model itself is also a common feature of the learned NL and CL samples in classification training, so the NLD model is universal.
[0168] In order to implement the model training method of the embodiment of the present application, the embodiment of the present application also provides a model training device, Figure 7 Schematic diagram of the structure of the model training device of the embodiment of the present application. Figure 7 As shown, the model training device includes:
[0169] A first acquisition unit 71, used to acquire target training data;
[0170] A first determining unit 72, configured to train the classification model based on the target training data to obtain simulation data related to the classification model;
[0171] A second acquisition unit 73, used to acquire a tag type sequence;
[0172] A second determining unit 74 is used to determine a first loss function based on the label type sequence and the simulated data related to the classification model;
[0173] The first generating unit 75 is used to update the parameters of the first encoder network and the second encoder network by using the first loss function until the loss value of the first loss function converges, thereby generating a noise label detection model.
[0174] In one embodiment, the first acquiring unit 71 is specifically configured to:
[0175] Acquire original training data; the original training data includes clean label samples, and the clean label samples represent training samples without noise labels; perform label noise processing on the original training data to obtain the target training data; the target training data represents training samples containing noise labels.
[0176] In one embodiment, the first determining unit 72 is specifically configured to:
[0177] Perform feature extraction on the target training data to obtain a feature vector of the target training data; based on the feature vector of the target training data, use a second loss function to update the parameters of the classification model until the loss value of the second loss function converges, and obtain simulation data related to the classification model; wherein the simulation data related to the classification model includes one or more of the following parameters: the number of iterations of each iteration of the classification model; the accuracy of the classification model; and the output result of the classification layer of the classification model.
[0178] In one embodiment, the second obtaining unit 73 is specifically configured to:
[0179] Determine the label type of the target training data; the target training data is obtained by performing label noise processing on the original training data, and the original training data includes clean label samples; perform sequence conversion on the label type of the target training data to obtain the label type sequence.
[0180] In one embodiment, the second determining unit 74 includes: a first determining subunit, a second determining subunit and a third determining subunit; wherein,
[0181] The first determining subunit is used to input the label type sequence into the first encoder network to obtain corresponding label features;
[0182] The second determining subunit is used to input the simulated data related to the classification model into the second encoder network to obtain corresponding data features;
[0183] The third determination subunit is used to determine the first loss function based on the label feature and the data feature.
[0184] In one embodiment, the third determining subunit is specifically configured to:
[0185] The label features and the data features are input into a joint network to obtain a first prediction result output by the joint network; the first prediction result represents a fusion feature of the label features and the data features; and the first loss function is determined based on the first prediction result and the label type sequence.
[0186] In one embodiment, the simulation data related to the classification model includes one or more of the following parameters: the number of iterations of each iteration of the classification model; the accuracy of the classification model; the output result of the classification layer of the classification model;
[0187] The second determining subunit is specifically used for:
[0188] In a case where the simulation data related to the classification model includes the iteration number of each iteration of the classification model, the iteration number of each iteration of the classification model is positionally encoded to obtain corresponding position features; the position features, the accuracy of the classification model and the output result of the classification layer of the classification model are spliced to obtain spliced simulation data; the spliced simulation data is input into the second encoder network to obtain corresponding data features.
[0189] In one embodiment, the model training device further includes: a third acquisition unit, a second generation unit, a third determination unit and a detection unit; wherein,
[0190] The third acquisition unit is used to acquire the classification task data to be detected after the first generation unit 75 generates the noise label detection model; the classification task data to be detected includes one or more category label samples;
[0191] The second generating unit is used to train the classification model based on the classification task data to be detected, and generate simulation data related to the classification model corresponding to each training round;
[0192] The third determination unit is used to input the simulation data related to the classification model corresponding to each training round into the noise label detection model to obtain a second prediction result; the second prediction result represents the probability that each category label sample is determined to be a noise label in the corresponding training round;
[0193] The detection unit is used to detect noise labels from the classification task data to be detected based on the second prediction result.
[0194] In one embodiment, the model training device further includes: a fourth determination unit and a screening unit; wherein,
[0195] The fourth determination unit is used to determine whether the probability that the category label sample is determined to be a noise label in the target training round is greater than a probability threshold;
[0196] The screening unit is used to screen out the category label samples trained in the target training round when the probability that the category label samples are determined to be noise labels in the target training round is greater than the probability threshold.
[0197] In one embodiment, the detection unit is specifically used for:
[0198] The second prediction result is compared with the probability threshold to obtain a comparison result; when the comparison result indicates that the second prediction result is greater than the probability threshold, the category label sample corresponding to the second prediction result greater than the probability threshold is determined to be a noise label.
[0199] In actual application, the first acquisition unit 71 and the second acquisition unit 73 can be implemented by the communication interface in the model training device; the first determination unit 72, the second determination unit 74 and the first generation unit 75 can be implemented by the processor in the model training device.
[0200] It should be noted that: the model training device provided in the above embodiment only uses the division of the above program modules as an example when performing model training. In actual applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device is divided into different program modules to complete all or part of the processing described above. In addition, the model training device provided in the above embodiment belongs to the same concept as the model training method embodiment. The specific implementation process is detailed in the model training method embodiment, which will not be repeated here.
[0201] Based on the hardware implementation of the above program modules, and in order to implement the model training method of the embodiment of the present application, the embodiment of the present application also provides a model training device, Figure 8 Schematic diagram of the hardware structure of the model training device of the embodiment of the present application. Figure 8 As shown, the model training device 80 includes:
[0202] Communication interface 81, capable of exchanging information with other devices;
[0203] The processor 82 is connected to the communication interface 81 to realize information interaction with other devices, and is used to execute the model training method provided above when running a computer program, and the computer program is stored in the memory 83.
[0204] Specifically, the communication interface 81 is used to obtain target training data;
[0205] The processor 82 is used to train the classification model based on the target training data to obtain simulation data related to the classification model;
[0206] The communication interface 81 is also used to obtain a tag type sequence;
[0207] The processor 82 is further used to determine a first loss function based on the label type sequence and the simulated data related to the classification model; use the first loss function to update the parameters of the first encoder network and the second encoder network until the loss value of the first loss function converges, thereby generating a noise label detection model.
[0208] In one embodiment, the communication interface 81 is specifically used for:
[0209] Acquire original training data; the original training data includes clean label samples, and the clean label samples represent training samples without noise labels;
[0210] The original training data is subjected to label noise processing to obtain the target training data; the target training data represents training samples containing noise labels.
[0211] In one embodiment, the processor 82 is specifically configured to:
[0212] Performing feature extraction on the target training data to obtain a feature vector of the target training data;
[0213] Based on the feature vector of the target training data, the parameters of the classification model are updated using a second loss function until the loss value of the second loss function converges, thereby obtaining simulation data related to the classification model;
[0214] The simulation data related to the classification model includes one or more of the following parameters:
[0215] The number of iterations of each iteration of the classification model; the accuracy of the classification model; and the output result of the classification layer of the classification model.
[0216] In another embodiment, the communication interface 81 is specifically used for:
[0217] Determining the label type of the target training data; the target training data is obtained by performing label noise processing on the original training data, and the original training data includes clean label samples;
[0218] The label types of the target training data are sequence-converted to obtain the label type sequence.
[0219] In another embodiment, the processor 82 is specifically configured to:
[0220] Inputting the label type sequence into the first encoder network to obtain corresponding label features;
[0221] Inputting the simulated data related to the classification model into the second encoder network to obtain corresponding data features;
[0222] Based on the label feature and the data feature, the first loss function is determined.
[0223] In another embodiment, the processor 82 is specifically configured to:
[0224] Inputting the label feature and the data feature into a joint network to obtain a first prediction result output by the joint network; the first prediction result represents a fusion feature of the label feature and the data feature;
[0225] Based on the first prediction result and the label type sequence, the first loss function is determined.
[0226] In another embodiment, the simulation data related to the classification model includes one or more of the following parameters: the number of iterations of each iteration of the classification model; the accuracy of the classification model; the output result of the classification layer of the classification model; the processor 82 is specifically used to:
[0227] In a case where the simulation data related to the classification model includes the number of iterations of each iteration of the classification model, position encoding is performed on the number of iterations of each iteration of the classification model to obtain corresponding position features;
[0228] splicing the position feature, the accuracy of the classification model and the output result of the classification layer of the classification model to obtain spliced simulation data;
[0229] The spliced analog data is input into the second encoder network to obtain corresponding data features.
[0230] In one embodiment, the communication interface 81 is further used to obtain classification task data to be detected after the processor 82 generates the noise label detection model; the classification task data to be detected includes one or more category label samples;
[0231] The processor 82 is also used to train the classification model based on the classification task data to be detected, and generate simulation data related to the classification model corresponding to each training round; input the simulation data related to the classification model corresponding to each training round into the noise label detection model to obtain a second prediction result; the second prediction result represents the probability of each category label sample being judged as a noise label in the corresponding training round; based on the second prediction result, the noise label is detected from the classification task data to be detected.
[0232] In one embodiment, the processor 82 is further configured to:
[0233] Determine whether the probability of a class label sample being judged as a noise label under the target training round is greater than a probability threshold;
[0234] When the probability that the category label sample is determined to be a noise label in the target training round is greater than the probability threshold, the category label sample trained in the target training round is screened out.
[0235] In one embodiment, the processor 82 is specifically configured to:
[0236] Comparing the second prediction result with the probability threshold to obtain a comparison result;
[0237] When the comparison result indicates that the second prediction result is greater than the probability threshold, it is determined that the category label sample corresponding to the second prediction result greater than the probability threshold is a noise label.
[0238] It should be noted that the specific processing process of the communication interface 81 and the processor 82 can be understood by referring to the above-mentioned model training method.
[0239] Of course, in actual application, the various components in the model training device 80 are coupled together through the bus system 84. It can be understood that the bus system 84 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 84 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Figure 8 Various buses are labeled as bus system 84 .
[0240] The memory 83 in the embodiment of the present application is used to store various types of data to support the operation of the model training device 80. Examples of such data include: any computer program used to operate on the model training device 80.
[0241] The model training method disclosed in the above embodiment of the present application can be applied to the processor 82, or implemented by the processor 82. The processor 82 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above model training method can be completed by an integrated logic circuit of the hardware in the processor 82 or an instruction in the form of software. The above-mentioned processor 82 may be a general-purpose processor, a digital signal processor (DSP, DigitalSignal Processor), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor 82 can implement or execute the various model training methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor may be a microprocessor or any conventional processor, etc. In combination with the steps of the model training method disclosed in the embodiment of the present application, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium, which is located in the memory 83, and the processor 82 reads the information in the memory 83 and completes the steps of the aforementioned model training method in combination with its hardware.
[0242] In an exemplary embodiment, the model training device 80 can be implemented by one or more application-specific integrated circuits (ASIC), DSP, programmable logic device (PLD), complex programmable logic device (CPLD), field-programmable gate array (FPGA), general-purpose processor, controller, microcontroller (MCU), microprocessor, or other electronic components to execute the aforementioned model training method.
[0243] It can be understood that the memory 83 of the embodiment of the present application can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM, SyncLink Dynamic Random Access Memory), and direct RAMbus random access memory (DRRAM, Direct Rambus Random Access Memory).The memory 83 described in the embodiments of the present application is intended to include but is not limited to these and any other suitable types of memory.
[0244] In an exemplary embodiment, the present application embodiment further provides a storage medium, namely a computer storage medium, specifically a computer-readable storage medium, for example, a memory 83 storing a computer program, and the above-mentioned computer program can be executed by a processor 82 in a model training device 80 to complete the steps of the model training method described in the above-mentioned embodiment of the present application. Among them, the computer-readable storage medium can be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface storage, optical disk, or CD-ROM.
[0245] In an exemplary embodiment, the present application also provides a computer program product, including a computer program, which can be executed by the processor 82 in the model training device 80 to complete the steps of the model training method described in the aforementioned embodiment of the present application.
[0246] It should be noted that: "first", "second", "third", etc. are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0247] In addition, the technical solutions described in the embodiments of the present application can be combined arbitrarily without conflict.
[0248] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A model training method, characterized in that: The method comprises: Acquire target training data, and train a classification model based on the target training data to obtain simulation data related to the classification model; Get the tag type sequence; Determining a first loss function based on the label type sequence and simulated data related to the classification model; The first loss function is used to update parameters of the first encoder network and the second encoder network until the loss value of the first loss function converges, thereby generating a noise label detection model.
2. The method according to claim 1, characterized in that The obtaining of target training data comprises: Acquire original training data; the original training data includes clean label samples, and the clean label samples represent training samples without noise labels; The original training data is subjected to label noise processing to obtain the target training data; the target training data represents training samples containing noise labels.
3. The method according to claim 1, characterized in that The step of training the classification model based on the target training data to obtain simulation data related to the classification model includes: Performing feature extraction on the target training data to obtain a feature vector of the target training data; Based on the feature vector of the target training data, the parameters of the classification model are updated using a second loss function until the loss value of the second loss function converges, thereby obtaining simulation data related to the classification model; The simulation data related to the classification model includes one or more of the following parameters: The number of iterations of each iteration of the classification model; the accuracy of the classification model; and the output result of the classification layer of the classification model.
4. The method according to claim 1, characterized in that: The step of obtaining a tag type sequence includes: Determining the label type of the target training data; the target training data is obtained by performing label noise processing on the original training data, and the original training data includes clean label samples; The label types of the target training data are sequence-converted to obtain the label type sequence.
5. The method according to claim 1, characterized in that The determining of a first loss function based on the simulated data related to the label type sequence and the classification model includes: Inputting the label type sequence into the first encoder network to obtain corresponding label features; Inputting the simulated data related to the classification model into the second encoder network to obtain corresponding data features; Based on the label feature and the data feature, the first loss function is determined.
6. The method according to claim 5, characterized in that The determining the first loss function based on the label feature and the data feature includes: Inputting the label feature and the data feature into a joint network to obtain a first prediction result output by the joint network; the first prediction result represents a fusion feature of the label feature and the data feature; Based on the first prediction result and the label type sequence, the first loss function is determined.
7. The method according to claim 5, characterized in that The simulation data related to the classification model includes one or more of the following parameters: the number of iterations of each iteration of the classification model; the accuracy of the classification model; the output result of the classification layer of the classification model; The step of inputting the simulated data related to the classification model into the second encoder network to obtain corresponding data features includes: In a case where the simulation data related to the classification model includes the number of iterations of each iteration of the classification model, position encoding is performed on the number of iterations of each iteration of the classification model to obtain corresponding position features; splicing the position feature, the accuracy of the classification model and the output result of the classification layer of the classification model to obtain spliced simulation data; The spliced analog data is input into the second encoder network to obtain corresponding data features.
8. The method according to claim 1, characterized in that After generating the noise label detection model, the method further includes: Acquire classification task data to be detected; the classification task data to be detected includes one or more category label samples; Training the classification model based on the classification task data to be detected, and generating simulation data related to the classification model corresponding to each training round; Inputting the simulated data related to the classification model corresponding to each training round into the noise label detection model to obtain a second prediction result; the second prediction result represents the probability that each category label sample is determined to be a noise label in the corresponding training round; Based on the second prediction result, a noise label is detected from the classification task data to be detected.
9. The method according to claim 8, characterized in that The method further comprises: Determine whether the probability of a class label sample being judged as a noise label under the target training round is greater than a probability threshold; When the probability that the category label sample is determined to be a noise label in the target training round is greater than the probability threshold, the category label sample trained in the target training round is screened out.
10. The method according to claim 8, characterized in that The detecting a noise label from the classification task data to be detected based on the second prediction result includes: Comparing the second prediction result with the probability threshold to obtain a comparison result; When the comparison result indicates that the second prediction result is greater than the probability threshold, it is determined that the category label sample corresponding to the second prediction result greater than the probability threshold is a noise label.
11. A model training device, characterized in that: The device comprises: A first acquisition unit, used to acquire target training data; A first determining unit, configured to train a classification model based on the target training data to obtain simulation data related to the classification model; A second acquisition unit, used to acquire a tag type sequence; A second determining unit, configured to determine a first loss function based on the label type sequence and simulated data related to the classification model; The first generating unit is used to update the parameters of the first encoder network and the second encoder network by using the first loss function until the loss value of the first loss function converges, thereby generating a noise label detection model.
12. A model training device, characterized in that: include: a processor and a memory for storing a computer program capable of running on said processor; Wherein, when the processor is used to run the computer program, it executes the steps of the method described in any one of claims 1 to 10.
13. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.
14. A computer program product comprising a computer program, characterized in that The computer program implements the steps of the method according to any one of claims 1 to 10 when executed by a processor.
Citation Information
Patent Citations
Target recognition model training method and device and electronic equipment
CN112990432A
Noise sample identification method and device
CN116229196A
Noise label correction method and system based on self-distillation assistance
CN117708688A
Multi-task classification method and apparatus, computer device, and storage medium
WO2021151296A1
Cited By
Model training method, apparatus and device, and storage medium and computer program product
WO2025201138A1
