Noise label federated learning method based on hybrid prediction and improved comparative learning

By adopting hybrid prediction and improved contrastive learning methods in federated learning, and using enhanced samples and sharpening operations to optimize model training, the problem of heterogeneity and noisy labels is solved, the accuracy and generalization of the model are improved, and a more accurate model is achieved. Efficient federated learning training.

CN118586516AInactive Publication Date: 2024-09-03GUANGDONG UNIV OF TECH
View PDF 0 Cites 6 Cited by

Patent Information

Application Number
CN202410630050.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-21
Publication Date
2024-09-03
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

There are heterogeneity problems, noisy label problems, and high communication overhead in existing federated learning, which lead to increased model training time and resource consumption, and traditional methods are not suitable for distributed training.

Method used

Adopt a contrastive learning method based on hybrid prediction and improvement, perform pre-training through FedAvg, use enhanced samples to calculate entropy regularization and cross-entropy loss, introduce sharpening operations and contrastive loss functions, optimize local model updates, and update the global through server aggregation model until the model converges.

Benefits of technology

It improves the accuracy and generalization of the model, prevents over-fitting, solves the problem of noisy labels, and maximizes the similarity of the same target and the distinction of different targets through contrastive learning methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118586516A
    Figure CN118586516A
Patent Text Reader

Abstract

The invention provides a noise label federated learning method based on hybrid prediction and improved comparative learning, which comprises the following steps: firstly, pre-training is carried out in a FedAvg mode, and after the pre-training is finished, in each training process, a server sends a global model to a local client; the local client calculates aggregation prediction of an enhanced sample, then calculates hybrid prediction, enhances the hybrid prediction by using sharpening operation, calculates cross entropy loss and contrast loss functions, increases entropy regularization on a local loss function, updates a local model by minimizing the loss function, and uploads the local model to a server; and the server aggregates the local model updated by the local client, updates the global model, sends the updated global model to the local client, and starts a new round of communication training until the global model converges. According to the method, the noise tag is memorized by using the hybrid prediction blocking model, and the classification precision and generalization performance of the model are improved through comparative learning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of federated learning, and in particular to a noisy label federated learning method based on hybrid prediction and improved contrastive learning. Background Art

[0002] Data silos caused by privacy protection, computing resources and other reasons are hindering the use of big data necessary for training artificial intelligence models. Federated learning is a distributed machine learning method that aims to train models while protecting user privacy. Its core idea is to allow each device (such as smartphones, medical devices, IoT devices, etc.) to train models locally without transmitting local data to a central server, and only share part of the model update information instead of the original data. In this way, the privacy and security of the entire system are significantly improved. Federated learning protects data privacy by collaboratively training machine learning models by exchanging models without sending data to others. It has been widely used in medical learning, natural language processing, and fraudulent credit card detection.

[0003] However, existing federated learning has the following problems:

[0004] 1) Heterogeneity problem: In a federated learning environment, diverse device conditions pose a major challenge. These devices have significant differences in storage capacity, processing power, and network connectivity, which not only causes uneven computing speeds across devices, but may also cause some devices to lose connectivity due to performance limitations or network problems. In addition, the data characteristics in federated learning are also heterogeneous, because data is usually generated on different devices in a non-independent and identically distributed manner based on user-specific behavior and environment. Furthermore, the amount of data owned by each device may be extremely uneven. In view of these factors, traditional optimization methods that assume that data is independent and identically distributed are no longer applicable to federated learning;

[0005] 2) Existing deep learning models used in federated learning, such as convolutional neural networks (CNNs), involve a large number of parameter optimizations during training. Each iteration requires updating millions of parameters. When it comes to distributed or remote training, the instability of network connections and differences in transmission rates will greatly increase communication overhead. These problems may lead to a significant increase in overall training time and resource consumption.

[0006] 3) Noisy label problem. Noisy labels refer to labels in the data set that are erroneous or uncertain. They may be due to user labeling errors, sensor failures, errors in the data collection process, or other reasons. Noisy labels will damage the generalization performance of deep networks. Federated learning involves multiple decentralized devices, each with its own data set. These data may come from different users or environments, increasing the possibility of label noise. Summary of the invention

