A hierarchical federated learning method for heterogeneous environments

By constructing a hierarchical federated learning framework in a cloud-edge-device scenario, introducing edge servers for initial updating and aggregation of model parameters, and using generative adversarial networks to generate virtual datasets, the performance problem of federated learning in heterogeneous environments is solved, achieving more efficient training accuracy and speed.

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

Patent Information

Application Number
CN202411644076.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-18
Publication Date
2025-10-28
Estimated Expiration
2044-11-18

AI Technical Summary

Technical Problem

In cloud-edge-device scenarios, the heterogeneity between clients and the limited communication and computing resources lead to a decline in the performance of traditional federated learning methods in heterogeneous environments, affecting the accuracy and training efficiency of the models.

Method used

A hierarchical federated learning framework is constructed, edge servers are introduced for initial updating and aggregation of model parameters, a virtual dataset is generated using generative adversarial networks, the hierarchical federated learning algorithm is optimized, and the theoretical convergence boundary is derived to improve training accuracy and speed.

Benefits of technology

The enhanced hierarchical federated learning method using edge servers reduces the communication resource consumption during model training, improves training accuracy and convergence speed, and adapts to the federated learning needs in heterogeneous environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119599143B_ABST
    Figure CN119599143B_ABST
Patent Text Reader

Abstract

This invention relates to a hierarchical federated learning method for heterogeneous environments, belonging to the field of artificial intelligence technology. The method includes: constructing a hierarchical federated learning framework in a cloud-edge-device scenario; constructing a hierarchical federated learning algorithm that can reduce model performance loss caused by heterogeneity between nodes; constructing a virtual dataset used in the edge server enhancement algorithm, and the data allocation method for the edge servers; and, under rigorous mathematical assumptions, theoretically deriving the boundary of the average global gradient bias to quantify the influence of cloud edge clustering intervals, the number of participating devices, and other important factors, and analyzing the theoretical convergence boundary of the hierarchical federated learning algorithm under the influence of heterogeneous environments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of artificial intelligence technology and relates to a hierarchical federated learning method for heterogeneous environments. Background Technology

[0002] The number of smart devices (such as mobile devices and IoT devices) is growing rapidly, with each device using its own computing, communication, and sensor resources to generate and collect data. This distributed data can be used to solve complex problems using machine learning (ML). Machine learning, an algorithm that analyzes large-scale datasets to obtain highly generalizable patterns, has far surpassed human performance in many fields and has become one of the main methods of big data analysis in recent years. Traditionally, devices send raw data to a central server, which trains an ML model based on the user device's raw data. After training, the central server sends the final model to the user device. However, because the central server can access each user's private information, this method is no longer suitable for sensitive information due to increasing concerns about privacy.

[0003] To address the aforementioned challenges and leverage the abundant user device data and their powerful computing resources, existing technologies have proposed 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 the 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 wheel (communication wheel) and are repeated multiple times until the desired accuracy is achieved. FL allows for the decoupling of data handling and computation at the central unit, enabling devices to collaboratively train ML models while ensuring their privacy.

[0005] Federated learning combines some characteristics of edge computing and machine learning, and has the following advantages compared to traditional distributed learning: 1) The computing clients have absolute control over the data; 2) The datasets of all participating clients do not follow a simple identically and independently distributed (IID) distribution, but rather a more complex non-identically and independently distributed (Non-IID) distribution. These advantages enable federated learning to be applied to more complex data network environments.

[0006] Data security and privacy are key drivers of federated learning. The algorithms inherent in federated learning ensure that data can only be accessed locally and not transmitted, further promoting research into combining federated learning with privacy and security technologies. Furthermore, in practical applications, federated learning may not simply follow the traditional central server-edge client set paradigm, but rather use a cloud-edge-device framework compatible with a large number of clients. This hierarchical federated learning employs a hierarchical aggregation system, breaking through the implicit constraints of traditional federated learning paradigms on the number of connected clients, enabling the cloud to handle large-scale client tasks simultaneously. The robustness of this system heavily relies on the collaboration of different federated learning components, such as an aggregator coordinating client transmission models and a server performing client scheduling and global computation.

