Metatag self-correction method based on feature constraint

By introducing feature constraint loss in the meta-learning process, the problem that existing meta-learning methods require manual specification of clean data and ignoring generalization performance is solved, and more accurate label correction and stronger model generalization capabilities are achieved.

CN120107668AActive Publication Date: 2025-06-06UNIV OF ELECTRONICS SCI & TECH OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510170833.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-17
Publication Date
2025-06-06
Estimated Expiration
2045-02-17

AI Technical Summary

Technical Problem

The existing meta-learning-based noise label processing method requires manual specification of clean data, and the model learning process only considers the minimum optimization loss, ignoring the impact of the overall generalization performance of the model.

Method used

The meta tag self-correction method based on feature constraints is adopted to distinguish noise from clean tags through the gradient change metric of the classification model, and feature constraint loss is introduced as regular terms to improve the generalization performance of the meta-learning model.

Benefits of technology

Improve the accuracy of meta tag correction, enhance the generalization performance of the model, and reduce the dependence on manual clean data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120107668A_ABST
    Figure CN120107668A_ABST
Patent Text Reader

Abstract

The invention discloses a feature constraint-based meta-label self-correction method, which comprises the following steps of: firstly, dividing an image data set to obtain a clean sample set, a noise sample set and a complex sample set, setting a label correction network and two feature extraction networks, and taking learning of a second feature extraction network and a target classification model as a lower-layer task of meta learning; taking the first feature extraction network and the label correction network as upper-layer tasks of meta-learning so as to obtain a meta-learning model; training and updating a second feature extraction network and a target classification model by using a complex sample set, training and updating a first feature extraction network and a label correction network by using a clean sample set and a noise sample set, and regularly re-dividing an image data set in the process; and taking the current label of each image sample after iteration as a final label, and completing label self-correction. According to the method, the generalization performance of the meta learning model can be effectively improved, so that the accuracy of meta label correction is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of tag correction, and more specifically, relates to a meta-tag self-correction method based on feature constraints. Background Art

[0002] With the rapid development of big data technology, the generation, collection and use of massive data have spawned various data processing methods. Among them, deep learning methods are widely used and have an important impact on people's production and life. The training of traditional deep learning models relies heavily on high-quality data and high-quality annotations, but it is difficult to avoid errors in the actual collection, storage and annotation of data. Therefore, directly using existing noisy labeled data for training usually leads to poor generalization performance of the model, and discarding the label and using it as unsupervised data will lead to incomplete information utilization. Therefore, more and more researchers have begun to study the problem of learning with noisy labels (LNL).

[0003] According to different processing methods, LNL problem processing methods can be roughly divided into the following three categories: 1) Data. This type of method starts from the data and adds a nonlinear mapping layer (that is, realizing the noise conversion matrix) in the network model learning to achieve data adaptation to reduce the impact of noise labels on model training. There are also methods that correct the loss from the perspective of data loss to alleviate this problem; 2) Loss function. This type of method starts from the perspective of regularization terms and proposes to add appropriate regularization terms to the loss to alleviate the problem of noise labels. There are also methods that propose to design robust loss functions to learn models with stronger generalization performance; 3) Optimization. This type of method attempts to alleviate this problem from the perspective of optimization. For example, new ways of solving the problem are introduced to make the results closer to the theoretical optimal solution, thereby improving the performance of the model.

[0004] The noisy label processing method based on meta-learning is a type of optimization. This method usually uses artificially given clean data as the source of metadata, and then uses the learned meta-knowledge to guide the training of noisy data. The common meta-learning process usually includes two stages, namely the meta-training stage and the meta-testing stage. In the meta-training stage, meta-knowledge is learned through clean data, and then the training of the model (such as the classification model) in the meta-testing stage is guided. For example, Shu et al. proposed to use the loss weighted network learned by specifying clean data in the meta-training stage to provide weight support for the update of the classification network parameters in the meta-testing stage to alleviate the problem of high loss values ​​caused by noisy label samples. Some researchers have also proposed a label correction method based on meta-learning. For example, Zheng et al. proposed to use the label correction network learned in the meta-training stage to alleviate this problem.

[0005] However, the existing meta-learning-based methods all have room for improvement: 1) The above existing methods all require manual specification of clean data, and the prerequisites are relatively difficult; 2) The model learning process only considers the minimization of optimization loss, ignoring the impact of the overall generalization performance of the model on the model. Summary of the invention

[0006] The purpose of the present invention is to overcome the shortcomings of the prior art and provide a meta-tag self-correction method based on feature constraints. First, the noise and clean label data in the data set are distinguished based on the measure of the gradient change of the classification model. Then, the feature constraint loss is introduced as a regularization term in the label correction stage to improve the generalization performance of the meta-learning model, thereby improving the accuracy of meta-tag correction.