[0007] In view of the shortcomings of the prior art, the present invention provides a noisy label federated learning method based on hybrid prediction and improved contrastive learning. The present invention obtains additional reliable supervision to process noisy labels without affecting data privacy, so as to solve the noisy label problem in federated learning while improving the accuracy and generalization of the model.

[0008] The technical solution of the present invention is: a noisy label federated learning method based on hybrid prediction and improved contrastive learning, comprising the following steps:

[0009] S1) Pre-training is performed in the FedAvg manner. After the pre-training is completed, in each round of training, the server sends the global model to the local client;

[0010] S2), the local client obtains the output logits value and the predicted value of the enhanced sample, calculates the aggregated prediction, and then calculates the mixed prediction and uses the sharpening operation to enhance the mixed prediction, thereby obtaining the sharpened mixed prediction;

[0011] S3), the local client uses the output logits value of the enhanced sample and the mixed prediction to calculate entropy regularization and cross entropy loss;

[0012] S4), the local client re-uses the enhanced sample to calculate the contrast loss function;

[0013] S5), the local client updates the local model by minimizing the loss function, and then uploads the updated local model to the server;

[0014] S6) The server aggregates the local models updated by the local clients, updates the global model, and sends the updated global model to the local clients, starting a new round of communication training until the global model converges.

[0015] Preferably, in step S1), pre-training is performed in the manner of FedAvg as follows:

[0016] In the pre-training phase, the server sends the global model to the selected local client. Each selected local client calculates the cross entropy loss of the local data, minimizes the cross entropy loss to optimize the local model, and sends the updated local model to the server. In this way, iterate t warm wheel.

[0017] Preferably, in step S1), the server sending the global model to the local client includes:

[0018] The server initializes the global model The server then randomly selects the local client participating in this round of federated learning and sends the global model to it. Where t represents the federated learning round.

[0019] As a preferred embodiment, in step S2), for each local client k, the local data set is represented by D k , each data sample x i With two enhanced samples and The enhanced dataset of each local client k is

[0020] Preferably, in step S2), the data sample x i Two enhanced samples and Respectively expressed as:

[0021]

[0022]

[0023] In the formula, Random() is a random function, which randomly rotates the data sample within 30 degrees and transforms the color space.

[0024] Preferably, step S2) comprises the following steps:

[0025] S21), respectively, the data samples x i , and the data sample x i The corresponding enhanced samples and Input to the feature extractor f θ and projection layer g p In the above example, we obtain the corresponding feature representation z i , and

[0026] S22), then the feature representation z i , and Input to the classifier In, get the corresponding logits output index l i , and And the corresponding category probability p i , and

[0027] S23), for category probability and Averaging to get aggregate predictions

[0028] S24), using the mix up method to predict the aggregation and p i Processing to obtain the mixed prediction p i ′,

[0029]

[0030] Where λ is a parameter randomly selected from the Beta distribution;

[0031] S25), using a sharpening operation to enhance the mixed prediction p i ′, thus obtaining the sharpened mixed prediction p s ,Right now:

[0032]

[0033] In the formula, p s,j is the predicted probability of the jth category after the sharpening operation, T represents the sharpening temperature, M is the total number of categories, and Sharpen() is the sharpening operation.

[0034] Preferably, in step S3), the output logits value of the enhanced sample and the mixed prediction are used to calculate entropy regularization The calculation formula is:

[0035]

[0036] At the same time, the cross entropy loss is calculated using the sharpened mixed prediction

[0037]

[0038] In the formula, The output logits value of the enhanced sample; They represent the entropy regularization of enhanced sample 1 and enhanced sample 2 respectively; CE() is the cross entropy function, y is the label of the sample, and p s is the mixed prediction after sharpening.

[0039] Preferably, in step S4), the contrast loss is calculated using the enhanced sample, specifically:

[0040] S41), the data sample x i The corresponding two enhanced samples and As positive sample pairs in contrastive learning, the enhanced samples of other data samples are used as negative sample pairs;

[0041] S42), using the feature representation z output by the feature extractori , and Compute the cosine similarity between feature representations;

[0042] S43), for each pair of positive samples Its contrast loss function is:

[0043]

[0044] in, The expression is:

[0045]

[0046] In the formula, represents the cosine similarity, τ is the preset temperature hyperparameter, and N is the sample size of bathsize.

[0047] As a preferred embodiment, in step S5), for the input data (x i ,y), its loss function is:

[0048]

[0049] In the formula, represents the cross entropy loss function, is the contrast loss function, is entropy regularization, μ is the weight used to adjust the contrast loss function; γ is the weight used for entropy regularization;

[0050] Therefore, at round t, the total loss function of the local client k is:

[0051]

[0052] Where N is the number of local clients;

[0053] Minimize the total loss function according to the preset learning rate η To optimize the local model to get the local model Then send it to the server.

[0054] Preferably, in step S5), the total loss function is minimized using a preset learning rate η To optimize the local model to get the local model Specifically:

[0055]

[0056] Among them, η g is the learning rate of client k in the g-th batch;

[0057] In round t, suppose client k’s local dataset D k Divided into G batches, in the gth batch, the learning rate η g Set to:

[0058]

[0059] In the formula, η is the initial preset learning rate.

[0060] Preferably, in step S6), the server updates the global model by specifically comprising the following steps:

[0061] S61), the server receives local models uploaded by several local clients

[0062] S62), the server uses the FedAvg method to convert several local models Perform unified aggregation to generate an updated global model The aggregation process expression is:

[0063]

[0064] Among them, K represents the local client c participating in the local training in the tth round k The number of k Indicates the local client c k The corresponding local data set, D represents the data set of all local clients, and k represents the local client c k The index of .

[0065] Preferably, the present invention also provides a noise label federated learning training system based on hybrid prediction and improved contrastive learning, comprising a server and multiple local clients;

[0066] The server is used to send the global model to multiple local clients, aggregate the local models uploaded by the local clients, and update the global model;

[0067] The local client is used to receive the global model, train the local model using the local data set, calculate the hybrid prediction, cross entropy loss function and contrast loss function, update the local loss function and the local model, and upload the updated local model to the server.

[0068] The beneficial effects of the present invention are:

[0069] 1. The present invention first pre-trains the model to improve the performance of the model and gradually form basic classification capabilities;

[0070] 2. The present invention optimizes the local client local training process by using a sharpening operation to enhance the confidence of model prediction during the federated learning of the pre-trained model, thereby preventing the training model from overfitting the noise label;

[0071] 3. The present invention also introduces an improved contrastive learning method in the process of federated learning, using the contrastive loss function to maximize the similarity of the same target under different data enhancements and minimize the similarity between different targets, thus solving the problem of data heterogeneity. ;

[0072] 4. In order to further enhance the model’s confidence in distinguishing, the present invention adds entropy regularization to the local loss function, thereby solving the noisy label problem in federated learning and improving the accuracy and generalization of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0073] Figure 1 is a flow chart of the federated learning training method of the present invention;

[0074] Figure 2 It is the overall framework diagram of the method of the present invention; DETAILED DESCRIPTION

[0075] The specific implementation of the present invention will be further described below in conjunction with the accompanying drawings:

[0076] Example 1

[0077] like Figure 1 and 2 As shown, this embodiment provides a noisy label federated learning method based on hybrid prediction and improved contrastive learning, including the following steps:

[0078] S1) Pre-training is performed in the FedAvg manner. After the pre-training is completed, in each round of training, the server sends the global model to the local client;

[0079] S2), the local client obtains the output logits value and the predicted value of the enhanced sample, calculates the aggregated prediction, and then calculates the mixed prediction and uses the sharpening operation to enhance the mixed prediction, thereby obtaining the sharpened mixed prediction;

[0080] S3), the local client uses the output logits value of the enhanced sample and the mixed prediction to calculate entropy regularization and cross entropy loss;

[0081] S4), the local client re-uses the enhanced sample to calculate the contrast loss function;

[0082] S5), the local client updates the local model by minimizing the loss function, and then uploads the updated local model to the server;

[0083] S6) The server aggregates the local models updated by the local clients, updates the global model, and sends the updated global model to the local clients, starting a new round of communication training until the global model converges.

