Hierarchical federal learning method oriented to heterogeneous environment
By introducing virtual data sets and edge-enhanced hierarchical federated learning algorithms in cloud edge-end scenarios, the problem of degradation in federated learning models in heterogeneous environments is solved, and efficient model training and rapid convergence are achieved.
Patent Information
- Application Number
- CN202411644076.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2044-11-18
AI Technical Summary
In cloud-edge end scenarios, heterogeneity between clients and limited communication computing resources lead to a degradation in federated learning model performance, making it difficult to efficiently train ML models in heterogeneous environments.
The hierarchical federated learning method for heterogeneous environments is adopted, and the model is initialized and updated by introducing virtual data sets on the edge server side, and an edge-enhanced hierarchical federated learning algorithm is built to reduce the communication resource consumption of model training, improve training accuracy and convergence speed.
It effectively improves the model performance of the hierarchical federated learning algorithm, reduces the model performance loss in heterogeneous environments, and realizes a training process of rapid convergence in resource-limited environments.
Smart Images

Figure CN119599143A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of artificial intelligence and relates to a hierarchical federated learning method for heterogeneous environments. Background Art
[0002] The number of smart devices, such as mobile devices and IoT devices, is growing rapidly, each of which generates and collects data using its own computing, communication, and sensor resources. This distributed data can be used to solve complex problems using machine learning (ML). Machine learning, an algorithm that analyzes large-scale data sets to obtain highly generalizable rules, has been applied in many fields far better than humans and has become one of the main methods for big data analysis in recent years. Traditionally, devices send raw data to a central server, which trains an ML model based on the raw data from the user's device. After training is completed, the central server sends the final model to the user's device. However, since the central server has access to each user's private information, this approach is no longer suitable for sensitive information as people are increasingly concerned about privacy issues.
[0003] To address the above challenges and leverage the rich user device data and their powerful computing resources, the prior art proposes a distributed machine learning approach called Federated Learning (FL). In this approach, the FL system optimizes the global ML model by repeating the following process: 1) Each user device performs local computation on its data to minimize the global model sent by the FL central server. They then upload their local model updates to the FL coordinator for aggregation; 2) The FL central server aggregates the local models received from the user devices and computes an improved global model; 3) The central server sends the updated global model to the user devices, which use this new global model as a reference.
[0004] These steps create a global round (communication round) and are repeated for multiple communication rounds until the desired accuracy is achieved. FL allows the decoupling of data accusation and computation at the central unit and enables devices to collaboratively train ML models while ensuring their privacy.
[0005] Federated learning combines some features of edge computing and machine learning, and has the following advantages over traditional distributed learning: 1) The computing client has absolute control over the data; 2) The data sets of all participating clients are not subject to simple independent and identical distribution (Identically and independently distributed, IID), but to more complex non-independent and identical distribution (Not identically and independently distributed, Non-IID). These advantages enable federated learning to be applied in more complex data network environments.
[0006] Data security and privacy are one of the driving forces of federated learning. The algorithm of federated learning itself ensures that data can only be accessed locally and cannot be transmitted, which further promotes the research on combining federated learning with privacy and security technologies. In addition, in actual application, federated learning may not simply follow the traditional paradigm of central server-edge client set, but use a cloud-edge-end framework that is compatible with large-scale clients. This hierarchical federated learning adopts a hierarchical aggregation system, which can break through the invisible constraints of the traditional federated learning paradigm on the number of connected clients, allowing the cloud to have the ability to handle large-scale client tasks simultaneously. The robustness of this system is extremely dependent on the collaboration of different federated learning components, such as the aggregator that coordinates the client transmission model and the server that performs client scheduling and global calculations.
[0007] Although the idea of deploying hierarchical federated learning to train ML models in a cloud-edge-device architecture is quite promising, it faces the following challenges in actual implementation: system heterogeneity and data heterogeneity between clients. System heterogeneity is mainly reflected in the different capabilities of clients to process and transmit data, which may cause the central server in federated learning to be out of sync with clients when coordinating the transmission parameters of multiple clients, thereby affecting each round of aggregation. Data heterogeneity is mainly reflected in the amount of data and data distribution on the client side. The characteristics of non-independent and identically distributed data seriously affect the accuracy of the global model; the data in federated learning is scattered on the client side, and the central server needs to communicate with the client through a wireless channel. This process is affected by the bandwidth and resource blocks of the uplink and downlink, and the transmission power of the client. Limited computing and communication resources have a serious impact on the performance of federated learning. Therefore, how to ensure the deployment of a hierarchical federated learning method for heterogeneous environments under the above challenges is the key to ensuring the completion of various business fields in the cloud-edge-device network. Summary of the invention
[0008] In view of this, the purpose of the present invention is to provide a hierarchical federated learning method for heterogeneous environments. Aiming at the needs of deploying hierarchical federated learning services in cloud-edge-end scenarios, the resource characteristics of cloud-edge-end scenarios, the heterogeneity between clients and the feasibility of virtual data sets are comprehensively considered to optimize the model performance of the hierarchical federated learning algorithm.
[0009] In order to achieve the above object, the present invention provides the following technical solutions:
[0010] A hierarchical federated learning method for heterogeneous environments, the method comprising:
[0011] 1. Construct a hierarchical federated learning framework in a cloud-edge scenario, which includes a cloud server, multiple edge servers, and multiple edge clients; the cloud server is used to send a global model to each edge server, and receive models uploaded by each edge server, and perform weighted aggregation to obtain a new round of global models; the edge server sends the received model to the edge clients under its jurisdiction, and receives the local model uploaded by the edge client after local update, and uploads it to the cloud server after model aggregation operation; the edge client only transmits local model parameters to the edge server, and the edge clients do not communicate directly with each other;
[0012] 2. Construct a hierarchical federated learning algorithm to reduce model performance loss; the hierarchical federated learning algorithm includes: at the beginning of the tth round of global update, the cloud server sends the model parameters to each edge server, the jth edge server performs an initial update on the model after receiving the model parameters, and then sends the model parameters to the edge clients under its jurisdiction; when the number of local training times of the edge client reaches a first set value, the edge client uploads the model parameters to the edge server, and the edge server aggregates all received model parameters; when the number of aggregation times of the edge server reaches a second set value, the edge server uploads the aggregated model parameters to the cloud server, and the cloud server performs global aggregation;
[0013] When the model reaches the required accuracy or the hierarchical federated learning performs a preset number of global updates, the hierarchical federated learning architecture with edge server assisted training stops training;
[0014] 3. Use the generative adversarial network to synthesize a virtual data set and distribute it to each edge server for the initial update operation of the edge server; specifically, the edge server uses the virtual data set to perform a stochastic gradient descent algorithm on the current model parameters;
[0015] 4. Derive the boundary of the average global gradient deviation, analyze the theoretical convergence boundary of the hierarchical federated learning algorithm in a heterogeneous environment, and obtain the corresponding system deployment guide based on the key parameters in the theoretical convergence boundary.
[0016] Further, in part 1, at the edge client, the local model is solved by the solver shown in the following formula:
[0017]
[0018] In the formula, It means that after t rounds of global aggregation and t 2 Wheel edge aggregation, t 1 The local model parameters after the local update, η represents the learning rate used by the edge client during local update, B represents the number of batches in the stochastic gradient descent method, represents the gradient of the loss function of the parameter ω to be optimized, It means that after t rounds of global aggregation and t 2 Wheel edge aggregation, t 1 Samples after local update.
[0019] Furthermore, in part 2, the initial update of the model by the j-th edge server after receiving the model parameters includes that the edge server updates the global model through a virtual data set at the beginning of each round to achieve rapid convergence of federated learning and reduce communication resource consumption of model training.
[0020] The edge server is initially updated as follows:
[0021]
[0022] In the formula, represents the model parameters after the initial update of the jth edge server, It means that after t rounds of global aggregation, t 2 The model parameters after round edge aggregation. Among them, the initial update method of the edge server and the local update method of the client are both stochastic gradient descent algorithms.
[0023] Furthermore, in part 2, the edge server aggregates all received model parameters, and the update rule is as follows:
[0024]
[0025] In the formula, Indicates that the jth edge server is globally aggregated in the tth round and the tth 2 +1 round of edge aggregation model parameters, It means that after t rounds of global aggregation and t 2 Wheel edge aggregation, τ 1 The local model after local training, M jrepresents the set of edge clients connected to the jth edge server, λ i represents the weight of edge client i influencing the global model of federated learning, Σ i∈u λ i =1,λ i ≥0;
[0026] In the cloud server, the model parameters uploaded by the edge server are globally aggregated, and the update rules are as follows:
[0027]
[0028] In the formula, ω t+1 represents the global model parameters of the cloud server during the t+1th round of full set aggregation, N represents the set of edge clients under the edge server, S represents the set of edge servers connected to the cloud server, It means that after t rounds of global aggregation, τ 2 Model parameters after sub-edge aggregation.
[0029] Furthermore, in part 3, when allocating virtual data sets to edge servers, it is necessary to consider the data heterogeneity between edge clients, that is, in the hierarchical federated learning architecture for heterogeneous environments, two non-IID levels are considered for data allocation:
[0030] 1) Non-IID-1: assign two types of samples to each edge client and randomly assign the edge client to each edge server;
[0031] 2) Non-IID-2: Each edge client is randomly assigned two types of samples, and each edge server is randomly assigned 10 edge clients, with a total of 10 types of labels.
[0032] Furthermore, in Section 4, we analyze the theoretical convergence bounds of the hierarchical federated learning algorithm in a heterogeneous environment. First, we make the following assumptions:
[0033] 1) Loss Function Satisfies L-smoothness, and the Lipschitz constant L>0, that is: For all All satisfy; where x represents the independent variable and y represents the dependent variable;
[0034] 2) For any fixed parameter ω, the stochastic gradient It is an unbiased estimate of the true gradient corresponding to the parameter ω, that is: in, represents the expected value of the gradient of the loss function for all ω, where ω represents the sample optimized by stochastic gradient on the client;
[0035] 3) For each user i, the upper bound of the expected l2 norm of its local gradient during model update satisfies: G is a constant;
[0036] 4) For any mini-batch ξ∈B uniformly randomly sampled by user i from B, the expected stochastic gradient obtained is unbiased from the standard gradient, and the variance of the stochastic gradient has an upper bound satisfying: Among them, σ represents a constant;
[0037] Based on the above assumptions, the transformation definition of the global model is substituted into the L-smooth function to obtain the gap between the model parameters after a round of global aggregation. Then, the global update rounds t from 0 to T-1 are summed and rearranged to obtain the theoretical convergence boundary.
[0038] The beneficial effects of the present invention are as follows: the present invention reduces the performance problem of the federated learning model in view of the heterogeneity between clients and the limited communication computing resources in the heterogeneous cloud-edge scenario, provides a hierarchical federated learning method for heterogeneous environments, introduces a virtual data set on the edge server side, and constructs an edge-enhanced hierarchical federated learning method, that is, before sending the model to the client, the edge server initializes and updates the model parameters by using the virtual data set, while improving the training accuracy of the hierarchical federated learning, the convergence speed of the entire federated learning training process is accelerated; secondly, under general assumptions, the theoretical convergence boundary of the edge-enhanced method is theoretically derived, and the influence of the cloud-edge aggregation interval, the number of participating devices and other important parameters is quantified. Using the obtained convergence boundary, appropriate parameter adjustment can ensure the system performance and convergence performance of the hierarchical federated learning. The method provided by the present invention can effectively improve the performance of the hierarchical federated learning algorithm model and has broad application prospects.
[0039] Other advantages, objectives and features of the present invention will be described in the following description to some extent, and to some extent, will be obvious to those skilled in the art based on the following examination and study, or can be taught from the practice of the present invention. The objectives and other advantages of the present invention can be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be described in detail below in conjunction with the accompanying drawings, wherein:
[0041] Figure 1 The process of the method of the present invention is schematically shown;
[0042] Figure 2 This is a schematic diagram of the hierarchical federated learning framework described in the present invention. DETAILED DESCRIPTION
[0043] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments only illustrate the basic concept of the present invention in a schematic manner, and the following embodiments and features in the embodiments can be combined with each other without conflict.
[0044] See also Figure 1 An embodiment of the present invention provides a hierarchical federated learning method for a heterogeneous environment, and the method is specifically as follows:
[0045] Step 1: Construct a hierarchical federated learning framework for heterogeneous environments and a hierarchical federated learning algorithm that can reduce the model performance loss caused by heterogeneity between clients: Due to the impact of increased model parameters and the cost of frequent communication, the convergence performance of traditional federated learning deployed in heterogeneous networks is easily affected. At the same time, due to the heterogeneity between clients, the performance of the model may not be guaranteed by a simple aggregation method. Therefore, a hierarchical federated learning framework for heterogeneous environments is constructed.
[0046] Step 1.1: Figure 2 As shown in the figure, the hierarchical federated learning framework in the cloud-edge scenario is a global federated learning model trained collaboratively by a cloud server, multiple edge servers and multiple edge clients; in this process, the client only transmits local model parameters to the edge server, and all clients do not communicate directly; at the beginning of each round of training, the cloud server sends the global model to each edge server, and the edge server then sends the model to each client under the edge server, and then each client uses the local data set to perform a local update process of a certain step length on the global model to obtain a different local model; after the client participating in hierarchical federated learning sends the local model to the edge server, the edge server performs the corresponding model aggregation operation, and then sends the aggregated model to the client until the edge server aggregation times reaches the set threshold and uploads the model to the cloud server; the cloud server performs weighted aggregation to obtain a new round of global model, and repeats the above steps until the model reaches the target accuracy or the preset training time.
[0047] Step 1.2: Define hierarchical federated learning in the cloud-edge scenario. The cloud server and base station have a transceiver system and an aggregation system, which can act as the central server and edge server. S = {1, 2, ..., j, ..., S} represents the set of all edge servers connected to the cloud server, and there is a node set n = {1, 2, ..., i, ..., N} within the coverage of the base station, where the data set collected on node i is And the solver used by node i to solve the optimal solution of the local model is:
[0048]
[0049] in, It means that after t rounds of global aggregation on the i-th client, t 2 Wheel edge aggregation, t 1 The local model parameters after the round of local update, η represents the learning rate used by the client during local update, and B represents the number of batches in the stochastic gradient descent method. represents the gradient of the loss function of the parameter ω to be optimized, It means that after t rounds of global aggregation and t 2 Wheel edge aggregation, t 1 Samples after local update.
[0050] Step 2: Construction of an edge-enhanced hierarchical federated learning algorithm: Based on the analysis of hierarchical federated learning and constraints in the cloud-edge scenario in S1, an edge-enhanced hierarchical federated learning algorithm is designed to improve the performance of the hierarchical federated learning model after training and to meet the deployment requirements in heterogeneous networks with limited resources.
[0051] Step 2.1: Introduce an edge-enhanced hierarchical federated learning algorithm, that is, the edge server accelerates model training by initially updating the global model at the beginning of each round. The model stored in the edge server is more biased towards the global model. Updating it with homogeneous data samples can achieve rapid convergence of federated learning and help reduce the communication resource consumption of model training. Among them, data samples can be obtained through generative adversarial networks.
[0052] At the beginning of the tth round of global update, the cloud server sets the tth round model parameter ω t Send it to the edge server, and the jth edge server receives the model parameters After that, the initial update plan for the edge server is: in, Model parameters after initial update for the jth edge server.
[0053] Step 2.2: According to the edge-enhanced hierarchical federated learning method proposed in step 2, when the number of local training times reaches the set value τ 1 After that, the client uploads the model parameters to the edge server, and the edge server aggregates all received model parameters. The update rule is:
[0054]
[0055] Among them, M j represents the set of clients connected to the jth edge server, λ represents the weight of each client affecting the global model of federated learning, and satisfies ∑ i∈u λ i =1,λ i ≥0.
[0056] The number of edge server aggregations reaches the set value τ 2 After that, the aggregated model parameters are uploaded to the cloud server, which performs global aggregation. The update rule is:
[0057]
[0058] ω t+1 represents the global model parameters after the t+1th round of global aggregation, Indicates that the jth edge server has undergone t rounds of global aggregation, τ 2 Model parameters after sub-edge aggregation.
[0059] When the model reaches the required accuracy or the entire hierarchical federated learning is globally updated T times, the hierarchical federated learning architecture assisted by edge servers stops training.
[0060] Step 3: In order to implement the edge-enhanced hierarchical federated learning algorithm proposed in step 2, a virtual dataset used in the edge server enhancement algorithm is constructed by generating an adversarial network, and a data distribution method for the edge server is constructed.
[0061] Step 3.1: In hierarchical federated learning, the operation of collecting and sharing data from natural distribution will expose it to the risk of privacy leakage, and if the model is trained with arbitrary noise or junk data, the model will have poor generalization performance. To address this problem, a virtual dataset is introduced to solve the adverse effects of noise and junk data on model training.
[0062] Step 3.2: Use a generative adversarial network to synthesize a virtual dataset for the initial update operation of the edge server. The generative adversarial network consists of a discriminator and a generator, where the generator is responsible for generating synthetic data from random noise and conditional information, while the discriminator is responsible for distinguishing the data generated by the generator from the real data. During the training process, the goals of the generator and the discriminator are contradictory, which is specifically reflected in the judgment accuracy of the discriminator. The discriminator and the generator are trained simultaneously and compete with each other until a Nash equilibrium is reached. The entire training process follows the objective function V(G,D):
[0063]
[0064] Among them, x represents real data, z represents noise or random number input, G(z) represents the data generated by the generator based on z, D(x) represents the result of the discriminator's judgment on the real data, and D(G(z)) represents the result of the discriminator's judgment on the generated data. ω represents the parameters of the model used by the discriminator to distinguish true and false data, and θ represents the parameters of the model used by the generator to generate virtual data.
[0065] The optimization process is divided into two steps: (1) Fix G and find D when the loss value is the largest, which is actually finding P d (x) and P g (x) The JS divergence between them is used to find the measure of the distribution difference. (2) Fix D and minimize the result of the first step, which is to minimize the JS divergence and make the distribution close. The sign of the maturity of the generative adversarial network is that both the generator G and the discriminator D have learned reasonable mapping functions, which enables the generative adversarial network to generate data with high semantic rationality and diversity, and is widely used in image generation and conversion tasks.
[0066] Step 3.3: In the hierarchical federated learning framework in the cloud-edge scenario, the distribution of the data set needs to be close to the real scenario. The virtual data set generated in step 3.2 needs to be randomly distributed in the edge server. At the same time, it is necessary to take into account the data heterogeneity between clients, that is, in the hierarchical federated learning system for heterogeneous environments, two levels of non-independent and identically distributed are considered: 1) Non-IID-1: two types of samples are assigned to each client, and the clients are randomly assigned to each edge server. 2) Non-IID-2: two types of samples are randomly assigned to each client, and each edge server is randomly assigned 10 clients, with a total of 10 types of labels.
[0067] Step 4: Theoretical convergence boundary of edge-enhanced hierarchical federated learning: In order to quantitatively study the performance of the proposed hierarchical federated learning model, the expected norm of the gradient of the algorithm is derived under reasonable assumptions commonly found in other literature, so as to clarify which parameters will affect the deployment of hierarchical federated learning in a cloud-edge scenario. The specific steps include:
[0068] Step 4.1: For the purpose of theoretical convergence analysis, make the following assumptions:
[0069] Assumption 1: Loss Function It satisfies L-smoothness, and the Lipschitz constant L>0, that is: For all All are satisfied. Among them, x represents the independent variable and y represents the dependent variable.
[0070] Assumption 2: For any fixed parameter ω, the stochastic gradient It is an unbiased estimate of the true gradient corresponding to the parameter ω, that is: in, represents the expected value of the gradient of the loss function for all ω, and ξ represents the sample optimized by stochastic gradient on the client.
[0071] Assumption 3: For each user i, the upper bound of the expected l2 norm of its local gradient during model update satisfies: G represents a constant.
[0072] Assumption 4: For any mini-batch ξ∈B sampled uniformly randomly by user i from B, the expected stochastic gradient obtained is unbiased from the standard gradient, and the variance of the stochastic gradient has an upper bound satisfying: σ represents a constant.
[0073] Assumption 1 requires that the local loss function is L-smooth, which means that the gradient is L-continuous. This assumption is crucial for the convergence analysis of most gradient-based algorithms. Assumption 2 states that the gradient estimate of mini-batch SGD is unbiased. Assumptions 3 and 4 are descriptions of the bias and variance of stochastic gradients, which are common in the analysis of related optimization methods for deep learning. For the error convergence analysis of non-convex loss functions, the expected gradient norm is usually used as an indicator of convergence. Specifically, if Then the algorithm achieves suboptimality for a given positive value of ∈. When ∈ is arbitrarily small, the algorithm converges to a first-order stationary point.
[0074] Step 4.2: Derive based on the assumptions of step 4.1 The theoretical convergence boundary of . The meaning of is the average value of the square of the norm of the gradient in each iteration in T iterations. It is used in theoretical analysis to evaluate the convergence speed and stability of the stochastic gradient descent algorithm. If this value tends to zero as the number of iterations increases, it means that the algorithm is converging.
[0075] Specifically, firstly, according to the edge-enhanced hierarchical federated learning algorithm designed in step 2, the transformation definition of the global model is derived as follows:
[0076]
[0077] Then substitute the global transformation definition into hypothesis 1 and derive the formula for a round of global aggregation transformation:
[0078]
[0079] According to mathematical methods, the convergence boundaries of parts A1 to A5 are derived respectively, and the convergence boundary of a round of global aggregation is obtained as follows:
[0080]
[0081] Finally, summing and rearranging t from 0 to T-1, the expected gradient norm result is proved to be:
[0082]
[0083]
[0084] in
[0085] The corresponding system deployment guide is obtained based on the key parameters in the theoretical convergence boundary of edge-enhanced hierarchical federated learning, including cloud aggregation interval, mini-batch size, learning rate, and the number of edge servers and clients. First, appropriately increasing the cloud aggregation interval in the system can reduce the consumption of communication resources and reduce the boundary of convergence analysis, thereby ensuring the convergence performance of the proposed method. Secondly, through the analysis of the convergence results, increasing the number of clients and edge servers and the batch size of stochastic gradient descent can reduce the boundary of convergence analysis, thereby improving the convergence performance of the algorithm.
[0086] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution, which should be included in the scope of the claims of the present invention.
Claims
1. A hierarchical federated learning method for heterogeneous environments, characterized in that: The method includes: Construct a hierarchical federated learning framework in a cloud-edge scenario, the hierarchical federated learning framework comprising a cloud server, multiple edge servers and multiple edge clients; the cloud server is used to send a global model to each edge server, and receive models uploaded by each edge server, and perform weighted aggregation to obtain a new round of global models; the edge server sends the received model to the edge clients under its jurisdiction, and receives the local model uploaded by the edge client after local update, and uploads it to the cloud server after performing model aggregation operation; the edge client only transmits local model parameters to the edge server, and the edge clients do not communicate directly with each other; Construct a hierarchical federated learning algorithm to reduce model performance loss; the hierarchical federated learning algorithm includes: at the beginning of the tth round of global update, the cloud server sends the model parameters to each edge server, the jth edge server performs an initial update on the model after receiving the model parameters, and then sends the model parameters to the edge clients under its jurisdiction; when the number of local training times of the edge client reaches a first set value, the edge client uploads the model parameters to the edge server, and the edge server aggregates all received model parameters; when the number of aggregation times of the edge server reaches a second set value, the edge server uploads the aggregated model parameters to the cloud server, and the cloud server performs global aggregation; When the model reaches the required accuracy or the hierarchical federated learning performs a preset number of global updates, the hierarchical federated learning architecture with edge server assisted training stops training; A virtual data set is synthesized using a generative adversarial network and distributed to each edge server for an initial update operation of the edge server; wherein the edge server uses the virtual data set to perform a stochastic gradient descent algorithm on the current model parameters; The boundary of the average global gradient deviation is derived, the theoretical convergence boundary of the hierarchical federated learning algorithm in a heterogeneous environment is analyzed, and the corresponding system deployment guidelines are obtained based on the key parameters in the theoretical convergence boundary.
2. The method according to claim 1, characterized in that: On the edge client, the local model is solved by the solver shown in the following formula: In the formula, represents the local model parameters on the ith edge client after t rounds of global aggregation, t2 rounds of edge aggregation, and t1 rounds of local updates. η represents the learning rate used by the edge client during local updates. B represents the number of batches in the stochastic gradient descent method. represents the gradient of the loss function of the parameter ω to be optimized, It represents the sample on the i-th edge client after t rounds of global aggregation, t2 rounds of edge aggregation, and t1 rounds of local update.
3. The method according to claim 1, characterized in that: The j-th edge server performs an initial update on the model after receiving the model parameters, including, at the beginning of each round, the edge server updates the global model through stored data samples that are homogeneous with the global model, so as to achieve rapid convergence of federated learning and reduce communication resource consumption of model training; The edge server is initially updated by: In the formula, represents the model parameters after the initial update of the jth edge server, represents the model parameters after t rounds of global aggregation and t2 rounds of edge aggregation on the jth edge server; represents the gradient of the loss function of the parameter ω to be optimized, It represents the sample on the i-th edge client after t rounds of global aggregation, t2 rounds of edge aggregation, and t1 rounds of local update.
4. The method according to claim 1, characterized in that: In the edge server, all received model parameters are aggregated, and the update rule is as follows: In the formula, represents the model parameters of the jth edge server in the tth round of global aggregation and the t2+1th round of edge aggregation, M represents the local model on the ith edge client after t rounds of global aggregation, t2 rounds of edge aggregation, and τ1 rounds of local training. j represents the set of edge clients connected to the jth edge server, λ i represents the weight of edge client i influencing the global model of federated learning, ∑ i∈u λ i =1,λ i ≥0; In the cloud server, the model parameters uploaded by the edge server are globally aggregated, and the update rule is as follows: In the formula, ω t+1 represents the global model parameters of the cloud server during the t+1th round of full set aggregation, N represents the set of edge clients under the edge server, S represents the set of edge servers connected to the cloud server, represents the model parameters on the j-th edge server after t rounds of global aggregation and τ2 rounds of edge aggregation.
5. The method according to claim 1, characterized in that: When allocating virtual datasets to edge servers, it is necessary to take into account the data heterogeneity between edge clients. That is, in the hierarchical federated learning architecture for heterogeneous environments, two non-IID levels are considered for data allocation: 1) Non-IID-1: two types of samples are assigned to each edge client, and the edge clients are randomly assigned to each edge server; 2) Non-IID-2: Each edge client is randomly assigned two types of samples, and each edge server is randomly assigned 10 edge clients, with a total of 10 types of labels.
6. The method according to claim 1, characterized in that: To analyze the theoretical convergence boundary of the hierarchical federated learning algorithm in a heterogeneous environment, we first make the following assumptions: 1) Loss Function Satisfies L-smoothness, and the Lipschitz constant L>0, that is: For all All satisfy; where x represents the independent variable and y represents the dependent variable; 2) For any fixed parameter ω, the stochastic gradient It is an unbiased estimate of the true gradient corresponding to the parameter ω, that is: in, represents the expected value of the gradient of the loss function for all ω, and ξ represents the sample optimized by stochastic gradient on the edge client; 3) For each user i, the upper bound of the expected l2 norm of its local gradient during model update satisfies: G is a constant; 4) For any mini-batch ξ∈B uniformly randomly sampled by user i from B, the expected stochastic gradient obtained is unbiased from the standard gradient, and the variance of the stochastic gradient has an upper bound satisfying: Among them, σ represents a constant; Based on the above assumptions, the transformation definition of the global model is substituted into the L-smooth function to obtain the gap between the model parameters after a round of global aggregation. Then, the global update rounds t from 0 to T-1 are summed and rearranged to obtain the theoretical convergence boundary.
Citation Information
Patent Citations
Asynchronous federated learning method, system, device and terminal for mobile vehicle
CN114116198A
Cloud edge network communication optimization method and system based on distributed federated learning
CN115277689A
User-level Privacy Preservation for Federated Machine Learning
US20230047092A1
Method and apparatus for detecting ami network intrusion, and medium
WO2023159812A1