A cross-device federated learning approach for min-max problems
By selecting only some clients to participate in each round in federated learning, and combining the stochastic gradient and momentum drop variance global gradient estimator to calculate the update direction, the limitations of all clients participating in the training throughout the training and the deviation of model parameter update direction in the existing federated learning algorithm are solved, and more efficient model parameter convergence is achieved.
Patent Information
- Application Number
- CN202111597238.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-24
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2041-12-24
AI Technical Summary
The existing federated learning algorithm for the minimum-maximization problem requires all clients to participate in the entire process of model training, resulting in limited scope of application, large deviations in the direction of update of client local model parameters, and high calculation cost and low efficiency.
A cross-device federated learning method is proposed. Only a part of the client is selected for each round of training, and the update direction of model parameters is calculated based on the stochastic gradient of the local objective function and the momentum-based global gradient estimator.
This method effectively solves the limitations of the scope of application of all clients participating in training throughout the process, reduces the deviation of the local model parameter update direction, and accelerates the convergence of model parameters at a smaller calculation cost.
Smart Images

Figure CN114330743B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of federated learning, and in particular to a cross-device federated learning method for minimum-maximum problems. Background Art
[0002] With the rapid growth of the number of mobile devices and the improvement of computing power and storage capacity, mobile devices generate and store a large amount of data. Using this data to train and predict machine learning models can effectively improve user experience. However, traditional machine learning methods require uploading user data to a data center for model training, which may lead to the leakage of user privacy. In order to solve this problem, federated learning was proposed. In federated learning, multiple clients jointly learn a machine learning model under the coordination of a central server, and during the learning process, the user's private data is always retained on the local client and will not be transmitted to the server or other clients.
[0003] Many important machine learning tasks (such as maximizing the area under the ROC curve, robust adversarial learning, training of generative adversarial networks, etc.) can be modeled as a minimum-maximum problem. Recently, some federated learning algorithms suitable for the minimum-maximum problem have been proposed. These methods require all clients to participate in the entire process of model training. Specifically, in each iteration of model parameter optimization, the central server transmits the current model parameters (i.e., the principal and dual variables of the minimum-maximum problem) to all clients. After receiving the model parameters, the client uses local data to perform multiple steps of local updates on the model parameters, and then sends the final model parameters to the central server. The central server then aggregates the model parameters of all clients (usually taking the average) to obtain the new model parameters and enters the next iteration. In the client local update step of the above process, the update strategies of the existing algorithms can be divided into three types: (i) using local stochastic gradients as the update direction, (ii) using local stochastic gradients and control variable techniques to calculate the update direction, and (iii) combining local stochastic gradients with true global gradients to calculate the update direction.
[0004] The existing federated learning algorithms for the minimum-maximum problem require all clients to participate in the entire process of model training, which has a large scope of application. In addition, the client local model parameter update direction of the existing algorithm has a large deviation, or requires a high computational cost to correct the update direction, so the efficiency of model training is low. Summary of the invention
[0005] In order to solve the above technical problems, the present invention proposes a cross-device federated learning method for the minimum-maximum problem. The specific scheme is as follows:
[0006] A cross-device federated learning method for a min-max problem includes the following steps:
[0007] Step 1: The central server initializes the main variable x in the model parameters -1 ∈X and the dual variable y -1 ∈y, and let x0=x -1 , y0=y -1 , and the number of iterations t = 0, where x and y represent the feasible domains of the primary and dual variables, respectively;
[0008] Step 2: The central server selects a subset of clients The model parameters {x t ,y t , x t-1 ,y t-1}Send to Each client in t ,y t Represents the primary and dual variables of t rounds of iterations;
[0009] Step 3, Each client in Compute the local gradient estimator And sent to the central server, at t = 0, the local gradient estimator is where f i and Represent the local objective function and its gradient of client i, α t is a hyperparameter in the interval [0, 1];
[0010] Step 4: The central server receives The local gradient estimator returned by each client in ;
[0011] Step 5: The central server calculates the global gradient estimator (u t , v t );
[0012] Step 6: The central server selects another subset of clients The model parameters (x t ,y t ) and the global gradient estimator (u t , v t )Send to Each client of
[0013] Step 7, Each client in Perform K-step local updates on the model parameters and use the final local model parameters Send to the central server;
[0014] Step 8: The central server receives The local model parameters returned by each client in;
[0015] Step 9: The central server calculates new global model parameters:
[0016]
[0017]
[0018] Where S represents the client subset The number of clients in the .
[0019] Step 10: The central server calculates t = t + 1; if t < T, repeat steps 2 to 10; otherwise, output the model parameters (x T ,y T ).
[0020] Furthermore, in the step 2, in order to prevent some clients in the client subset selected by the central server from failing to work properly, the central server may select a client subset of size cS. Where c>1 is a hyperparameter; in step 4, the central server receives After receiving the local gradient estimator returned by S clients in , stop receiving information from the remaining clients and Update to the set consisting of the S clients.
[0021] Furthermore, in step 6, in order to prevent some clients in the client subset selected by the central server from failing to work properly, the central server may select a client subset of size cS. Where c>1 is a hyperparameter; in step 8, the central server receives After receiving the local model parameters returned by S clients, stop receiving information from the remaining clients and Update to the set consisting of the S clients.
[0022] Compared with the prior art, the present invention has the following beneficial effects:
[0023] (1) The present invention adopts a technical means in which only some clients participate in each round of training. Therefore, compared with the means in the prior art, it solves the technical problem of requiring all clients to participate in the whole process of training, and is suitable for cross-device federated learning.
[0024] (2) In the client local model parameter update step, the present invention combines the stochastic gradient of the local objective function and the momentum-based reduced-variance global gradient estimator to calculate the update direction of the model parameters. Therefore, compared with the means in the prior art, the technical defects of large deviation in the update direction of the local model parameters or the need to calculate the true global gradient to correct the deviation are solved, and the technical effect of reducing the deviation in the update direction of the local model parameters and accelerating the convergence of the model parameters is achieved at a relatively low computational cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 It is a flowchart of a cross-device federated learning method for a minimum-maximum problem shown in an embodiment of the present invention. DETAILED DESCRIPTION
[0026] The present invention will be further described below in conjunction with the accompanying drawings.
[0027] In traditional federated learning algorithms, all clients need to participate in each iteration of model training, which requires a small number of clients, high reliability, and stable network connections. Therefore, it is only applicable to federated learning between institutions and data centers, not to federated learning across devices.
[0028] In addition, the two update strategies of using local stochastic gradient as the update direction and using local stochastic gradient and control variable technology to calculate the update direction usually have a large deviation, which can easily make the local model parameters biased towards the optimal solution of the local objective function rather than the optimal solution of the global objective function; and the update strategy that combines local stochastic gradient and true global gradient to calculate the update direction requires the calculation of global gradient (that is, the average of local gradients of all clients), so the computational cost is quite high.
[0029] In the cross-device federated learning method proposed in the present invention, only some clients participate in each round of training. In the client local model parameter update step, the stochastic gradient of the local objective function and the momentum-based reduced-variance global gradient estimator are combined to calculate the update direction of the model parameters. This method is suitable for cross-device federated learning between mobile devices whose clients include a huge number, low reliability and relatively slow network connections. It reduces the local model parameter update direction deviation at a lower computational cost and accelerates the convergence of the model parameters.
[0030] like Figure 1 As shown, the present invention provides a method for efficiently solving the minimum-maximum problem in a cross-device federated learning setting, that is, a cross-device federated learning method for the minimum-maximum problem, and the main steps are as follows:
[0031] Step 1: The central server initializes the main variable x in the model parameters -1 ∈X and the dual variable y -1∈y, and let x0=x -1 , y0=y -1 , and the number of iterations t = 0, where x and y represent the feasible regions of the primary and dual variables, respectively.
[0032] Step 2: The central server selects a client subset of size cS Where c>1 is a hyperparameter; the model parameter {x t ,y t , x t-1 ,y t-1}Send to At t = 0, i.e. the initial moment, only the model parameters {x0, y0} need to be sent to Each client in .
[0033] Step 3, Each client in Compute the local gradient estimator And sent to the central server, similarly, at t = 0, that is, the initial moment, the local gradient estimator is where f i and Represent the local objective function and its gradient of client i, α t is a hyperparameter in the interval [0, 1].
[0034] Step 4: After receiving the local gradient estimates returned by S clients, the central server stops receiving information from the remaining clients and Update to the set consisting of the S clients.
[0035] Step 5: The central server calculates the global gradient estimator (u t , v t ), the calculation method is:
[0036] If the iteration number t = 0, the central server calculates the mini-batch estimator of the global gradient:
[0037]
[0038] in and Respectively represent f i Partial derivatives with respect to the principal and dual variables;
[0039] If the number of iterations is 0<t≤T, the central server calculates the momentum-based reduced-variance global gradient estimator:
[0040]
[0041] Step 6: The central server selects another client subset of size cS Where c>1 is a hyperparameter; the model parameter (x t ,y t ) and the global gradient estimator (u t , v t )Send to Each client.
[0042] Step 7, Each client in Perform K-step local updates on the model parameters and use the final local model parameters Sent to the central server.
[0043] In this embodiment, step seven includes:
[0044] Step 7.1: Each client receives the model parameters (x t ,y t ) and the global gradient estimator (u t , v t ).
[0045] Step 7.2: Client Initialize local model parameters And assume that the number of local iterations k=0.
[0046] Step 7.3: Client Sample a subset of data from the local dataset The superscript k corresponds to the subset of data samples sampled at the kth iteration.
[0047] Step 7.4: Client Combine the global gradient estimator and the stochastic gradient of the local objective function to calculate the update direction of the primary and dual variables
[0048]
[0049] in, Represents client i for the data sample subset The value of the defined objective function at the point (x, y).
[0050] Step 7.5: Client Update local model parameters:
[0051]
[0052] Among them, χ and Π y Respectively represent the projection operation to the sets x and y, with a step length of ηt and γ t is a hyperparameter on the interval (0, +∞).
[0053] Step 7.6: Client Calculate k = k + 1. If k < K, start again from step 7.3; otherwise, set the local model parameters Sent to the central server.
[0054] Step 8: After receiving the local model parameters returned by S clients, the central server stops receiving information from the remaining clients and sends Update to the set consisting of the S clients.
[0055] Step 9: The central server calculates new global model parameters:
[0056]
[0057]
[0058] Step 10: The central server calculates t = t + 1. If t < T, start again from step 2; otherwise, output the model parameters (x T ,y T ).
[0059] The above examples are only specific embodiments of the present invention. Obviously, the present invention is not limited to the above examples, and many variations are possible. All variations that can be directly derived or associated with the contents disclosed by a person skilled in the art should be considered as the protection scope of the present invention.
Claims
1. A cross-device federated learning method for the min-max problem, characterized in that: The following steps are involved: Step 1: The central server initializes the main variables in the model parameters and dual variables And let x0 = x -1 ,y0=y -1 , and the number of iterations t = 0, where and denote the feasible domains of the primary and dual variables respectively; Step 2: The central server selects a subset of clients The model parameters {x r ,y t ,x r-1 ,y t-1 }Send to Each client in t ,y t Represents the primary and dual variables of t rounds of iterations; Step 3, Each client in Compute the local gradient estimator And sent to the central server, at t = 0, the local gradient estimator is where f i and Represent the local objective function and its gradient of client i, α t is a hyperparameter in the interval [0,1]; Step 4: The central server receives The local gradient estimator returned by each client in ; Step 5: The central server calculates the global gradient estimator (u t ,v t ); The step five is specifically as follows: If the iteration number t = 0, the central server calculates the mini-batch estimator of the global gradient: in, and Respectively represent f i Partial derivatives with respect to the principal and dual variables; If the number of iterations is 0<t≤T, the central server calculates the momentum-based reduced-variance global gradient estimator: Wherein, T represents the preset total number of iterations; Step 6: The central server selects another subset of clients The model parameters (x t ,y t ) and the global gradient estimator (u t ,v t )Send to Each client of Step 7, Each client in Perform K-step local updates on the model parameters and use the final local model parameters Send to the central server; Step 8: The central server receives The local model parameters returned by each client in; Step 9: The central server calculates new global model parameters: Where S represents the client subset The number of clients in Step Ten, the central server calculates t = t + 1; if t < T, repeat Step Two to Step Ten; otherwise, output the model parameters (x T , y T ).
2. A cross-device federated learning method for a minimum-maximum problem according to claim 1, characterized in that: The step seven comprises: Step 7.1: Each client receives the model parameters (x t ,y t ) and the global gradient estimator (u t ,v t ); Step 7.2: Client Initialize local model parameters And set the number of local iterations k = 0; Step 7.3: Client Sample a subset of data from the local dataset The superscript k corresponds to the data sample subset sampled in the kth iteration; Step 7.4: Client The update directions of the primary and dual variables are calculated by combining the global gradient estimator and the stochastic gradient of the local objective function: in, Represents client i for the data sample subset The objective function is defined at the point The value at Represents client i for the data sample subset The objective function is defined at the point (x t ,y t ) at the value; Step 7.5: Client Update local model parameters: in, and Respectively represent the projection to the set and The projection operation with a step size of η t and γ t It is a hyperparameter on the interval (0, +∞); Step 7.6: The client Calculate k = k + 1; if k < K, repeat Steps 7.3 to 7.6; otherwise, send the local model parameters to the central server.
3. A cross-device federated learning method for a minimum-maximum problem according to claim 1, characterized in that: In step 2, at t = 0, i.e. the initial moment, only the model parameters {x0, y0} need to be sent to Each client in .
4. A cross-device federated learning method for a minimum-maximum problem according to claim 1, characterized in that: In the step 2, in order to prevent some clients in the client subset selected by the central server from failing to work properly, the central server selects a client subset of size cS. Where c>1 is a hyperparameter; in step 4, the central server receives After receiving the local gradient estimator returned by S clients in , stop receiving information from the remaining clients and Update to the set consisting of the S clients.
5. A cross-device federated learning method for a minimum-maximum problem according to claim 1, characterized in that: In step 6, in order to prevent some clients in the client subset selected by the central server from failing to work properly, the central server selects a client subset of size cS. Where c>1 is a hyperparameter; in step 8, the central server receives After receiving the local model parameters returned by S clients, stop receiving information from the remaining clients and Update to the set consisting of the S clients.
Citation Information
Patent Citations
Image training method and system based on distributed learning, medium and intelligent equipment
CN110956202A
Method, system and device for updating model parameters based on federated learning
CN112288100A