[0084] In this embodiment, due to the memory effect of the deep network, during the training process, the model tends to adapt to the correctly labeled data rather than the noisy labeled data. Generally, samples with smaller loss are more likely to have accurate labels. Therefore, there is a short pre-training phase t at the beginning of training. warm During this period, the performance of the model gradually improved, and gradually formed basic classification capabilities. Next, this embodiment uses enhanced samples to calculate hybrid predictions, and sharpens them to enhance the confidence of the hybrid prediction results. The sharpened results are input as prediction values ​​into the cross entropy loss function to calculate the cross entropy loss.

[0085] At the same time, this embodiment optimizes the local client local training process by using sharpening operations to enhance the confidence of model predictions, thereby preventing the training model from overfitting to noise labels; in addition, this embodiment also introduces an improved contrastive learning method in the process of federated learning to learn the common features between similar instances, and uses the contrastive loss function to maximize the similarity of the same target under different data enhancements, minimize the similarity between different targets, and solve the problem of data heterogeneity. At the same time, in order to further enhance the confidence of model differentiation, this embodiment adds entropy regularization to the local loss function While solving the noisy label problem in federated learning, the accuracy and generalization of the model are improved.

[0086] As a preferred embodiment of this invention, in step S1), pre-training is performed in the manner of FedAvg as follows:

[0087] In the pre-training phase, the server sends the global model to the selected local client. Each selected local client calculates the cross entropy loss of the local data, minimizes the cross entropy loss to optimize the local model, and sends the updated local model to the server. In this way, iterate t warm wheel.

[0088] As a preferred embodiment of this embodiment, in step S1), the server sending the global model to the local client includes:

[0089] The server initializes the global model The server then randomly selects the local client participating in this round of federated learning and sends the global model to it. Where t represents the federated learning round.

[0090] As a preferred embodiment of this invention, in step S2), for each local client k, the local data set is represented by D k , each data sample x i With two enhanced samples and The enhanced dataset of each local client k is

[0091] Among them, the data sample x i Two enhanced samples and Respectively expressed as:

[0092]

[0093]

[0094] In the formula, Random() is a random function, which randomly rotates the data sample within 30 degrees and transforms the color space.

[0095] As a preferred embodiment of this invention, step S2) includes the following steps:

[0096] S21), respectively, the data samples x i , and the data sample x i The corresponding enhanced samples and Input to the feature extractor f θ and projection layer g p In the above example, we obtain the corresponding feature representation z i , and

[0097] S22), then the feature representation z i , and Input to the classifier In, get the corresponding logits output index l i , and And the corresponding category probability p i , and

[0098] S23), for category probability and Averaging to get aggregate predictions

[0099] S24), using the mix up method to predict the aggregation and p iProcessing to obtain the mixed prediction p i ′,

[0100]

[0101] Where λ is a parameter randomly selected from the Beta distribution;

[0102] S25), using a sharpening operation to enhance the mixed prediction p i ′, thus obtaining the sharpened mixed prediction p s ,Right now:

[0103]

[0104] In the formula, p s,j is the predicted probability of the jth category after the sharpening operation, T represents the sharpening temperature, M is the total number of categories, and Sharpen() is the sharpening operation.

[0105] As a preferred embodiment of this invention, in step S3), the output logits value of the enhanced sample and the hybrid prediction are used to calculate entropy regularization The calculation formula is:

[0106]

[0107] At the same time, the cross entropy loss is calculated using the sharpened mixed prediction

[0108]

[0109] In the formula, The output logits value of the enhanced sample; They represent the entropy regularization of enhanced sample 1 and enhanced sample 2 respectively; CE() is the cross entropy function, y is the label of the sample, and p s is the mixed prediction after sharpening.

[0110] As a preferred embodiment of this invention, in step S4), the contrast loss is calculated using the enhanced sample, specifically:

[0111] S41), the data sample x i The corresponding two enhanced samples and As positive sample pairs in contrastive learning, the enhanced samples of other data samples are used as negative sample pairs;

[0112] S42), using the feature representation z output by the feature extractor i , and Compute the cosine similarity between feature representations;

[0113] S43), for each pair of positive samples Its contrast loss function is:

[0114]