[0007] In order to achieve the above-mentioned object of the invention, the meta tag self-correction method based on feature constraints of the present invention comprises the following steps:

[0008] S1: For the image dataset X that needs to be self-corrected, each image sample is denoted as I n , corresponding to the original label y n , n=1,2,…,N, N represents the number of image samples in the image dataset; divide the image dataset X into several batches, use the preset classification model to perform M rounds of label prediction on the image dataset, and calculate the gradient of the loss function of each image sample in each round of label prediction m=1,2,…,M; the score of each image sample is calculated using the following formula: n :

[0009]

[0010] Among them, Norm() means normalization, || || 2 represents the calculation of the two-norm, and λ represents the preset weight;

[0011] The separation parameter s is preset to a value range of s<0.5. If the score of image sample n is n <s, it is regarded as a clean sample. If the score of image sample n is s≤score n <1-s, it is regarded as a complex sample. If the score of image sample n is n ≥1-s, it is regarded as a noise sample; thus the image data set is divided into a clean sample set Noise Sample Set and Complex Samples Set

[0012] S2: according to actual needs, two feature extraction networks with the same structure are set to extract feature images of input image samples;

[0013] A label correction network is set according to actual needs to receive the feature image output by the first feature extraction network and predict the correction label of the input image sample;

[0014] According to actual needs, a target classification model is set to receive the feature image output by the second feature extraction network and obtain the classification label of the input image sample;

[0015] The learning of the second feature extraction network and the target classification model is used as the lower-level task of meta-learning, and the first feature extraction network and the label correction network are used as the upper-level task of meta-learning, thereby obtaining a meta-learning model;

[0016] Initialize the parameters of the second feature extraction network Parameters w of the target classification model (1) and the parameters of the first feature extraction network Parameters θ of the label correction network (1) ;

[0017] S3: record the number of iterations t = 1;

[0018] S4: clean sample sets Noise Sample Set and Complex Samples Set Perform sample sampling to obtain a clean sample set X cl , noise sample set X ny and complex sample set X cp ;

[0019] S5: Perform meta-learning for this round based on feature constraints. The specific method is as follows:

[0020] S5.1: Use the current complex sample set X cp The target classification model is initially trained, and the parameters of the second feature extraction network and the target classification model are updated respectively to obtain the parameters of the feature extraction network. and the initial training parameters of the target classification model Among them, the loss function of the second feature extraction network adopts the feature constraint loss function, and the complex sample set X cp For each sample x i The feature-constrained loss function The calculation formula is as follows:

[0021]

[0022] in, Indicates that the parameter is The features extracted by the second feature extraction network, δ 1 Indicates |X cp |-dimensional vector, Xcp,k Represents the current complex sample set X cp The sample set of category k in , α 1 Indicates |X cp,k |-dimensional vector, Represents a complex sample set X cp Other sample sets other than category k, β 1 express dimensional vector;

[0023] Target classification model parameters are being updated, complex sample set For each sample x i The loss function The calculation formula is as follows:

[0024]

[0025] in, represents the preset classification loss function, Denote the parameter as θ (t) The label correction network for sample x i The corrected label, f(x i ,w (t) ) indicates that the parameter is w (t) The target classification model for sample x i The predicted label, γ vc Indicates the preset balance coefficient;

[0026] S5.2: Use the current clean sample set X cl , noise sample set X ny Train the label correction network, update the parameters of the first feature extraction network and the label correction network respectively, and obtain the parameters of the first feature extraction network and the training parameters θ of the label correction network (t+1) ; Among them, the loss function of the first feature extraction network adopts the feature constraint loss function, and the clean sample set X cl and noise sample set X ny For each complex sample x j The calculation formula of the feature constraint loss function is as follows:

[0027]

[0028] Among them, z∈{cl,ny}, Indicates that the parameter is The features extracted by the first feature extraction network, δ 2 Indicates |X z |-dimensional vector, x j Represents a sample set The jth sample in Represents a sample set The sample set of category k in , α 2 Indicates |X z,k |-dimensional vector, Represents a sample set Other sample sets other than category k, β 2 express dimensional vector;

[0029] Each sample x in the label correction network j The loss function The loss function is calculated as follows:

[0030]

[0031] in, Represents the preset label correction loss Represents sample x j The current label, Indicates that the parameter is The target classification model for sample x j Predicted labels;

[0032] S5.3: Using the updated label correction network, using complex sample sets The second feature extraction network and the target classification model are trained again, and the parameters of the second feature extraction network and the target classification model are updated respectively to obtain the parameters of the feature extraction network. and the parameters w of the target classification model (t+1) ; In the feature extraction network parameter update, the complex sample set For each sample x i The feature-constrained loss function The calculation formula is as follows:

[0033]

[0034] in, Indicates that the parameter is The features extracted by the second feature extraction network;

[0035] Target classification model parameters are being updated, complex sample set For each sample x i The loss function The calculation formula is as follows:

[0036]

[0037] in, Denote the parameter as θ (t+1) The label correction network for sample xi Correct the obtained labels;

[0038] S6: Determine whether t<t max , t max Indicates the preset maximum number of iterations. If yes, proceed to step S7, otherwise proceed to step S11;

[0039] S7: Determine whether t%Q=0, where Q represents a preset data set update period. If yes, proceed to step S8; otherwise, proceed directly to step S9;

[0040] S8: Set t=t+1, and return to step S5;

[0041] S9: For the clean sample set Let each sample label Remain unchanged; for the noise sample set and Complex Samples Set Each sample is input into the current first feature extraction network and label correction network, and the obtained label is used as the corrected label of the sample and the current label is Make updates;

[0042] S10: Count the gradient of the loss function of each image sample in the most recent Q trainings, use the same method as in step S1 to calculate the average score of each image sample in the most recent Q trainings, and re-divide the N image samples to obtain a clean sample set Noise Sample Set and Complex Samples Set Let t=t+1, and return to step S4;

[0043] S11: taking the labels of the current N image samples as their final labels to complete label self-correction.

[0044] The present invention is a meta-label self-correction method based on feature constraints. First, a preset classification model is used to perform several rounds of label prediction on an image data set, and the score of each image sample is calculated according to the gradient of the loss function of each image sample. Based on this, the image data set is divided into a clean sample set, a noisy sample set and a complex sample set. A label correction network and two feature extraction networks are set, and the learning of the second feature extraction network and the target classification model is used as the lower-level task of meta-learning, and the first feature extraction network and the label correction network are used as the upper-level task of meta-learning, thereby obtaining a meta-learning model; then the second feature extraction network and the target classification model are updated by training with the complex sample set, and the first feature extraction network and the label correction network are updated by training with the clean sample set and the noisy sample set. In this process, the image data set is re-divided regularly, and the current label of each image sample after the iteration is completed is used as its final label to complete the label self-correction.

[0045] The present invention introduces feature constraint loss as a regularization term in the meta-learning process to learn more accurate features, thereby training a more accurate label correction network and improving the accuracy of meta-label correction. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 It is a flowchart of a specific implementation of the meta tag self-correction method based on feature constraints of the present invention;

[0047] Figure 2 is a flow chart of meta-learning based on feature constraints in the present invention;

[0048] Figure 3 It is a comparison diagram of the thermal maps before and after correction of the present invention and the comparative method in this embodiment on the CIFAR10 data set containing 50% symmetric noise data. DETAILED DESCRIPTION

[0049] The specific implementation of the present invention is described below in conjunction with the accompanying drawings so that those skilled in the art can better understand the present invention. It should be noted that in the following description, when the detailed description of known functions and designs may dilute the main content of the present invention, these descriptions will be omitted here.

[0050] Figure 1 It is a flowchart of a specific implementation of the meta-tag self-correction method based on feature constraints of the present invention.

[0051] like Figure 1 As shown, the meta tag self-correction method based on feature constraints of the present invention includes the following steps:

[0052] S101: Dataset division:

[0053] For the image dataset X that needs to be self-corrected by labels, each image sample is denoted as I n , corresponding to the original label y n ,n=1,2,…,N,N represents the number of image samples in the image dataset. Divide the image dataset X into several batches, use the preset classification model to perform M rounds of label prediction on the image dataset, and calculate the gradient of the loss function of each image sample in each round of label prediction. m=1,2,…,M. In the label prediction of this embodiment, the loss function of each image sample adopts the cross entropy loss, and its calculation formula is as follows:

[0054]

[0055] Among them, y k Represents the probability that the original label of the image sample is in category k, p kIndicates the probability that the predicted label of the image specimen is in category k, k = 1, 2, ..., K, K represents the number of categories. Since the dataset labels contain noise, the network learning guided by this loss function will have a large gradient change for the same sample in different rounds. Therefore, the present invention judges the label quality according to the change score of the predicted sample gradient factor to divide the dataset. The specific method is:

[0056] The following formula is used to calculate the score of each image sample: n :

[0057]

[0058] Among them, Norm() means normalization, || || 2 Indicates the calculation of the two norms, and λ indicates the preset weight, which is used to adjust the parameters to balance the two gradient change value measurement parts.

