An agnostic-based fair federated learning asynchronous training method

By introducing an agnostic fair federated learning asynchronous training method in federated learning and dynamically adjusting user training and weight parameters, the problem of fair collaborative training among users with heterogeneous data is solved, the fairness and utility balance of the global model are achieved, and user training enthusiasm and model performance are improved.

CN116757294BActive Publication Date: 2025-10-21CHONGQING UNIV OF POSTS & TELECOMM
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310574374.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-19
Publication Date
2025-10-21
Estimated Expiration
2043-05-19

AI Technical Summary

Technical Problem

Existing federated learning methods suffer from uneven utility distribution in fair collaborative training among heterogeneous data users, which affects user training enthusiasm and the fairness of global model performance. Existing research is relatively complex or harms user interests and has low practical value.

Method used

An agnostic fair federated learning asynchronous training method is adopted. By randomly selecting some users for training, combining fairness estimation and aggregate weight adjustment, the number of local iterations and weight parameters are dynamically adjusted to ensure the fairness of the model update direction.

Benefits of technology

It improves the fairness of the global model's performance, avoids the errors introduced by the aggregation method, enhances user training enthusiasm, and improves the model's applicability and training efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116757294B_ABST
    Figure CN116757294B_ABST
Patent Text Reader

Abstract

The present application belongs to the field of distributed machine learning in artificial intelligence, and particularly relates to a fair federated learning asynchronous training method based on agnosticism; comprising: constructing a federated learning system, in the tth round, randomly selecting users to form a training set, and the central server issuing global model parameters to the training set; the user performs local training and uploads user model parameters and test accuracy to the central server; when the central server collects all user model parameters and test accuracy, the global model parameters are updated and the global accuracy is calculated; when the global accuracy is greater than the target accuracy, the updated global model parameters are issued to all users, and the training is completed; the present application uses agnosticism to improve the construction ability of federated learning on the fair optimization goal, designs a training adjustment mechanism to alleviate the deviation degree of the global optimization direction to part of the users, and when facing a data heterogeneous user group, good performance fairness and model fairness can be achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of distributed machine learning in artificial intelligence, and in particular relates to an agnostic-based fair federated learning asynchronous training method. Background Art

[0002] The development of artificial intelligence relies on large-scale data sets, especially data from real-world scenarios. Models need to continuously learn from a large number of valid samples to ultimately obtain models with reasoning capabilities. As the complexity of tasks increases, model training has increasingly stringent requirements for data sets, requiring more data samples. However, the frequent occurrence of user data leaks has caused more and more individuals and organizations to begin to pay attention to the security of private data. In 2021, China successively promulgated the Data Security Law and the Personal Information Protection Law to strengthen security supervision of private data. In 2016, researchers at Google proposed the concept of federated learning and provided a feasible algorithm in 2017. The main idea of ​​federated learning is to delegate model training to the user terminal, and the server only collects the trained user model parameters, rather than the user's private data. Federated learning provides a global model training method without leaving the local data, effectively solving the training problem of not being able to collect user data.

[0003] Fairness in federated learning is a key research area. When user data is not independent and identically distributed (IID), the global model may not perform consistently across user groups. Differences in user data quality, quantity, and resources directly impact the impact of users on the global model, potentially leading to an uneven distribution of utility across users. As training participants, users do not want the global model to exhibit utility bias, particularly excessive bias toward a specific group. Uneven utility distribution undermines user training motivation. Therefore, research on fair federated learning can protect user training motivation and increase the effective applicability of the global model. Based on the concept of fairness, federated learning can be categorized into contribution-fair federated learning, model-fair federated learning, and performance-fair federated learning. Based on the differences in their approaches, performance-fair federated learning can be further divided into three categories: training objective adjustment, aggregate weight adjustment, and agnostic optimization. More research on fair federated learning focuses on ensuring balanced model performance across user groups, a concept known as performance-fair federated learning, as most research outside of incentive mechanisms assumes user active training.

[0004] In summary, research on contribution-fair federated learning rarely focuses on user training motivation, making federated learning more profit-oriented. Research on model-fair federated learning requires adding additional group-fair calculations to each training round, increasing training costs. Research on performance-fair federated learning: the computational process for adjusting training objectives is often complex and easily introduces additional training costs; training methods based on aggregate weight adjustment may harm the existing interests of some users; and agnostic optimization provides new insights into fair federated learning research, but existing research scenarios are relatively idealistic and have low practical value. Summary of the Invention

