Two-stage noise label image classification method and system based on dual-network cooperative training mode
By adopting a two-stage method of dual network collaborative training mode in image classification, using sample history information and dynamic thresholds to select small loss samples, the problem of noise overfitting during noise label training is solved, and the generalization performance of the model is improved .
Patent Information
- Application Number
- CN202411359942.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-09-27
AI Technical Summary
In the process of processing image training with noise labels, it is difficult to accurately filter noise labels, resulting in a degradation of model overfitting and generalization performance.
A two-stage image classification method based on dual-network collaborative training mode is adopted. By selecting clean instances to train the network, using sample history information for discrimination and reweighting, and dynamic thresholds to select small loss samples for network parameters to be updated.
Effectively filter noise labels, reduce the overfitting of the model to noise labels, and improve the generalization performance and classification accuracy of the model.
Smart Images

Figure CN119445196A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of deep learning technology, and in particular to a two-stage noisy labeled image classification method and system based on a dual-network collaborative training mode. Background Art
[0002] In recent years, deep neural networks have achieved great success in the field of computer vision, but the excellent performance of deep neural networks usually relies on accurately labeled large-scale datasets. In industrial applications, obtaining such large-scale datasets usually requires huge labeling costs, which is both expensive and time-consuming, especially in fields that require expertise, such as medicine and the military. Therefore, in order to save labeling costs, many researchers seek some alternative methods that can be used to complete dataset labeling. Common alternative methods include crowdsourcing, web search, and automatic labeling tools. However, datasets labeled by these alternative methods usually contain more noisy labels. The introduction of these noisy labels may have a very serious impact in practical applications, so many methods have been proposed to deal with the noisy label problem. In addition, deep neural networks are very easy to overfit noisy labels, which seriously reduces the generalization performance of the model. Therefore, designing an effective image classification method with noisy labels has high practical value.
[0003] Recently, co-training to select small loss samples to deal with noisy labels has become a mainstream method to deal with noisy label interference. This type of method uses a direct processing method to retain small loss samples for network parameter updates and discard samples with larger loss values to avoid network overfitting noise. At the same time, most of these methods are based on the dual-network co-training model, which can effectively avoid the problem of cumulative bias that is easily caused by using a single model. However, this type of method still has some shortcomings. The practice of directly linking the size of the loss value to whether the sample is retained cannot accurately filter out all noise, and the dual network is prone to degenerate into two networks with exactly the same parameters in the later stage of training, losing the advantage of multi-model joint guidance. Summary of the invention
[0004] In order to solve the technical problems arising in the training process of noisy labeled images in the prior art, the present invention provides a two-stage noisy labeled image classification method based on a dual-network collaborative training mode, which can accurately filter noise by selecting clean instances to train the network to combat the interference of noisy labels.
[0005] The technical solution adopted by the method of the present invention is: a two-stage noisy label image classification method based on a dual-network collaborative training mode, comprising the following steps:
[0006] S1. Divide the data set into multiple batches of input samples, where each input sample corresponds to a sample label for identifying image category information; create two feature extraction networks with the same structure and initialize network parameters; pass each batch of input samples into the two feature extraction networks for training at the same time, and obtain the outputs p1 and p2 of the two feature extraction networks after feature extraction of the input samples;
[0007] S2, the outputs p1 and p2 of the two feature extraction networks are combined with the sample labels to calculate the total loss of the input sample in one stage;
[0008] S3. Sort the one-stage total loss values of the input samples from small to large, and retain the input samples whose one-stage total loss values are less than the threshold; take the average of the one-stage total loss values of the retained input samples, and use it for back-propagation to update the parameters of the two feature extraction networks;
[0009] S4, saving a record of each input sample processing to form sample history information; the record includes a mark of each input sample being retained or discarded, and a category label calculated based on the outputs p1 and p2;
[0010] S5. Perform statistical processing on the sample history information to obtain the discriminant matrix Y and the weight matrix W;
[0011] S6. Use the discriminant matrix Y as an indicator signal to calculate the total loss of the two stages for the input sample;
[0012] S7, sort the two-stage total loss values of the input samples from small to large, and retain the input samples whose two-stage total loss values are less than the threshold;
[0013] S8, activating the weights stored in the weight matrix W as sample weights, re-weighting the two-stage total loss of the input samples retained in step S7, and averaging the weighted losses for back-propagation to update the parameters of the two feature extraction networks;
[0014] S9. Train until the maximum number of iterations set, and obtain the final two-stage noisy label image classification model; use the two-stage noisy label image classification model to classify the image.
[0015] The technical solution adopted by the system of the present invention is: a two-stage noisy label image classification system based on a dual-network collaborative training mode, comprising the following modules:
[0016] The feature extraction module divides the data set into multiple batches of input samples, each of which corresponds to a sample label used to identify image category information; creates two feature extraction networks with the same structure and initializes network parameters; simultaneously passes each batch of input samples into the two feature extraction networks for training, and after feature extraction of the input samples, the outputs p1 and p2 of the two feature extraction networks are obtained;
[0017] The one-stage total loss calculation module calculates the one-stage total loss of the input sample based on the outputs p1 and p2 of the two feature extraction networks and the sample labels;
[0018] The one-stage network parameter update module sorts the one-stage total loss values of the input samples from small to large, and retains the input samples whose one-stage total loss values are less than the threshold; the one-stage total loss values of the retained input samples are averaged and used for back-propagation to update the parameters of the two feature extraction networks;
[0019] A recording module is used to save the records of each input sample processing to form sample history information; the records include the marks of each input sample being retained or discarded, and the category labels calculated based on the outputs p1 and p2;
[0020] The statistical processing module is used to perform statistical processing on the sample history information to obtain the discriminant matrix Y and the weight matrix W;
[0021] The two-stage total loss calculation module uses the discriminant matrix Y as an indicator signal to calculate the two-stage total loss for the input sample;
[0022] The two-stage network parameter update module sorts the two-stage total loss values of the input samples from small to large, and retains the input samples whose two-stage total loss values are less than the threshold; the weight activation stored in the weight matrix W is used as the sample weight to re-weight the two-stage total loss of the retained input samples, and the weighted loss is averaged for back-propagation to update the parameters of the two feature extraction networks;
[0023] The classification module obtains the final two-stage noisy label image classification model when the training reaches the set maximum number of iterations; the two-stage noisy label image classification model is used to classify the image.
[0024] Compared with the prior art, the beneficial effects achieved by the present invention are mainly as follows: a dual network with the same structure is used to extract features, and the training process of the classification model includes two stages. In the first stage, the output relationship of the two networks is used to guide network training. When the output categories of the two networks are consistent, the sample features are selectively aggregated; when the output categories of the two networks are inconsistent, the sample features are selectively alienated. Then, a dynamic threshold is used to select small loss samples for network parameter update, and sample history information is obtained at the same time. In the second stage, the sample history information is used to determine whether the sample is a clean sample. If it is a clean sample, the two network features of the sample are guided to aggregate. If it is a noise sample, the two network features of the sample are guided to alienate. In addition, after the dynamic threshold selection, the sample history information is also used for sample reweighting, and different weights are assigned to the selected clean samples. The present invention can accurately filter noise by selecting clean instances to train the network to combat the interference of noise labels. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0026] Figure 1 It is a flow chart of a two-stage noisy labeled image classification method based on a dual-network collaborative training mode in an embodiment of the present invention.
[0027] Figure 2 4 is a schematic diagram of a two-stage weight matrix W generation structure in an embodiment of the present invention.
[0028] Figure 3 It is a schematic diagram of the two-stage discriminant matrix Y fusion training process in an embodiment of the present invention. DETAILED DESCRIPTION
[0029] The present invention will be further described in detail below in conjunction with embodiments and drawings, but the embodiments of the present invention are not limited thereto.
[0030] Example 1
[0031] This embodiment proposes a two-stage noisy label image classification method based on a dual-network collaborative training mode, which selects clean examples to train the network to combat the interference of noisy labels. The process framework is as follows: Figure 1 As shown in the figure, the training process consists of two stages, with a total of 200 iterations. The first 80 iterations are the first stage, and the last 120 iterations are the second stage. After the second stage of training, the final noisy label image classification model is obtained.
[0032] The image classification method of this embodiment specifically includes the following steps:
[0033] S1. Divide the data set into multiple batches of input samples (i.e., multiple mini-batch data), where each input sample corresponds to a sample label for identifying image category information; create two feature extraction networks A1 and A2 with the same structure, and initialize the network parameters; pass each batch of input samples into the feature extraction network A1 and the feature extraction network A2 for training at the same time, and after feature extraction of the input samples, obtain the outputs p1 and p2 of the two feature extraction networks.
[0034] In this step, the feature extraction network (i.e., network A1 and network A2) is selected according to the size of the data set. The feature extraction network structure selected for a smaller data set is also simpler, and the feature extraction network structure selected for a larger data set is also more complex. In other words, the size of the network structure is set according to the size of the data set. For large-scale data sets, the ResNet18 convolutional network is used, and for small-scale data sets, a 2-layer MLP network or a 7-layer convolutional network is used.
[0035] S2. For the outputs p1 and p2 of the two feature extraction networks, combined with the sample labels, calculate the total loss of the first stage of the input sample.
[0036] In this step, the categories of the maximum probability values of the outputs p1 and p2 of the two feature extraction networks are the same as an indicator signal. If the categories of the maximum probability values of p1 and p2 are the same, the input sample is regarded as a clean sample, otherwise it is regarded as a noise sample. The supervised loss is calculated for the output of all input samples, the one-stage unsupervised aggregation loss is calculated for the clean samples, and the one-stage unsupervised alienation loss is calculated for the noise samples. The weighted sum of all losses is obtained to obtain the one-stage total loss.
[0037] Among them, the total loss of one stage includes supervised loss, one stage unsupervised aggregation loss and one stage unsupervised alienation loss. The cross entropy loss is calculated as the supervised loss using formula (1), the one stage unsupervised aggregation loss is calculated using formula (2), the one stage unsupervised alienation loss is calculated using formula (5), and the total loss of one stage is expressed by formula (6).
[0038] The supervised loss is expressed as:
[0039]
[0040] The cross entropy loss is calculated for both feature extraction network outputs p1 and p2, x i represents the i-th input sample, y irepresents the i-th sample label, B represents the number of input samples in each batch, k represents the number of output categories to be classified, and m is used to traverse all output categories from 1 to k, 1≤m≤k, It represents the first feature extraction network (i.e., feature extraction network A1) for the input sample x i The output probability predicted as category m, Represents the second feature extraction network (i.e., feature extraction network A2) for the input sample x i The output probability of the prediction being class m.
[0041] The one-stage unsupervised aggregation loss is expressed as:
[0042] l Se-A (x i )=1{max(p1)==max(p2)}*{D KL (p1||p2)+D KL (p2||p1)} (2)
[0043] Where 1{·} is an indicator function used to identify whether the input sample is a clean sample or a noise sample. In the above formula (2), it is specifically used to determine whether the categories of the maximum probability values output by the two feature extraction networks are the same. If the categories are the same, it is set to 1, and if the categories are different, it is set to 0; D KL It means calculating the KL divergence of the outputs of two feature extraction networks. Due to the asymmetry of KL divergence, a two-part symmetric structure is used. The specific form is expressed by formula (3) and formula (4):
[0044]
[0045] The one-stage unsupervised alienation loss is expressed as:
[0046]
[0047] Where 1{·} is an indicator function used to identify whether the input sample is a clean sample or a noise sample. In the above formula (5), it is specifically used to select samples with different categories of the maximum probability values output by the two feature extraction networks. If the categories are different, it is set to 1, and if the categories are the same, it is set to 0; Used to calculate the cosine similarity of the outputs p1 and p2 of two feature extraction networks.
[0048] The specific expression of the total loss in one stage is:
[0049] l one-stage (x i )=(1-α)*l sup (x i ,y i )+α*l Se-A (xi )+δ*l Se-Sp (x i ) (6)
[0050] The first part is the supervised loss part, the second part is the one-stage unsupervised aggregation loss part, and the third part is the one-stage unsupervised alienation loss part. α and δ are hyperparameters.
[0051] The indication signal described in this step is to take the maximum probability value of the two network outputs p1 and p2 of the input sample. If the category of the maximum probability value in output p1 is the same as the category of the maximum probability value in output p2, the sample is marked as a clean sample with 1; otherwise, it is marked as a noise sample with 0. When calculating the unsupervised aggregation loss for the clean sample, the participation of the noise sample can be effectively avoided; when calculating the unsupervised alienation loss for the noise sample, the label is inverted, which can effectively avoid the participation of the clean sample.
[0052] S3. Sort the one-stage total loss values of the input samples from small to large, use a dynamic threshold to retain the input samples with small loss values at the front, specifically retain the input samples with one-stage total loss values less than the threshold; take the average of the one-stage total loss values of the retained input samples, and use it for backpropagation to update the parameters of the two feature extraction networks. The one-stage total loss values of other input samples do not participate in the update of the feature extraction network parameters.
[0053] The calculation formula of dynamic threshold R(t) is:
[0054]
[0055] Where τ is a parameter used to reflect the noise ratio, t represents the current number of iterations; T k Take a fixed value, which in this embodiment can be 10. After calculating the total loss value of the input sample in one stage, the total loss value is sorted using a dynamic threshold, and samples smaller than the threshold are retained, while the remaining samples are discarded.
[0056] In this embodiment, the dynamic threshold gradually changes with the increase in the number of iterative training times. During training, input samples with a ratio less than the threshold are retained, and input samples with a ratio greater than the threshold are discarded. Since the model will first learn simple knowledge in the early stage of training, and will not learn difficult knowledge until the later stage, a larger threshold is used in the early stage of training to allow more input samples to be added to the training, and then the threshold will remain fixed. This step retains appropriate input samples through the dynamic threshold, thereby filtering noise samples.
[0057] The operation of taking the average of the total loss values of the retained input samples in one stage is as follows:
[0058]
[0059] Among them l one-stage (x) represents the total loss value of the input sample in one stage, D clean Represents the input samples retained after dynamic threshold filtering in one stage.
[0060] S4. Save the record of each input sample processing to form sample history information; the record includes two parts, the first part is the mark of each input sample being retained or discarded, and the second part is the category label calculated based on the outputs p1 and p2.
[0061] The calculation process of the category label is as follows: all category output probabilities of the outputs p1 and p2 of the feature extraction network are grouped into a set, the maximum value in the set is taken, and the category label corresponding to the maximum value is used as the second part of the record.
[0062] S5. Perform statistical processing on the sample history information obtained in step S4 to obtain two key matrices: a discriminant matrix Y and a weight matrix W.
[0063] From this step, the training enters the second stage. The sample history information recorded in the first stage is statistically processed, such as Figure 2 As shown in the figure, N represents the number of samples and L represents the number of training iterations.
[0064] The first part of the sample history information record is the multiple marks of all the input samples that are retained and discarded after multiple iterations of training. This step counts the number of times the input sample is retained and discarded, and converts it into a probability value; when the probability of being retained is greater than the probability of being discarded, the input sample is identified as a clean sample and marked as 1, otherwise the input sample is identified as a noise sample and marked as 0; all the mark values are saved in the discriminant matrix Y as an indicator signal to determine whether the input sample is a clean sample.
[0065] The second part of the sample history information record is the multiple output categories (i.e., category labels) of the input samples after multiple iterations of training. The number of occurrences of each output category is counted and converted into a probability value. The maximum value of the probability value is taken and saved in the weight matrix W as the weight value for sample reweighting.
[0066] The discriminant matrix Y stores values of 0 and 1, which are used to identify whether the sample is a noise sample; the weight matrix W stores continuous values in the range of 0 to 1, which are used for sample reweighting.
[0067] In fact, the statistics of sample history information are for the whole process. Whether it is the first stage or the second stage, the sample history information will be recorded, but in the first stage, the sample history information is not used, and in the second stage, the sample history information is used and recorded at the same time.
[0068] S6. Calculate the two-stage total loss for the input sample, where the two-stage total loss includes three parts: supervised loss, two-stage unsupervised aggregation loss, and two-stage unsupervised alienation loss.
[0069] In the two-stage training, the process of fusion training using the discriminant matrix Y is as follows Figure 3 As shown in Figure 2, the discriminant matrix Y is used as an indicator signal to calculate the supervised loss for the output of all samples. At the same time, the two-stage unsupervised aggregation loss is calculated for the clean samples, and the two-stage unsupervised alienation loss is calculated for the noise samples. All losses are added together to get the two-stage total loss.
[0070] The calculation of the supervised loss is the same as that of the supervised loss in step S2, but the discriminant matrix Y is used as the indicator signal when calculating the second-stage unsupervised aggregation loss. In other words, the calculation formulas for the aggregation loss and alienation loss in step S6 are structurally the same as those for the aggregation loss and alienation loss in step S2, except that the indicator signals are different. Step S2 uses the same output maximum probability category as the indicator signal, while step S6 uses the statistical judgment of whether the sample is a noise sample based on the sample history information as the indicator signal.
[0071] The two-stage unsupervised aggregation loss is expressed as:
[0072] l New-Se-A (x i )=1{φ==clean}*{D KL (p1||p2)+D kL (p2||p1)} (9)
[0073] Where 1{·} is an indicator function used to determine whether the input sample is a clean sample. The indicator signal φ in the indicator function is the stored value in the discriminant matrix Y. The latter part is the same as the KL divergence calculation in the aggregation loss of step S2.
[0074] The two-stage unsupervised alienation loss is expressed as:
[0075]
[0076] Wherein 1{·} is an indicator function, which is used to determine whether the input sample is a noise sample. The indicator signal φ in the indicator function is the value stored in the discriminant matrix Y. The latter part is also the same as the alienation loss calculation in step S2.
[0077] The total loss of the two-stage is the weighted sum of the supervised loss, the two-stage unsupervised aggregation loss, and the two-stage unsupervised alienation loss, which is specifically expressed as:
[0078] l two-stage (x i )=(1-α)*lsup (x i ,y i )+α*l New-Se-A (x i )+δ*l New-Se-Sp (x i ) (11)
[0079] The first part is the supervised loss, the second part is the two-stage unsupervised aggregation loss, the third part is the two-stage unsupervised alienation loss, and α and δ are hyperparameters.
[0080] S7. Sort the two-stage total loss values of the input samples from small to large, and use a dynamic threshold to retain the input samples with small loss values at the front. Specifically, retain the input samples whose two-stage total loss values are less than the threshold, and discard the remaining input samples.
[0081] The dynamic threshold R(t) is also calculated using formula (7).
[0082] S8. Use the softmax function to activate the weights stored in the weight matrix W as sample weights, reweight the two-stage total loss of the input samples retained in step S7, and average the weighted losses (using formula (12)) for backpropagation to update the parameters of the two feature extraction networks.
[0083]
[0084] where D′ clean represents the input samples retained after dynamic threshold filtering in the second stage, w i The weight value of the i-th sample saved in the weight matrix W.
[0085] S9. Train until the maximum number of iterations set, and obtain the final two-stage noisy label image classification model; use the two-stage noisy label image classification model to classify the image.
[0086] Example 2
[0087] Based on the same inventive concept as Example 1, this embodiment provides a two-stage noisy label image classification system based on a dual-network collaborative training mode, including the following modules:
[0088] The feature extraction module divides the data set into multiple batches of input samples, each of which corresponds to a sample label used to identify image category information; creates two feature extraction networks with the same structure and initializes network parameters; simultaneously passes each batch of input samples into the two feature extraction networks for training, and after feature extraction of the input samples, the outputs p1 and p2 of the two feature extraction networks are obtained;
[0089] The one-stage total loss calculation module calculates the one-stage total loss of the input sample based on the outputs p1 and p2 of the two feature extraction networks and the sample labels;
[0090] The one-stage network parameter update module sorts the one-stage total loss values of the input samples from small to large, and retains the input samples whose one-stage total loss values are less than the threshold; the one-stage total loss values of the retained input samples are averaged and used for back-propagation to update the parameters of the two feature extraction networks;
[0091] A recording module is used to save the records of each input sample processing to form sample history information; the records include the marks of each input sample being retained or discarded, and the category labels calculated based on the outputs p1 and p2;
[0092] The statistical processing module is used to perform statistical processing on the sample history information to obtain the discriminant matrix Y and the weight matrix W;
[0093] The two-stage total loss calculation module uses the discriminant matrix Y as an indicator signal to calculate the two-stage total loss for the input sample;
[0094] The two-stage network parameter update module sorts the two-stage total loss values of the input samples from small to large, and retains the input samples whose two-stage total loss values are less than the threshold; the weight activation stored in the weight matrix W is used as the sample weight to re-weight the two-stage total loss of the retained input samples, and the weighted loss is averaged for back-propagation to update the parameters of the two feature extraction networks;
[0095] The classification module obtains the final two-stage noisy label image classification model when the training reaches the set maximum number of iterations; the two-stage noisy label image classification model is used to classify the image.
[0096] For the image classification system described in this embodiment, since the implementation of the technical solution corresponds to the method of Example 1, this embodiment is described relatively briefly. For the corresponding technical features, please refer to the description of each step in Example 1, and no further details will be given here.
[0097] What is disclosed above is only a preferred embodiment of the present invention, and it certainly cannot be used to limit the scope of rights of the present invention. Ordinary technicians in this field can understand that all or part of the processes of the above embodiment and equivalent changes made according to the claims of the present invention still fall within the scope of the invention.
Claims
1. A two-stage noisy label image classification method based on a dual-network collaborative training mode, characterized in that: The following steps are involved: S1. Divide the data set into multiple batches of input samples, where each input sample corresponds to a sample label for identifying image category information; create two feature extraction networks with the same structure and initialize network parameters; pass each batch of input samples into the two feature extraction networks for training at the same time, and obtain the outputs p1 and p2 of the two feature extraction networks after feature extraction of the input samples; S2, the outputs p1 and p2 of the two feature extraction networks are combined with the sample labels to calculate the total loss of the input sample in one stage; S3, sort the total loss values of the input samples in one stage from small to large, and retain the input samples whose total loss values of the one stage are less than the threshold; The total loss value of the retained input samples in one stage is averaged and used for back-propagation to update the parameters of the two feature extraction networks; S4, saving a record of each input sample processing to form sample history information; the record includes a mark of each input sample being retained or discarded, and a category label calculated based on the outputs p1 and p2; S5. Perform statistical processing on the sample history information to obtain the discriminant matrix Y and the weight matrix W; S6. Use the discriminant matrix Y as an indicator signal to calculate the total loss of the two stages for the input sample; S7, sort the two-stage total loss values of the input samples from small to large, and retain the input samples whose two-stage total loss values are less than the threshold; S8, activating the weights stored in the weight matrix W as sample weights, re-weighting the two-stage total loss of the input samples retained in step S7, and averaging the weighted losses for back-propagation to update the parameters of the two feature extraction networks; S9. Train until the maximum number of iterations set, and obtain the final two-stage noisy label image classification model; use the two-stage noisy label image classification model to classify the image.
2. The image classification method according to claim 1, characterized in that: In step S2, when calculating the total loss of one stage, whether the categories of the maximum probability values of the outputs p1 and p2 of the two feature extraction networks are the same is used as an indication signal. If the categories of the maximum probability values of p1 and p2 are the same, the input sample is taken as a clean sample, otherwise it is taken as a noise sample; the supervised loss is calculated for the output of all input samples, the one-stage unsupervised aggregation loss is calculated for the clean samples, and the one-stage unsupervised alienation loss is calculated for the noise samples, and all losses are weighted and summed to obtain the total loss of one stage.
3. The image classification method according to claim 2, characterized in that: In step S2, the supervised loss is expressed as: The cross entropy loss is calculated for both feature extraction network outputs p1 and p2, x i represents the i-th input sample, y i represents the i-th sample label, B represents the number of input samples in each batch, k represents the number of output categories to be classified, and m is used to traverse all output categories from 1 to k, 1≤m≤k, Represents the first feature extraction network for the input sample x i The output probability predicted as category m, Represents the second feature extraction network for the input sample x i Predict the output probability of category m; The one-stage unsupervised aggregation loss is expressed as: e Se-A (x i )=1{max(p1)==max(p2)}*{D KL (p1||p2)+D KL (p2||p1)} Where 1{·} is an indicator function used to determine whether the categories of the maximum probability values output by the two feature extraction networks are the same. If the categories are the same, it is set to 1, and if the categories are different, it is set to 0; D KL Indicates the calculation of the KL divergence of the two feature extraction network outputs p1 and p2; The one-stage unsupervised alienation loss is expressed as: Where 1{·} is an indicator function, which is used to select samples with different categories of the maximum probability values output by the two feature extraction networks. If the categories are different, it is set to 1, and if the categories are the same, it is set to 0; Used to calculate the cosine similarity of the outputs p1 and p2 of the two feature extraction networks; The total loss of one stage is expressed as: l one-stage (x i )=(1-a)*l sup (x i ,y i )+a*l Se-A (x i )+δ*l Se-Sp (x i ) where α and δ are hyperparameters.
4. The image classification method according to claim 1, characterized in that: In step S3, a dynamic threshold is used to retain input samples whose total loss value in the first stage is less than the threshold, and in step S7, a dynamic threshold is used to retain input samples whose total loss value in the second stage is less than the threshold; The calculation formula of dynamic threshold R(t) is: Where τ is a parameter used to reflect the noise ratio, t represents the current number of iterations; T k Take a fixed value.
5. The image classification method according to claim 1 or 4, characterized in that: Step S3 is to take the average of the total loss values of the retained input samples in one stage, specifically: Among them l one-stage (x i ) represents the total loss value of the input sample in one stage, D clean represents the input samples retained after threshold filtering in one stage, x i represents the i-th input sample; The expression for calculating the mean of the weighted losses in step S8 is: Among them l two-stage (x i ) represents the total loss value of the two stages of the input sample, D′ clean represents the input samples retained after threshold filtering in the second stage, w i The weight value of the i-th sample saved in the weight matrix W.
6. The image classification method according to claim 1, characterized in that: The calculation process of the category label in step S4 is: all category output probabilities of the outputs p1 and p2 of the feature extraction network are grouped into a set, the maximum value in the set is taken, and the category label corresponding to the maximum value is used as the category label calculated based on the outputs p1 and p2.
7. The image classification method according to claim 1, characterized in that: Step S5 counts the number of times the input sample is retained and the number of times it is discarded, and converts it into a probability value; when the probability of being retained is greater than the probability of being discarded, the input sample is identified as a clean sample and marked as 1, otherwise the input sample is identified as a noise sample and marked as 0; all the marked values are saved in the discriminant matrix Y as an indication signal for judging whether the input sample is a clean sample; Step S5 also counts the number of occurrences of each category label of the input sample and converts it into a probability value, takes the maximum value among the probability values, and saves the maximum value in the weight matrix W as the weight value for sample reweighting.
8. The image classification method according to claim 2, characterized in that: In step S6, when calculating the two-stage total loss, the discriminant matrix Y is used as an indicator signal, and the supervised loss is calculated for the output of all samples. At the same time, the two-stage unsupervised aggregation loss is calculated for the clean samples, and the two-stage unsupervised alienation loss is calculated for the noise samples. The weighted sum of all losses is obtained to obtain the two-stage total loss.
9. The image classification method according to claim 8, characterized in that: In step S6, the supervised loss is expressed as: The cross entropy loss is calculated for both feature extraction network outputs p1 and p2, x i represents the i-th input sample, y i represents the i-th sample label, B represents the number of input samples in each batch, k represents the number of output categories to be classified, and m is used to traverse all output categories from 1 to k, 1≤m≤k, Represents the first feature extraction network for the input sample x i The output probability predicted as category m, Represents the second feature extraction network for the input sample x i Predict the output probability of category m; The two-stage unsupervised aggregation loss is expressed as: l New-Se-A (x i )=1{φ==clean}*{D KL (p1||p2)+D KL (p2||p1)} Where 1{·} is the indicator function, which is used to determine whether the input sample is a clean sample. The indicator signal φ in the indicator function is the stored value in the discriminant matrix Y; D KL Indicates the calculation of the KL divergence of the outputs of two feature extraction networks; The two-stage unsupervised alienation loss is expressed as: Where 1{·} is an indicator function, which is used to determine whether the input sample is a noise sample. The indicator signal φ in the indicator function is the value stored in the discriminant matrix Y; Used to calculate the cosine similarity of the outputs p1 and p2 of the two feature extraction networks; The total loss of the second stage is expressed as: l two-stage (x i )=(1-a)*l sup (x i ,y i )+a*l New-Se-A (x i )+δ*l New-Se-Sp (x i ) Among them, α and δ are hyperparameters.
10. A two-stage noisy label image classification system based on a dual-network collaborative training mode, characterized in that: Includes the following modules: The feature extraction module divides the data set into multiple batches of input samples, each of which corresponds to a sample label used to identify image category information; creates two feature extraction networks with the same structure and initializes network parameters; simultaneously passes each batch of input samples into the two feature extraction networks for training, and after feature extraction of the input samples, the outputs p1 and p2 of the two feature extraction networks are obtained; The one-stage total loss calculation module calculates the one-stage total loss of the input sample based on the outputs p1 and p2 of the two feature extraction networks and the sample labels; The one-stage network parameter update module sorts the one-stage total loss values of the input samples from small to large, and retains the input samples whose one-stage total loss values are less than the threshold; The total loss value of the retained input samples in one stage is averaged and used for back-propagation to update the parameters of the two feature extraction networks; A recording module is used to save the records of each input sample processing to form sample history information; the records include the marks of each input sample being retained or discarded, and the category labels calculated based on the outputs p1 and p2; The statistical processing module is used to perform statistical processing on the sample history information to obtain the discriminant matrix Y and the weight matrix W; The two-stage total loss calculation module uses the discriminant matrix Y as an indicator signal to calculate the two-stage total loss for the input sample; The two-stage network parameter update module sorts the two-stage total loss values of the input samples from small to large, and retains the input samples whose two-stage total loss values are less than the threshold; the weight activation stored in the weight matrix W is used as the sample weight to re-weight the two-stage total loss of the retained input samples, and the weighted loss is averaged for back-propagation to update the parameters of the two feature extraction networks; The classification module obtains the final two-stage noisy label image classification model when the training reaches the set maximum number of iterations; the two-stage noisy label image classification model is used to classify the image.
Citation Information
Patent Citations
Noise robust pedestrian re-identification method based on two stages
CN114022904A
Self-tag modification method for processing noise tag
CN115861625A
Medical image classification method based on small sample meta learning
CN116503668A
Method and system for cell image segmentation using multi-stage convolutional neural networks
US20190228268A1