[0059] In the above formula, the first term The second term is to calculate the mean of the gradient norm of two adjacent rounds and normalize the result. It is to calculate the cosine value of the angle between the gradient changes in adjacent rounds.

[0060] The larger the score, the more likely the sample label is to be a noise label. Given that the gradient change value directly learned in a high-noise environment cannot quickly distinguish between clean and noise labels, the present invention chooses to use scoring sorting to divide the dataset labels. That is, the separation parameter s is pre-set, and its value range is s < 0.5. If the score of image sample n is n <s, it is regarded as a clean sample. If the score of image sample n is s≤score n <1-s, it is regarded as a complex sample. If the score of image sample n is n ≥1-s, it is regarded as a noise sample. Thus, the image data set is divided into a clean sample set Noise Sample Set and Complex Samples Set

[0061] S102: Building a meta-learning model:

[0062] According to actual needs, two feature extraction networks with the same structure are set up to extract feature images of input image samples.

[0063] A label correction network is set according to actual needs to receive the feature image output by the first feature extraction network and predict the correction label of the input image sample.

[0064] The target classification model is set according to actual needs to receive the feature image output by the second feature extraction network and obtain the classification label of the input image sample.

[0065] The learning of the second feature extraction network and the target classification model is used as the lower-level task of meta-learning, and the first feature extraction network and the label correction network are used as the upper-level task of meta-learning, thereby obtaining a meta-learning model.

[0066] Initialize the parameters of the second feature extraction network Parameters w of the target classification model (1) and the parameters of the first feature extraction network Parameters θ of the label correction network (1) .

[0067] S103: Record the number of iterations t=1.

[0068] S104: Sample Sampling:

[0069] For the clean sample set Noise Sample Set and Complex Samples Set Perform sample sampling to obtain a clean sample set X cl , noise sample set X ny and complex sample set X cp .

[0070] In order to improve the sample quality of the sample set, the sample set images of the current batch can be enhanced. Since different images have different effects on the model, in this embodiment, strong enhancement is used for clean samples, such as AutoAugment or RandAugment (in actual applications, the enhancement method can be selected according to different situations), and weak enhancement is used for noisy samples and complex samples. The weak enhancement methods include one or more of flipping, rotating, and cropping.

[0071] S105: Meta-learning based on feature constraints:

[0072] In order to increase the generalization performance of the model, the feature extraction network introduced in the present invention learns features with constraints. According to existing research, the generalization error bound is established with a probability not less than 1-δ, and its specific form is shown in formula (3):

[0073]

[0074] Among them, P() represents probability, E(h) represents the true error of the model, represents the empirical error of the model, and the difference between the two is the generalization error bound of the model, e represents the natural constant, and n represents the number of samples in the data set. From formula (3), we can see that the generalization error upper bound is the VC dimension value d of the model VCTherefore, d is reduced VC The value of can reduce the upper bound of the generalization error, so it can be minimized by VC To enhance the generalization performance of the model.

[0075] According to Vapnik's theory, for a data partitioning model, the value of its VC dimension satisfies the following formula:

[0076]

[0077] Here, R represents the radius of the sphere that projects the original data onto, and M is the distance from the partitioning hyperplane to the nearest sample. For classification tasks, the data dimension d is usually much larger than R. 2 / M 2 Therefore, the optimization of VC dimension can be transformed into solving R and M.

[0078] remember is the model feature extraction parameter, and its value space is Ψ, then formula (4) can be rewritten as formula (5):

[0079]

[0080] Among them, X + With X - To select the data of the category and other category sample data.

[0081] In order to facilitate the solution of R and M, the present invention introduces the definition of convex hull ch() by Boyd et al., which is shown in formula (6):

[0082]

[0083] Here, the α dimension is the canonical form of |X|-1.

[0084] From formula (6), we can know that the convex hull of a data set is the linear weighted sum of the samples in the data set. If the distance from any point in the sphere to the center of the sphere is not greater than the radius, then we have formula (7):

[0085]

[0086] Among them, ball represents the smallest ball that can contain all samples X, with a radius of r and a center of c.

[0087] According to formula (6), the convex hull of the data set can be written as the weighted sample of the data set, so we can let C(X) = Xη, then we have R 2 for According to the definition of convex hull as the smallest convex polygon that contains all the data in the data set, the corresponding vector η must meet the standard shape constraint so that the radius R(X) is the smallest, then there is formula (8):

[0088]

[0089] Define the distance between two convex hulls as Where X + With X - Represents data divided into two categories by the hyperplane. Then, by combining this formula with formula (6), we can obtain formula (9):

[0090]

[0091] Where α and β are learnable vectors that help project data into the solution. Finally, by substituting formulas (8) and (9) into (5), the final optimization objective formula is shown in (10):

[0092]