[0007] While the idea of ​​deploying hierarchical federated learning to train ML models in a cloud-edge-device architecture holds considerable promise, its practical implementation faces several challenges: system heterogeneity and data heterogeneity among clients. System heterogeneity primarily manifests in the different data processing and transmission capabilities of clients, potentially leading to desynchronization between clients when the central server coordinates parameter transmission, thus affecting each round of aggregation. Data heterogeneity is mainly reflected in the amount and distribution of data on each client; the non-independent and identically distributed nature of the data severely impacts the accuracy of the global model. Furthermore, data in federated learning is scattered across clients, requiring the central server to communicate with them via wireless channels. This process is affected by uplink and downlink bandwidth, resource blocks, and client transmission power. Limited computing and communication resources significantly impact federated learning performance. Therefore, ensuring the successful deployment of a hierarchical federated learning method for heterogeneous environments under these challenges is crucial for completing various business operations across cloud-edge-device networks. Summary of the Invention

[0008] In view of this, the purpose of this invention is to provide a hierarchical federated learning method for heterogeneous environments. It addresses the need to deploy hierarchical federated learning services in cloud-edge-device scenarios by comprehensively considering the resource characteristics of cloud-edge-device scenarios, the heterogeneity between clients, and the feasibility of virtual datasets, thereby optimizing the model performance of the hierarchical federated learning algorithm.

[0009] To achieve the above objectives, the present invention provides the following technical solution:

[0010] A hierarchical federated learning method for heterogeneous environments, comprising:

[0011] 1. Construct a hierarchical federated learning framework for cloud-edge-device scenarios. The hierarchical federated learning framework includes a cloud server, multiple edge servers, and multiple edge clients. The cloud server is used to distribute the global model to each edge server and receive the models uploaded by each edge server, performing weighted aggregation to obtain a new round of global models. The edge servers distribute the received models to their respective edge clients and receive the locally updated local models uploaded by the edge clients, performing model aggregation operations before uploading them to the cloud server. The edge clients only transmit local model parameters to the edge servers, 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 the following steps: at the beginning of the t-th round of global update, the cloud server sends model parameters to each edge server; after receiving the model parameters, the j-th edge server performs an initial update on the model and then sends the model parameters to its subordinate edge clients; when the number of local training iterations of the edge clients reaches a first set value, the edge clients upload the model parameters to the edge servers, and the edge servers aggregate all received model parameters; when the number of aggregation iterations of the edge servers reaches a second set value, the edge servers upload the aggregated model parameters to the cloud server, and the cloud server performs global aggregation.

[0013] Once 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. Generative adversarial networks are used to synthesize virtual datasets and distribute them to various edge servers for initial update operations. Specifically, the edge servers use the virtual datasets to perform stochastic gradient descent on the current model parameters.

[0015] 4. Derive the boundary of the average global gradient bias, analyze the theoretical convergence boundary of the hierarchical federated learning algorithm in a heterogeneous environment, and obtain the corresponding system deployment guidelines based on the key parameters in the theoretical convergence boundary.

[0016] Furthermore, in part 1, at the edge client, the local model is solved using a solver as shown in the following equation:

[0017]

[0018] In the formula, Let represent the local model parameters on the i-th edge client after t rounds of global aggregation, t2 rounds of edge aggregation, and t1 rounds of local updates; η represent the learning rate used by the edge client during local updates; and B represent the batch number in the stochastic gradient descent method. This represents the gradient of the loss function for the parameter ω to be optimized. This 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.

[0019] Furthermore, in Part 2, the initial update of the model after the j-th edge server receives the model parameters includes updating the global model through a virtual dataset at the beginning of each round, thereby achieving rapid convergence of federated learning and reducing the communication resource consumption during model training.

[0020] The edge server performs the initial update using the following formula:

[0021]

[0022] In the formula, This represents the model parameters after the initial update of the j-th edge server. This represents the model parameters on the j-th edge server after t rounds of global aggregation and t2 rounds of edge aggregation. Both the initial update method for the edge server and the local update method for the client are 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, This represents the model parameters of the j-th edge server during the t-th round of global aggregation and the t2+1-th round of edge aggregation. M represents the local model on the i-th edge client after t rounds of global aggregation, t2 rounds of edge aggregation, and τ1 rounds of local training. j Let λ represent the set of edge clients connected to the j-th edge server. i This indicates that edge client i influences the weights of the global federated learning model, Σ. i∈u λ i =1,λ i≥0;

[0026] In the cloud server, the model parameters uploaded from the edge server are globally aggregated, and the update rules are as follows:

[0027]