[0005] To solve the above problems in the prior art, the present invention proposes an agnostic and fair federated learning asynchronous training method, comprising:

[0006] S1. Build a federated learning system consisting of a central server and N users, each of which is within the communication range of the central server. Initialize the system and set the federated learning round t, where t = 1.

[0007] S2. In the tth round, randomly select κ×N users to form the training set C train , where κ represents the proportion of users participating in training, and the central server sends train All users in send the updated global model parameters θ after the t-1th round of training t-1 ;

[0008] S3. User c n , n=1,2,…,κ×N receive global model parameters θ t-1 Perform local training and upload user model parameters θ to the central server n,t And the test accuracy acc n,t ;

[0009] S4. When the central server collects the user model parameters and test accuracy of κ×N users, it updates the global model parameters and calculates the global accuracy

[0010] S5. Determine whether the global accuracy is less than the target accuracy. If so, set t = t + 1 and return to step S2; if not, send the updated global model parameters θ to N users. t , complete the training.

[0011] Furthermore, in step S3, user c n Receive global model parameters θ t-1 Perform local training and upload user model parameters θ to the central server n,t And the test accuracy acc n,tThe specific process is:

[0012] S31. User c n Based on the global model M(θ t-1 ) Calculate user c n The exact loss value l(D n ,M(θ t-1 )); where D n For user c n training dataset;

[0013] S32. According to the accurate loss value l(D n ,M(θ t-1 ))Update α n , and adopt the updated α n Calculate user c n The estimated loss at round t

[0014] S33. User c n Initialize the number of epochs of local training iterations, and then run the parameter calculation process and the local training process in parallel;

[0015] S34. Determine whether epochs>epochs n,t , if satisfied, then user c n Send user model parameters and test accuracy to the central server.

[0016] Furthermore, the estimated loss The calculation formula is:

[0017]

[0018] λ t =λ0×(1+ρ) t

[0019]

[0020]

[0021] Among them, λ t Indicates estimated loss value Regarding the accurate loss value l(D n ,M(θ t-1 ))'s convergence coefficient, l(D n ,M(θ t-1 )) represents user c n The exact loss value of the t-1th round of training, α n Indicates estimated loss value Correction coefficient, Δl(D n,M(θ t-1 )) represents user c n The loss value estimation error of the t-1th round of training, λ0 represents the convergence coefficient λ t The initial value of ρ represents the convergence coefficient λ t The convergence factor, μ α Indicates the correction coefficient α n The update step size, Indicates user c n The loss value of the t-1th round of training estimates the gradient of the error.

[0022] Furthermore, the parameter calculation process includes:

[0023] S301. User c n Upload the accurate loss value l(D n ,M(θ t-1 )) and loss estimates Wait for the central server to return the training set C train All users have a certain understanding of the current global model M(θ t )’s loss estimate set;

[0024] S302. When user c n After receiving the loss estimate set, calculate user c n Fairness estimate at round t Based on fairness estimates Calculate updated user c n The local iteration factor epochs in the tth round n,t ;

[0025] The local training process includes:

[0026] S311. When epochs=0, user c n User model parameters θ n,t =θ t-1 ;

[0027] S312. Training and updating user model parameters θ n,t , and calculate the current test accuracy acc n,t ; Set epochs = epochs + 1 and return to step S34 to determine whether epochs> epochs n,t If not satisfied, execute step S312.

[0028] Furthermore, in step S302, user c n The calculation formula for the fairness estimate in round t is:

[0029]

[0030] in, Indicates user c n The fairness estimate in the tth round of training, L upp represents the maximum loss value, Indicates user c n Through the dataset D n During the tth round of training, the global model M(θ t ) the estimated value of the losses incurred; It means that all users use the total dataset D to train the global model M(θ t ), the average loss estimate generated by Represents a hash table structure that stores the estimated loss of the user training dataset with respect to the global model in the current federated learning round.

[0031] Furthermore, step S302 calculates and updates the local iteration round factor epochs n,t The formula is:

[0032]

[0033]

[0034] Among them, μ epochs Represents epochs n,t The update time factor, U1(a) represents the judgment function, which determines whether the user is a disadvantaged user or an advantaged user, and whether it is necessary to adjust the local training iteration round factor epochs n,t value.

[0035] Furthermore, in step S4, the central server collects the user model parameters and test accuracy of κ×N users, updates the global model parameters and calculates the global accuracy include:

[0036] S41 receives and stores relevant data uploaded by the user;