[0115] in, The expression is:

[0116]

[0117] In the formula, represents the cosine similarity, τ is the preset temperature hyperparameter, and N is the sample size of bathsize.

[0118] As a preferred embodiment of this invention, in step S5), for the input data (x i ,y), its loss function is:

[0119]

[0120] In the formula, represents the cross entropy loss function, is the contrast loss function, is entropy regularization, μ is the weight used to adjust the contrast loss function; γ is the weight used for entropy regularization;

[0121] Therefore, at round t, the total loss function of the local client k is:

[0122]

[0123] Where N is the number of local clients;

[0124] Minimize the total loss function according to the preset learning rate η To optimize the local model to get the local model Then send it to the server.

[0125] As a preferred embodiment of this invention, in step S5), the total loss function is minimized using the preset learning rate η. To optimize the local model to get the local model Specifically:

[0126]

[0127] Among them, η g is the learning rate of client k in the g-th batch;

[0128] In this embodiment, the learning rate is updated in a cosine decay manner. In the tth round, assuming that the local data set D of client k is kDivided into G batches, in the gth batch, the learning rate η g Set to:

[0129]

[0130] In the formula, η is the initial preset learning rate.

[0131] As a preferred embodiment of the present invention, in step S6), the server updating the global model specifically comprises the following steps:

[0132] S61), the server receives local models uploaded by several local clients

[0133] S62), the server uses the FedAvg method to convert several local models Perform unified aggregation to generate an updated global model The aggregation process expression is:

[0134]

[0135] Among them, K represents the local client c participating in the local training in the tth round k The number of k Indicates the local client c k The corresponding local data set, D represents the data set of all local clients, and k represents the local client c k The index of .

[0136] S63), after the server aggregates the local models, it sends the newly generated global model to the selected local client and starts a new round of training until the global model converges.

[0137] Example 2

[0138] like Figure 2 As shown, this implementation provides a noisy label federated learning training system based on hybrid prediction and improved contrastive learning, including a server and multiple local clients;

[0139] The server is used to send the global model to multiple local clients, aggregate the local models uploaded by the local clients, and update the global model;

[0140] The local client is used to receive the global model, train the local model using the local data set, calculate the hybrid prediction, cross entropy loss function and contrast loss function, update the local loss function and the local model, and upload the updated local model to the server.

[0141] The above embodiments and descriptions are only for illustrating the principles and best embodiments of the present invention. Without departing from the spirit and scope of the present invention, the present invention may be subject to various changes and improvements, all of which fall within the scope of the present invention to be protected.

Claims

1. A noisy label federated learning method based on hybrid prediction and improved contrastive learning, characterized in that: The following steps are involved: S1) Pre-training is performed in the FedAvg manner; after the pre-training is completed, in each round of training, the server sends the global model to the local client; S2), the local client obtains the output logits value and the predicted value of the enhanced sample, calculates the aggregated prediction, and then calculates the mixed prediction and uses the sharpening operation to enhance the mixed prediction, thereby obtaining the sharpened mixed prediction; S3), the local client uses the output logits value of the enhanced sample and the mixed prediction to calculate entropy regularization and cross entropy loss; S4), the local client re-uses the enhanced sample to calculate the contrast loss function; S5), the local client updates the local model by minimizing the loss function, and then uploads the updated local model to the server; S6) The server aggregates the local models updated by the local clients, updates the global model, and sends the updated global model to the local clients, starting a new round of communication training until the global model converges.

2. The noisy label federated learning method based on hybrid prediction and improved contrastive learning according to claim 1, characterized in that: In step S1), pre-training is performed in the FedAvg manner as follows: In the pre-training phase, the server sends the global model to the selected local client. Each selected local client calculates the cross entropy loss of the local data, minimizes the cross entropy loss to optimize the local model, and sends the updated local model to the server. In this way, iterate t warm wheel.

3. The noisy label federated learning method based on hybrid prediction and improved contrastive learning according to claim 2, characterized in that: In step S1), the server sends the global model to the local client, including: the server initializes the global model The server then randomly selects the local client participating in this round of federated learning and sends the global model to it. Where t represents the federated learning round.