[0028] In the formula, ω t+1 This represents the global model parameters at the (t+1)th round of full set aggregation on the cloud server, where N represents the set of edge clients under the jurisdiction of the edge server, and S represents the set of edge servers connected to the cloud server. This represents the model parameters on the j-th edge server after t rounds of global aggregation and τ2 rounds of edge aggregation.

[0029] Furthermore, in Part 3, when allocating virtual datasets to edge servers, the data heterogeneity among edge clients needs to be considered. That is, in the hierarchical federated learning architecture for heterogeneous environments, two non-independent and identically distributed levels should be 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, for a total of 10 types of labels.

[0032] Furthermore, in Part 4, the theoretical convergence boundary of the hierarchical federated learning algorithm in a heterogeneous environment is analyzed. The following assumptions are made first:

[0033] 1) Loss Function It satisfies L-smoothness, and the Lipschitz constant L > 0, that is: For all All of these conditions are met; 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, This represents the expected value of the gradient of the loss function over all ω, where ω represents the sample on the client side optimized using stochastic gradient descent.

[0035] 3) For each user i, the upper bound of the expected l2 norm of its local gradient during model updates satisfies: G is a constant;

[0036] 4) For any mini-batch ξ∈B uniformly and randomly sampled from B by user i, the resulting expected stochastic gradient is unbiased compared to the standard gradient, and the variance of the stochastic gradient has an upper bound satisfying: Where σ represents a constant;

[0037] Based on the above assumptions, the transformation definition of the global model is substituted into the L-smoothing function to obtain the difference between the model parameters after one round of global aggregation. Then, the summation of the global update rounds t from 0 to T-1 is obtained and rearranged to obtain the theoretical convergence boundary.

[0038] The beneficial effects of this invention are as follows: This invention addresses the performance issues of federated learning models in heterogeneous cloud-edge-device scenarios due to the heterogeneity between clients and the limited communication and computing resources. It provides a hierarchical federated learning method for heterogeneous environments. By introducing a virtual dataset on the edge server and constructing an edge-enhanced hierarchical federated learning method, the edge server initializes and updates the model parameters using the virtual dataset before distributing the model to the client. This improves the training accuracy of hierarchical federated learning while accelerating the convergence speed of the entire federated learning training process. Secondly, under general assumptions, the theoretical convergence boundary of the edge-enhanced method is derived theoretically, quantifying the impact of cloud-edge aggregation interval, the number of participating devices, and other important parameters. Using the obtained convergence boundary, appropriate parameter adjustments can ensure the system performance and convergence performance of hierarchical federated learning. The method provided by this invention can effectively improve the performance of hierarchical federated learning algorithms and has broad application prospects.

[0039] Other advantages, objectives, and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination, or may be learned from practice of the invention. The objectives and other advantages of the invention can be realized and obtained through the following description. Attached Figure Description

[0040] To make the objectives, technical solutions, and advantages of the present invention clearer, the preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings, wherein:

[0041] Figure 1 This is a flowchart illustrating the method described in this invention;

[0042] Figure 2 This is a schematic diagram of the hierarchical federated learning framework described in this invention. Detailed Implementation

[0043] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can be modified or changed 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 are only schematic representations of the basic concept of the present invention. Unless otherwise specified, the following embodiments and features can be combined with each other.

[0044] Please see Figure 1 An embodiment of the present invention provides a hierarchical federated learning method for heterogeneous environments, the method being as follows:

[0045] Step 1: Constructing a hierarchical federated learning framework for heterogeneous environments and a hierarchical federated learning algorithm to reduce model performance loss caused by heterogeneity among clients: Due to the increased model parameters and the cost of frequent communication, the convergence performance of traditional federated learning deployed in heterogeneous networks is easily affected. Furthermore, due to the heterogeneity among clients, simple aggregation methods may not guarantee model performance. Therefore, a hierarchical federated learning framework for heterogeneous environments was constructed.

[0046] Step 1.1: As Figure 2 As shown, the hierarchical federated learning framework in the cloud-edge-device scenario involves a cloud server, multiple edge servers, and multiple edge clients collaboratively training a global federated learning model. During this process, clients only transmit local model parameters to the edge servers; all clients do not communicate directly with each other. At the start of each training round, the cloud server distributes the global model to each edge server, which then distributes the model to each client under its jurisdiction. Each client then uses its local dataset to perform a local update process on the global model with a certain step size, resulting in different local models. After the clients participating in hierarchical federated learning send their local models to the edge servers, the edge servers perform corresponding model aggregation operations and then distribute the aggregated model to the clients. This process continues until the edge servers have aggregated a set number of times, at which point they upload the model to the cloud server. The cloud server performs weighted aggregation to obtain a new global model, and repeats the above steps until the model reaches the target accuracy or a preset training time.