[0037] S42. When the central server collects the training set C train All users in the previous round of global model M(θ t-1 ), then the accurate loss value of the training set C train Each user returns the training set C train All users have a certain understanding of the current global model M(θ t ) loss estimation value set; then executing step S43;

[0038] S43. When the central server collects the training set C trainIf the user model parameters of all users in the current round are obtained, step S44 is executed;

[0039] S44. Update global model parameters and calculate global accuracy Then execute step S5.

[0040] Furthermore, the asynchronous update expression of global model parameters in the agnostic fair federated learning asynchronous training method is:

[0041]

[0042] Δθ n,t =θ n,t -θ n

[0043]

[0044]

[0045] Where Δθ n,t Indicates user c n The difference between the local model parameters and the latest global model parameters obtained, θ n,t Indicates user c n The local model parameters uploaded in the tth round of training, θ n Indicates user c n The latest global model parameters obtained, w n,t For user c n The weight parameter of the tth round of training, μ w represents the update step size of the weight parameters, Indicates user c n The gradient of the accurate loss value of the t-1th round of training, U2(a) represents the judgment function, which determines whether the user is a disadvantaged user or an advantaged user, and whether the user c needs to be adjusted n The weight parameter w of the tth round of training n,t The value of Represents a hash table structure that stores the exact loss value of the global model trained with respect to the user's training dataset in the previous round of federated learning.

[0046] Beneficial effects of the present invention:

[0047] The present invention mainly solves the problem of fair collaborative training among users with heterogeneous data, and in particular enhances the performance fairness of the global model; the present invention designs a fairness estimation method based on historical accumulation and adjusts user training according to fairness. The lower the user's fairness, the more local iterations are needed to increase the amplitude of the user update gradient, thereby avoiding the problem of errors introduced by the fairness measurement calculation method using model aggregation; the present invention introduces an agnostic optimization goal, constructs aggregation weights that can follow the user's training status, and designs an aggregation parameter update method oriented to performance fairness to ensure fairness in the parameter update direction and avoid the problem of uneven distribution of model utility that may be caused by fixed aggregation weights. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 A diagram of the agnostic fair federated learning model used in this invention;

[0049] Figure 2 This is a flowchart for implementing the agnostic fair federated learning asynchronous training method proposed in the present invention;

[0050] Figure 3 This is a flowchart of the user part training in the agnostic fair federated learning asynchronous training method proposed in the present invention;

[0051] Figure 4 This is a training flowchart for the central server part of the agnostic fair federated learning asynchronous training method proposed in the present invention. DETAILED DESCRIPTION