4. The noisy label federated learning method based on hybrid prediction and improved contrastive learning according to claim 1, characterized in that: In step S2), for each local client k’s local data set, use D k , each data sample x i With two enhanced samples and The enhanced dataset of each local client k is 5. The noisy label federated learning method based on hybrid prediction and improved contrastive learning according to claim 4, characterized in that: Step S2) includes the following steps: S21), respectively, the data samples x i , and the data sample x i The corresponding enhanced samples and Input to the feature extractor f θ and the projection layer g p In the above example, we obtain the corresponding feature representation z i , and S22), then the feature representation z i , and Input to the classifier In, get the corresponding logits output index l i , and And the corresponding category probability p i , and S23), for category probability and Averaging to get aggregate predictions S24), using the mix up method to predict the aggregation and p i Processing to obtain the mixed prediction p′ i , Where λ is a parameter randomly selected from the Beta distribution; S25), using a sharpening operation to enhance the mixed prediction p′ i , thus obtaining the sharpened mixed prediction p s ,Right now: In the formula, p s,j is the predicted probability of the jth category after the sharpening operation, T represents the sharpening temperature, M is the total number of categories, and Sharpen() is the sharpening operation.

6. The noisy label federated learning method based on hybrid prediction and improved contrastive learning according to claim 5, characterized in that: In step S3), the output logits value of the enhanced sample and the mixed prediction are used to calculate entropy regularization The calculation formula is: At the same time, the cross entropy loss is calculated using the sharpened mixed prediction In the formula, The output logits value of the enhanced sample; They represent the entropy regularization of enhanced sample 1 and enhanced sample 2 respectively; CE() is the cross entropy function, y is the label of the sample, and p s is the mixed prediction after sharpening.

7. The noisy label federated learning method based on hybrid prediction and improved contrastive learning according to claim 5, characterized in that: In step S4), the contrast loss is calculated using the enhanced sample, specifically: S41), the data sample x i The corresponding two enhanced samples and As positive sample pairs in contrastive learning, the enhanced samples of other data samples are used as negative sample pairs; S42), using the feature representation z output by the feature extractor i , and Compute the cosine similarity between feature representations; S43), for each pair of positive samples Its contrast loss function is: In the formula, represents the cosine similarity, τ is the preset temperature hyperparameter, and N is the sample size of bathsize.

8. The noisy label federated learning method based on hybrid prediction and improved contrastive learning according to claim 7, characterized in that: In step S5), for the input data (x i , y), its loss function is: In the formula, represents the cross entropy loss function, is the contrast loss function, is entropy regularization, μ is the weight used to adjust the contrast loss function; γ is the weight used for entropy regularization; Therefore, at round t, the total loss function of the local client k is: Where N is the number of local clients; Minimize the total loss function according to the preset learning rate η To optimize the local model to get the local model Then send it to the server.

9. The noisy label federated learning method based on hybrid prediction and improved contrastive learning according to claim 8, characterized in that: In step S5), the total loss function is minimized using the preset learning rate η To optimize the local model to get the local model Specifically: Among them, η g is the learning rate of client k in the g-th batch; In round t, suppose client k’s local dataset D k Divided into G batches, in the gth batch, the learning rate η g Set to: In the formula, η is the initial preset learning rate.

10. The noisy label federated learning method based on hybrid prediction and improved contrastive learning according to claim 1, characterized in that: In step S6), the server updates the global model by specifically including the following steps: S61), the server receives local models uploaded by several local clients S62), the server uses the FedAvg method to convert several local models Perform unified aggregation to generate an updated global model The aggregation process expression is: Among them, K represents the local client c participating in the local training in the tth round k The number of u Represents the local client c k The corresponding local data set, D represents the data set of all local clients, and k represents the local client c k The index of .

Citation Information

Cited By

  • False data injection attack detection method and device based on federal learning and comparative learning, and storage medium

    CN119030798A

  • Distributed training method for traffic recommendation system based on federal learning

    CN119067202A

  • Federal learning domain generalization method for medical field

    CN119719896A

  • A medical field-oriented federated learning domain generalization method

    CN119719896B

  • Training method and device based on federal multi-level knowledge migration and medium

    CN119886292A