[0047] Step 1.2: Define a hierarchical federated learning model in a cloud-edge-device scenario. The cloud server and base station possess transceiver and aggregation systems, respectively, acting as the central server and edge server. Let s = {1,2,...,j,...,S} represent the set of all edge servers connected to the cloud server, and within the base station's coverage area, there exists a set of nodes n = {1,2,...,i,...,N}, where the dataset collected at node i is... Furthermore, the solver used by node i to find the optimal solution for the local model is:

[0048]

[0049] in, Let represent the local model parameters on the i-th 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 client during local updates, and B represents the number of batches in the stochastic gradient descent method. This represents the gradient of the loss function for the parameter ω to be optimized. This 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.

[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-device scenario in S1, in order to improve the performance of the hierarchical federated learning model after training and meet the requirements for deployment in resource-constrained heterogeneous networks, an edge-enhanced hierarchical federated learning algorithm was designed.

[0051] Step 2.1: Introduce an edge-enhanced hierarchical federated learning algorithm, where the edge server accelerates model training at the beginning of each round by updating the global model initially. The model stored on the edge server is more biased towards the global model, and updating it with homogeneous data samples can achieve rapid convergence of federated learning, which helps reduce the communication resource consumption during model training. The data samples can be obtained through a generative adversarial network.

[0052] At the start of the t-th round of global updates, the cloud server will update the t-th round model parameters ω. t The model parameters are sent to the edge servers, and the j-th edge server receives them. Subsequently, the initial update plan for the edge server is as follows: in, The model parameters are updated after the initial setup for the j-th edge server.

[0053] Step 2.2: Based on the hierarchical federated learning method for edge enhancement proposed in Step 2, after the local training iterations reach a set value τ1, the client uploads the model parameters to the edge server. The edge server aggregates all received model parameters, and the update rule is as follows:

[0054]

[0055] Among them, M j Let represent the set of clients connected to the j-th edge server, and λ represent the weights of each client that influence the global federated learning model, satisfying ∑ i∈u λ i =1,λ i ≥0.

[0056] After the edge server performs aggregations τ² times, the aggregated model parameters are uploaded to the cloud server for global aggregation. The update rule is as follows:

[0057]

[0058] ω t+1 This represents the global model parameters after the (t+1)th round of global aggregation. This represents the model parameters after t rounds of global aggregation and τ² rounds of edge aggregation on the j-th edge server.

[0059] Once the model reaches the required accuracy or the hierarchical federated learning process has undergone T global updates, the hierarchical federated learning architecture with edge server-assisted training 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 generative adversarial network, and the data allocation method of the edge server is also constructed.

[0061] Step 3.1: In hierarchical federated learning, the collection and sharing of data from natural distributions poses a risk of privacy breaches, and training the model with arbitrary noisy or spam data will result in poor generalization performance. To address this issue, a virtual dataset is introduced to mitigate the adverse effects of noisy and spam data on model training.

[0062] Step 3.2: Use a Generative Adversarial Network (GAN) to synthesize a virtual dataset for the initial update operation of the edge server. The GAN consists of a discriminator and a generator. The generator is responsible for generating synthetic data from random noise and conditional information, while the discriminator is responsible for distinguishing the generated data from the real data. During training, the goals of the generator and discriminator are contradictory, specifically the discriminator's judgment accuracy. The discriminator and generator are trained simultaneously and compete against each other until a Nash equilibrium is reached. The entire training process follows the objective function V(G,D):

[0063]

[0064] Where 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 real data, and D(G(z)) represents the result of the discriminator's judgment on generated data. ω represents the parameters of the model used by the discriminator to distinguish between real and fake data, and θ represents the parameters of the model used by the generator to generate virtual data.

[0065] The optimization process consists of two steps: (1) Fix G and find D when the loss value is maximized, which is actually finding P. d (x) and P g (2) Fix D and minimize the result of the first step, which is to minimize the JS divergence and make the distributions closer. The maturity of generative adversarial networks is marked by the fact that both the generator G and the discriminator D have learned reasonable mapping functions, which enables generative adversarial networks to generate data with high semantic rationality and diversity, and are widely used in image generation and conversion tasks.

[0066] Step 3.3: In the hierarchical federated learning framework for cloud-edge-device scenarios, the allocation of datasets needs to closely resemble real-world scenarios. The virtual dataset generated in Step 3.2 needs to be randomly distributed across edge servers. Simultaneously, the data heterogeneity among clients needs to be considered. Specifically, in a hierarchical federated learning system oriented towards heterogeneous environments, two levels of non-independent identically distributed (IID) are considered: 1) Non-IID-1: Two classes of samples are assigned to each client, and the client is randomly assigned to each edge server. 2) Non-IID-2: Two classes of samples are randomly assigned to each client, and 10 clients are randomly assigned to each edge server, resulting in a total of 10 labeled classes.