[0093] in, represents the parameters of the feature extraction network, Ψ represents the value space of the feature extraction network parameters. X represents the input sample set, x represents the sample in the input sample set, represents the features extracted by the feature extraction network, δ represents the |X|-dimensional vector, and || represents the number of samples in the sample set. X k represents the sample set of category k in the input sample set X, and α represents |X k |-dimensional vector, represents the sample set other than category D in the input sample set X, and β represents dimensional vector.

[0094] Based on the above analysis, the present invention makes the feature constraint loss Then the feature constraint loss is integrated into the meta-learning process as a regular term, and a meta-learning method based on feature constraints is proposed. Figure 2 This is a flow chart of the meta-learning based on feature constraints in the present invention. Figure 2 As shown, the specific steps of meta-learning based on feature constraints in the present invention include:

[0095] S201: Initial training of target classification model:

[0096] Use the current complex sample set X cp The target classification model is initially trained, and the parameters of the second feature extraction network and the target classification model are updated respectively to obtain the parameters of the second feature extraction network. and the initial training parameters of the target classification model Among them, the loss function of the second feature extraction network adopts the feature constraint loss function, and the complex sample set X cp For each sample x i The feature-constrained loss function The calculation formula is as follows:

[0097]

[0098] in, Indicates that the parameter is The features extracted by the second feature extraction network, δ 1 Represents X cp |-dimensional vector, X cp,k Represents the current complex sample set X cp The sample set of category k in , α 1 Indicates |X cp,k |-dimensional vector, Represents a complex sample set X cp Other sample sets other than category k, β 1 express dimensional vector.

[0099] At this time, the update formula of the feature extraction network parameters can be expressed as follows:

[0100]

[0101] Among them, η vc Represents the learning rate of the feature extraction network.

[0102] Target classification model parameters are being updated, complex sample set For each sample x i The loss function The calculation formula is as follows:

[0103]

[0104] in, Represents a preset classification loss function. In this embodiment, the classification loss function adopts cross entropy loss. Denote the parameter as θ (t) The label correction network for sample x i The corrected label, f(x i ,w (t) ) indicates that the parameter is w (t) The target classification model for sample x i The predicted label, γ vc Represents the preset balance coefficient, which is used to adjust the weight between the classification loss function and the feature constraint loss function.

[0105] At this time, the update formula of the target classification model parameters can be expressed as:

[0106]

[0107] Among them, ηtrain Represents the learning rate of the preset target classification model.

[0108] Since the training of the target classification model depends on the correction of the network parameters θ, the initial training update here is not the final result of this round of classification network update.

[0109] S202: Label correction network training:

[0110] Next, use the current clean sample set X cl , noise sample set X ny Train the label correction network, update the parameters of the first feature extraction network and the label correction network respectively, and obtain the parameters of the first feature extraction network and the training parameters θ of the label correction network (t+1) Among them, the loss function of the first feature extraction network adopts the feature constraint loss function, and the clean sample set X cl and noise sample set X ny For each complex sample x j The calculation formula of the feature constraint loss function is as follows:

[0111]

[0112] Among them, z∈{cl,ny}, Indicates that the parameter is The features extracted by the first feature extraction network, δ 2 Indicates |X z |-dimensional vector, x j Represents a sample set The jth sample in Represents a sample set The sample set of category k in , α 2 Indicates |X z,k |-dimensional vector, Represents a sample set Other sample sets other than category k, β 2 express dimensional vector.

[0113] At this time, the update formula of the first feature extraction network parameters can be expressed as follows:

[0114]

[0115] Each sample x in the label correction network j The loss function The loss function is calculated as follows:

[0116]

[0117] in, represents the preset label correction loss, Represents sample x j The current label, Indicates that the parameter is The target classification model for sample x j The predicted labels. In this embodiment, the label correction loss of clean samples and noise samples is calculated using different methods, and the calculation formula is as follows:

[0118]

[0119] At this time, the update formula of the label correction network parameters is as follows:

[0120]

[0121] Among them, η meta Represents the learning rate of the preset target classification model.

[0122] In order to make full use of the learned information, in this embodiment, the sample x j Current label of Labels from the previous round And the prediction results of this round of target classification model Fusion is performed to generate new labels to guide the training of the model, which is as follows:

[0123]

[0124] Among them, λ y is the preset weight to balance the two items. For sample x j The initial label y j , so that the label information given in the dataset is also utilized.

[0125] S203: Target classification model retraining:

[0126] Since the labels in the initial training of the target classification network in step S201 contain noise, the first gradient update obtains is not very accurate, so the present invention uses the updated label correction network and uses a complex sample set The second feature extraction network and the target classification model are trained again, and the parameters of the second feature extraction network and the target classification model are updated respectively to obtain the parameters of the feature extraction network. and the parameters w of the target classification model (t+1) ; In the feature extraction network parameter update, the complex sample set For each sample x i The feature-constrained loss function The calculation formula is as follows:

[0127]

[0128] in, Indicates that the parameter is The features extracted by the second feature extraction network.

[0129] At this time, the update formula of the second feature extraction network parameters can be expressed as follows:

[0130]

[0131] Target classification model parameters are being updated, complex sample set For each sample x i The loss function The calculation formula is as follows:

[0132]

[0133] in, Denote the parameter as θ (t+1) The label correction network for sample x i Correct the obtained labels.

[0134] At this time, the update formula of the target classification model parameters can be expressed as:

[0135]

[0136] S106: Determine whether t<t max , t max Indicates the preset maximum number of iterations. If yes, go to step S107, otherwise go to step S111.

[0137] S107: Determine whether t%Q=0, where Q represents a preset data set update period. If so, proceed to step S108; otherwise, proceed to step S109.

[0138] S108: Let t=t+1, and return to step S105.

[0139] S109: Label update:

[0140] For the clean sample set Let each sample label Remain unchanged. For the noise sample set and Complex Samples Set Each sample is input into the current first feature extraction network and label correction network, and the obtained label is used as the corrected label of the sample and the current label is to update.

[0141] S110: Re-dividing the data set:

[0142] Count the gradient of the loss function of each image sample in the most recent Q trainings, use the same method as in step S101 to calculate the average score of each image sample in the most recent Q trainings, and re-divide the N image samples to obtain a clean sample set Noise Sample Set and Complex Samples Set Let t=t+1, and return to step S104.

[0143] In practical applications, the noise content of the label correction dataset is relatively high at the beginning, so a smaller separation parameter is taken to facilitate the separation of noise and clean labels. Then, as the training progresses, the label noise content gradually decreases and the separation parameter can be increased to allow more labels to be classified as clean labels. Therefore, each time the dataset is re-divided, the separation parameter s = s + Δs, where Δs represents the preset growth step.

[0144] S111: Complete label self-calibration:

[0145] The labels of the current N image samples are used as their final labels to complete the label self-correction. Subsequently, the image samples and the corrected labels can be used as training samples to further update the parameters of the classification network model until the training of the classification network model is completed.

[0146] In order to better illustrate the technical effect of the present invention, a specific example is used to experimentally verify the present invention. In this experimental verification, the most commonly used typical data sets CIFAR10 and CIFAR100 in this field are used as examples, and the present invention is compared and analyzed with other existing methods in the field. The present invention is implemented using PyTorch programming and trained using NVIDIA GPU. The detailed experimental information is as follows:

[0147] 1. Dataset: The CIFAR10 dataset is a basic image dataset with 10 categories. The entire dataset contains 60,000 images, including 50,000 images in the training set and 10,000 images in the test set. Each image has three RGB channels and its pixel size is 32*32. The CIFAR100 dataset has 100 categories, each with 600 images of 32*32 size, of which 500 are training samples and 100 are test samples.

[0148] 2. Implementation details

[0149] 2.1) Network Architecture

[0150] In this embodiment, the classification model uses ResNet18 when dividing the data set, and the two feature extraction networks also use ResNet18. The label correction network is completed using a single hidden layer MLP (feature extraction is not involved here, and the label correction network directly uses the features extracted by the classification network as input to achieve correction). The target classification network for noisy data training still uses ResNet18 as the backbone network, and then adds feature constraints as regularization terms to improve the accuracy of feature extraction.

[0151] 2.2) Hyperparameter Setting

[0152] The noise label separation parameter s takes values ​​of [0.1, 0.2, 0.3, 0.4]. At the beginning of model training, the noise content of the dataset is relatively high, so a smaller separation value is taken to facilitate the separation of noise and clean labels. Then, as the training progresses, the label noise content gradually decreases and the separation value is increased so that more labels can be classified as clean labels. Feature learning constraint parameter γ vc Depending on the data set, the common values ​​are [0.1, 0.01, 0.001]. ny The common value of is [0.1, 0.01, 0.001]. As the correction process proceeds, the number of noisy labels decreases, gradually reducing the impact of noisy labels on the correction process.

[0153] 2.3) Data preprocessing

[0154] Since the labels of the original CIFAR10 dataset and CIFAR100 dataset do not contain noise, artificial noise is added to the training set in order to better measure the effectiveness of the proposed method. In this experiment, 20%, 40%, 60%, and 80% noise were added to the labels of the dataset to test the present invention. The added noise type was uniform noise, that is, a specified proportion of noise was added to each category so that the added labels still only contained 10 categories and the number of labels in each category remained basically the same.