[0052] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0053] The present invention is based on Figure 1 The federated learning system shown in the figure is studied, which includes a central server and multiple users. Assume that the central server is denoted as s, and the communication coverage of the central server s includes N users. These N users are grouped into a user group C = [c1, c2, ...c N The central server s has computing, communication and scheduling capabilities, which can be abstractly described as s = [comp s ,comm s ,sche s ], where comp s Represents the computing power of the central server, comm sRepresents the central server communication capability, sche s Represents the central server scheduling capability; the central server s is mainly responsible for the management and aggregation of the global model in the federated learning system. It usually maintains the initial parameters of the global model and aggregates the updated user model parameters from each user after each federated learning round to generate new global model parameters, which are then distributed to each user. User c n It mainly has the ability to collect, store and process data, which can be abstractly described as c n =[D n ,oa n ], D n Indicates user c n The training data set, oa n Indicates user c n Each user has his or her own training dataset and can train the model locally and send the updated user model parameters to the central server. The expression satisfied by the sample distribution between heterogeneous users is:

[0054]

[0055] in, Indicates user c i The kth sample of Indicates user c i The kth sample Obey the distribution.

[0056] The computing power and communication capability of the central server s are superior to those of the users, and the users are randomly distributed within the communication coverage of the server. In order to ensure the effective implementation of the training, it is assumed that a hypothetical mixed set containing all user data sets It is about the sample space sufficient observation results, and does not consider malicious users and passive users.

[0057] In order to explain the problem from the perspective of optimization, this embodiment uses the loss value of the model on the test set to measure the model utility. θ represents the model parameter. Consider the global model M(θ) with respect to user c n The utility is u n ,u n The calculation expression is:

[0058] u n =L upp -l(D n ,M(θ)) (2)

[0059] Among them L upp Indicates the maximum loss value, D n For user c n The training data set, l(Dn ,M(θ)) is the loss function.

[0060] In one embodiment, based on the tth federated learning round, considering the gradient update form, for user c i and c j Describe the problem. As mentioned above, assume that user c i and c j There is data heterogeneity between them, and in Indicates user c n The sample size, num sample Represents the total number of samples of all users. Without loss of generality, this embodiment assumes that the user model M(θ i,t ) and M(θ j,t ) satisfies the expression:

[0061] l(D i ,M(θ i,t ))=l(D j ,M(θ j,t )) (3)

[0062] l(D i ,M(θ i,t )) for user c i About the user model M(θ i,t ) loss value.

[0063] Taking the federated averaging algorithm as an example, after the tth round of federated learning training, the expression of the updated global model parameters is:

[0064]

[0065] Among them, g t ′ represents the global model optimization direction of the tth federated learning round training; g n,t Indicates the training of user c in the tth round of federated learning n It can be found that the more users the sample size, the more their update gradient will affect the global model optimization direction g. t ′, γ represents the update step size of the global model parameters along the gradient direction, or called the learning rate.

[0066] User c i and c j The relationship expression of the gradient is:

[0067] ||g′ t -g i,t ||<||g′ t -g j,t || (5)

[0068] That is, the optimization direction of the global model is more inclined to user c i User c i and c j Regarding the global model M(θ t The loss value of ) is expressed as:

[0069] l(D i ,M(θ t ))<l(D j ,M(θ t )) (6)

[0070] Therefore, the model utility u i,t Greater than u j,t Because the data is heterogeneous, the global model M(θ t ) The model utility of the user is tilted due to D i and D j are not sufficient observations in the global sample space, so it is impossible to determine whether the global model is sufficient for user c i Whether the tilted optimization path helps convergence or causes the optimization path to appear random.

[0071] Based on the above analysis and optimization requirements, the present invention provides an agnostic and fair federated learning asynchronous training method. For ease of explanation, we first define the relevant concepts used throughout the present invention.

[0072] (1) Fairness. When the global model M(θ) is used in the training dataset D i The loss value l on i Higher than in the training dataset D j The loss value l on j When , it represents the global model M(θ) about user c i The fairness of is lower. Define user c n The fairness of n The expression is:

[0073]

[0074] Among them, l ave (D,M(θ)) represents the average loss value of all users with respect to the global model M(θ). n The higher the value, the better the global model is about user c n The higher the tendency.

[0075] (2) Advantageous / disadvantaged users. Assume that the global model M(θ) is about user c n The utility is u n , the mean utility of all users is u ave If u nGreater than u ave , call user c n For the dominant user; if u n Less than u ave , call user c n For disadvantaged users.

[0076] In one embodiment, an agnostic fair federated learning asynchronous training method is provided, such as Figure 2 As shown, the following steps are included:

[0077] S1. Build a federated learning system, which includes a central server and N users, where each user is within the communication coverage of the central server; initialize the system and set the federated learning round t, where t = 1.

[0078] S2. In the tth round, randomly select κ×N users to form the training set C train , the central server sends the training set C train All users in send the updated global model parameters θ after the t-1th round of training t-1 Where κ represents the proportion of users participating in training; in each round of training, the central server randomly selects κ×N users to participate in the training. Compared with the training method for all users, this method has a smaller computational load and higher training efficiency. It can complete model training based on distributed datasets faster, and the model performance is far better than the training method for all users.

[0079] S3. User c n , n=1,2,…,κ×N receive global model parameters θ t-1 Perform local training and upload user model parameters θ to the central server n,t And the test accuracy acc n,t .

[0080] Specifically, we need to calculate the user c in the tth round of training n The exact fairness of n,t , based on the global model M(θ t ) is calculated accurately. However, the global model M(θ t ) is the training result of the tth round, which cannot be obtained before training, so it is necessary to use the existing information to calculate ψ n,t Estimated value of Inspired by momentum optimization, we first give the loss estimate The calculation expression is:

[0081]

[0082] λ t =λ0×(1+ρ) t (9)

[0083]

[0084]

[0085] Among them, λ t Indicates estimated loss value Regarding the accurate loss value l(D n ,M(θ t-1 ))'s convergence coefficient, l(D n ,M(θ t-1 )) represents user c n The exact loss value of the t-1th round of training, α n Indicates estimated loss value Correction coefficient, Δl(D n ,M(θ t-1 )) represents user c n The loss value estimation error of the t-1th round of training, λ0 represents the convergence coefficient λ t The initial value of ρ represents the convergence coefficient λ t The convergence factor, μ α Indicates the correction coefficient α n The update step size, Indicates user c n The loss value of the t-1th round of training estimates the gradient of the error.

[0086] The calculation of l(D n ,M(θ t ))The curve gradually flattens; (2) and l(D n ,M(θ t )) should provide feedback and correction to the calculation method.

[0087] Accordingly, user c n The calculation formula for the fairness estimate in round t is:

[0088]

[0089] in, Indicates user c n The fairness estimate in the tth round of training, L upp represents the maximum loss value, Indicates user c n Through the dataset D n In the tth round of training, about the global model M(θ t ) the estimated value of the losses incurred; It means that all users have passed the total dataset D in the tth round of training about the global model M(θ t ) is the average loss estimate generated by

[0090] Specifically, based on the above analysis and related conclusions, in step S3, user c n Receive global model parameters θ t-1 Perform local training and upload user model parameters θ to the central server n,t And the test accuracy acc n,t ,like Figure 3 As shown, the specific process is:

[0091] S31. User c n Based on the global model M(θ t-1 ) Calculate user c n The exact loss value l(D n ,M(θ t-1 )); where D n For user c n training dataset;

[0092] S32. According to the accurate loss value l(D n ,M(θ t-1 ))Update α n , and adopt the updated α n Calculate user c n The estimated loss at round t

[0093] S33. User c n Initialize the number of epochs of local training iterations, and then run the parameter calculation process and the local training process in parallel;

[0094] The parameter calculation process includes:

[0095] S301. User c n Upload the accurate loss value l(D n ,M(θ t-1 )) and loss estimates Wait for the central server to return the training set C train All users have a certain understanding of the current global model M(θ t )’s loss estimate set;

[0096] S302. When user c n After receiving the loss estimate set, calculate user c n Fairness estimate at round t Based on fairness estimates Calculate the user c at this time nThe local iteration factor epochs in the tth round n,t ; and update the local iteration round factor epochs in the judgment condition of step S34 n,t ;

[0097] The local training process includes:

[0098] S311. When epochs=0, user c n User model parameters θ n,t =θ t-1 ;

[0099] S312. Training and updating user model parameters θ n,t , and calculate the current test accuracy acc n,t ; Set epochs = epochs + 1 and return to step S34 to determine whether epochs> epochs n,t If not, execute step S312;

[0100] S34. Determine whether epochs>epochs n,t , if satisfied, then user c n Send the user model parameters and test accuracy to the central server. If the requirements are not met, continue the local training process. It should be noted that although there are two parallel processes, whether the user model parameters and test accuracy at this time are uploaded to the central server is determined only by the local training process.

[0101] Specifically, step S302 calculates and updates the local iteration round factor epochs n,t The formula is:

[0102]

[0103] Among them, μ epochs Represents epochs n,t The update time factor, U1(a) represents the judgment function, which determines whether the user is a disadvantaged user or an advantaged user, and whether the local iteration round factor epochs needs to be adjusted n,t The value of .

[0104] when When it is lower than the average level, that is, user c n When user c becomes a disadvantaged user, n Only then can the local iteration round factor epochs be adjusted n,t-1 , and the adjustment range is related to the fairness estimate and the iteration round; otherwise epochs n,t =epochs n,t-1 From formula (13), we can know that when t increases, (μepochs ) t Smaller, local iteration round factor epochs n,t-1 Specifically, the lower the fairness, the earlier the time, and the smaller the adjustment of the local iteration round factor epochs. n,t-1 The larger the adjustment range, the greater the update range of disadvantaged users. By adjusting the local training method, the update range of disadvantaged users can be increased.

[0105] To illustrate the role of the mechanism for adjusting the training scheme based on the fairness estimate introduced above, this embodiment assumes that in the tth federated learning round, the update gradient of the global model is g t , user c n The updated gradient is g n,t Taking the aggregation method of the federated average algorithm as an example, the training set C train , w n,t For user c n The weight parameter of the tth round of training, g t With g n,t The relationship between them is:

[0106]

[0107] Consider the disadvantaged user c m , g t The calculation expression can be rewritten as:

[0108]

[0109] The local iteration round factor epochs introduced in formula (13) n,t After the adjustment calculation, since it does not affect the training of the dominant user, the second term on the right side of the equal sign of Equation (15) will not change. Only the gradient amplitude in the first term will increase due to the increase in the number of iterations, and will be changed to g′ m,t .

[0110] According to the vector calculation rules, after introducing a mechanism to adjust the training plan based on the fairness estimate, the optimization direction of the global model will be more inclined towards disadvantaged users. The specific expression is:

[0111] ||g t -g′ m,t ||<||g t -g m,t || (16)

[0112] From the above analysis, we can see that the mechanism of adjusting the training scheme based on the fairness estimate can improve the effect of disadvantaged users on the global optimization direction, while alleviating the impact of fairness adjustment on advantaged users.

[0113] S4. When the central server collects the user model parameters and test accuracy of κ×N users, it updates the global model parameters and calculates the global accuracy

[0114] Specifically, common aggregation weight adjustment methods, due to the constraints of normalization conditions, will affect all users, thereby affecting the effect of dominant users on the global model. To this end, this invention, based on an agnostic federated learning algorithm and agnostic thinking, parameterizes the aggregation weights and continuously optimizes the weight parameters through iterative training.

[0115] Assume that in the tth round of federated learning, the aggregation weight is parameterized as:

[0116]

[0117] Among them, θ n,t For user c n The user model parameters sent to the central server during the t-th round of training; w n,t For user c n The weight parameters for the tth round of training.

[0118] In order to make the update path of the weight parameters fair, this embodiment designs a parameter update method based on fairness guidance, which is expressed as follows:

[0119]

[0120]

[0121] The central server needs to calculate the global model M(θ t-1 ) About c n The exact fairness of n,t-1 , adjust c n The weight parameter w in the tth round of training n,t , μ w represents the update step size of the weight parameters, Indicates user c n The gradient of the accurate loss value of the t-1th round of training, U2(a) represents the judgment function, which determines whether the user is a disadvantaged user or an advantaged user, and whether the user c needs to be adjusted n The weight parameter w of the tth round of training n,t value.

[0122] From the above formula (18), we can see that the update of weight parameters will adjust the optimization direction and amplitude of the current round of user weight parameters according to the fairness performance of the previous round of user models. n ψ n,t-1 Large, indicating that the global model M(θ t-1 ) w in the aggregation equationn,t-1 Too large, making the global model M(θ t-1 ) biased towards user model M(θ n,t-1 ), we need to use the gradient descent method to calculate w n,t Update. If ψ n,t-1 If it is small, then we need to use the gradient ascent method to adjust w n,t To maintain consistency with the existing federated learning algorithm, w n,t The initial value is set to the ratio of the user sample size to the total sample size.

[0123] Since the update method of weight parameters follows the fairness guidance, when the agnostic federated learning behaves unfairly during training, it will be reflected in the update of weight parameters in a timely manner, avoiding the situation where the optimization goal is to minimize the average empirical risk. w When the value is set to a small value, the update path of the weight parameter is stable and is less affected by fluctuations of noise or abnormal events.

[0124] Specifically, if Figure 4 As shown, in step S4, the central server collects user model parameters and test accuracy of κ×N users, updates the global model parameters and calculates the global accuracy include:

[0125] S41 receives and stores relevant data uploaded by the user;

[0126] S42. When the central server collects the training set C train All users in the previous round of global model M(θ t-1 ), then the accurate loss value of the training set C train Each user returns the training set C train All users have a certain understanding of the current global model M(θ t ) loss estimation value set; then executing step S43;

[0127] S43. When the central server collects the training set C train If the user model parameters of all users in the current round are obtained, step S44 is executed;

[0128] S44. Update global model parameters and calculate global accuracy Then execute step S5.

[0129] The update of global model parameters requires collecting the user model parameters of all users participating in the training first, so only when Q(θ) is full, that is, the central server collects the training set C train Step S44 is executed to update the global model parameters only when all users in the current round have the same user model parameters.

[0130] S5. Determine whether the global accuracy is less than the target accuracy. If so, set t = t + 1 and return to step S2; if not, send the updated global model parameters θ to N users. t , complete the training.

[0131] This embodiment proposes an agnostic and fair federated learning asynchronous training method, which is mainly divided into two parts: users and central servers, as shown in the following table:

[0132]

[0133] In the table, the buffer queue Q(l) is used to update the weight parameters and store the accurate loss value of the user dataset with respect to the previous global model; Used to adjust the user's training mechanism and store the estimated loss of the user data set with respect to the current global model; Q(θ) is used to update the global model and store the user model parameters uploaded by the user; the hash table Q(acc) is used to calculate the global accuracy Use key-value pairs to store the test accuracy submitted by users; training set C train Indicates the set of users participating in the current round of training. When the global accuracy calculated based on Q(acc) Higher than the target accuracy acc target When ψ is , a fair federated learning training process based on agnosticism ends. t-1 Represents a storage of the accurate fairness of all users in the t-1th round of training ψ n,t-1 The matrix is ​​calculated by the exact loss value of all users during the t-1 round of training and is used to calculate w t .w t It is a storage of all user weight parameters w during the tth round of training n,t The matrix of .

[0134] Specifically, in order to ensure that the calculation formula of the fairness estimation value can still be carried out normally in the asynchronous mode, the present invention changes the buffer queue Q(l) and the buffer queue in the above-mentioned synchronous algorithm to Are replaced with hash table structures, respectively and The buffer queue Q(l) is replaced with a hash table structure After that, it is still used to update the weight parameters and store the accurate loss value of the global model obtained by the user training dataset in the previous round of federated learning training; buffer queue Replace with hash table structure After that, it is still used to adjust the user's local training plan and store the loss estimate of the user's training data set for the global model in the current federated learning round training. The above improvement is made because all users are trained asynchronously (each user performs model training and parameter updates at different times or speeds). Assuming that the central server enters the tth round of training, each user needs the loss estimate of all users in the tth round when calculating the corresponding fairness estimate. However, at this time, the loss estimate of some users may still be the result of the previous round calculation. Therefore, this embodiment limits the loss estimate. When performing relevant calculations in each round, the current loss estimate in the hash table structure is stored. The loss value is used as the estimated loss value of the user's current round. The hash table structure used to update the weight parameters Similarly, the complete expression of formula (12) is shown in formula (19):

[0135]

[0136] Similarly, to ensure that the parameter update method based on fair guidance can still proceed normally in asynchronous mode, the complete expression of formula (18) is as follows:

[0137]

[0138] Specifically, the buffer queue Q(l) (or hash table structure ) is initialized to the calculation result of the first epochs of all users in the first round of training, that is, l(D n ,M(θ0)). And the buffer queue (or hash table structure ) initialization needs to be manually set according to the task type and difficulty.

[0139] Specifically, in asynchronous training, M(θ t ) needs to consider the randomness of user model parameter uploads, and the global model parameter asynchronous update expression in the agnostic fair federated learning asynchronous training method is given as:

[0140]

[0141] Δθ n,t =θ n,t -θ n (twenty two)

[0142] Where Δθ n,t Indicates user c n The difference between the local model parameters and the latest global model parameters obtained, θ n,t Indicates user c n The local model parameters uploaded in the tth round of training, θn Indicates user c n Get the latest global model parameters.

[0143] The weight parameter also needs to be corrected using the state factor ζ, and the correction expression is:

[0144] w n,t =w n,t ×ζ n,t

[0145] ζ n,t Indicates user c n The state factor in round t is initially 0, updated to 1 after the training process starts, and updated to 0 after the training ends. Due to the introduction of the state factor, the global model can dynamically perceive changes in the user group, thereby facilitating the scale adjustment of global model updates.

[0146] In the present invention, unless otherwise clearly stipulated and limited, the terms "installation", "setting", "connection", "fixation", "rotation" and the like should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium; it can be the internal connection of two elements or the interaction relationship between two elements. Unless otherwise clearly defined, ordinary technicians in this field can understand the specific meanings of the above terms in the present invention according to the specific circumstances.

[0147] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to these embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the appended claims and their equivalents.

Claims

1. A fair federated learning asynchronous training method based on agnosticism, characterized by: The following steps are involved: S1. Build a federated learning system consisting of a central server and N users, each of which is within the communication range of the central server. Initialize the system and set the federated learning round t, where t = 1. S2. In the tth round, randomly select κ×N users to form the training set C train , where κ represents the proportion of users participating in training; the central server sends train All users in send the updated global model parameters θ after the t-1th round of training t-1 ; S3. User c n , n=1,2,…,κ×N receive global model parameters θ t-1 Perform local training and upload user model parameters θ to the central server n,t And the test accuracy acc n,t ; In step S3, user c n Receive global model parameters θ t-1 Perform local training and upload user model parameters θ to the central server n,t And the test accuracy acc n,t The specific process is: S31. User c n Based on the global model M(θ t-1 ) Calculate user c n The exact loss value l(D n ,M(θ t-1 )); where D n For user c n training dataset; S32. According to the accurate loss value l(D n ,M(θ t-1 ))Update correction coefficient α n , and adopt the updated α n Calculate user c n The estimated loss at round t S33. User c n Initialize the number of epochs of local training iterations, and then run the parameter calculation process and the local training process in parallel; S34. Determine whether epochs>epochs n,t , if satisfied, then user c n Send user model parameters and test accuracy to the central server; S4. When the central server collects the user model parameters and test accuracy of κ×N users, it updates the global model parameters and calculates the global accuracy S5. Determine whether the global accuracy is less than the target accuracy. If so, set t = t + 1 and return to step S2; if not, send the updated global model parameters θ to N users. t , complete the training.

2. The agnostic fair federated learning asynchronous training method according to claim 1, characterized in that: Loss estimate The calculation formula is: l t =λ0×(1+ρ) t Among them, λ t Indicates estimated loss Regarding the accurate loss value l(D n ,M(θ t-1 ))'s convergence coefficient, l(D n ,M(θ t-1 )) represents user c n The exact loss value of the t-1th round of training, α n Indicates estimated loss value Correction coefficient, Δl(D n ,M(θ t-1 )) represents user c n The loss value estimation error of the t-1th round of training, λ0 represents the convergence coefficient λ t The initial value of ρ represents the convergence coefficient λ t The convergence factor, μ α Indicates the correction coefficient α n The update step size, Indicates user c n The loss value of the t-1th round of training estimates the gradient of the error.

3. The agnostic fair federated learning asynchronous training method according to claim 1, characterized in that: The parameter calculation process includes: S301. User c n Upload the accurate loss value l(D n ,M(θ t-1 )) and loss estimates Wait for the central server to return the training set C train All users have a certain understanding of the current global model M(θ t )’s loss estimate set; S302. When user c n After receiving the loss estimate set, calculate user c n Fairness estimate at round t Based on fairness estimates Calculate updated user c n The local iteration factor epochs in the tth round n,t ; The local training process includes: S311. When epochs=0, user c n User model parameters θ n,t =θ t-1 ; S312. Training and updating user model parameters θ n,t , and calculate the current test accuracy acc n,t ; Set epochs = epochs + 1 and return to step S34 to determine whether epochs> epochs n,t If not satisfied, execute step S312.

4. The agnostic fair federated learning asynchronous training method according to claim 3, characterized in that: Step S302 User c n The calculation formula for the fairness estimate in round t is: in, Indicates user c n The fairness estimate in the tth round of training, L upp represents the maximum loss value, Indicates user c n Through the dataset D n In the tth round of training, about the global model M(θ t ) the estimated value of the losses incurred; It means that all users have passed the total dataset D in the tth round of training about the global model M(θ t ), the average loss estimate generated by Represents a hash table structure that stores the estimated loss of the user training dataset with respect to the global model in the current federated learning round.

5. The agnostic fair federated learning asynchronous training method according to claim 3, characterized in that: Step S302 calculates and updates the local iteration round factor epochs n,t The formula is: Among them, μ epochs Represents epochs n,t The update time factor, U1(a) represents the judgment function, which determines whether the user is a disadvantaged user or an advantaged user, and whether the local iteration round factor epochs needs to be adjusted n,t value.

6. The agnostic fair federated learning asynchronous training method according to claim 1, characterized in that: Step S4: The central server collects the user model parameters and test accuracy of κ×N users, updates the global model parameters and calculates the global accuracy. include: S41 receives and stores relevant data uploaded by the user; S42. When the central server collects the training set C train All users in the previous round of global model M(θ t-1 ), then the accurate loss value of the training set C train Each user returns the training set C train All users have a certain understanding of the current global model M(θ t ) loss estimation value set; then executing step S43; S43. When the central server collects the training set C train If the user model parameters of all users in the current round are obtained, step S44 is executed; S44. Update global model parameters and calculate global accuracy Then execute step S5.

7. The agnostic fair federated learning asynchronous training method according to claim 1, characterized in that: The asynchronous update expression of global model parameters in the agnostic fair federated learning asynchronous training method is: Dth n,t =θ n,t -θ n Where Δθ n,t Indicates user c n The difference between the local model parameters and the latest global model parameters obtained, θ n,t Indicates user c n The local model parameters uploaded in the tth round of training, θ n Indicates user c n The latest global model parameters obtained, w n,t For user c n The weight parameter of the tth round of training, μ w represents the update step size of the weight parameters, Indicates user c n The gradient of the accurate loss value of the t-1th round of training, U2(a) represents the judgment function, which determines whether the user is a disadvantaged user or an advantaged user, and whether the user c needs to be adjusted n The weight parameter w of the tth round of training n,t The value of Represents a hash table structure that stores the exact loss value of the global model trained with respect to the user's training dataset in the previous round of federated learning.

Citation Information

Patent Citations

  • Federal learning method and system

    CN114781545A

  • Wireless federated learning asynchronous training method based on optimization direction guidance

    CN115618963A