Federal learning local sharpness optimization method and system based on approximate global disturbance
The federated learning local sharpness optimization method that approximates global perturbation solves the global sharpness optimization problem caused by data heterogeneity in federated learning, improves model generalization performance and saves computational overhead, and is suitable for a variety of application scenarios.
Patent Information
- Application Number
- CN202410669693.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-28
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2044-05-28
AI Technical Summary
When existing federated learning technology faces the problem of data heterogeneity, it is difficult to achieve global sharpness optimization locally, resulting in overfitting and sharp loss surfaces during model training, which limits its generalization capabilities and application scenarios.
The federated learning local sharpness optimization method based on approximate global perturbation is adopted. The approximate global perturbation is calculated by obtaining the global model and the last global model, and the local model parameters are updated based on the preset local learning rate to achieve local sharpness optimization of the global perturbation.
It effectively optimizes global sharpness, improves model generalization performance, reduces computing overhead, improves convergence speed and reduces communication costs. It is suitable for a variety of federated learning scenarios, such as Internet of Vehicles systems.
Smart Images

Figure CN118607661A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of federated learning, and in particular to a method and system for optimizing local sharpness of federated learning based on approximate global perturbation. Background Art
[0002] In today's big data era, protecting the privacy and security of user data is becoming increasingly important. Whether it is data captured by sensors, data stored in mobile phones, or medical records in hospitals, they are all rich in privacy elements. Compared with the centralized training of traditional deep learning methods, the federated learning framework does not require data to be aggregated to a central server, which can effectively alleviate the problem of privacy leakage during data transmission, storage and training. It ensures that end-user data will not be leaked, which is safer and more reliable than the traditional training paradigm. Under the federated learning framework, a central server is connected to multiple user nodes. User nodes train models on their own data, while the central server is only responsible for transmitting and aggregating models locally. Finally, the aggregated model on the central server converges and trains on the data of each terminal to form a globally converged model.
[0003] Due to the differences in data distribution between different terminals, there are large differences in the models trained by different nodes, which often causes the global model to fall into a local optimal solution and is accompanied by the problem of sharp loss surface. Research at home and abroad on alleviating the sharp surface problem of federated learning in heterogeneous situations is in the early stages. Most of the existing solutions focus on optimizing the sharpness of local nodes and introduce additional computational overhead, such as introducing a sharpness-aware minimization optimizer at the local node and combining a dynamic regularizer with a sharpness-aware minimization optimizer. These methods either only optimize local sharpness or introduce a large amount of additional computational overhead, which has great limitations.
[0004] In summary, the existing model training technology based on federated learning will face the problem of overfitting when dealing with data heterogeneity, and the loss surface during convergence is often sharp and uneven, which limits the generalization ability of federated learning and its application in actual scenarios. Summary of the invention
[0005] The purpose of the present invention is to overcome the defects of the above-mentioned prior art and to provide a local sharpness optimization method and system for federated learning based on approximate global perturbation, so as to solve or partially solve the problem that it is difficult to achieve global sharpness optimization locally due to the data heterogeneity of federated learning.
[0006] The purpose of the present invention can be achieved by the following technical solutions:
[0007] In one aspect of the present invention, a method for optimizing local sharpness of federated learning based on approximate global perturbation is provided, which is applied to a local node in federated learning. The optimization method comprises the following steps:
[0008] Obtain a global model, and calculate an approximated global perturbation based on the obtained global model and the global model obtained last time;
[0009] Calculating a local loss based on a preset local model and the approximated global perturbation;
[0010] Based on the local loss and a preset local learning rate, the parameters of the local model are updated to achieve local sharpness optimization taking into account global disturbances.
[0011] As a preferred technical solution, the approximated global disturbance is calculated using the following formula:
[0012]
[0013] Among them, δ is the global perturbation, w t is the global model received in round t, is the global model received by the i-th local node last time, and ρ is the preset disturbance amplitude.
[0014] As a preferred technical solution, the parameter update of the local model is implemented using the following formula:
[0015]
[0016] in, are the parameters of the kth and k+1th rounds of the global model received in the tth round and trained at the i-th local node, δ is the global disturbance, η l is the local learning rate, is the local loss gradient operator of the i-th local node.
[0017] As a preferred technical solution, the optimization goal of the local sharpness optimization taking into account the global disturbance is:
[0018]
[0019] Among them, F represents the global loss function, and the local batch training data is ζ i , the i-th local node obeys ζ i ~p i data distribution, w represents the global model parameters, E is the expectation, δ is the local loss, and ρ is the preset disturbance amplitude.
[0020] As a preferred technical solution, the global perturbation before approximation is calculated using the following formula:
[0021]
[0022] Among them, δ is the global disturbance, ρ is the preset disturbance amplitude, is the gradient operator, ζ is the global batch training data, F represents the global loss function, and w represents the global parameter model.
[0023] Another aspect of the present invention provides a vehicle networking system for local sharpness optimization based on federated learning of approximate global perturbations, comprising:
[0024] The server is deployed with a global model, which is used to receive the parameters of the local models of each vehicle and update the global model through aggregation;
[0025] Multiple vehicle terminals are deployed with local nodes in federated learning, which are used to adopt the aforementioned federated learning local sharpness optimization method based on approximate global perturbation to update the local model.
[0026] As a preferred technical solution, the local model is used to output the vehicle's action decision based on the input radar point cloud data and / or image information.
[0027] As a preferred technical solution, it also includes:
[0028] The roadside unit is used to realize data exchange between the service end and the vehicle end.
[0029] Another aspect of the present invention provides an electronic device, comprising: one or more processors and a memory, wherein the memory stores one or more programs, and the one or more programs include instructions for executing the aforementioned federated learning local sharpness optimization method based on approximate global perturbation.
[0030] According to another aspect of the present invention, a computer-readable storage medium is provided, comprising one or more programs for execution by one or more processors of an electronic device, wherein the one or more programs include instructions for executing the aforementioned local sharpness optimization method based on approximate global perturbation based federated learning.
[0031] Compared with the prior art, the present invention has at least the following beneficial effects:
[0032] (1) Implementing local sharpness optimization of federated learning based on approximate global perturbations: Some methods only optimize local sharpness, do not consider the inconsistency of the loss surface in the global optimization goal, and do not consider the data heterogeneity characteristics of federated learning. During the parameter update process of local nodes, the present invention can effectively optimize the global sharpness and improve the generalization performance of the model by estimating the global perturbation.
[0033] (2) Low computational overhead: By approximately estimating the global perturbation, there is no need to calculate the gradient additionally, thus saving computational overhead.
[0034] (3) Fast convergence speed and low communication cost: To achieve the same accuracy, compared with other similar federated learning algorithms, fewer iterations are required and the total amount of communication is lower.
[0035] (3) Wide application scenarios: This method can be applied in scenarios related to federated learning, such as the Internet of Vehicles system. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 It is a flowchart of a local sharpness optimization method of federated learning based on approximate global perturbation in an embodiment;
[0037] Figure 2 A schematic diagram of a vehicle networking system in an embodiment;
[0038] Figure 3 Schematic diagram of the estimation principle of the global disturbance in the embodiment. DETAILED DESCRIPTION
[0039] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are 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 creative work should fall within the scope of protection of the present invention.
[0040] Example 1
[0041] The disadvantage of some sharpness optimization schemes is that they only optimize local sharpness, do not consider the inconsistency of the loss surface in the global optimization goal, and regard local sharpness and global sharpness as consistent. The algorithm designed under this assumption cannot achieve global flatness in principle in the data heterogeneous federation scenario, making it difficult for federated learning to effectively optimize global sharpness in the case of data heterogeneity.
[0042] To address this problem, this embodiment provides a method for optimizing the local sharpness of federated learning based on approximate global perturbations. The method is improved based on the federated learning system, and the entire federated learning system is roughly divided into two parts: the model training part of the local node and the global aggregation part of the server. This embodiment optimizes the generalization ability of the global model by focusing on the sharpness perception of the model training part of the local node.
[0043] This embodiment designs an efficient disturbance estimation algorithm to optimize global sharpness and reduce additional computational overhead. With parameter model w, set global loss function F and local loss function F i Assume that the global distribution is p and the i-th node obeys ζ i ~p i The data distribution satisfies E i [pi ] = P. There are N nodes in total, each gradient perturbation is δ, and the local batch training data is ζ i , E is the expectation, and the optimization goal of global sharpness perception can be written as:
[0044]
[0045] This optimization process maximizes the sharpness of the loss surface of the neighborhood internally and minimizes the loss function externally, which can achieve the effect of optimizing the loss function and the sharpness around the loss function curve at the same time. Definition is the gradient operator, the global batch training data ζ, and the predefined amplitude ρ. Without considering the communication constraints in the local training process, the global perturbation is calculated in the optimization of global sharpness perception as follows:
[0046]
[0047] Due to the unavailability of global batch training data and the inconsistency of local models, the global perturbation cannot be directly calculated. This embodiment provides an approximate calculation method. Figure 3 , using the global update direction obtained in the previous iteration To replace the global model to the optimal solution w * Update direction
[0048] Define w t is the global model received in round t, is the global model received by node i last time. The global perturbation can be approximately calculated as:
[0049]
[0050] Based on the above derivation, see Figure 1 , the local sharpness optimization method includes the following steps:
[0051] S1, for local node i, obtain the global model w t , based on the global model obtained and the global model obtained last time Calculate the approximated global perturbation δ;
[0052] S2, based on a pre-built local model and the approximated global perturbation δ, calculating the local loss;
[0053] S3, based on the local loss and the preset local learning rate η l , update the parameters of the local model to achieve local sharpness optimization taking into account the global disturbance.
[0054] Specifically, the global disturbance is approximately calculated as follows:
[0055]
[0056] Among them, w t is the global model received in round t, is the global model received by node i last time, and ρ is the disturbance amplitude. After obtaining the global disturbance, the local update can be simplified as:
[0057]
[0058] in The global model trained for round k at the ith node is received in round t, η l is the local learning rate, is the local loss gradient operator of the i-th node, and ρ is the perturbation amplitude.
[0059] This method optimizes global sharpness by estimating global perturbations in the scenario of heterogeneous data, while saving computational overhead and improving the generalization performance of the model.
[0060] This method does not require additional calculation of gradients and approximates global perturbations. While saving computational overhead, it can effectively optimize global sharpness and improve the generalization performance of the model by estimating global perturbations. This method has a wide range of applications and can improve the global generalization performance of federated learning in heterogeneous scenarios. It is simple to deploy and low-cost, with almost no additional computational overhead on the server and terminal levels, and has a theoretical guarantee of global convergence.
[0061] After testing on four benchmark data in the field of federated learning and comparing with many federated learning algorithms, the most advanced performance has been achieved. In some field generalization problems, the accuracy can be improved by about 3% compared with the latest method and by about 7% compared with the benchmark algorithm. The latest algorithm benchmark algorithm has much less computational overhead than other sharpness perception optimization federated algorithms. Compared with the same category of algorithms, the computational time overhead can be reduced by more than half while achieving the same accuracy.
[0062] Example 2
[0063] Based on Example 1, this embodiment provides a vehicle networking system, and applies a local sharpness optimization method of federated learning based on approximate global perturbation to the vehicle networking system.
[0064] See also Figure 2 , the Internet of Vehicles system mainly includes:
[0065] The server is usually deployed in the cloud or on an edge computing device, on which a global model is deployed to receive the parameters of the local model of each vehicle and update the global model through aggregation.
[0066] Roadside unit is used to realize data exchange between the service end and each vehicle end.
[0067] There are multiple vehicle terminals, each of which serves as a local node and maintains a local model. The local model uses the local sharpness optimization method of federated learning based on approximate global perturbation in Example 1 to achieve parameter update.
[0068] The local model can be used to implement a variety of applications in the Internet of Vehicles, such as driving decisions, throttle control, brake control, etc. Taking driving decisions as an example, the vehicle is equipped with hardware devices such as radar and cameras. The local model outputs the vehicle's action decisions based on the input radar point cloud data and / or image information.
[0069] It should be noted that the above is only a typical application of the present invention. In the absence of conflict, the present method can be applied to other practical scenarios based on federated learning.
[0070] The vehicle networking system in this embodiment is based on federated learning. For the situation where the loss surface is sharp during convergence in data heterogeneous scenarios, a unified and efficient federated training framework is provided. The variance reduction algorithm and the dynamic regularizer are combined to locally optimize the global sharpness. When the global sharpness is optimized locally, the global disturbance is estimated according to the global update, which improves the smoothness of the loss surface and the generalization ability of the federated learning algorithm, thereby improving the usability of the federated learning algorithm in practical application scenarios.
[0071] Example 3
[0072] The present embodiment provides an electronic device, characterized in that it includes: one or more processors and a memory, wherein the memory stores one or more programs, and the one or more programs include instructions for executing the local sharpness optimization method based on federated learning based on approximate global perturbation as described in Example 1.
[0073] Example 4
[0074] This embodiment provides a computer-readable storage medium, including one or more programs for execution by one or more processors of an electronic device, wherein the one or more programs include instructions for executing the local sharpness optimization method of federated learning based on approximate global perturbation as described in Example 1.
[0075] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A method for optimizing local sharpness of federated learning based on approximate global perturbation, characterized in that: Applied to the local node in federated learning, the optimization method comprises the following steps: Obtain a global model, and calculate an approximated global perturbation based on the obtained global model and the global model obtained last time; Calculating a local loss based on a preset local model and the approximated global perturbation; Based on the local loss and a preset local learning rate, the parameters of the local model are updated to achieve local sharpness optimization taking into account global disturbances.
2. The method for optimizing local sharpness of federated learning based on approximate global perturbation according to claim 1, characterized in that: The approximated global perturbation is calculated using the following formula: Among them, δ is the global perturbation, w t is the global model received in round t, is the global model received by the i-th local node last time, and ρ is the preset disturbance amplitude.
3. The method for optimizing local sharpness of federated learning based on approximate global perturbation according to claim 1, characterized in that: The parameter update of the local model is implemented by the following formula: in, are the parameters of the kth and k+1th rounds of the global model received in the tth round and trained at the i-th local node, δ is the global disturbance, η l is the local learning rate, is the local loss gradient operator of the i-th local node.
4. The method for optimizing local sharpness of federated learning based on approximate global perturbation according to claim 1, characterized in that: The optimization goal of the local sharpness optimization taking into account the global disturbance is: Among them, F represents the global loss function, and the local batch training data is ζ i , the i-th local node obeys ζ i ~p i data distribution, w represents the global model parameters, E is the expectation, δ is the local loss, and ρ is the preset disturbance amplitude.
5. The method for optimizing local sharpness of federated learning based on approximate global perturbation according to claim 1, characterized in that: The global perturbation before approximation is calculated as follows: Among them, δ is the global disturbance, ρ is the preset disturbance amplitude, is the gradient operator, ζ is the global batch training data, F represents the global loss function, and w represents the global parameter model.
6. A vehicle networking system with local sharpness optimization based on federated learning of approximate global perturbations, characterized in that: include: The server is deployed with a global model, which is used to receive the parameters of the local models of each vehicle and update the global model through aggregation; Multiple vehicle terminals are deployed with local nodes in federated learning, which are used to update the local model by adopting the federated learning local sharpness optimization method based on approximate global perturbation as described in any one of claims 1-5.
7. The vehicle networking system based on approximate global perturbation federated learning local sharpness optimization according to claim 6, characterized in that: The local model is used to output the vehicle's action decision based on the input radar point cloud data and / or image information.
8. The vehicle networking system with local sharpness optimization based on federated learning of approximate global perturbation according to claim 6, characterized in that: Also includes: The roadside unit is used to realize data exchange between the service end and the vehicle end.
9. An electronic device, characterized in that: include: One or more processors and a memory, wherein the memory stores one or more programs, wherein the one or more programs include instructions for executing the local sharpness optimization method of federated learning based on approximate global perturbation as described in any one of claims 1-8.
10. A computer-readable storage medium, characterized in that: It includes one or more programs for execution by one or more processors of an electronic device, and the one or more programs include instructions for executing the local sharpness optimization method based on federated learning of approximate global perturbations as described in any one of claims 1-8.
Citation Information
Patent Citations
Differential privacy joint training method of medical diagnosis model for resisting inference attack
CN114357526A
Non-IID federated learning model backdoor robustness evaluation method based on generative adversarial network
CN116187432A
Federal learning method and system
CN116861239A
Federal learning method and system based on gradient correction and meta learning, and storage medium
CN117422149A
Efficient communication federal learning method based on adaptive differential privacy
CN117574416A
