A method and system for detecting noise annotation in a federated learning scenario
By identifying noisy clients and samples through dynamic thresholds and global feature distribution consistency methods, the problem of inaccurate identification of noise samples in federated learning is solved and the generalization ability of the model is improved.
Patent Information
- Application Number
- CN202510375049.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-27
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2045-03-27
AI Technical Summary
Existing technologies have difficulty in accurately identifying noise samples under extreme noise labeling in federated learning scenarios, resulting in a decrease in the model's generalization ability.
By using a dynamic threshold and global feature distribution consistency method to identify clean and noisy clients, and using the global feature distribution to judge noisy samples, the clean samples are used to train the local model and aggregate the global model.
The recognition accuracy of noisy samples in extreme noise labeling conditions is improved, and the generalization ability of the global model trained by federated learning is enhanced.
Smart Images

Figure CN120258173B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of federated learning, and more specifically, to a method and system for detecting noise annotations in a federated learning scenario. Background Art
[0002] Current research on algorithms for detecting noisy annotations in federated learning scenarios can be categorized into two main approaches: noisy client detection and noisy annotation sample detection. For noisy client detection, noisy clients are first detected, and then processed. For example, FedCorr, FedNoRo, and FedNed calculate each client's LID, class-loss, and uncertainty, and then use the unsupervised Gaussian mixture model (GMM) to fit these values and classify the clients into clean and noisy clients. However, these methods all use the differences in these values to distinguish between noisy and clean clients. When a large proportion of clients are either clean or noisy, the differences in these values decrease, causing these methods to mistakenly identify noisy clients as clean, reducing the performance of federated learning.
[0003] Another existing approach improves federated learning performance by identifying and isolating client-side noise samples to reduce their impact on model training. However, these methods rely on simple metrics to distinguish between noise and clean samples. When faced with extreme noisy labels, these metrics, which only utilize a single piece of information (such as the loss of a single sample), are easily affected. This makes them ineffective in distinguishing noisy samples and can lead to them mistakenly being identified as clean samples, causing the model to learn incorrect information and thus reducing its generalization ability. Summary of the Invention
[0004] In order to overcome the defect of the above-mentioned prior art that noise annotation samples cannot be accurately identified, the present invention provides a method and system for detecting noise annotations in a federated learning scenario.
[0005] In order to solve the above technical problems, the technical solutions of the present invention are as follows:
[0006] A method for detecting noise annotations in a federated learning scenario, wherein the federated learning scenario includes several clients and servers, comprising the following steps:
[0007] Based on dynamic threshold detection, several clients are divided into clean clients and noisy clients;
[0008] The local feature distribution of each client is uploaded to the server, and the server aggregates the received local features into a global feature distribution;
[0009] For noisy clients, samples are divided into clean samples and noise samples based on whether their distribution categories in the global feature distribution are consistent with their labeled categories;
[0010] For clean clients, all samples from the clean client are used to train the local model of the clean client. For noisy clients, the local model of the noisy client is trained using clean samples, and the updated content of the trained model of each client is uploaded to the server.
[0011] The updated content of the model uploaded by each client is aggregated in the server to obtain an updated global model.
[0012] The present invention also proposes a system for detecting noise annotation in a federated learning scenario for implementing the above-mentioned method for detecting noise annotation in a federated learning scenario. The system includes:
[0013] A client differentiation module is used to classify several clients into clean clients and noisy clients based on dynamic threshold detection;
[0014] The global feature distribution acquisition module is used to upload the local feature distribution of each client to the server, and the server aggregates the received local features into a global feature distribution;
[0015] The sample denoising module is used to classify the samples of noisy clients into clean samples and noise samples according to whether the distribution category of the samples in the global feature distribution is consistent with their labeled category;
[0016] The model training module is used to train the local model of the clean client using the clean client's labeled sample dataset; for the noisy client, it uses the clean sample to train the local model of the noisy client, and upload the updated content of the trained model of each client to the server;
[0017] The global model aggregation module is used to aggregate the updated content of the model uploaded by each client in the server to obtain an updated global model.
[0018] The present invention also proposes a computer device comprising a memory and a processor, wherein the memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor performs the steps of the method for detecting noise annotations in the above-mentioned federated learning scenario.
[0019] Compared with the prior art, the beneficial effects of the technical solution of the present invention are:
[0020] For noise client detection, after identifying the noise client, the noise samples of the noise client are detected by considering the global feature distribution of the entire federated learning system, and richer information is used to identify noise samples, thereby improving the accuracy of identifying noise samples in extreme noise labeling situations, improving the generalization ability of the global model trained by federated learning, and providing assistance for the subsequent application of federated learning in real-world noise data scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 This is a schematic diagram of the first flow chart of the method for detecting noise annotation in the federated learning scenario proposed in Example 1;
[0022] Figure 2 This is a second flow chart of the method for detecting noise annotation in the federated learning scenario proposed in Example 2;
[0023] Figure 3 This is a schematic diagram of the overall structure of the system for detecting noise annotation in the federated learning scenario proposed in Example 3. DETAILED DESCRIPTION
[0024] The accompanying drawings are for illustrative purposes only and are not to be construed as limiting the present embodiment;
[0025] In order to better illustrate this embodiment, some parts in the drawings may be omitted, enlarged, or reduced, and do not represent the actual product size;
[0026] It is understandable to those skilled in the art that some well-known structures and descriptions thereof may be omitted in the drawings.
[0027] The technical solution of the present invention is further described below with reference to the accompanying drawings and embodiments.
[0028] Example 1
[0029] This embodiment proposes a method for detecting noise annotation in a federated learning scenario. Figure 1 This is a schematic diagram of the first flow chart of the method for detecting noise annotation in the federated learning scenario of this embodiment;
[0030] This embodiment proposes a method for detecting noise annotations in a federated learning scenario, wherein the federated learning scenario includes several clients and servers, and includes the following steps:
[0031] S1: Classify several clients into clean clients and noisy clients based on dynamic threshold detection;
[0032] S2: upload the local feature distribution of each client to the server, and the server aggregates the received local features into a global feature distribution;
[0033] S3: For noisy clients, the samples are divided into clean samples and noise samples according to whether the distribution category of the samples in the global feature distribution is consistent with their labeled category;
[0034] S4: For clean clients, all samples of the clean client are used to train the local model of the clean client; for noisy clients, the local model of the noisy client is trained using the clean samples, and the updated content of the trained model of each client is uploaded to the server;
[0035] S5: Aggregate the updated content of the model uploaded by each client in the server to obtain an updated global model.
[0036] During the specific implementation process, for noise client detection, after the noise client is identified, the noise samples of the noise client are detected by considering the global feature distribution of the entire federated learning system, and richer information is used to identify noise samples, thereby improving the accuracy of identifying noise samples in extreme noise labeling conditions, and improving the generalization ability of the global model trained by federated learning, providing assistance for the subsequent application of federated learning in real-world noise data scenarios.
[0037] In an optional embodiment, the step of classifying the plurality of clients into clean clients and noisy clients based on dynamic threshold detection includes: calculating, based on a labeled sample data set of each client, a labeled category probability and a predicted category probability corresponding to each client, setting a dynamic threshold based on the predicted category probability, and classifying the plurality of clients into clean clients and noisy clients based on the dynamic threshold and the labeled category probability;
[0038] The expressions of the labeled category probability and the predicted category probability respectively include:
[0039]
[0040] Where, represents the probability of the labeled category of the k-th client, N represents the predicted category probability of the kth client in the tth round of communication; k Denotes the labeled sample dataset D of the kth client k The total number of samples in Represents the dataset D k The i-th sample in , Represents the sample predicted by the kth client The predicted label For samples Original label The probability of max(p i ) represents the kth client pair sample The maximum predicted probability of the label; where and The smaller the absolute value of the difference between the two, the better the data set D k The more true labeled samples there are, the fewer noise labeled samples there are.
[0041] In an optional embodiment, the expression of the dynamic threshold includes:
[0042]
[0043] Where τ(t) and τ(t-1) represent the dynamic thresholds of the k-th client in the t-th and t-1-th rounds of communication, respectively, and λ represents Tolerance factor;
[0044] The steps of classifying several clients into clean clients and noisy clients based on dynamic thresholds and labeled class probabilities include:
[0045] Calculate the probability of the labeled category corresponding to each round of communication. The expression of the probability of the labeled category corresponding to each round of communication includes:
[0046]
[0047] Where c(t) and c(t-1) represent the probability of the labeled category of the k-th client in the t-th and t-1-th rounds of communication, respectively; when t = 1, c(t-1) = 0;
[0048] In each round of communication, the dynamic threshold and the labeled category probability of each client in this round of communication are compared. If the labeled category probability of any client in this round of communication is greater than its dynamic threshold, the client is considered a clean client in this round of communication; otherwise, the client is considered a noise client in this round of communication.
[0049] In an optional embodiment, the steps of uploading the local feature distribution of each client to the server and aggregating the received local features into a global feature distribution by the server include:
[0050] In each round of communication, each client regards the global model sent by the server in the previous round of communication as its own local model. When this round of communication is the first round of communication, the local model of each client is the initial global model.
[0051] For a noise client, the labeled sample dataset of the noise client is input into the local model of the noise client to obtain the sample features and model prediction probability of each sample in the labeled sample dataset, and the model prediction probability is sharpened using the temperature coefficient T to obtain the sharpened prediction probability;
[0052] Based on the sharpened prediction probability, a Gaussian mixture model is constructed to obtain the local feature distribution Φ of the noise client. k ;
[0053] The local feature distribution Φ k The expressions include:
[0054]
[0055] In the formula, GMM(·) represents Gaussian mixture model, J c and J j They represent the jth and cth labels in the labeled sample dataset of the noise client, Represents the jth label J j The mean of the corresponding Gaussian mixture model, The jth label J j The covariance of the corresponding Gaussian mixture model, Represents the jth label J j The corresponding weights of the Gaussian mixture model; represents the sharpened prediction probability of the i-th sample, y represents the model prediction label of the i-th sample, and v i represents the sample feature of the i-th sample in the labeled sample dataset, C represents the total number of categories of labels in the labeled sample dataset of the noise client; p i (y=J j ) represents the model prediction label y is label J j probability;
[0056] For a clean client, the labeled sample dataset of the clean client is input into its own local model to obtain the sample features of each sample in the labeled sample dataset, and the sample features are modeled using a Gaussian mixture model to obtain the local feature distribution of the clean client;
[0057] The local feature distributions of the clean client and the noisy client are uploaded to the server. The server aggregates the received local feature distributions into a global feature distribution and distributes the global feature distribution to each noisy client.
[0058] In an optional embodiment, for a noisy client, the step of classifying the sample into a clean sample and a noise sample according to whether the distribution category of the sample in the global feature distribution is consistent with its labeled category includes:
[0059] Each noise client calculates the distribution to which the sample belongs based on the global feature distribution. The expression of the distribution to which the sample belongs includes:
[0060]
[0061] γ i={γ i (y=J1),…,γ i (y=J j ),…,γ i (y=J C )}
[0062]
[0063] Where, Represents the i-th sample x in the labeled sample dataset of the noise client i The distribution to which it belongs, γ i Represents sample x i The posterior probability of belonging to a Gaussian distribution, Represents the sample x in the global feature distribution i The weight of the Gaussian mixture model corresponding to the j-th label, represents a Gaussian distribution, Represents the sample x in the global feature distribution i The mean of the Gaussian mixture model corresponding to the j-th label, Represents the sample x in the global feature distribution i The covariance of the Gaussian mixture model corresponding to the j-th label;
[0064] If the label corresponding to the distribution to which the sample belongs is consistent with the original label of the sample, the sample is considered a clean labeled sample, otherwise the sample is considered a noise labeled sample.
[0065] In an optional embodiment, for a noisy client, before inputting the annotated sample dataset of the noisy client into its own local model, each sample in the annotated sample dataset of the noisy client is expanded into samples corresponding to two or more viewpoints, all samples corresponding to each viewpoint are input into the local model, and sample features and model prediction probabilities of each sample corresponding to each viewpoint are obtained; a Gaussian mixture model is constructed based on the sample features of each sample corresponding to each viewpoint, the model prediction probability, and the sharpened prediction probabilities corresponding to the model prediction probabilities, to obtain a local feature distribution corresponding to each viewpoint of the noisy client;
[0066] For the clean client, similarly, the sample features of each sample corresponding to each viewpoint are obtained, and the sample features are modeled using a Gaussian mixture model to obtain the local feature distribution corresponding to each viewpoint of the clean client;
[0067] The local feature distribution corresponding to each view of the clean client and the noisy client is uploaded to the server. The server aggregates the received local feature distribution by view into the global feature distribution corresponding to each view.
[0068] The noise client calculates the distribution of samples corresponding to each perspective based on the global feature distribution corresponding to each perspective. If the label corresponding to the distribution of the sample corresponding to any perspective is consistent with the original label of the sample, the sample is considered a clean labeled sample; otherwise, the sample is considered a noise labeled sample.
[0069] In an optional embodiment, when training the models of clean clients and noisy clients, the cross entropy loss function L is used. ce Calculate the difference between the model prediction result and the actual label, and calculate the loss function L through backpropagation ce The gradient of the model parameters and the optimization algorithm are used to update the model parameters of the clean client or the noisy client. When the loss function L ce When the value reaches the minimum or the number of model parameter updates reaches the preset value, the training is stopped and the trained model is obtained;
[0070] The loss function L ce The expressions include:
[0071]
[0072] Where p ij represents the predicted probability of the i-th sample of the k-th client for the j-th label, represents the original label of the i-th sample of the k-th client.
[0073] In an optional embodiment, the updated parameter θ of the updated global model is g The expressions include:
[0074]
[0075] Where K represents the total number of clients, N k represents the total number of samples in the labeled sample dataset of the kth client; θ k Represents the parameters of the trained model.
[0076] Example 2
[0077] This embodiment is based on the method for detecting noise annotation in the federated learning scenario proposed in Example 1. Figure 2 This is a second flow chart of the method for detecting noise annotation in the federated learning scenario proposed in this embodiment, as shown in FIG. Figure 2 As shown, this embodiment proposes the following specific implementation examples:
[0078] The method for detecting noise annotations in the federated learning scenario includes the following steps:
[0079] S1: A dynamic threshold is set based on the difference between the predicted probability distribution of labels and the predicted probability distribution of the corresponding true labeled samples to determine whether each client has noise labeled samples, thereby identifying the noise client;
[0080] S2: For noisy clients, we introduce global feature distribution and use the consistency algorithm of local and global feature distribution to detect noisy labeled samples, and separate clean labeled samples from noisy labeled samples.
[0081] S3: For clean clients, all samples are used to train the client model. For clients with noisy annotations, clean samples are selected using a feature distribution consistency algorithm to train the client model to prevent the noise samples from affecting model training. Finally, the client model and client feature distribution are uploaded to the server.
[0082] S4: Aggregate the models uploaded by the client in the server and send the aggregated results to the client;
[0083] As an example, in step S1, the labeling category probability and predicted class probability The smaller the absolute value of the difference between the k-th client's label prediction probability distribution and the true labeled sample's label prediction probability distribution, the smaller the difference is.
[0084] As an example, noisy labeled samples are also called mislabeled samples.
[0085] Specifically, such as Figure 2 As shown, we consider a classic federated learning scenario with a server and K local clients, where each client k∈{1,...,K} has a private dataset in is a training sample, is the corresponding training label, which includes the incorrectly labeled label. First, the present invention uses the classic federated learning FedAvg to train the global model and uses the dynamic threshold method to distinguish between noisy clients and clean clients. Then, multiple rounds of model iterative optimization between the client and the server begin. In the round communication, the client uploads the local feature distribution Φ k and the local model θ k To the server, the server aggregates and obtains the global feature distribution Φ g and the global model θ g And send it to all clients. For clients identified as noise, the noise label detection algorithm based on feature distribution consistency is performed using the global feature distribution as a guide, and the dataset D of the noise client is k Divide into clean data set Dclean and the noise dataset D noidy , the noisy client uses the clean dataset D clean To train the local model; for the clean client, directly use the entire client dataset D k This is used to train local models. Finally, all clients upload their local models to the server for aggregation and start the next round of communication.
[0086] According to the model memory principle (from the literature: D.Arpit, S.Jastrz ebski, N.Ballas, D.Krueger, E.Bengio, M.Kanwal, T.Maharaj, A.Fischer, A.Courville, and Y.Bengio. A closer look at memorization in deep networks. In ICML, 2017 proposed), the model will first learn the easy samples (i.e., clean samples) and then learn the difficult samples. Therefore, in the warm-up phase, the model training process is less affected by the noise samples, and the probability of the labeled category of the clean client is will be close to its predicted class probability Relatively speaking, the probability of noise clients being mislabeled is and probability There will be significant differences between them.
[0087] Based on the above analysis, a dynamic threshold is set to distinguish the detection of noisy clients. This threshold can be regarded as the minimum probability of the clean client labeling category and is automatically adjusted during the federated learning process. As shown in formula (1), we use And the tolerance coefficient λ is used to obtain the threshold τ(t) (i.e., the minimum tolerance probability) of the tth round, which also takes into account the minimum tolerance probability of the previous t-1 rounds to make the threshold more stable. As shown in formula (2), the client's labeling category probability c(t) in the tth round is based on the average predicted probability of its labeling category Updated round by round.
[0088]
[0089] In each round, we calculate the minimum tolerance probability τ(t) and the labeled category probability c(t) for each client. If the labeled category probability c(t) is greater than the threshold τ(t), the client is considered a clean client; otherwise, it is considered a noisy client.
[0090] Previous methods used the differences between clients to distinguish between clean and noisy clients. However, when faced with extreme noise (e.g., when all clients are noisy), the differences between clients become smaller, and previous methods cannot distinguish noisy clients well. Our method calculates a dynamic threshold for each client and compares it with the labeled class probability to distinguish, and independently determines whether a client is a noisy sample, rather than relying on the differences between clients. Therefore, we can still effectively identify noisy clients in extreme noise conditions.
[0091] Given the global model θ g Extracted sample features v i =E(θ g ;x i ), and use the Gaussian mixture model to model it to obtain the local feature distribution. Due to the presence of noisy labels, the local distribution constructed based on the original annotations may deviate significantly from the true distribution. This deviation may make the subsequent use of feature distribution to detect noisy labels inaccurate, resulting in a decrease in the performance of the global model trained by federated learning. In order to reduce the impact of noisy labels on the construction of feature distribution modeling, we use the global model θ g The predicted probability p i =P(θ g ;x i ) to replace the original annotation to achieve the correction of local feature distribution. At the same time, in order to obtain a more accurate distribution, we use the temperature coefficient T to sharpen the probability p i ,get By utilizing Replace the latent variable z required to construct the Gaussian mixture model to obtain the local feature distribution Φ k =GMM(μ,σ,λ).
[0092] After receiving the global feature distribution Φ sent by the server g Afterwards, we detect the mislabeled samples of the noise client by judging whether the distribution category of the sample in the global feature distribution is consistent with its labeled category. Specifically, we calculate the sample x according to the following formula: i The posterior probability γ of k belonging to the Gaussian distribution i , the maximum posterior probability That is, sample x i The distribution to which it belongs.
[0093] Furthermore, since we model the distribution of the two perspectives separately, we will obtain the distribution categories of the two perspectives respectively. and In order to improve the accuracy of noise recognition, we believe that as long as and Any one of them and yi If the data set D is consistent, then the sample can be regarded as a clean sample, otherwise it is considered a noise sample. Finally, we use the following formula to transform the data set D k Divide into noise subsets and clean subset
[0094]
[0095] For clean clients, use all samples D k Train the client model; for clients with noisy annotations, use the feature distribution consistency algorithm to filter out clean samples Train the client model to prevent noise samples from affecting model training. Get the prediction results for the training images and use the cross entropy L ce To calculate the difference between the predicted result and the actual label.
[0096]
[0097] where p ij The model predicts the probability of the jth sample for category i. Next, the gradient of the loss with respect to the model parameters is calculated through backpropagation, and the local model parameters are updated using an optimization algorithm. Finally, the client model is uploaded to the server for aggregation to obtain the global model.
[0098] In order to more effectively utilize the information of other clients, make the distribution better reflect the global characteristics, and improve the accuracy of noise detection, we aggregate the local distribution Φ on the server. k Get the global distribution Φ g Specifically, we sample the local feature distributions sent by the client and use the Gaussian mixture model (GMM) to model the sampled data to obtain the global feature distribution Φ g , as shown below.
[0099]
[0100] Through this global modeling approach, we can more comprehensively describe the characteristic distribution of the data and, with the help of data distribution information from other clients, avoid the loss of accuracy of a single client due to overly limited data distribution or excessive noise interference.
[0101] We use the classic model aggregation method based on data proportion. By taking a weighted average of the model parameters of each client, we can effectively integrate knowledge from different clients while protecting data privacy. Model aggregation is shown in the following formula, where
[0102]
[0103] This paper conducts experiments on the CIFAR10 dataset. We compare FedAvg, a traditional federated learning method that does not consider the noisy annotation problem, with FedCorr, FedNoRo, FedRN, RoFL, and FedNed, algorithms designed to detect noisy annotations in federated learning scenarios. The results demonstrate that our method achieves higher accuracy than other algorithms for detecting noisy annotations in federated learning scenarios.
[0104] Among them, FedAvg comes from: McMahan, Brendan, et al. "Communication-efficient learning of deep networks from decentralized data." Artificial intelligence and statistics. PMLR, 2017.
[0105] FedCorr originates from: Xu, Jingyi, et al. "Fedcorr: Multi-stage federated learning for label noise correction." Proceedings of the IEEE / CVF conference on computer vision and pattern recognition. 2022.
[0106] FedNoRo originated from: Nannan Wu, Li Yu, Xuefeng Jiang, Kwang-Ting Cheng, and Zengqiang Yan, "Fednoro: Towards noise-robust fed-erated learning by addressing class imbalance and label noise heterogeneity," in Proceedings of the Thirty-Second International Joint Conference on Artificial Intelligence, IJCAI-23, 82023, pp.4424-4432.
[0107] FedRN originates from: Kim, SangMook, et al. "FedRN: Exploiting k-reliable neighbors towards robust federated learning." Proceedings of the 31st ACM International Conference on Information & Knowledge Management. 2022.
[0108] RoFL originates from: Yang, Seunghan, et al. "Robust federated learning with noisylabels." IEEE Intelligent Systems 37.2(2022):35-43.
[0109] FedNed originated from: Lu, Yang, et al. "Federated learning with extremely noisyclients via negative distillation." Proceedings of the AAAI Conference on Artificial Intelligence.Vol.38.No.13.2024.
[0110] Experiment 1:
[0111] Experimental setup: For the artificially noisy CIFAR10 dataset, to simulate incorrect annotations, we erode the training set using two common erroneous annotation methods: symmetric flipping and pair flipping. We use ρ to represent the probability that a client is noisy, with a larger value indicating a higher proportion of noisy clients. (η l ,η u ) represents the range of the proportion of noisy labeled samples in noisy clients. A larger value indicates a higher proportion of noisy samples in the noisy clients. We tested the performance of federated learning under different ratios of noisy clients and different ratios of noisy samples, including noisy client ratios ρ = 1 and ρ = 0.5, and noisy label ratios of (0.3, 0.5) and (0.5, 0.7) to simulate extreme noisy labeling conditions.
[0112] Experimental results and analysis: Table 1 shows the accuracy of different federated learning methods proposed in this embodiment on CIFAR10 (IID data distribution). In the noise labeling scenario, the global prediction accuracy of the federated learning trained model is recorded in Table 1. It can be seen that due to the influence of noise labels, the performance of the traditional federated learning method FedAvg will drop sharply as the noise level increases. At the same time, it can be observed that the current algorithm for detecting noise labels in federated learning scenarios can alleviate the impact of noise labels to a certain extent. However, when the noise level is very large, these methods are still affected by erroneous information because they cannot identify noise labels well, which causes the performance of these methods to drop sharply. Due to the consideration of richer information, it can be found that our method can maintain good performance even in extreme noise conditions and can more effectively resist the impact of noise labels; Table 1 is shown below:
[0113]
[0114] Table 1 Accuracy of different federated learning methods on CIFAR10 (IID data distribution)
[0115] Experiment 2:
[0116] Experimental setup: We compare the current mainstream noise detection methods, such as Loss, Class-Loss[3], and LID[2], to detect noisy clients. As in Experiment 1, we use ρ to represent the probability that the client is noisy, (η l ,η u ) represents the range of the proportion of noisy labeled samples of noisy clients. We tested the accuracy of these methods in detecting noisy clients under different proportions of noisy clients and different proportions of noisy samples, including the case where all the noisy clients are noisy and the case where half of the clean clients are clean, and the case where the noise label ratio is (0.3, 0.5).
[0117] Table 2 shows the accuracy of detecting noisy clients using different methods proposed in this embodiment. Table 2 is as follows:
[0118]
[0119] Table 2 Accuracy of different methods in detecting noisy clients
[0120] The present invention proposes a noise client detection algorithm based on dynamic thresholds and a method for detecting noise annotations based on the consistency of global feature distribution, which solves the problem of the federated learning algorithm in traditional noise scenarios detecting noise samples and the decline in the ability of noise samples in extreme noise conditions. Specifically, we use the difference in the probabilities corresponding to the labeled categories between clean clients and noisy clients to distinguish them. The dynamic threshold is adjusted according to the probability corresponding to the predicted category, and the difference between the probability corresponding to the labeled category and the dynamic threshold is compared to distinguish clean clients from noisy clients; for the error sample detection of noise clients, we detect noise samples by judging whether the category to which the sample belongs in the global feature distribution is consistent with its labeled category. It uses richer information to identify noise samples, thereby improving the accuracy of identifying noise samples in extreme noise annotation conditions, improving the generalization ability of the global model trained by federated learning, and providing help for the subsequent application of federated learning in real-world noise data scenarios.
[0121] Compared with the traditional federated learning method for combating noise, the method and system for detecting noise labels in the federated learning scenario proposed in this embodiment have the following main features: (1) A noise client detection algorithm based on dynamic threshold is proposed. We use the difference in data feature distribution between clean clients and noisy clients under the labeling category to identify noisy clients. The present invention adjusts the dynamic threshold according to the data feature distribution corresponding to the predicted category, and compares the difference between the distribution probability corresponding to the labeling category and the dynamic threshold to distinguish clean clients from noisy clients. Unlike the previous method that uses the static difference of the client to distinguish clean and noisy clients, our method sets personalized thresholds for each client based on their information, which can effectively deal with noise client detection under extreme noise conditions. (2) Global feature aggregation method: By aggregating local feature distribution, we can more comprehensively describe the feature distribution of the data, and with the help of data distribution information of other clients, avoid the subsequent detection of noise samples due to the reduction of accuracy caused by the data distribution of a single client being too limited or the noise interference being too strong. (3) A noise label detection algorithm based on the consistency of global feature distribution is proposed. We detect noise label samples by judging whether the category to which the sample belongs in the global feature distribution is consistent with the category it is labeled. This method considers the overall data distribution of the entire federated learning system. Compared with previous indicators that only use single client information, it is more reliable and can avoid the problem of large noise detection errors caused by excessively high noise ratios on a single client. In this invention, a dynamic threshold-based noise client detection algorithm and a method for detecting noise labels based on global feature distribution consistency are implemented. This can effectively reduce the impact of noise samples on model training, improve the performance of federated learning in the presence of noisy labels, and provide assistance for the subsequent application of federated learning in real-world noisy data scenarios.
[0122] Example 3
[0123] This embodiment proposes a system for detecting noise annotation in a federated learning scenario, which is used to implement the method for detecting noise annotation in a federated learning scenario proposed in Example 1. Figure 3 This is a schematic diagram of the overall structure of the system for detecting noise annotation in the federated learning scenario proposed in this embodiment.
[0124] like Figure 3 As shown, the system for detecting noise annotation in the federated learning scenario includes:
[0125] A client differentiation module is used to classify several clients into clean clients and noisy clients based on dynamic threshold detection;
[0126] The global feature distribution acquisition module is used to upload the local feature distribution of each client to the server, and the server aggregates the received local features into a global feature distribution;
[0127] The sample denoising module is used to classify the samples of noisy clients into clean samples and noise samples according to whether the distribution category of the samples in the global feature distribution is consistent with their labeled category;
[0128] The model training module is used to train the local model of the clean client using the clean client's labeled sample dataset; for the noisy client, it uses the clean sample to train the local model of the noisy client, and upload the updated content of the trained model of each client to the server;
[0129] The global model aggregation module is used to aggregate the updated content of the model uploaded by each client in the server to obtain an updated global model.
[0130] This embodiment proposes a computer device including a memory and a processor, wherein the memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor performs the steps of the method for detecting noise labeling in the federated learning scenario described in Example 1.
[0131] It can be understood that the system and computer device for detecting noise annotation in the federated learning scenario of this embodiment apply the method of Example 1. The optional options in the above-mentioned Example 1 are also applicable to this embodiment, so they will not be repeated here.
[0132] The same or similar reference numerals correspond to the same or similar components;
[0133] The terms used in the drawings to describe positional relationships are for illustrative purposes only and should not be construed as limiting the present embodiment.
[0134] Obviously, the above embodiments of the present invention are merely examples for the purpose of clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. Those skilled in the art will appreciate that other variations or modifications can be made based on the above description. It is not necessary and impossible to enumerate all embodiments here. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the claims of the present invention.
Claims
1. A method for detecting noise annotation in a federated learning scenario, wherein the federated learning scenario includes several clients and servers, characterized in that: The following steps are involved: Based on dynamic threshold detection, several clients are divided into clean clients and noisy clients; The local feature distribution of each client is uploaded to the server, and the server aggregates the received local features into a global feature distribution; For noisy clients, samples are divided into clean samples and noise samples based on whether their distribution categories in the global feature distribution are consistent with their labeled categories; For a clean client, all samples of the clean client are used to train the local model of the clean client; For noisy clients, use clean samples to train the local model of the noisy client, and upload the updated content of the trained model of each client to the server; Aggregate the updated content of the model uploaded by each client in the server to obtain an updated global model; The step of classifying the plurality of clients into clean clients and noisy clients based on dynamic threshold detection includes: calculating the labeled category probability and the predicted category probability corresponding to each client based on a labeled sample dataset of each client, setting a dynamic threshold based on the predicted category probability, and classifying the plurality of clients into clean clients and noisy clients based on the dynamic threshold and the labeled category probability; The expressions of the labeled category probability and the predicted category probability respectively include: Where, Indicates the The probability of the labeled category of each client, Indicates the The client in Predicted class probabilities in round-by-round communication; Indicates the A dataset of labeled samples from clients The total number of samples in Representing a dataset The samples, Indicates the use of Samples predicted by the client The predicted label For samples Original label probability; Indicates the Client pair samples The maximum predicted probability of the label; where and The smaller the absolute value of the difference between the two, the better the data set The more true labeled samples there are, the fewer noise labeled samples there are; The steps of uploading the local feature distribution of each client to the server and aggregating the received local features into a global feature distribution include: In each round of communication, each client regards the global model sent by the server in the previous round of communication as its own local model. When this round of communication is the first round of communication, the local model of each client is the initial global model. For the noise client, the labeled sample data set of the noise client is input into the local model of the noise client to obtain the sample features and model prediction probability of each sample in the labeled sample data set, and the temperature coefficient is used to calculate the predicted probability of each sample. Sharpen the model prediction probability to obtain the sharpened prediction probability; A Gaussian mixture model is constructed based on the sharpened prediction probability to obtain the local feature distribution of the noise client. ; The local feature distribution The expressions include: Where, represents a Gaussian mixture model, and Represents the first Kind and Kind of tags, Indicates the Kind of label The mean of the corresponding Gaussian mixture model, No. Kind of label The covariance of the corresponding Gaussian mixture model, Indicates the Kind of label The corresponding weights of the Gaussian mixture model; Indicates the The sharpened predicted probability of samples, Indicates the The model predicts labels for samples, Indicates the first The sample characteristics of the samples, Represents the total number of categories of labels in the labeled sample dataset of the noise client; The model predicted label represented by For label probability; For a clean client, the labeled sample dataset of the clean client is input into its own local model to obtain the sample features of each sample in the labeled sample dataset, and the sample features are modeled using a Gaussian mixture model to obtain the local feature distribution of the clean client; The local feature distributions of the clean client and the noisy client are uploaded to the server. The server aggregates the received local feature distributions into a global feature distribution and distributes the global feature distribution to each noisy client.
2. The method for detecting noise annotation in a federated learning scenario according to claim 1, characterized in that: The expression of the dynamic threshold includes: Where, and Respectively represent The client in Round and Dynamic thresholds in round-robin communication, express Tolerance factor; The steps of classifying several clients into clean clients and noisy clients based on dynamic thresholds and labeled class probabilities include: Calculate the probability of the labeled category corresponding to each round of communication. The expression of the probability of the labeled category corresponding to each round of communication includes: Where, and Respectively represent The client in Round and The probability of the labeled category in the round communication; when hour, ; In each round of communication, the dynamic threshold and the labeled category probability of each client in this round of communication are compared. If the labeled category probability of any client in this round of communication is greater than its dynamic threshold, the client is considered a clean client in this round of communication; otherwise, the client is considered a noise client in this round of communication.
3. The method for detecting noise annotation in a federated learning scenario according to claim 1, characterized in that: For noisy clients, the steps of classifying their samples into clean samples and noise samples based on whether their distribution categories in the global feature distribution are consistent with their labeled categories include: Each noise client calculates the distribution to which the sample belongs based on the global feature distribution. The expression of the distribution to which the sample belongs includes: Where, The first in the labeled sample dataset of the noisy client samples The distribution to which it belongs, Represents a sample The posterior probability of belonging to a Gaussian distribution, Represents samples in the global feature distribution The label is The weight of the Gaussian mixture model corresponding to the label, represents a Gaussian distribution, Represents samples in the global feature distribution The label is The mean of the Gaussian mixture model corresponding to the label, Represents samples in the global feature distribution The label is The covariance of the Gaussian mixture model corresponding to the label; If the label corresponding to the distribution to which the sample belongs is consistent with the original label of the sample, the sample is considered a clean labeled sample, otherwise the sample is considered a noise labeled sample.
4. The method for detecting noise annotation in a federated learning scenario according to claim 1, characterized in that: For a noisy client, before inputting the annotated sample dataset of the noisy client into its own local model, each sample in the annotated sample dataset of the noisy client is expanded into samples corresponding to two or more viewpoints, and all samples corresponding to each viewpoint are input into the local model to obtain the sample features and model prediction probabilities of each sample corresponding to each viewpoint; a Gaussian mixture model is constructed based on the sample features, model prediction probabilities, and sharpened prediction probabilities corresponding to the model prediction probabilities of each sample corresponding to each viewpoint to obtain the local feature distribution corresponding to each viewpoint of the noisy client; For the clean client, similarly, the sample features of each sample corresponding to each viewpoint are obtained, and the sample features are modeled using a Gaussian mixture model to obtain the local feature distribution corresponding to each viewpoint of the clean client; The local feature distribution corresponding to each view of the clean client and the noisy client is uploaded to the server. The server aggregates the received local feature distribution by view into the global feature distribution corresponding to each view. The noise client calculates the distribution of samples corresponding to each perspective based on the global feature distribution corresponding to each perspective. If the label corresponding to the distribution of the sample corresponding to any perspective is consistent with the original label of the sample, the sample is considered a clean labeled sample; otherwise, the sample is considered a noise labeled sample.
5. The method for detecting noise annotation in a federated learning scenario according to claim 1, characterized in that: When training the local models of clean and noisy clients, the cross entropy loss function is used. Calculate the difference between the model prediction result and the actual label, and calculate the loss function through backpropagation The gradient of the model parameters and the optimization algorithm are used to update the model parameters of the clean client or the noisy client. When the value reaches the minimum or the number of model parameter updates reaches the preset value, the training is stopped and the trained model is obtained; The loss function The expressions include: Where, Indicates the Client's Sample pair The predicted probability of the label, Indicates the Client's The original labels of the samples.
6. The method for detecting noise annotation in a federated learning scenario according to any one of claims 1 to 5, characterized in that: Update parameters of the updated global model The expressions include: Where, Indicates the total number of clients. Indicates the The total number of samples in the labeled sample dataset of the client; Represents the parameters of the trained model.
7. A system for detecting noise annotation in a federated learning scenario, used to implement the method for detecting noise annotation in a federated learning scenario according to any one of claims 1 to 6, characterized in that: include: A client differentiation module is used to classify several clients into clean clients and noisy clients based on dynamic threshold detection; The global feature distribution acquisition module is used to upload the local feature distribution of each client to the server, and the server aggregates the received local features into a global feature distribution; The sample denoising module is used to classify the samples of noisy clients into clean samples and noise samples according to whether the distribution category of the samples in the global feature distribution is consistent with their labeled category; A model training module is used to train a local model of a clean client using a labeled sample dataset of the clean client; For noisy clients, use clean samples to train the local model of the noisy client, and upload the updated content of the trained model of each client to the server; The global model aggregation module is used to aggregate the updated content of the model uploaded by each client in the server to obtain an updated global model.
8. A computer device comprising a memory and a processor, wherein the memory stores computer-readable instructions, characterized in that: When the computer-readable instructions are executed by the processor, the processor performs the steps of the method for detecting noise annotations in a federated learning scenario as described in any one of claims 1 to 6.