[0067] Step 4: Theoretical Convergence Boundary of Edge-Enhanced Hierarchical Federated Learning: To quantitatively study the performance of the proposed hierarchical federated learning model, under reasonable assumptions common in other literature, the gradient expectation norm of the algorithm is derived, thereby clarifying which parameters will affect the deployment of hierarchical federated learning in a cloud-edge scenario. This includes the following steps:

[0068] Step 4.1: For the purpose of theoretical convergence analysis, the following assumptions are made:

[0069] Assumption 1: Loss Function It satisfies L-smoothness, and the Lipschitz constant L > 0, that is: For all Both conditions are met. Here, 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 over all ω, and ξ represents the sample on the client side optimized by stochastic gradient descent.

[0071] Assumption 3: For each user i, the upper bound of the expected l2 norm of its local gradient during model updates satisfies: G represents a constant.

[0072] Assumption 4: For any mini-batch ξ∈B uniformly randomly sampled by user i from B, the resulting expected stochastic gradient is unbiased compared to the standard gradient, and the variance of the stochastic gradient has an upper bound satisfying the following: σ represents a constant.

[0073] Assumption 1 requires that the local loss function is L-smooth, meaning the gradient is L-continuous. This assumption is crucial for convergence analysis of most gradient-based algorithms. Assumption 2 states that the gradient estimate of mini-batch SGD is unbiased. Assumptions 3 and 4 describe the bias and variance of stochastic gradients, which are common in the analysis of optimization methods in deep learning. For error convergence analysis of non-convex loss functions, the expected gradient norm is typically used as a convergence metric. Specifically, if... The algorithm achieves suboptimal performance for a given positive value ∈. When ∈ is arbitrarily small, the algorithm converges to a first-order stationary point.

[0074] Step 4.2: Derive the derivation based on the assumptions in Step 4.1 The theoretical convergence boundary. The represents the average of the squared norms of the gradient in each of the T iterations. In theoretical analysis, it is used to evaluate the convergence speed and stability of the stochastic gradient descent algorithm. If this value approaches zero as the number of iterations increases, it indicates that the algorithm is converging.

[0075] Specifically, based on the edge-enhanced hierarchical federated learning algorithm designed in step 2, the transformation definition of the global model is first derived as follows:

[0076]

[0077] Then, substituting the definition of global transformation into Assumption 1, we derive the formula for a round of global aggregation transformation as follows:

[0078]

[0079] The convergence boundaries of parts A1 to A5 are derived using mathematical methods, resulting in the following convergence boundary for a single round of global aggregation:

[0080]

[0081] Finally, summing and rearranging the values ​​of t from 0 to T-1, the expected gradient norm is proven to be:

[0082]

[0083]

[0084] in

[0085] Based on key parameters in the theoretical convergence boundary of edge-enhanced hierarchical federated learning, corresponding system deployment guidelines are derived. These parameters include 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 reduces communication resource consumption and narrows the convergence analysis boundary, ensuring the convergence performance of the proposed method. Second, analysis of the convergence results shows that increasing the number of clients and edge servers, as well as the batch size in stochastic gradient descent, can further reduce the convergence analysis boundary, thereby improving the algorithm's convergence performance.