[0155] 2.4) Comparison of algorithms and evaluation indicators

[0156] In this experimental verification, the present invention is compared with previous methods in this field to reflect the performance of the proposed method. Specifically, taking Cross Entropy (CE) as a comparison benchmark, the comparison methods are divided into two categories: non-meta-learning-based methods such as Bootstrapping, M-Correction, and Co-teaching, and meta-learning-based methods such as MSLC and MLC. Specifically, the Bootstrapping method gradually reduces the model's dependence on noise labels by weighted mixing the model predictions with the original labels in a certain proportion, thereby improving the robustness of training. The M-Correction method uses a bias correction module to correct the noise labels, and adjusts the model's prediction results by learning the correction function to reduce the impact of noise. Co-teaching uses a mechanism in which dual models train each other and screen samples, and gradually filters out possible noise label samples by allowing the two models to only learn each other's low-loss samples. MSLC and MLC both use meta-learners to learn correction networks to reduce the noise label content of the data set and thus improve model performance.

[0157] In order to make a fair comparison, this embodiment uses classification accuracy as the evaluation indicator, and its specific calculation formula is as follows:

[0158]

[0159] Among them, TP represents a positive example with correct classification, TN represents a positive example with incorrect classification, FP represents a negative example with correct classification, and FN represents a negative example with incorrect classification.

[0160] Table 1 is a comparison table of classification results of the present invention and the comparative method in this embodiment on the CIFAR10 dataset and the CIFAR100 dataset under the Symmetric mode with different noise rates.

[0161]

[0162] Table 1

[0163] Table 2 is a comparison table of classification results of the present invention and the comparative method in this embodiment on the CIFAR10 dataset and the CIFAR100 dataset at different noise rates in the Asymmetric mode.

[0164]

[0165] Table 2

[0166] The best results in Table 1 and Table 2 are highlighted in bold. It can be seen from Table 1 and Table 2 that the present invention has a certain improvement over all other comparison algorithms under the setting of 20%-80% noise rate in the Symmetric and Asymmetric noise of CIFAR10 and CIFAR100 datasets. For example, when the noise rate is 20%, the overall average improvement is 8.23%. In general, it can be seen from the experimental results that the present invention has better processing capabilities for noise labels than other comparison algorithms, and the performance of the learned classification model is better.

[0167] Figure 3 : is a comparison diagram of the thermal images before and after correction of the present invention and the comparative method on the CIFAR10 dataset containing 50% symmetric noise data in this embodiment. Figure 3 It can be seen intuitively that the present invention effectively reduces the noise rate of the data set, and the noise rate of all categories of noise labels is reduced by an average of 38.64%, and the quality of the data set is significantly improved.

[0168] Although the above describes the illustrative specific embodiments of the present invention to facilitate those skilled in the art to understand the present invention, it should be clear that the present invention is not limited to the scope of the specific embodiments. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations using the concept of the present invention are protected.

Claims

1. A meta-tag self-correction method based on feature constraints, characterized in that: The following steps are involved: S1: For the image dataset X that needs to be self-corrected, each image sample is denoted as I n , corresponding to the original label y n , n=1,2,…,N, N represents the number of image samples in the image dataset; divide the image dataset X into several batches, use the preset classification model to perform M rounds of label prediction on the image dataset, and calculate the gradient of the loss function of each image sample in each round of label prediction m=1,2,…,M; the score of each image sample is calculated using the following formula: n : Among them, Norm() means normalization, || ||2 means obtaining the bi-norm, and λ means the preset weight; The separation parameter s is preset to a value range of s<0.

