Adaptive weighted federated learning method based on ShapDiv
By combining Shapley Value and KL Divergence's ShapDiv index, an adaptive weighted federated learning method is designed to solve the problems of unfair user benefits and data distribution differences in federated learning, improve accuracy and robustness, encourage user participation, and improve Training efficiency and fairness.
Patent Information
- Application Number
- CN202410712839.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-04
- Publication Date
- 2024-09-17
AI Technical Summary
In federated learning, the imbalance of data quality among users leads to unfair benefits, the existing incentive mechanism is insufficient, causing users to refuse to participate, and the complexity and cost of calculating Shapley Value are high, making it difficult to effectively evaluate and process differences in data distribution. .
The ShapDiv index is proposed based on Shapley Value and KL Divergence. Rewards and penalties are fairly distributed through the ShapDiv incentive mechanism. Adaptive weighted aggregation is used. Federated learning is regarded as a sequential cooperative game. Weighted aggregation is performed based on the ShapDiv value to solve the issues of fairness and accuracy.
It improves the accuracy and robustness of federated learning, encourages users to actively participate, dynamically adjusts weights to improve training efficiency, and ensures fairness and efficiency in the model training process.
Smart Images

Figure CN118657229A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of federated learning, and in particular to an adaptive weighted federated learning method based on ShapDiv. Background Art
[0002] In the era of big data, data sharing is of great significance to scientific research, economic development, social governance, etc. Federated Learning (FL), as a distributed machine learning technology, allows clients to form an alliance to jointly train global models under the coordination of a central server while retaining data localization learning, which not only protects data privacy but also enables data sharing learning. However, in federated learning, the client obtains benefits that match its own efforts, and participates in data federation learning safely and effectively based on the data quality of the client. These are key issues to ensure that the client completes federated learning fairly, actively and efficiently. Also, because federated learning involves data sets from different entities, there is an imbalance in data quality between these entities. Current research focuses on improving the performance of federated learning, but ignores the incentive mechanism to encourage user participation. Existing incentive mechanisms mostly distribute benefits based on whether users participate in the federated learning process, which may put users in an unfair situation in the federated learning process, or even cause them to directly refuse to participate.
[0003] Therefore, how to encourage users to continue to participate in federated learning and minimize unfairness among users while maximizing the sustainable operation of federated learning is crucial to achieving federated learning. In order to motivate users to actively participate, it becomes crucial to fairly evaluate the data contributions from different users.
[0004] Shapley Value (SV) is a concept in cooperative game theory that measures the contribution of each participant to the benefits of cooperation. In federated learning, Shapley Value can be used as the basis for an incentive mechanism to ensure that each participant is fairly rewarded when sharing their data for global model training. By calculating Shapley Value based on each user's data contribution, a fair reward system can be established to encourage users to participate more actively in federated learning. This helps to solve the problem of unfair user benefits caused by data imbalance, and ultimately promotes the sustainable development and widespread application of federated learning. In recent studies, some scholars have explored the use of Shapley Value (SV) to evaluate the contribution of each data point in a dataset when training machine learning models. These studies jointly explore how to more accurately evaluate the contribution of data points in machine learning and federated learning environments, and provide useful insights for building a more efficient and fair model training framework.
[0005] Although Shapley Value has excellent characteristics, using Shapley Value to evaluate customer contributions and design robust federated learning algorithms still faces a series of challenges. First, the customers involved in the training process will change from round to round, so using Shapley Value to evaluate the contributions of each customer becomes quite complicated. Second, most algorithms based on weighted federated aggregation of Shapley Value ignore the differences in data distribution between different participants. In federated learning, each participant may have a different data distribution, which may lead to a decrease in performance on the global model, especially when the distribution difference is large.
[0006] Finally, computing the exact Shapley Value of the clients participating in federated learning involves retraining the model for different subsets of clients. This computation becomes a very difficult problem due to the enumeration of subsets. Even with the approximate method of ShapleyValue, the computational cost on the server inevitably becomes huge when a large number of clients are involved. Summary of the invention
[0007] In view of this, in order to solve the above problems, the purpose of the present invention is to provide an adaptive weighted federated learning method based on ShapDiv, which combines Shapley Value with KL Divergence and applies it to federated learning. A new indicator value for evaluating contribution is proposed by integrating Shapley Value and KL Divergence, namely, the ShapDiv metric inspired by Shapley Value and KLDivergence, and an incentive mechanism combined with user ShapDiv is designed. Through the incentive mechanism of ShapDiv, rewards and penalties corresponding to the contribution of each client are fairly matched. Under this mechanism, FL training is regarded as a sequential cooperative game, and weighted federated aggregation is performed according to the ShapDiv of the client, which not only solves the fairness problem in federated learning but also improves the accuracy of federated learning.
[0008] The present invention is implemented by the following technical solutions:
[0009] In a first aspect, the present invention provides an adaptive weighted federated learning method based on ShapDiv, comprising the following steps:
[0010] Step 1. Initialize the global model: Initialize the pre-defined global model parameters to initial values and send the global model to all federated learning clients;
[0011] Step 2. Client training and model update: Each client uses the local dataset to perform local model training and calculate the local model of each client;
[0012] Step 3. The central server collects model updates: The central server collects the local model uploaded by the client, calculates the ShapDiv of the client, and calculates Shapley Value and KLDivergence respectively when calculating ShapDiv. Among them, Shapley Value is used to evaluate the client's data quality contribution; KLDivergence evaluates the quality of the local model by calculating the difference in distribution probability between the local model and the global model;
[0013] Step 4. ShapDiv adaptive weighting: Adaptive weighted aggregation is performed based on the ShapDiv value of each client;
[0014] Step 5. Update the global model: Update the global model according to the weighted client model parameters;
[0015] Step 6. Iterative training: Repeat the above steps to perform multiple rounds of federated learning iterative training. During each round of training, the client updates the local model and uploads it to the central server. The central server performs adaptive weighted aggregation based on the ShapDiv value and updates the global model.
[0016] Step 7. Model evaluation, set the convergence conditions and evaluate the final global model.
[0017] Through the above steps, the adaptive weighted federated learning method based on ShapDiv can effectively utilize the contribution of each client, improve the efficiency and accuracy of federated learning, and ensure fairness in the model training process.
[0018] As a further solution of the present invention, when initializing the global model, the global model X is initialized. t Sent to all federated learning clients; for each client i, use each client’s local dataset D i Perform local model training And the updated model Return to the server; the central server collects the updated models uploaded by all participants and applies the updated local models to the aggregated global model; where the objective function F(X) of the central server is:
[0019]
[0020] Where N is the number of clients participating in federated learning, X∈R d indicates that X is a d-dimensional vector in the real space R, i.e., the model parameter; w i is the calculation weight of the i-th client; F i (X) is the local objective function of the i-th client.
[0021] As a further solution of the present invention, the local objective function F of the i-th client i The calculation formula of (X) is:
[0022]
[0023] Among them, D i is the local dataset of the i-th client, n i is the total data volume of client i, f i (X) = L(A i ,B i ,X) is a model with parameters X for the dataset D i Example in (A i ,B i ) The loss function generated by i The sum of the loss functions generated by all instances in Divide by the total data volume n of client i i , and the average loss function of the local client. The loss function is inversely proportional to the model accuracy.
[0024] As a further solution of the present invention, during client training and model updating, KL divergence is introduced to evaluate the difference between the local model and the global model, and Shapley and KL divergence are integrated to define a parameter ShapDiv for comprehensively evaluating the contribution of the client, wherein the definition of KL divergence is based on entropy, and KL divergence is proportional to the difference between the local model and the global model.
[0025] As a further solution of the present invention, the ShapDiv-based adaptive weighted federated learning method also includes an incentive mechanism based on ShapDiv, which allocates rewards and penalties to the client according to ShapDiv, wherein the reward factor and penalty factor of the incentive mechanism include:
[0026] The reward factor is to determine the contribution of the participants according to ShapDiv, including basic rewards and ShapDiv rewards. The basic reward is the basic reward for participating in federated learning that all participants will receive to encourage participation; the ShapDiv reward is used to allocate according to the ShapDiv value, and the higher the ShapDiv value, the higher the reward;
[0027] The penalty factors are based on data quality and data violations, and the contribution penalty of the participant is determined according to ShapDiv.
[0028] As a further solution of the present invention, rewards and penalties are allocated to the client according to ShapDiv, and the allocation of rewards and penalties includes the following steps:
[0029] Calculate the ShapDiv value of each client for this federated learning;
[0030] The Shapley Value obtained by each client participating in the training is combined with the KL Divergence to obtain the ShapDiv, which is the contribution of the client in this federated learning. i ;in:
[0031]
[0032] In the formula, α is used to control the update rate of ShapDiv, and its value range is 0-1; represents the Shapley Value of client i in round t, which is used to evaluate the contribution of the client in this round; Represents the KL divergence of client i in round t, which is used to evaluate the performance of the client model in this round.
[0033] As a further solution of the present invention, the incentive mechanism based on ShapDiv includes the following steps:
[0034] Enter the Shapley Value and KL Divergence of each client;
[0035] Output the number of coins for each client;
[0036] Calculate the client's first round of initial ShapDiv, i.e. SD i ;
[0037] ShapDiv i =(αSV i +(1-α)DKL i )
[0038] Average the ShapDiv of N clients,
[0039] Traverse i=1,2,…,N;
[0040] Traverse t=1,2,…T;
[0041] The ShapDiv of client i is
[0042] like The number of gold coins of client i
[0043] like The number of coins of client i Coin=SD avg ×10-SDi ;
[0044] Output the number of coins of N clients.
[0045] Among them, N is the total number of participating clients, T is the training round of the model, Coin is the number of gold coins each client has, and the initial value is 0. The income of each client Coin consists of two parts. One part is the income SD of the client participating in federated learning. avg ×10; rewards obtained based on the client's contribution in each round The higher the number of gold coins, the higher the access rights. When the number of gold coins on a client is less than 0, the client will be removed from the federated learning aggregation task, and the client will be permanently unable to use any data resources.
[0046] As a further solution of the present invention, adaptive weighted aggregation is performed according to the ShapDiv value, and the global model is updated. In each round of collaborative training, the training process of each round t (t≥1) is defined as a cooperative game G(x t ,C t ,D v ,U F ), where X t is the global model at the beginning of round t, C t is the subset of participants in round t, Return the client subset S to update X t The model after is the model parameter update vector of client i in round t, η g (η l ) are the global (local) learning rates; a set The performance of the global model update in round t is represented by S; the performance function is U F (S) = Φ(D v ,Ψ(x t ,S)).
[0047] As a further solution of the present invention, in the cooperative game G(x t ,C t ,D v ,U F In the example, client i∈C t The Shapley Value in round t is:
[0048]
[0049] In the formula, It means to normalize the Shapley value to ensure that the sum of the total contribution is consistent with the overall utility change. represents the Shapley Value of the i-th client in the t-th round of training; C t represents the subset of participants in round t; U represents considering all subsets S that do not include client i, and considering the contribution of all such subsets to i by summing them up; F (S∪{i}) represents the performance when client i participates; U F (S) represents the performance when client i does not participate; U F (S∪{i})-U F (S) represents the contribution of client i to S; represents the number of combinations, which takes into account the number of combinations of different clients; Φ(D v ,Ψ(x t ,S∪{i})) is the performance measurement function U F The specific calculation process of (S∪{i}), where D v represents a given validation dataset; Ψ(x t , S∪{i}) represents the model trained by the subset S that does not contain client i; where x t represents the global model at the beginning of round t; S∪{i} represents the set after the client subset S joins client i; Ψ(x t ,S) Similarly, S represents the subset without client i participating; The significance of the denominator is to ensure that the contribution of each subset is properly considered and averaged during the final normalization.
[0050] The ShapDiv of the ith device is calculated as:
[0051]
[0052] Among them, (0≤α≤1) is used to control the update rate of ShapDiv;
[0053] The normalized Shapley divergence is calculated as:
[0054]
[0055] In the formula, represents the Shapley divergence (Shapdiv) of the i-th client in the t-th round; min(SD t ) represents the minimum value among all clients’ SD in round t. By subtracting this minimum value, the numerator of the formula is adjusted to start from 0, eliminating the influence of the minimum value; max(SD t) represents the maximum value of the SD values of all clients in round t. This maximum value is used as the denominator of normalization to ensure that the normalized value does not exceed 1; max(SD t )-min(SD t Indicates that this is the range of SD values for all clients in round t. It adjusts the value of the numerator to between [0,1]. By dividing by this range, the formula ensures that all normalized values are within this standard range.
[0056] Each client's contribution to the global loss is adaptively weighted by its ShapDiv.
[0057] As a further solution of the present invention, W is defined as the adaptive weighted weight, X is the model parameter, and the normalized ShapDiv is weighted into the federated learning as follows:
[0058]
[0059] In the formula, Represented in the vector space R d Find an optimal solution X in the equation so that the objective function reaches the minimum value; represents the weighted summation process, where represents the weight of the i-th client in the t-th round; The specific calculation process of client weight is shown, where: represents the normalized Shapley divergence, which indicates the contribution of client i; represents the sum of normalized divergences of all clients; To represent the proportion of client i’s contribution, that is, the weight
[0060] In the aggregation phase, the probability of each client being selected is combined with the weight W.
[0061] As a further solution of the present invention, the ShapDiv-based adaptive weighted federated learning method adopts a unified client sampling strategy, and the ShapDiv-based adaptive weighted federated learning includes the following steps:
[0062] Input global model parameters x 1 , global step size and local step size η g ,η l , initialization probability P = [γ,…,γ];
[0063] Output the global model parameters x after T rounds of training T+1 , traverse the communication rounds t=1,2,…,T to execute;
[0064] Sampling Client C t ~P; the server will xt Broadcast to all selected clients, and execute on client i=1,2,…,N;
[0065] Initialize local model parameters Traverse the local step length le=1,2,…,Le to execute;
[0066] Compute mini-batch gradients renew
[0067] Computing Gradients Send gradient To the server;
[0068] The server calculates the weight in round t:
[0069]
[0070] Among them, 1≤i≤N; is the sum of the normalized Shapley divergences of all clients in round t, which is used to normalize the weight of each client; represents the normalized Shapley divergence and represents the contribution of client i.
[0071] Server Update Model
[0072] Returns the global model parameters x T+1 ;
[0073] Among them, x t+1 represents the model of round t+1; x t represents the model of the t-wheel; η g Represents the global learning rate, which is the step size in gradient descent; Indicates the gradient weighting of the client; η l The learning rate used for local training; is the weight of the client; is the gradient obtained by the i-th client in the t-th round of training; is the local model obtained by client i in the tth round of training after le rounds of local model training; Indicates weighted aggregation of each client's local model; It means that the i-th client obtains the weight calculated in the t-th round.
[0074] Among them, the number of clients participating in federated learning in each round is defined as m, then the probability of each client being selected in each round is The local model training round of the client is local-epoch, referred to as le. The maximum round of local model training of the client is defined as Le, and the maximum round of global model training is T.
[0075] Through the above steps, the adaptive weighted federated learning method based on ShapDiv can effectively utilize the contribution of each client, improve the efficiency and accuracy of federated learning, and ensure fairness in the model training process.
[0076] The present invention also includes a computer device, comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor executes the ShapDiv-based adaptive weighted federated learning method.
[0077] The present invention also includes a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the ShapDiv-based adaptive weighted federated learning method.
[0078] Compared with the prior art, the adaptive weighted federated learning method based on ShapDiv provided by the present invention has the following beneficial effects:
[0079] 1. Improved accuracy: By introducing the ShapDiv metric, the contribution of each participant in federated learning can be more accurately evaluated, so that the information provided by each participant can be more effectively used to update the global model. Accurate contribution evaluation helps improve the accuracy of the model because more important participants will be considered more, thereby optimizing the training process of the global model.
[0080] 2. Enhanced robustness: By combining Shapley Value and KL Divergence, ShapDiv can better handle data distribution differences between different participants. The improvement in robustness makes the federated learning system more adaptable to diverse and heterogeneous data, thereby enhancing the model's generalization ability and adaptability to changes in data distribution.
[0081] 3. Incentives for cooperation: The designed incentive mechanism can reward participants who put more effort and resources into federated learning, promoting wider participation and more efficient information sharing. A positive incentive mechanism helps build a more proactive and cooperative federated learning environment and drives the entire system towards a more optimized state.
[0082] 4. Efficiency improvement: The adaptive weighted federated learning algorithm fully considers the differences in contributions of the participants and pays more attention to the participants who have made great contributions to performance improvement by dynamically adjusting the weights. The adaptive weight distribution makes it possible to more efficiently utilize the information of each participant in the global model training, thereby accelerating the convergence of the model and improving the overall training efficiency.
[0083] Based on the above effects, the adaptive weighted federated learning method based on ShapDiv of the present invention can not only improve the accuracy and robustness of the model, but also motivate the participants to cooperate more actively, thereby improving the efficiency and performance of the entire federated learning system.
[0084] These and other aspects of the present invention will be more clearly understood in the following description of the embodiments. It should be understood that the above general description and the following detailed description are only exemplary and explanatory and cannot limit the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0085] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or related technologies, the following briefly introduces the drawings required for use in the exemplary embodiments or related technical descriptions. The drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation to the present invention. In the drawings:
[0086] Figure 1 The flowchart of the adaptive weighted federated learning method based on ShapDiv in an embodiment of the present invention.
[0087] Figure 2 This is a comparison chart of algorithms in the case of non-independent and identically distributed Non-IID data in the ShapDiv-based adaptive weighted federated learning method in an embodiment of the present invention.
[0088] Figure 3 This is a comparison diagram of algorithms under the condition of data label noise interference in the adaptive weighted federated learning method based on ShapDiv in an embodiment of the present invention.
[0089] Figure 4 This is a comparison diagram of algorithms under data noise interference in the ShapDiv-based adaptive weighted federated learning method in an embodiment of the present invention.
[0090] Figure 5 This is a performance comparison chart of the ShapDiv-based adaptive weighted federated learning method and the FedSV algorithm in an embodiment of the present invention. DETAILED DESCRIPTION
[0091] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0092] In some of the processes described in the specification and claims of the present invention and the above-mentioned figures, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in the present invention or executed in parallel, and the sequence numbers of the operations, such as 101, 102, etc., are only used to distinguish between different operations, and the sequence numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in the present invention are used to distinguish different messages, devices, modules, etc., do not represent the order of precedence, and do not limit the "first" and "second" to be different types.
[0093] The following will be combined with the drawings in the exemplary embodiments of the present invention to clearly and completely describe the technical solutions in the exemplary embodiments of the present invention. Obviously, the exemplary embodiments described are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0094] The invention provides an adaptive weighted federated learning method based on ShapDiv. ShapleyValue and KL Divergence are combined and applied to federated learning. A set of incentive methods is designed. A new indicator value for evaluating contribution is proposed by integrating Shapley Value and KL Divergence, namely, a ShapDiv measurement value inspired by Shapley Value and KL Divergence. An incentive mechanism combined with user ShapDiv is designed. The incentive mechanism of ShapDiv is used to fairly match rewards and penalties corresponding to the contribution of each client. Under this mechanism, FL training is regarded as a sequential cooperative game, and weighted federated aggregation is performed according to the ShapDiv of the client. This not only solves the fairness problem in federated learning but also improves the accuracy of federated learning.
[0095] The technical solution of the present invention is further described below in conjunction with specific embodiments:
[0096] See also Figure 1 As shown, an adaptive weighted federated learning method based on ShapDiv is provided in one embodiment of the present invention, comprising the following steps:
[0097] Step S10. Initialize the global model: initialize the pre-defined global model parameters to initial values, and send the global model to all federated learning clients;
[0098] Step S20. Client training and model update: Each client uses a local data set to perform local model training and calculate the local model of each client;
[0099] Step S30. The central server collects model updates: The central server collects the local model uploaded by the client, calculates the ShapDiv of the client, and calculates Shapley Value and KLDivergence respectively when calculating ShapDiv; Shapley Value is used to evaluate the client data quality contribution; KLDivergence evaluates the quality of the local model by calculating the difference in distribution probability between the local model and the global model;
[0100] Step S40. ShapDiv adaptive weighting: perform adaptive weighted aggregation according to the ShapDiv value of each client;
[0101] Step S50. Update the global model: update the global model according to the weighted client model parameters;
[0102] Step S60. Iterative training: Repeat the above steps to perform multiple rounds of federated learning iterative training; during each round of training, the client updates the local model and uploads it to the central server, and the central server performs adaptive weighted aggregation according to the ShapDiv value and updates the global model;
[0103] Step S70: Model evaluation, setting convergence conditions and evaluating the final global model.
[0104] Through the above steps, the adaptive weighted federated learning method based on ShapDiv can effectively utilize the contribution of each client, improve the efficiency and accuracy of federated learning, and ensure fairness in the model training process.
[0105] Federated learning trains models on local devices without transmitting raw data to a centralized server. It allows model training in a distributed environment while protecting user privacy. Suppose there is a set of N federated learning clients N = {1…|N|}, where client i∈N has its local dataset D i , in each iteration round t∈{0,1…T}, there are the following steps:
[0106] When initializing the global model, the global model X is initialized t Sent to all federated learning clients; for each client i, use each client’s local dataset D iPerform local model training And the updated model Return to the server; the central server collects the updated models uploaded by all participants and applies the updated local models to the aggregated global model; where the objective function F(X) of the central server is:
[0107]
[0108] Where N is the number of clients participating in federated learning, X∈R d indicates that X is a d-dimensional vector in the real space R, i.e., the model parameter; w i is the calculation weight of the i-th client; F i (X) is the local objective function of the i-th client.
[0109] The local objective function F of the i-th client i The calculation formula of (X) is:
[0110]
[0111] Among them, D i is the local dataset of the i-th client, n i is the total data volume of client i, f i (X) = L(A i ,B i ,X) is a model with parameters X for the dataset D i Example in (A i ,B i ) The loss function generated by i The sum of the loss functions generated by all instances in Divide by the total data volume n of client i i , and the average loss function of the local client. The loss function is inversely proportional to the model accuracy. Therefore, the objective function optimization of machine learning is to minimize the loss function.
[0112] Due to the practicality of Shapley Value, Shapley Value measures the expected marginal contribution of participant i in all possible alliances S (composed of multiple independent participants in collaboration), that is, Shapley Value is a measure of the average marginal contribution made by client i in various possible cooperation combinations. Among them, the ShapleyValue of federated learning client i is defined as:
[0113]
[0114] In the above formula, for a set of clients N = {1…|N|}. Alliance S is a subset of N, which collaborates to complete a task. This term means considering all subsets S that do not include client i, and then considering the contribution of all such subsets to i by summing them up. When calculating the Shapley value, for each client i, the possibility of combining with other players must be considered. The |S|! (|N|-|S|-1)! in the formula means calculating the number of combinations, which takes into account the possibility of combining different clients. The utility function is the utility evaluation function of alliance S for a task. The marginal contribution of client i to alliance S is U(S∪i})-U(S).
[0115] In federated learning, it is crucial to design a fair incentive mechanism for clients with different data qualities. Although Shapley Value can fairly evaluate the contribution of each client, Shapley Value does not take into account the differences between models. When the difference between the local model and the global model is particularly large, it will have a very large impact on the performance of the model. Therefore, the present invention introduces KL Divergence, which can accurately evaluate the difference between the local model and the global model. By combining KL Divergence and Shapley Value to establish an incentive mechanism scheme, the federated learning task will be more efficient and fairer.
[0116] In this embodiment, during client training and model updating, KL divergence is also introduced to evaluate the difference between the local model and the global model. Shapley and KL divergence are integrated to define a parameter ShapDiv for comprehensively evaluating the contribution of the client. The definition of KL divergence is based on entropy, and KL divergence is proportional to the difference between the local model and the global model.
[0117] The present invention defines a parameter ShapDiv by integrating Shapley and KL divergence, which responds to the difference of clients in FL to more accurately measure their benefits. KL Divergence is based on entropy. Here, taking discrete random variables as an example, the definition of entropy is given first, and then the definition of KL Divergence is given.
[0118] If a discrete random variable X has possible values X = {x1, x2, ... x n}, and the corresponding probability is p i =p(X=x i ), then the information entropy of the random variable X is defined as:
[0119]
[0120] It is stipulated that when p(x i)=0, p(x i )logp(x i )=0.
[0121] If there are two random variables P and Q, and their probability distributions are p(x) and q(x) respectively, then the relative entropy of p relative to q is:
[0122]
[0123] It is called relative entropy because it can be derived from the cross-entropy of two random variables and information entropy:
[0124] For the probability distribution of the above discrete variables p(x) and q(x), the cross entropy is defined as:
[0125]
[0126] In information theory, cross entropy can be considered as the amount of information required to encode the predicted distribution q(x) using the true distribution p(x).
[0127] Therefore, the KL divergence or relative entropy can be given by the following formula:
[0128]
[0129] If the local model distribution of a client is very similar to the global model distribution, the calculated KLDivergence will be smaller. Conversely, if the local model distribution is very different from the global model distribution, the KL Divergence will be larger.
[0130] The fusion of Shapley Value and KL Divergence is called ShapDiv. Based on ShapDiv, we can evaluate the marginal contribution of each client to the overall model and consider the difference between the local client model and the global model, thereby improving the model performance.
[0131] In order to make the client more willing to participate in federated learning, the present invention designs a set of incentive mechanisms based on ShapDiv, which can fairly distribute benefits that are consistent with the quality of its data to the client. Let the client participate in federated learning training more actively. The adaptive weighted federated learning method based on ShapDiv also includes an incentive mechanism based on ShapDiv, which allocates rewards and penalties to the client according to ShapDiv, wherein the reward factors and penalty factors of the incentive mechanism include:
[0132] The reward factor is to determine the contribution of the participants according to ShapDiv, including basic rewards and ShapDiv rewards. The basic reward is the basic reward for participating in federated learning that all participants will receive to encourage participation; the ShapDiv reward is used to allocate according to the ShapDiv value, and the higher the ShapDiv value, the higher the reward;
[0133] The penalty factors are based on data quality and data violations, and the contribution penalty of the participants is determined according to ShapDiv. Violations may cause the participants to lose part of their rewards or even be excluded from federated learning.
[0134] In the embodiment of the present invention, rewards and penalties are allocated to the client according to ShapDiv, and the allocation process is as follows:
[0135] Calculate the ShapDiv value of each client for this federated learning;
[0136] The Shapley Value obtained by each client participating in the training is combined with the KL Divergence to obtain the ShapDiv, which is the contribution of the client in this federated learning. i ;in:
[0137]
[0138] In the formula, α is used to control the update rate of ShapDiv, and its value range is 0-1; represents the Shapley Value of client i in round t, which is used to evaluate the contribution of the client in this round; Represents the KL divergence of client i in round t, which is used to evaluate the performance of the client model in this round.
[0139] The calculation process of combining Shapley Value with KL Divergence to calculate the contribution of the i-th client is shown. Based on the incentive mechanism of ShapDiv, the following steps are included:
[0140] Enter the Shapley Value and KL Divergence of each client;
[0141] Output the number of coins for each client;
[0142] Calculate the client's first round of initial ShapDiv, i.e. SD i ;
[0143] ShapDiv i =(αSV i +(1-α)DKL i )
[0144] Average the ShapDiv of N clients,
[0145] Traverse i=1,2,…,N;
[0146] Traverse t=1,2,…T;
[0147] The ShapDiv of client i is
[0148] like The number of gold coins of client i
[0149] like The number of coins of client i Coin=SD avg ×10-SD i ;
[0150] Output the number of coins of N clients.
[0151] The algorithm based on the ShapDiv incentive mechanism is shown in Table 1:
[0152] Table 1 Based on ShapDiv incentive mechanism
[0153]
[0154] Among them, N is the total number of participating clients, T is the training round of the model, Coin is the number of gold coins each client has, and the initial value is 0. The income of each client Coin consists of two parts. One part is the income SD of the client participating in federated learning. avg ×10; rewards obtained based on the client's contribution in each round The higher the number of gold coins, the higher the access rights. When the number of gold coins on a client is less than 0, the client will be removed from the federated learning aggregation task, and the client will be permanently unable to use any data resources.
[0155] In federated learning, a stable and excellent global model is obtained after multiple rounds of iterative aggregation of client update models. In each round of collaborative training, the cooperation of client subsets provides valuable information that can be used to evaluate the marginal contribution of each client in the current round without retraining. Inspired by this observation, the marginal contribution of each client in consecutive rounds is calculated and combined as an approximation of its Shapley Value in order to obtain ShapDiv more efficiently.
[0156] The present invention defines each round t (t ≥ 1) of training as a cooperative game G (x t ,C t ,Dv ,U F ), here, X t is the global model at the beginning of round t, C t is the subset of participants in round t, Return the client subset S to update X t The model after is the model parameter update vector of client i in round t, η g (η l ) are the global (local) learning rates respectively. A set The utility of is represented by the performance of the global model update of S in round t, and the performance function is U F (S) = Φ(D v ,Ψ(x t ,S)).
[0157] In the tth round, the Shapley Value of each client is defined. t ,C t ,D v ,U F ), client i∈C t The Shapley Value in round t is:
[0158]
[0159] In the formula, It means to normalize the Shapley value to ensure that the sum of the total contribution is consistent with the overall utility change. represents the Shapley Value of the i-th client in the t-th round of training; C t represents the subset of participants in round t; U represents considering all subsets S that do not include client i, and considering the contribution of all such subsets to i by summing them up; F (S∪{i}) represents the performance when client i participates; U F (S) represents the performance when client i does not participate; U F (S∪{i})-U F (S) represents the contribution of client i to S; represents the number of combinations, which takes into account the number of combinations of different clients; Φ(D v ,Ψ(x t ,S∪{i})) is the performance measurement function U F The specific calculation process of (S∪{i}), where D v represents a given validation dataset; Ψ(x t, S∪{i}) represents the model trained by the subset S that does not contain client i; where x t represents the global model at the beginning of round t; S∪{i} represents the set after the client subset S joins client i; Ψ(x t ,S) Similarly, S represents the subset without client i participating; The significance of the denominator is to ensure that the contribution of each subset is properly considered and averaged during the final normalization.
[0160] The calculation formula of ShapDiv for the i-th device is:
[0161]
[0162] Among them, (0≤α≤1) is used to control the update rate of ShapDiv. As the training process progresses, the change in the performance of the central model tends to become smaller and smaller, so the range of ShapDiv in different rounds is unequal. Therefore, min-max normalization is used in each round to eliminate the impact of unequal ranges in ShapDiv calculation.
[0163] The calculation formula of Normalized ShapDiv (normalized Shapley divergence) is:
[0164]
[0165] In the formula, represents the Shapley divergence (Shapdiv) of the i-th client in the t-th round; min(SD t ) represents the minimum value among all clients’ SD in round t. By subtracting this minimum value, the numerator of the formula is adjusted to start from 0, eliminating the influence of the minimum value; max(SD t ) represents the maximum value of the SD values of all clients in round t. This maximum value is used as the denominator of normalization to ensure that the normalized value does not exceed 1; max(SD t )-min(SD t ) indicates that this is the range of SD values for all clients in round t. It adjusts the value of the numerator to between [0,1]. By dividing by this range, the formula ensures that all normalized values are within this standard range.
[0166] Each client's contribution to the global loss is adaptively weighted by its ShapDiv.
[0167] In order to distinguish the federated learning weight from the model parameters in the loss function, W is defined as the adaptive weight, X is the model parameter, and the formula for weighting the normalized ShapDiv to federated learning is:
[0168]
[0169] In the formula, Represented in the vector space R d Find an optimal solution X in the equation so that the objective function reaches the minimum value; represents the weighted summation process, where represents the weight of the i-th client in the t-th round; The specific calculation process of client weight is shown, where: represents the normalized Shapley divergence, which indicates the contribution of client i; represents the sum of normalized divergences of all clients; To represent the proportion of client i’s contribution, that is, the weight
[0170] In the aggregation stage, the probability of each client being selected is combined with the weight W. This method can make the model aggregation more accurate and effective.
[0171] The ShapDiv-based adaptive weighted federated learning method adopts a unified client sampling strategy. The ShapDiv-based adaptive weighted federated learning includes the following steps:
[0172] Input global model parameters x 1 , global step size and local step size η g ,η l , initialization probability P = [γ,…,γ];
[0173] Output the global model parameters x after T rounds of training T+1 , traverse the communication rounds t=1,2,…,T to execute;
[0174] Sampling Client C t ~P; the server will x t Broadcast to all selected clients, and execute on client i=1,2,…,N;
[0175] Initialize local model parameters Traverse the local step length le=1,2,…,Le to execute;
[0176] Compute mini-batch gradients renew
[0177] Computing Gradients Send gradient To the server;
[0178] The server calculates the weight in round t Among them, 1≤i≤N; is the sum of the normalized Shapley divergences of all clients in round t, which is used to normalize the weight of each client; represents the normalized Shapley divergence and represents the contribution of client i.
[0179] Server Update Model
[0180] Returns the global model parameters x T+1 ;
[0181] Among them, x t+1 represents the model of round t+1; x t represents the model of the t-wheel; η g Represents the global learning rate, which is the step size in gradient descent; Indicates the gradient weighting of the client; η l The learning rate used for local training; is the weight of the client; is the gradient obtained by the i-th client in the t-th round of training; is the local model obtained by client i in the tth round of training after le rounds of local model training; Indicates weighted aggregation of each client's local model; It means that the i-th client obtains the weight calculated in the t-th round.
[0182] Define the number of clients participating in federated learning in each round as m, then the probability of each client being selected in each round is The local model training round of the client is local-epoch, referred to as le. The maximum round of local model training of the client is defined as Le, and the maximum round of global model training is T.
[0183] Among them, the algorithm of adaptive weight federated learning based on ShapDiv is shown in Table 2:
[0184] Table 2 Adaptive weight federated learning based on ShapDiv
[0185]
[0186]
[0187] The server broadcasts the current central model parameters x t To the selected client (lines 5-7). The selected clients perform local training, which uses their local data to update the received parameters Is the client i through model x t It is obtained after training Le rounds on its local dataset at round t. (Lines 8-13).
[0188] Given the local client’s learning rate η l , is the local model gradient. After local training is completed, the local parameters The update is sent to the server (line 14). The server uses the received parameter update to calculate the client's ShapDiv and updates the global model parameters based on ShapDiv through weighted local updates (lines 15-16).
[0189] The adaptive weighted federated aggregation algorithm based on ShapDiv combines Shapley and KL divergence to more comprehensively aggregate model updates, which can better adapt to different data distributions and improve the generalization performance of the model.
[0190] When the ShapDiv-based adaptive weighted federated learning method of the present invention is experimentally evaluated, it is implemented on the standard image dataset Fashion-MNIST. Since CNN is widely used in the field of image classification, CNN is used as the global model here. Like other studies, the present invention focuses on the more challenging Non-IID data features and simulates the synthetic Non-IID partition of the FashionMNIST dataset. TestAccuracy (TestAC) is used as the evaluation index, and experiments and data analysis are performed under the following three popular data and model poisoning scenarios: 1) Non-IID data; 2) Data with data feature label noise interference; 3) Data with data noise interference. In the experiment, 6000 data sets were set for training and 1000 data sets were set for testing.
[0191] The adaptive weighted federated learning method based on ShapDiv of the present invention is compared with the following federated learning algorithms:
[0192] 1. FedAvg: is currently the most popular and widely used FL algorithm
[0193] 2. FedProx: An algorithm that addresses the Non-IID problem by adding proximal terms to the loss function.
[0194] 3. FedSV: A robust federated learning algorithm using a Shapley Value variant, which is also an improved algorithm based on which the present invention will conduct an ablation experiment with this algorithm.
[0195] 4. RFA: The Robust Federated Aggregation Algorithm (RFA) relies on the geometric median-based robust aggregation oracle in FL.
[0196] The experimental results are as follows:
[0197] (1) Non-IID experiment. Non-IID means that the local data of each client has different distributions. In the data set, there are a few categories with a large number of samples, while most categories have only a small number of samples. In image classification tasks, some common object categories (such as cats, dogs, and cars) may have a large number of samples, while some rare categories (such as rare animal and plant species) have only a few samples. In federated learning, this is an inevitable problem because each device has a different data distribution. This may introduce inconsistencies between devices, thereby affecting the performance of the federated learning model.
[0198] To deal with non-IID cases, see Figure 2 As shown, the present invention combines Shapley Value and KLDivergence, proposes the concept of ShapDiv to solve the problem of Non-IID between devices, comprehensively calculates the Shapley Value and KL Divergence calculated from the client training, distributes the calculated ShapDiv to each client, and then applies it to the global model adaptive weighted aggregation, so that clients with better data performance have a higher proportion in the global model aggregation, which can make the global model more generalizable and have higher performance. Figure 2 The experimental results of the adaptive weighted federated learning method (FedSD) based on ShapDiv of the present invention and other three algorithms under the condition of data label noise interference are demonstrated. The results show that the present invention still has good robustness under the condition of data label noise interference.
[0199] (2) Data noise interference experiment. Data noise refers to the presence of data beyond known categories in the training data, which will cause outliers to appear in the federated learning training process, thereby interfering with the federated learning training process. Data noise may cause the model to learn the wrong relationship between categories, affecting the generalization ability of the model, especially when encountering categories with similar characteristics during testing.
[0200] See also Figure 3 As shown, in the adaptive weighted federated learning method based on ShapDiv of the present invention, ShapleyValue can very intuitively reflect the quality of client data, calculate the Shapley Value of each client, and apply it to the measurement of ShapDiv. ShapDiv participates in the federated aggregation as the client adaptive weight, which can resist the interference of data noise to a certain extent, so as to achieve the purpose of protecting the model performance. Figure 3The performance of the ShapDiv-based adaptive weighted federated learning method (FedSD) of the present invention and the other three algorithms in the presence of data noise interference is demonstrated. The results show that the present invention can better resist data noise interference when the data set is interfered with by noise.
[0201] (3) Ablation experiment. In order to verify the effect of the ShapDiv adaptive weighting algorithm proposed in the present invention, an ablation experiment was conducted to compare it with the original algorithm FedSV. Since the adaptive weighted federated learning method based on ShapDiv in the present invention not only obtains the client Shapley Value but also incorporates the KL Divergence that can measure the difference between the local model and the global model of different clients, it can achieve the purpose of improving the performance of the global model of federated learning. Therefore, see Figure 4 As shown in Figure 2, the adaptive weighted federated learning method (FedSD) based on ShapDiv should have better performance. In the dataset with Non-IID features, the performance comparison between FedSD and FedSV is as follows: Figure 4 shown. Figure 4 The ablation experiment results show that the performance of FedSD with KLDivergence is improved, and its stability is also better than that of the FedSV algorithm.
[0202] Therefore, the adaptive weighted federated learning method based on ShapDiv proposed in the present invention combines the advantages of ShapleyValue and KL Divergence, and improves the efficiency and performance of model training and information aggregation in a distributed environment by introducing adaptive weighting and incentive mechanisms. Shapley Value and KL Divergence are successfully integrated to define a new utility evaluation index ShapDiv, which evaluates the contribution of each participant through Shapley Value, and can more accurately quantify the contribution of each participant to the training of the global model. At the same time, the introduction of KL Divergence can better handle the differences in data distribution between different participants, thereby improving the robustness of federated learning.
[0203] Secondly, the present invention designs an incentive mechanism to promote wider participation and more efficient information sharing by rewarding participants who put more effort and resources into federated learning. This incentive mechanism helps to build a more proactive and cooperative federated learning environment and promote the entire system to a more optimized state.
[0204] Finally, the adaptive weighted federated learning method based on ShapDiv proposed in this invention fully considers the contribution differences of the participants and dynamically adjusts the weights, so that more attention is paid to the participants who contribute most to performance improvement in global model training. Experiments have shown that compared with the traditional uniform weight distribution, this invention has achieved significant improvements in both model performance and convergence speed.
[0205] It should be understood that, although described in a certain order, these steps are not necessarily performed in sequence in the above order. Unless there is clear explanation in the present invention, the execution of these steps does not have strict order restriction, and these steps can be performed in other orders. Moreover, a part of the steps of the present embodiment may include a plurality of steps or a plurality of stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a part of the steps or stages in other steps or other steps.
[0206] In one embodiment, a computer device is also provided in an embodiment of the present invention, comprising at least one processor and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor performs the steps of the ShapDiv-based adaptive weighted federated learning method.
[0207] In one embodiment, the present invention further provides a computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute the steps of the ShapDiv-based adaptive weighted federated learning method.
[0208] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be realized by instructing the relevant hardware through a computer program represented by computer instructions, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory.
[0209] Non-volatile memory may include read-only memory, magnetic tape, floppy disk, flash memory or optical storage, etc. Volatile memory may include random access memory or external cache memory. As an illustration and not limitation, RAM may be in various forms, such as static random access memory or dynamic random access memory, etc.
[0210] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. An adaptive weighted federated learning method based on ShapDiv, characterized in that: The method comprises the following steps: Step 1). Initialize the global model: initialize the pre-defined global model parameters to initial values and send the global model to all federated learning clients; Step 2). Client training and model update: Each client uses the local dataset to perform local model training and calculate the local model of each client; Step 3). The central server collects model updates: The central server collects the local model uploaded by the client, calculates the ShapDiv of the client, and calculates Shapley Value and KLDivergence respectively when calculating ShapDiv; Shapley Value is used to evaluate the client's data quality contribution; KLDivergence evaluates the quality of the local model by calculating the difference in distribution probability between the local model and the global model; Step 4). ShapDiv adaptive weighting: Adaptive weighted aggregation is performed based on the ShapDiv value of each client; Step 5). Update the global model: Update the global model according to the weighted client model parameters; Step 6). Iterative training: Repeat the above steps to perform multiple rounds of federated learning iterative training. During each round of training, the client updates the local model and uploads it to the central server. The central server performs adaptive weighted aggregation based on the ShapDiv value and updates the global model. Step 7). Model evaluation, set convergence conditions, and evaluate the final global model.
2. The adaptive weighted federated learning method based on ShapDiv according to claim 1, characterized in that: When initializing the global model, the global model X is initialized t Sent to all federated learning clients; For each client i, use each client's local dataset D i Perform local model training And the updated model Return to the server; the central server collects the updated models uploaded by all participants and applies the updated local models to the aggregated global model; where the objective function F(X) of the central server is: Where N is the number of clients participating in federated learning, X∈R d indicates that X is a d-dimensional vector in the real space R, i.e., the model parameter; w i is the calculation weight of the i-th client; F i (X) is the local objective function of the i-th client.
3. The ShapDiv-based adaptive weighted federated learning method according to claim 2, characterized in that: The local objective function F of the i-th client i The calculation formula of (X) is: Among them, D i is the local dataset of the i-th client, n i is the total data volume of client i, f i (X) = L(A i ,B i ,X) is a model with parameters X for the dataset D i Example in (A i ,B i ) The loss function generated by i The sum of the loss functions generated by all instances in Divide by the total data volume n of client i i , and the average loss function of the local client. The loss function is inversely proportional to the model accuracy.
4. The adaptive weighted federated learning method based on ShapDiv as claimed in claim 3, characterized in that: During client training and model updating, KL divergence is also introduced to evaluate the difference between the local model and the global model. Shapley and KL divergence are combined to define a parameter ShapDiv, which is used to comprehensively evaluate the contribution of the client. The definition of KL divergence is based on entropy, and KL divergence is proportional to the difference between the local model and the global model.
5. The ShapDiv-based adaptive weighted federated learning method according to claim 1, characterized in that: The ShapDiv-based adaptive weighted federated learning method also includes an incentive mechanism based on ShapDiv, which allocates rewards and penalties to the client according to ShapDiv, wherein the reward factor and penalty factor of the incentive mechanism include: The reward factor is to determine the contribution of the participants according to ShapDiv, including basic rewards and ShapDiv rewards. The basic reward is the basic reward for participating in federated learning that all participants will receive to encourage participation; the ShapDiv reward is used to allocate according to the ShapDiv value, and the higher the ShapDiv value, the higher the reward; The penalty factors are based on data quality and data violations, and the contribution penalty of the participant is determined according to ShapDiv.
6. The ShapDiv-based adaptive weighted federated learning method according to claim 5, characterized in that: According to ShapDiv, rewards and penalties are allocated to the client, and the allocation of rewards and penalties includes the following steps: Calculate the ShapDiv value of each client for this federated learning; The Shapley Value obtained by each client participating in the training is combined with the KL Divergence to obtain the ShapDiv, which is the contribution of the client in this federated learning. i ;in:
7. The ShapDiv-based adaptive weighted federated learning method according to claim 1, characterized in that: The incentive mechanism based on ShapDiv includes the following steps: Enter the Shapley Value and KL Divergence of each client; Output the number of coins for each client; Calculate the client's first round of initial ShapDiv, i.e. SD i ; ShapDiv i =(αSV i +(1-a)DKL i ) Average the ShapDiv of N clients. Traverse i=1,2,…,N; Traverse t=1,2,…T; The ShapDiv of client i is like The number of gold coins of client i like Client i's coins Coin=SD avg ×10-SD i ; Output the number of coins of N clients; Among them, N is the total number of participating clients, T is the training round of the model, Coin is the number of gold coins each client has, and the initial value is 0. The income of each client Coin consists of two parts. One part is the income SD of the client participating in federated learning. avg ×10; rewards obtained based on the client's contribution in each round The higher the number of gold coins, the higher the access rights. When the number of gold coins on a client is less than 0, the client will be removed from the federated learning aggregation task, and the client will be permanently unable to use any data resources.
8. The ShapDiv-based adaptive weighted federated learning method according to claim 7, characterized in that: According to the ShapDiv value, adaptive weighted aggregation is performed and the global model is updated. In each round of collaborative training, the training process of each round t (t ≥ 1) is defined as a cooperative game G (x t ,C t ,D v ,U F ), where X t is the global model at the beginning of round t, C t is the subset of participants in round t, Return the client subset S to update X t The model after is the model parameter update vector of client i in round t, η g (η l ) are the global (local) learning rates; a set The performance of the global model update in round t is represented by S; the performance function is U F (S) = Φ(D v ,Ψ(x t ,S)).
9. The ShapDiv-based adaptive weighted federated learning method according to claim 8, characterized in that: In the cooperative game G(x t ,C t ,D v ,U F ), client i∈C t The Shapley Value in round t is: The ShapDiv of the ith device is calculated as: Among them, (0≤α≤1) is used to control the update rate of ShapDiv; The normalized Shapley divergence is calculated as: Each client's contribution to the global loss is adaptively weighted by its ShapDiv.
10. The ShapDiv-based adaptive weighted federated learning system according to claim 9, characterized in that: The ShapDiv-based adaptive weighted federated learning method adopts a unified client sampling strategy. The ShapDiv-based adaptive weighted federated learning includes the following steps: Input global model parameters x 1 , global step size and local step size η g ,η l , initialization probability P = [γ,…,γ]; Output the global model parameters x after T rounds of training T+1 , traverse the communication rounds t=1,2,…,T to execute; Sampling Client C t ~P; the server will x t Broadcast to all selected clients, and execute on client i=1,2,…,N; Initialize local model parameters Traverse the local step length le=1,2,…,Le to execute; Compute mini-batch gradients renew Computing Gradients Send gradient To the server; The server calculates the weight in round t Server Update Model Returns the global model parameters x T+1 ; Among them, the number of clients participating in federated learning in each round is defined as m, and the probability of each client being selected in each round is The local model training round of the client is local-epoch, the maximum round of local model training of the client is defined as Le, and the maximum round of global model training is T.