[0086] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within 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: A hierarchical federated learning framework for cloud-edge-device scenarios is constructed. This framework includes a cloud server, multiple edge servers, and multiple edge clients. The cloud server distributes a global model to each edge server and receives models uploaded from each edge server, performing weighted aggregation to obtain a new global model. Each edge server distributes the received model to its assigned edge client and receives locally updated models uploaded by the edge clients, performing model aggregation before uploading them to the cloud server. Each edge client only transmits local model parameters to the edge server, and there is no direct communication between edge clients. Construct a hierarchical federated learning algorithm to reduce model performance loss; the hierarchical federated learning algorithm includes, in the first... When the global update begins, the cloud server distributes the model parameters to each edge server. After receiving the model parameters, each edge server performs an initial update to the model and then distributes the model parameters to its assigned edge clients. When the number of local training iterations on each edge client reaches a first preset value, the edge client uploads the model parameters to the edge server, which then aggregates all received model parameters. When the number of aggregation iterations on the edge server reaches a second preset value, the edge server uploads the aggregated model parameters to the cloud server for global aggregation. The aggregation and update rules for all received model parameters on the edge server are as follows: In the formula, Indicates the first The edge server in the first t Round global aggregation, the first Model parameters for edge aggregation, Indicates the first On an edge client Global aggregation of rounds, Wheel edge aggregation, The local model after secondary local training Indicates the first The set of edge clients connected to each edge server Represents edge client i Weights that influence the global model of federated learning ; 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, Indicates the first on the cloud server t +1 round of full set aggregation global model parameters N This represents the set of edge clients under the jurisdiction of the edge server. S This represents the set of edge servers connected to the cloud server. Indicates the first j Passing through the edge server t Global aggregation of rounds, Model parameters after secondary edge aggregation; Once 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 dataset is synthesized using a generative adversarial network and distributed to each edge server for initial update operations. The edge servers then use the virtual dataset to perform stochastic gradient descent on the current model parameters. The boundary of the average global gradient bias 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: The local model is solved by the solver shown in the following equation at the edge client: In the formula, Indicates the first On an edge client Global aggregation of rounds, Wheel edge aggregation, The local model parameters are updated locally. This indicates the learning rate used by the edge client when updating locally. This indicates the number of batches used in the stochastic gradient descent method. Indicates the parameters to be optimized The gradient of the loss function, Indicates the first On an edge client Global aggregation of rounds, Wheel edge aggregation, The locally updated sample.

3. The method according to claim 1, characterized in that: The first After receiving the model parameters, each edge server performs an initial update to the model, which includes updating the global model at the beginning of each round using stored data samples that are homogeneous with the global model, thereby achieving rapid convergence of federated learning and reducing the communication resource consumption during model training. The edge server performs an initial update using the following formula: In the formula, Indicates the first The model parameters are initially updated on each edge server. Indicates the first Passed by an edge server Global aggregation of rounds, Model parameters after wheel edge aggregation; Indicates the parameters to be optimized The gradient of the loss function, Indicates the first On an edge client Global aggregation of rounds, Wheel edge aggregation, The locally updated sample.

4. The method according to claim 1, characterized in that: When allocating virtual datasets to edge servers, the data heterogeneity among edge clients needs to be taken into account. That is, in a hierarchical federated learning architecture for heterogeneous environments, two levels of non-independent identical distribution should be considered for data allocation: 1) Non-IID-1: Assign two types of samples to each edge client and randomly assign the edge client 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, for a total of 10 types of labels.

5. 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, the following assumptions are first made: 1) Loss Function It satisfies L-smoothness and has the Lipschitz constant. ,Right now: For all All are satisfied; among them, Indicates the independent variable. Indicates the dependent variable; 2) For any fixed parameter stochastic gradient It is a parameter The corresponding unbiased estimate of the true gradient is: ;in, Indicates all Calculate the expected value of the gradient of the loss function. This represents samples optimized using stochastic gradient descent on edge clients; 3) For each user The expected local gradient during model update The upper bound of the norm satisfies: , G It is a constant; 4) For users from Any small batch of uniformly random sampling The resulting expected stochastic gradient is unbiased compared to the standard gradient, and the variance of the stochastic gradient has an upper bound satisfying the following: ;in, Represent it as a constant; Based on the above assumptions, substituting the transformation definition of the global model into the L-smoothing function yields the difference between model parameters after one round of global aggregation. Then, the number of rounds for global update is calculated. from arrive Summing and rearranging yields the theoretical convergence boundary.

Citation Information

Patent Citations

  • Asynchronous federated learning method, system, device and terminal for mobile vehicle

    CN114116198A

  • User-level Privacy Preservation for Federated Machine Learning

    US20230047092A1