5. If the score of image sample n is n <s, it is regarded as a clean sample. If the score of image sample n is s≤score n <1-s, it is regarded as a complex sample. If the score of image sample n is n ≥1-s, it is regarded as a noise sample; thus the image data set is divided into a clean sample set Noise Sample Set and Complex Samples Set S2: according to actual needs, two feature extraction networks with the same structure are set to extract feature images of input image samples; A label correction network is set according to actual needs to receive the feature image output by the first feature extraction network and predict the correction label of the input image sample; According to actual needs, a target classification model is set to receive the feature image output by the second feature extraction network and obtain the classification label of the input image sample; The learning of the second feature extraction network and the target classification model is used as the lower-level task of meta-learning, and the first feature extraction network and the label correction network are used as the upper-level task of meta-learning, thereby obtaining a meta-learning model; Initialize the parameters of the second feature extraction network Parameters w of the target classification model (1) and the parameters of the first feature extraction network Parameters θ of the label correction network (1) ; S3: record the number of iterations t = 1; S4: clean sample sets Noise Sample Set and Complex Samples Set Perform sample sampling to obtain a clean sample set X cl , noise sample set X ny and complex sample set X cp ; S5: Perform meta-learning for this round based on feature constraints. The specific method is as follows: S5.1: Use the current complex sample set X cp The target classification model is initially trained, and the parameters of the second feature extraction network and the target classification model are updated respectively to obtain the parameters of the feature extraction network. and the initial training parameters of the target classification model Among them, the loss function of the second feature extraction network adopts the feature constraint loss function, and the complex sample set X cp For each sample x i The feature constraint loss function The calculation formula is as follows: in, Indicates that the parameter is The features extracted by the second feature extraction network, δ1 represents |X cp |-dimensional vector, X cp,k Represents the current complex sample set X cp The sample set of category k in X, α1 represents | cp,k |-dimensional vector, Represents a complex sample set X cp Other sample sets other than category k, β1 represents dimensional vector; Target classification model parameters are being updated, complex sample set For each sample x i The loss function The calculation formula is as follows: Among them, l train () represents the preset classification loss function, Denote the parameter as θ (t) The label correction network for sample x i The corrected label, f(x i ,w (t) ) indicates that the parameter is w (t) The target classification model for sample x i The predicted label, γ vc Indicates the preset balance coefficient; S5.2: Use the current clean sample set X cl , noise sample set X ny Train the label correction network, update the parameters of the first feature extraction network and the label correction network respectively, and obtain the parameters of the first feature extraction network and the training parameters θ of the label correction network (t+1) ; Among them, the loss function of the first feature extraction network adopts the feature constraint loss function, and the clean sample set X cl and noise sample set X ny For each complex sample x j The calculation formula of the feature constraint loss function is as follows: Among them, z∈{cl,ny}, Indicates that the parameter is The features extracted by the first feature extraction network, δ2 represents |X z |-dimensional vector, x j Represents a sample set The jth sample in Represents a sample set The sample set of category k in X, α2 represents | z,k |-dimensional vector, Represents a sample set Other sample sets other than category k, β2 represents dimensional vector; Each sample x in the label correction network j The loss function The loss function is calculated as follows: Among them, l meta () represents the preset label correction loss Represents sample x j The current label, Indicates that the parameter is The target classification model for sample x j Predicted labels; S5.3: Using the updated label correction network, using complex sample sets The second feature extraction network and the target classification model are trained again, and the parameters of the second feature extraction network and the target classification model are updated respectively to obtain the parameters of the feature extraction network. and the parameters w of the target classification model (t+1) ; In the feature extraction network parameter update, the complex sample set For each sample x i The feature constraint loss function The calculation formula is as follows: in, Indicates that the parameter is The features extracted by the second feature extraction network; Target classification model parameters are being updated, complex sample set For each sample x i The loss function The calculation formula is as follows: in, Denote the parameter as θ (t+1) The label correction network for sample x i Correct the obtained labels; S6: Determine whether t<t max , t max Indicates the preset maximum number of iterations. If yes, proceed to step S7, otherwise proceed to step S11; S7: Determine whether t%Q=0, where Q represents a preset data set update period. If yes, proceed to step S8; otherwise, proceed directly to step S9; S8: Set t=t+1, and return to step S5; S9: For the clean sample set Let each sample label Remain unchanged; for the noise sample set and Complex Samples Set Each sample is input into the current first feature extraction network and label correction network, and the obtained label is used as the corrected label of the sample and the current label is Make updates; S10: Count the gradient of the loss function of each image sample in the most recent Q trainings, use the same method as in step S1 to calculate the average score of each image sample in the most recent Q trainings, and re-divide the N image samples to obtain a clean sample set Noise Sample Set and Complex Samples Set Let t=t+1, and return to step S4; S11: taking the labels of the current N image samples as their final labels to complete label self-correction.

2. The meta tag self-correction method according to claim 1, characterized in that: In step S4, the clean sample set X cl , noise sample set X ny and complex sample set X cp The samples in are enhanced, where strong enhancement is used for clean samples and weak enhancement is used for noisy samples and complex samples.

3. The meta tag self-correction method according to claim 1, characterized in that: The label correction loss l in step S5.2 meta The calculation formula of () is as follows:

4. The meta tag self-correction method according to claim 1, characterized in that: In step S5.2, the label The following formula is used to obtain: Among them, λ y is the preset weight, For sample x j The initial label y j .

5. The meta tag self-correction method according to claim 1, characterized in that: When the data set is re-divided in step S10, the separation parameter s=s+Δs, where Δs represents a preset growth step.

Citation Information

Patent Citations

  • Label self-correction method based on meta learning

    CN117456306A

  • Passive domain adaptive image classification method based on class guide meta-learning

    CN117523295A