Efficient client screening privacy protection federal learning method for data isomerism
By designing an efficient client screening mechanism and personalized differential privacy protection strategy in federated learning, the model performance and efficiency problems under data heterogeneity and privacy protection requirements are solved, and more efficient and secure federated learning is achieved.
Patent Information
- Application Number
- CN202411945969.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2044-12-26
AI Technical Summary
When facing data heterogeneity and privacy protection needs, federated learning has deteriorated model performance and slow convergence. The existing differential privacy methods are difficult to apply in resource-constrained environments, and it is difficult to balance model performance with client personalized privacy needs.
An efficient client filtering mechanism is designed to cluster through gradient similarity clustering and evaluate client contributions based on improved Shapley Value values, combined with personalized differential privacy protection policies, optimize client selection and privacy budget allocation.
It improves the participation of clients with high data quality in model training, reduces privacy budget consumption and communication overhead, and improves the overall efficiency and security of federated learning.
Smart Images

Figure CN119830347A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the fields of computer science and information technology, and specifically relates to an efficient client screening privacy-preserving federated learning method for data heterogeneity. Background Art
[0002] With the rapid development of artificial intelligence technology, data-driven machine learning models have been widely used in fields such as medicine, finance, and smart cities. However, in practical applications, data is usually distributed among different devices or organizations. Due to the needs of privacy protection and data security, it is not feasible to directly share the original data. Federated Learning, as a distributed machine learning framework, achieves collaborative training of global models without directly transmitting data by sinking model training to the client, effectively solving the data privacy problem. However, Federated Learning still faces many challenges in practical applications.
[0003] First, because the data distribution and quality of different clients may differ significantly (i.e., data heterogeneity), traditional federated learning methods are easily affected by low-quality or unbalanced data, resulting in degraded model performance or slower convergence. Second, in order to protect data privacy, federated learning usually uses differential privacy technology to inject noise during parameter transmission. However, existing differential privacy methods have problems with large privacy budget consumption and high communication overhead in practical applications, which limits their application in resource-constrained environments. In addition, how to balance model performance with client personalized privacy requirements is also a major problem in current federated learning research.
[0004] Some existing client selection methods often adopt a unified client selection criterion, that is, selecting clients with large local data sets. This criterion usually leads to fixed client selection. These frequently selected clients will inject a lot of noise into the model parameters, which will have an adverse effect on the model performance. Therefore, we need to incorporate privacy considerations into the client selection. The paper "Chen Y, Xu W, Wu X, et al. Personalized Local Differentially Private Federated Learning with Adaptive Client Sampling[C] / / ICASSP 2024-2024IEEE International Conference on Acoustics, Speech and Signal Processing(ICASSP). IEEE, 2024:6600-6604." proposed an adaptive client sampling algorithm that selects clients by calculating the client sampling probability through an optimization algorithm. However, when allocating the privacy budget among different clients, they did not consider the impact of changes in client privacy requirements, but chose a random distribution. The paper "Li Q, Li X, Zhou L, et al. Adafl: Adaptive client selection and dynamic contribution evaluation for efficient federated learning [C] / / ICASSP 2024-2024 IEEE International Conference on Acoustics, Speech and Sig nal Processing (ICASSP). IEEE, 2024: 6645-6649." proposed an adaptive client selection method to select clients for local training based on their contribution values. In addition, as the number of communication rounds increases, the number of participating clients also gradually increases. This scheme ignores the adverse effects of adding personalized differential privacy to the client selection strategy, and the increase in the number of clients may lead to an increase in the noise injected into the model, resulting in a decrease in model performance. Summary of the invention
[0005] In response to the above problems, the present invention proposes an efficient client screening privacy-preserving federated learning method for data heterogeneity, designs an efficient client screening mechanism, and combines it with a personalized differential privacy protection strategy, which can not only improve the participation of clients with high data quality in model training, but also reduce the consumption of privacy budget and communication overhead while ensuring strong privacy protection, thereby improving the overall efficiency and security of federated learning. This is of great significance for the wide application of federated learning in practical scenarios.
[0006] In order to achieve the above object, the present invention is achieved through the following technical solutions:
[0007] The present invention is an efficient client-side screening privacy-preserving federated learning method for data heterogeneity. The proposed federated learning framework mainly consists of two parts: one is the client C k (k=1,2,…,N), each client has its own data set D k (k=1,2,…,N), and the local data of each client is heterogeneous, that is, their data label distribution is inconsistent, some clients have more labels, and some have fewer. The second is the server S, which collaborates with N clients to complete the model training of federated learning.
[0008] The federated learning method specifically includes the following steps:
[0009] Step 1: Initialization phase: Server S generates a federated learning task and initializes the global model parameter ω of round 0 0 , the global model parameter ω of round 0 0 Send to the candidate client set TS for the next round of training to allocate privacy budget to the client;
[0010] Step 2: Client screening phase: Select the best client and add it to the candidate client set TS for training. The specific steps include:
[0011] Step 2-1: Calculate and store the gradients of all clients, and cluster all clients to obtain a group set {G1, G2, …, G n +;
[0012] Step 2-2, in each group, the best client is selected according to the contribution value AVG-Shapley value to join the candidate client set TS for training;
[0013] Step 2-3: Adopt a privacy budget allocation strategy to provide privacy protection;
[0014] Step 3: Local training phase: The client trains based on the local dataset D i And the global model parameters ω are trained to generate local model parameters Local model parameters Inject noise and change the local model parameters Send to server S;
[0015] Step 4: Model aggregation and parameter distribution phase: Server S receives the local model parameters Perform mean aggregation: specifically:
[0016]
[0017] The aggregated model parameters ω t As the new round of global model parameters ω, it is sent to the client for the next round of training;
[0018] Step 5: Repeat steps 2 to 4 until the maximum number of training rounds or the global model parameter ω is reached. t Convergence, maximum number of training rounds T = 50, t < T.
[0019] A further improvement of the present invention is that: in step 2-2, the best client is selected from each group according to the contribution value AVG-Shapley value to join the candidate client set TS for training, specifically: for the group set {G1, G2, ..., G n + All clients are sorted in descending order according to their contribution AVG-Shapley values, and the client with the highest contribution AVG-Shapley value is selected to join the candidate client set TS for training.
[0020] A further improvement of the present invention is that: in step 2-3, a total consumption privacy budget set E is defined, where E = {E1, E2, ..., E N +, which stores the total privacy budget consumed by each client during the entire training process. The privacy budget allocation strategy specifically includes the following steps:
[0021] Step 2-3-1: Server S uses a total consumed privacy budget set E to calculate the total privacy budget consumed by each client in the federated learning iteration, and also sets the upper bound of the privacy budget ∈ max and the privacy budget lower bound ∈ min ;
[0022] Step 2-3-2: For client C participating in training i∈TS , its total consumed privacy budget E i With the privacy budget upper bound ∈ max For comparison, if E i <∈ max , client C i Still involved in training;
[0023] Step 2-3-3, if E i ≥∈max And∈ i ≤∈ min , client C i Exit the training candidate client set TS;
[0024] Step 2-3-4, if E i ≥∈ max And∈ i >∈ min , so that the client's privacy budget ∈ i The decrease range ∈0, ∈0 is set by the client, where 0<∈0<5;
[0025] Step 2-3-5: If the originally screened clients in each group no longer participate in the training, the second-ranked clients are added to the training candidate client set TS to supplement the clients to participate in the training.
[0026] A further improvement of the present invention is that in step 3, the local training stage specifically includes the following steps:
[0027] Step 3-1: Each client C in the candidate client set TS i∈TS After receiving the global model parameters ω from server S, based on its local dataset D i And global model parameters ω for model training;
[0028] Step 3-2: After the local model training is completed, noise is injected based on the allocated privacy budget, and the model with noise injection is sent to the server S;
[0029] Step 3-3: After receiving the model after the noise is injected, the server S calculates the contribution level of each client to the model training compared with the previous round. The contribution level is calculated using AVG-Shapley.
[0030] A further improvement of the present invention is that in step 3-3, AVG-Shapley means using the mean of the loss functions of all clients after training in the previous round to replace the global loss function of the previous round, and using the contribution value φ calculated by the AVG-Shapley method i-AVG for:
[0031]
[0032] Among them, |TS| represents the number of clients in the candidate client set TS, f(W S∪{i+ ) represents the loss function after client i participates in training, f(W S∈TS) represents the loss function of each client in the candidate client set TS of the previous round after training. After the training of client i is completed in each round, the loss function of client i after participating in the training is obtained, and the server S will store the average loss function of all clients in the candidate client set of the previous round of training after participating in the training, and use the average loss function of all clients after participating in the training as the global loss function after the previous round of training. Client i uses the loss function obtained after its own training and the global loss function to calculate its marginal contribution value to the global model. After that, in the next round of client screening stage, server S can sort the clients according to the marginal contribution value of each client, so as to screen out the clients participating in the next round of training.
[0033] A further improvement of the present invention is that: Step 3-1 is for each client C in the candidate client set TS i∈TS After receiving the global model parameters ω from server S, based on its local dataset D i And global model parameters ω for model training. In the tth round of training, client C i∈TS Based on the local dataset D i and the global model parameter ω after the t-1th round of update (t-1) Calculate the local loss value and its gradient, and update the global model parameter ω through the SGD stochastic gradient descent algorithm (t-1) , the specific steps are as follows:
[0034] In the tth round of training, client C i∈TS Based on the local dataset D i and the global model parameter ω after the t-1th round of update (t-1) Calculate the local loss value f i t (ω (t-1) , D i ), the global model parameter ω after the t-1th round update (t-1) The derivative is used to get the gradient, the formula is:
[0035]
[0036] Based on the calculated gradient Use the stochastic gradient descent algorithm SGD to update the global model parameters ω after t-1 rounds of updates (t-1) , the specific formula is:
[0037]
[0038] Where η is the learning rate.
[0039] A further improvement of the present invention is that: the step 3-2 is to inject noise based on the allocated privacy budget after the local training is completed, and send the model after the noise injection to the server S and the client C i∈TS After local training is completed, the local model parameters of the tth round are obtained Generate Gaussian noise N(μ,σ) that follows a normal distribution 2 ), to local model parameters Inject Gaussian noise N(μ,σ 2 ), and send the noisy local model parameters to the server S. Specifically, in the tth round of training, the client C i∈TS According to the set privacy budget ∈ and failure probability δ, generate Gaussian noise N(μ,σ 2 ), where μ = 0, Δf is the sensitivity, which is defined as the maximum magnitude of a single data change in function f, and then the local model parameters Inject Gaussian noise N(0,σ 2 ):
[0040]
[0041] The local model parameters after adding noise Send to server S.
[0042] A further improvement of the present invention is that: in step 3-3, Shapley Value defines the contribution value φ of client i i , and its calculation formula is:
[0043]
[0044] Where N represents N participants, v represents the profit function, and for any subset S of N, the function v(S) represents the total profit brought by the cooperation of the participants in the subset. The last two terms of the summation symbol in the formula are represents the combined weight, which represents the probability of occurrence of subset S in all possible arrangements, v(S∪{i+)-v(S)- represents the marginal contribution of participant i to subset S,
[0045] Using the loss function to represent the revenue function, the Shapley Value calculation formula is expressed as:
[0046]
[0047] Where Δf(W)=f(W S∪{i+ )-f(W S );
[0048] Using approximate algorithms to reduce time complexity, the above formula can be expressed as:
[0049]
[0050] Where f(W S ) represents the loss function after no client i participates in training, f(W S∪{i+ ) represents the loss function after client i participates in training, and assigns weights to it Represents the marginal contribution value of client i.
[0051] A further improvement of the present invention is that the initialization phase of step 1 mainly includes the following steps:
[0052] Step 1-1: Server S generates a federated learning task and initializes the global model parameters ω for round 0 0 , prepare to set the global model parameter ω of round 0 0 Send to the candidate client set TS for the next round of training;
[0053] Step 1-2: Allocate a different privacy budget to each client, based on the proportion of its local data set to the total data volume. The privacy budget of client i ∈ i The calculation formula is as follows:
[0054]
[0055] Among them, |D i | is the number of samples in the local dataset of client i.
[0056] A further improvement of the present invention is that: the step 2-1 calculates and stores the gradients of all clients, and all clients are clustered and grouped according to the generated gradient similarity matrix, specifically including the following steps:
[0057] Step 2-1-1: After the t-1 round of training is completed, each client in the candidate client set TS will obtain the gradient g obtained in this round of training. (t-1) Stored to form a gradient set gList, gList = (g1, g2, ..., g N ), after the t-1th round of training, Client (C1,…,C i ,…,C N )∈TS (t-1) ;
[0058] Step 2-1-2: The gradient set gList stores the gradient of each client. For the gradient g of client i and client j, i With g j , calculate the cosine similarity, that is:
[0059]
[0060] Step 2-1-3, calculate the cosine similarity cos(g i ,g j ) fill in the gradient similarity matrix, calculate the cosine similarity between all clients, and fill the gradient similarity matrix V t In the client screening phase of round t, the server S generates a gradient similarity matrix V according to the gradient set gList t :
[0061]
[0062] Among them, V t ,i-,j- is the gradient similarity between client i and client j, V t ,i-,j-=cos(g i ,g j ), the closer it is to 1, the more similar their data distributions are. According to the threshold α set in advance, when V t ,i-,j->α, clients i and j are clustered into one class and grouped into one group. After clustering all clients, we get the grouping set {G1,G2,…,G n +, for any group, any client i and any client j satisfy V t ,i-,j->α.
[0063] The beneficial effects of the present invention are:
[0064] The present invention designs a client screening method, clusters and groups clients in combination with gradient similarity, and evaluates the contribution of clients to model training according to an improved Shapley Value calculation method AVG-Shapley, thereby screening out the best clients to participate in training, which can reduce a lot of communication overhead.
[0065] The present invention provides personalized differential privacy protection for the client, and reallocates the privacy budget during the training process to enhance the security of privacy protection, thereby saving a large amount of privacy budget.
[0066] The present invention can screen out clients with high data quality for training in each round, and provide strong privacy protection for clients and model parameters. Compared with existing frameworks, this framework can save a lot of privacy budget, reduce a lot of communication overhead, realize efficient training of the model, and the model converges faster. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] Figure 1This is a flowchart of the privacy-preserving federated learning framework for efficient client-side screening of data heterogeneity proposed in the present invention.
[0068] Figure 2 This is a diagram of the privacy-preserving federated learning framework for efficient client-side screening of data heterogeneity proposed in the present invention.
[0069] Figure 3 It is a schematic diagram for comparing the accuracy test of the present invention with the existing OptimalQ method and AdaFL method.
[0070] Figure 4 This is a comparison chart of the total privacy budget consumed by the present invention, the existing OptimalQ method and the AdaFL method.
[0071] Figure 5 The figure is a comparison chart of the communication overhead consumed by the present invention, the existing OptimalQ method and the AdaFL method.
[0072] Figure 6 The figure is a comparison chart of the relationship between the communication overhead consumed and the accuracy rate of the present invention, the existing OptimalQ method and the AdaFL method. DETAILED DESCRIPTION
[0073] The following will disclose the embodiments of the present invention with drawings. For the purpose of clear description, many practical details will be described together in the following description. However, it should be understood that these practical details should not be used to limit the present invention. That is to say, in some embodiments of the present invention, these practical details are not necessary.
[0074] Figure 1 The figure shows the flow chart of the federated learning framework of the present invention, wherein the system architecture mainly consists of two parts: the client and the server. k (k=1,2,…,N), each client has its own data set D k (k=1,2,…,N), and the local data of each client is heterogeneous, that is, their data label distribution is inconsistent, some clients have more labels, and some have fewer. Server S, which collaborates with N clients to complete the federated learning model training.
[0075] The present invention discloses an efficient client-screening privacy-preserving federated learning method for data heterogeneity, which mainly includes four stages, namely, initialization stage, client screening stage, local training stage, model aggregation and parameter distribution stage. Except for the initialization stage, which only needs to be executed once, the other three stages need to be executed repeatedly until the model converges.
[0076] The initialization phase includes the following steps:
[0077] Step 1-1: Server S generates a federated learning task and initializes the global model parameters ω for round 0 0 , ready to 0 Send to the candidate client set TS for the next round of training;
[0078] Step 1-2: In order to meet the personalized privacy needs of the client, a different privacy budget is allocated to each client. The allocation method is the proportion of its local data set to the total data volume. The privacy budget of client i ∈ i The calculation formula is as follows:
[0079]
[0080] Among them, |D i | is the number of samples in the local dataset of client i.
[0081] The client screening phase includes the following steps:
[0082] Step 2-1: All clients are clustered and grouped according to the generated gradient similarity matrix;
[0083] Step 2-1-1: After the t-1 round of training is completed, each client in the candidate client set TS will obtain the gradient g obtained in this round of training. (t-1) gList stores the gradient of each client, that is, gList = (g1, g2, ..., g N ), after the t-1th round of training, Client (C1,…,C i ,…,C N )∈TS (t-1) The gradient similarity matrix V is generated as follows: t :
[0084] Step 2-1-2: gList stores the gradient of each client. For the gradient g of client i and j i With g j , calculate the cosine similarity, that is:
[0085]
[0086] Step 2-1-3: Fill the calculated cosine similarity into the gradient similarity matrix, i.e. V t ,i-,j-=cos(g i ,g j ). Calculate the cosine similarity between all clients and fill the gradient similarity matrix V t In the client screening phase of round t, the server S generates a gradient similarity matrix V according to the gradient set gList t :
[0087]
[0088] Where V t ,i-,j- represents the gradient similarity between client i and client j. The closer it is to 1, the more similar their data distributions are. According to the pre-set threshold α, when V t ,i-,j->α, clients i and j are clustered into one class and grouped into one group. After clustering all clients, the grouped results are {G1,G2,…,G n +. For any group, any client i and j satisfy V t ,i-,j->α.
[0089] Step 2-2: Select the best client in each group according to the AVG-Shapley value to add to the training candidate client set TS; specifically: for any group, sort all clients in group S in descending order according to the AVG-Shapley value, and select the client with the highest AVG-Shapley value to add to the training candidate client set TS.
[0090] Step 2-3: Adopt a privacy budget allocation strategy to provide stronger privacy protection. The privacy budget allocation strategy is as follows: Server S sets the upper bound of the privacy budget ∈ max In each round of training, the client consumes a certain privacy budget to provide differential privacy protection for the model parameters. The privacy budget consumed by the client in each round is counted. When the privacy budget consumed exceeds the upper bound of the privacy budget ∈ max , so that its own privacy budget ∈ i This makes the privacy protection stronger and the clients participating in the training are less likely to leak data privacy. Define a total consumption privacy budget set E, E = {E1, E2, ..., E N +, which stores the total privacy budget consumed by each client during the entire training process, including the following steps:
[0091] Step 2-3-1: The server uses a total consumed privacy budget set E to calculate the total privacy budget consumed by each client in the federated learning iteration, and also sets the upper bound of the privacy budget ∈ max and the privacy budget lower bound ∈ min The privacy budget is allocated as follows:
[0092] Step 2-3-2: For client C participating in training i∈TS , its total consumed privacy budget E i With the privacy budget upper bound ∈ max For comparison, if E i<∈ max , client C i Still participating in training.
[0093] Step 2-3-3: If E i ≥∈ max And∈ i ≤∈ min , client C i Exit the training candidate client set TS.
[0094] Step 2-3-4: If E i ≥∈ max And∈ i >∈ min , so that the client's privacy budget ∈ i Decrease by a certain amount ∈0, where ∈0 is set by the server, and 0<∈0<5;
[0095] Step 2-3-5: If the originally screened clients in each group no longer participate in the training, the second-ranked clients are added to the training candidate client set TS to supplement sufficient clients to participate in the training.
[0096] The local training phase includes the following steps:
[0097] Step 3-1: Each client C in the candidate client set TS i∈TS After receiving the global model parameters ω from server S, based on its local dataset D i and global model parameters ω for model training. In the tth round of training, client C i∈TS Based on the local dataset D i and the global model parameter ω after the t-1th round of update (t-1) Calculate the local loss value and its gradient, and update the global model parameter ω through the SGD stochastic gradient descent algorithm (t-1) .
[0098] The specific steps are as follows:
[0099] In the tth round of training, client C i∈TS Based on the local dataset D i and the global model parameter ω after the t-1th round of update (t-1) Calculate the local loss value f i t (ω (t-1) , D i ), for the global model parameter ω (t-1) The derivative is used to get the gradient, the formula is:
[0100]
[0101] Based on the calculated gradient Use the stochastic gradient descent algorithm SGD to update the global model parameter ω (t-1) , the specific formula is:
[0102]
[0103] Where η is the learning rate.
[0104] Step 3-2: After local training is completed, noise is injected based on the allocated privacy budget, and the model with injected noise is sent to server S. Client C i∈TS After local training is completed, the local model parameters of the tth round are obtained Generate Gaussian noise N(μ,σ) that follows a normal distribution 2 ), to local model parameters Inject Gaussian noise N(μ,σ 2 ), and send the noisy local model parameters to the server S. The specific steps are as follows:
[0105] In the tth round of training, client C i∈TS According to the set privacy budget ∈ and failure probability δ, generate Gaussian noise N(μ,σ 2 ), where μ = 0, Δf is the sensitivity, which is defined as the maximum magnitude by which a single data point can change the function f. Inject Gaussian noise N(0,σ 2 ):
[0106]
[0107] The local model parameters after adding noise Send to server S.
[0108] Step 3-3: After receiving the model parameters, the server calculates the contribution level of each client to the model training compared with the previous round. The contribution level is calculated using the approximate calculation method AVG-Shapley of Shapley Value. Shapley Value defines the contribution value φ of client i i , and its calculation formula is:
[0109]
[0110] In this formula, N represents N participants, v represents the benefit function, and for any subset S of N, the function v(S) represents the total benefit brought by the cooperation of the participants in the subset. The last two terms of the summation symbol in the formula, the first term represents the combination weight, which represents the probability of occurrence of subset S in all possible arrangements, and the second term represents the marginal contribution of participant i to subset S.
[0111] The present invention uses the loss function to represent the benefit function, and the Shapley Value calculation formula can be expressed as:
[0112]
[0113] Where Δf(W)=f(W S∪{i+ )-f(W S ).
[0114] Using approximate algorithms to reduce time complexity, the above formula can be expressed as:
[0115]
[0116] Where f(W S ) represents the loss function after no client i participates in training, f(W S∪{i+ ) represents the loss function after client i participates in training, and assigns weights to it Represents the marginal contribution value of client i.
[0117] In order to more accurately show the contribution of each client participating in the training to the global model, we improved the Shapley Value method and used the average loss function of all clients after training in the previous round instead of the global loss function of the previous round, namely AVG-Shapley. The contribution value φ calculated using the AVG-Shapley method i-AVG for:
[0118]
[0119] Among them, |TS| represents the number of clients in the candidate client set TS, f(W S∪{i+ ) represents the loss function after client i participates in training, f(W S∈TS ) represents the loss function of each client in the candidate client set TS of the previous round after training. After each round of training of client i, the loss function of client i after training is obtained, and the server will store the average of the loss functions of all clients in the candidate client set of the previous round of training after training, and use the average as the global loss function after the previous round of training. Client i uses the loss function obtained after its own training and the global loss function to calculate its marginal contribution value to the global model. After that, in the next round of client screening stage, the server can sort the clients according to the marginal contribution value of each client, so as to screen out the clients participating in the next round of training.
[0120] The model aggregation and parameter distribution phase includes the following steps:
[0121] Step 4-1: The server performs mean aggregation on the received model parameters of the tth round. The specific formula is as follows:
[0122]
[0123] Step 4-2: The aggregated model parameters ω t As the global model parameter of the new round, it is sent to the client for the next round of training. This process repeats until the maximum number of training rounds or the global model parameter ω is reached. t Convergence. The maximum number of training rounds is T = 50, t < T.
[0124] In order to verify the present invention, the present invention was tested.
[0125] The dataset used in this paper is the MNIST dataset, a standard dataset widely used in deep learning, mainly used for the classification task of handwritten digits. It contains 10 categories of grayscale images, each corresponding to a digit. Each image pixel is 28*28. There are 60,000 training images and 10,000 test images in the dataset.
[0126] For the local training model architecture, the present invention uses CNN, a neural network specialized in processing images, which has powerful feature extraction and pattern recognition capabilities. In the local training stage, the present invention uses the stochastic gradient descent algorithm SGD to update the model parameters. In addition, the present invention sets the number of samples owned by each user to 2000, the learning rate lr to 0.01, the learning rate decay γ to 0.998, the number of iterations T to 50, the number of local iterations to 30, the batch size BatchSize to 50, the threshold α to 0.4, the privacy budget ∈ is initially allocated according to the amount of local data on the client, and the privacy budget allocation strategy is subsequently executed for redistribution, and the upper bound of the privacy budget ∈ max is 30, and the privacy budget lower bound ∈ min is 3, and the decrease range∈0 is 1. The dataset is divided by Dirichlet distribution, where the α parameter is used to control the degree of heterogeneity. The smaller α is, the deeper the heterogeneity and the more unbalanced the label distribution. α is set to 0.5.
[0127] The framework of the present invention (OurScheme) is compared with two existing federated learning client screening methods, Optimal Q and AdaFL. Optimal is an adaptive sampling algorithm that selects clients by calculating the sampling probability of the client through an optimization algorithm. AdaFL is an adaptive client selection method that samples clients for local training based on their contribution values. The experimental results are shown in Figure 2. Figure 3-Figure 6As shown. From the experimental results, it can be seen that the three schemes can effectively screen out clients for training, and the test accuracy rate has reached more than 85%. In contrast, the scheme of the present invention converges faster and achieves higher model accuracy in the first 20 rounds. Then AdaFL has the highest accuracy, but its privacy budget and communication overhead consumed far exceed the scheme of my present invention. The accuracy of OptimalQ is not as good as the other two schemes, and the privacy budget and communication overhead consumed are the highest. The scheme of the present invention saves about 48% of the privacy budget and about 37% of the communication overhead. According to Figure 6 It can be found that under the same communication overhead, the solution of the present invention achieves higher model accuracy.
[0128] The efficient client screening privacy protection federated learning framework for data heterogeneity proposed by the present invention can effectively cope with the data heterogeneity environment according to the gradient similarity matrix clustering grouping in the data heterogeneity environment, and can screen out clients with high data quality and representative data for training, which greatly improves the convergence of the model; at the same time, it ensures the diversity of training data, so that the model maintains a high accuracy. The client screening strategy can effectively screen out some clients for training, rather than all clients, which greatly reduces the communication overhead. Compared with other methods, it can also maintain a high model accuracy while maintaining a low communication overhead; and the privacy budget allocation strategy provides personalized differential privacy protection for the client, and continuously adjusts the privacy budget of the client during the training process, which can further improve the noise scale for the client and thus improve privacy. A large amount of privacy budget can be saved by adjusting and redistributing the privacy budget. The present invention comprehensively considers data heterogeneity and client data privacy, and proposes a targeted solution to solve the existing problems, which is a trade-off between the two; at the same time, the model maintains a high model accuracy after training, so that the availability of the model is greatly improved.
[0129] The above description is only an embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of the claims of the present invention.
Claims
1. An efficient client-screening privacy-preserving federated learning method for data heterogeneity, characterized by: The federated learning framework that applies this federated learning method mainly includes the client C k (k=1,2,…,N) and a server S, each client has its own data set D k (k=1, 2, ..., N) and the local data of each client is heterogeneous. Specifically, the federated learning method includes the following steps: Step 1: Initialization phase: Server S generates a federated learning task and initializes the global model parameter ω of round 0 0 , the global model parameter ω of round 0 0 Send to the candidate client set TS for the next round of training to allocate privacy budget to the client; Step 2: Client screening phase: Select the best client and add it to the candidate client set TS for training. The specific steps include: Step 2-1: Calculate and store the gradients of all clients, and cluster all clients to obtain a group set {G1, G2, …, G n }; Step 2-2, in each group, the best client is selected according to the contribution value AVG-Shapley value to join the candidate client set TS for training; Step 2-3: Adopt a privacy budget allocation strategy to provide privacy protection; Step 3: Local training phase: Client i is based on the local dataset D i And the global model parameters ω are trained to generate the local model parameters ω i t , to the local model parameter ω i t Inject noise and change the local model parameter ω i t Send to server S; Step 4: Model aggregation and parameter distribution phase: Server S receives the local model parameters ω i t Perform mean aggregation: specifically: The aggregated model parameters ω t As the new round of global model parameters ω, it is sent to the client for the next round of training; Step 5: Repeat steps 2 to 4 until the maximum number of training rounds or the global model parameter ω is reached. t Convergence, maximum number of training rounds T = 50, t < T.
2. The method for efficient client-side screening and privacy-preserving federated learning for data heterogeneity according to claim 1, characterized in that: In step 2-2, the best client is selected from each group according to the contribution value AVG-Shapley value to join the candidate client set TS for training. Specifically, the group set {G1, G2, ..., G n All clients in} are sorted in descending order according to their contribution AVG-Shapley values, and the client with the highest contribution AVG-Shapley value is selected to join the candidate client set TS for training.
3. The method for efficient client-side screening and privacy-preserving federated learning for data heterogeneity according to claim 2, characterized in that: In step 2-3, a total consumption privacy budget set E is defined. E={E1,E2,…,E N }, which stores the total privacy budget consumed by each client during the entire training process. The privacy budget allocation strategy specifically includes the following steps: Step 2-3-1: Server S uses a total consumed privacy budget set E to calculate the total privacy budget consumed by each client in the federated learning iteration, and also sets the upper bound of the privacy budget ∈ max and the privacy budget lower bound ∈ min ; Step 2-3-2: For client C participating in training i∈TS , its total consumed privacy budget E i With the privacy budget upper bound ∈ max For comparison, if E i <∈ max , client C i Still involved in training; Step 2-3-3, if E i ≥∈ max And∈ i ≤∈ min , client C i Exit the training candidate client set TS; Step 2-3-4, if E i ≥∈ max And∈ i >∈ min , so that the client's privacy budget ∈ i The decrease range ∈0, ∈0 is set by the client, where 0<∈0<5; Step 2-3-5: If the originally screened clients in each group no longer participate in the training, the second-ranked clients are added to the training candidate client set TS to supplement the clients to participate in the training.
4. The method for efficient client-side screening and privacy-preserving federated learning for data heterogeneity according to claim 1, characterized in that: In step 3, the local training phase specifically includes the following steps: Step 3-1: Each client C in the candidate client set TS i∈TS After receiving the global model parameters ω from server S, based on its local dataset D i And global model parameters ω for model training; Step 3-2: After the local model training is completed, noise is injected based on the allocated privacy budget, and the model with noise injection is sent to the server S; Step 3-3: After receiving the model after the noise is injected, the server S calculates the contribution level of each client to the model training compared with the previous round. The contribution level is calculated using AVG-Shapley.
5. The method for efficient client-side screening and privacy-preserving federated learning for data heterogeneity according to claim 4, characterized in that: In step 3-3, AVG-Shapley means using the mean of the loss functions of all clients after training in the previous round to replace the global loss function of the previous round, and using the contribution value φ calculated using the AVG-Shapley method i-AVG for: Among them, |TS| represents the number of clients in the candidate client set TS, f(W S∪{i} ) represents the loss function after client i participates in training, f(W S∈TS ) represents the loss function of each client in the candidate client set TS of the previous round after training. After the training of client i is completed in each round, the loss function of client i after participating in the training is obtained, and the server S will store the average loss function of all clients in the candidate client set of the previous round of training after participating in the training, and use the average loss function of all clients after participating in the training as the global loss function after the previous round of training. Client i uses the loss function obtained after its own training and the global loss function to calculate its marginal contribution value to the global model. After that, in the next round of client screening stage, server S can sort the clients according to the marginal contribution value of each client, so as to screen out the clients participating in the next round of training.
6. The method for efficient client-side screening and privacy-preserving federated learning for data heterogeneity according to claim 4, characterized in that: The step 3-1 is for each client C in the candidate client set TS. i∈TS After receiving the global model parameters ω from server S, based on its local dataset D i And global model parameters ω for model training. In the tth round of training, client C i∈TS Based on the local dataset D i and the global model parameter ω after the t-1th round of update (t-1) Calculate the local loss value and its gradient, and update the global model parameter ω through the SGD stochastic gradient descent algorithm (t-1) , the specific steps are as follows: In the tth round of training, client C i∈TS Based on the local dataset D i and the global model parameter ω after the t-1th round of update (t-1) Calculate local loss value The global model parameter ω after the t-1th round update (t-1) The derivative is used to get the gradient, the formula is: Based on the calculated gradient Use the stochastic gradient descent algorithm SGD to update the global model parameters ω after t-1 rounds of updates (t-1) , the specific formula is: Where η is the learning rate.
7. The method for efficient client-side screening and privacy-preserving federated learning for data heterogeneity according to claim 4, characterized in that: Step 3-2 is to inject noise based on the allocated privacy budget after local training is completed, and send the model with injected noise to the server S and the client C. i∈TS After local training is completed, the local model parameters of the tth round are obtained Generate Gaussian noise N(μ,σ) that follows a normal distribution 2 ), to local model parameters Inject Gaussian noise N(μ,σ 2 ), and send the noisy local model parameters to the server S. Specifically, in the tth round of training, the client C i∈TS According to the set privacy budget ∈ and failure probability δ, generate Gaussian noise N(μ,σ 2 ), where μ = 0, Δf is the sensitivity, which is defined as the maximum magnitude of a single data change in function f, and then the local model parameters Inject Gaussian noise N(0,σ 2 ): The local model parameters after adding noise Send to server S.
8. The method of efficient client-side screening privacy-preserving federated learning for data heterogeneity according to claim 4, characterized in that: In step 3-3, Shapley Value defines the contribution value φ of client i i , and its calculation formula is: Where N represents N participants, v represents the profit function, and for any subset S of N, the function v(S) represents the total profit brought by the cooperation of the participants in the subset. The last two terms of the summation symbol in the formula are represents the combined weight, which represents the probability of occurrence of subset S in all possible arrangements, [v(S∪{i})-v(S)] represents the marginal contribution of participant i to subset S, Using the loss function to represent the revenue function, the Shapley Value calculation formula is expressed as: where Δf(W) = f(W S∪{i} ) - f(W S ); Using approximate algorithms to reduce time complexity, the above formula can be expressed as: Where f(W S ) represents the loss function after no client i participates in training, f(W S∪{i} ) represents the loss function after client i participates in training, and assigns weights to it Represents the marginal contribution value of client i.
9. The method for efficient client-side screening and privacy-preserving federated learning for data heterogeneity according to claim 1, characterized in that: The initialization phase of step 1 mainly includes the following steps: Step 1-1: Server S generates a federated learning task and initializes the global model parameters ω for round 0 0 , prepare to set the global model parameter ω of round 0 0 Send to the candidate client set TS for the next round of training; Step 1-2: Allocate a different privacy budget to each client, based on the proportion of its local dataset to the total data volume. The privacy budget α of client i is i The calculation formula is as follows: Among them, |D i | is the number of samples in the local dataset of client i.
10. The method of efficient client-side screening privacy-preserving federated learning for data heterogeneity according to claim 1, characterized in that: The step 2-1 calculates and stores the gradients of all clients, and all clients are clustered and grouped according to the generated gradient similarity matrix, specifically including the following steps: Step 2-1-1: After the t-1 round of training is completed, each client in the candidate client set TS will obtain the gradient g obtained in this round of training. (t-1) Stored to form a gradient set gList, gList = (g1, g2, ..., g N ), after the t-1th round of training, Client (C1,…,C i ,…,C N )∈TS (t-1) ; Step 2-1-2: The gradient set gList stores the gradient of each client. For the gradient g of client i and client j, i With g j , calculate the cosine similarity, that is: Step 2-1-3, calculate the cosine similarity cos(g i ,g j ) fill in the gradient similarity matrix, calculate the cosine similarity between all clients, and fill the gradient similarity matrix V t In the client screening phase of round t, the server S generates a gradient similarity matrix V according to the gradient set gList t : Among them, V t [i][j] is the gradient similarity between client i and client j, V t [i][j]=cos(g i ,g j ), the closer it is to 1, the more similar their data distributions are. According to the threshold α set in advance, when V t When [i][j]>α, client i and client j are clustered into one class and grouped into one group. After clustering all clients, we get the grouping set {G1, G2, …, G n }, for any group, any client i and any client j satisfy V t [i][j]>α.
Citation Information
Patent Citations
Federal learning method fusing adaptive weight distribution and personalized differential privacy
CN114595831A
Trusted federal gradient boosting decision tree training method based on trusted incentive
CN114757285A
Federated learning method of image analysis model based on heterogeneous CXR image with noise
CN116452495A
Federal contrast clustering learning method and system for non-independent identically distributed data
CN117808121A
Fair federated learning method based on contribution and income collaborative balance
CN117933422A
Cited By
Robust federated learning architecture for image classification
CN120031108A
Robust Federated Learning Method for Image Classification
CN120031108B
Nuclear power station risk information dual robust differential privacy defense method and device based on Hodges-Lehmann
CN120724483A
A hodges-lehmann-based dual robust differential privacy defense method and device for nuclear power plant risk information
CN120724483B
Federal learning client dynamic screening and joint excitation optimization system oriented to edge computing
CN121168698A