Asynchronous hierarchical federated learning method and system for resisting data isomerism
By building an asynchronous hierarchical federated learning framework in the Internet of Things network, optimizing the hierarchical federated learning algorithm, and using virtual data sets and client selection methods, the problems of data heterogeneity, system heterogeneity and unexpected fall behind are solved, and efficient federated learning model performance is achieved.
Patent Information
- Application Number
- CN202411644082.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2025-03-11
AI Technical Summary
In the Internet of Things network, due to problems such as data heterogeneity, system heterogeneity and unexpected fall behind, the performance of federated learning models has deteriorated, making it difficult to achieve efficient stratified federated learning in network environments with limited resources and unreliable resources.
A asynchronous hierarchical federated learning method that resists data heterogeneity is proposed. By constructing an asynchronous hierarchical federated learning framework, hierarchical federated learning algorithm is optimized, virtual data sets are used to mitigate data heterogeneity, and a client selection method based on learning utility and delay is designed.
It effectively improves the model performance of the hierarchical federated learning algorithm, reduces communication overhead, enhances the stability and efficiency of the system, and can achieve efficient federated learning in the Internet of Things network.
Smart Images

Figure CN119599144A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of artificial intelligence technology and relates to an asynchronous hierarchical federated learning method and system for resisting data heterogeneity. Background Art
[0002] Embedding intelligence into ubiquitous IoT devices can perform more complex tasks, thus benefiting a wide range of applications, including personal healthcare, smart cities, and self-driving cars. To achieve distributed learning in large-scale networks, federated learning has emerged as a promising paradigm. The learning process starts with a central server distributing a global model to selected devices. Each device then performs gradient descent training on its local dataset and sends the updated model back to the server. Finally, the central server aggregates the received models to obtain a new global model. Edge devices only share the updated model. Therefore, federated learning collaboratively learns distributed devices while protecting user privacy. The basic aggregation method in federated learning is federated averaging, which adopts synchronous global aggregation - the central server performs aggregation after the slowest device returns, so it cannot accept long delays or obstacles from stragglers. Although semi-asynchronous federated learning alleviates this problem by aggregating updates that arrive within a certain period of time and asynchronously processing late model updates, semi-asynchronous schemes still have the problem of untimely updates and have difficult-to-adjust waiting periods on heterogeneous and unreliable networks.
[0003] For real-world IoT networks, the diversity of the entire system hinders efficient and powerful federated learning deployment, and a large number of real deployment schemes are based on a layered approach. All of these architectures can be simplified into a three-layer structure of cloud servers, edge servers, and edge clients, such as Figure 1 As shown in Figure 1. The cloud layer provides powerful servers with abundant resources and effective processing capabilities. The edge server layer includes base stations and routers, acting as an intermediate layer connecting the cloud and edge clients. The underlying edge clients refer to small mobile systems such as sensors, smartphones, and drones, which are usually constrained by limited resources and energy.
[0004] There are significant advantages in deploying hierarchical federated learning in the IoT environment. In terms of data privacy and security, it allows data to be processed on local devices or edge nodes, reducing the risk of data leakage and facilitating integration with encryption and anonymization technologies. In terms of model training efficiency, this method can reduce communication overhead and make full use of edge computing resources. From the perspective of model performance and adaptability, hierarchical federated learning can integrate the characteristics of multi-source heterogeneous data and respond quickly to local environmental changes. In addition, hierarchical federated learning is compatible with the distributed characteristics of the IoT, can support large-scale distributed training, and has good scalability, which can easily cope with the increase of IoT devices.
[0005] Although the idea of deploying hierarchical federated learning to train ML models in the IoT is quite promising, it faces the following challenges when it comes to actual implementation: The distribution of local data on edge devices varies greatly due to environmental changes or user specific situations. If customized local training and model aggregation strategies are not designed, non-independent and identically distributed data have been shown to slow down or prevent federated learning convergence; edge devices are equipped with a variety of different CPU chips, and there are also differences in internal memory storage and communication technologies. Therefore, the computational latency of each layer and the communication latency between the two layers can be very different. Applying synchronous and semi-asynchronous federated learning requires longer waiting times. Accidental dropouts are common in every layer of the IoT network due to energy shortages, circuit shorts, or wireless interference. If not carefully managed, the learning process may be delayed or completely terminated due to dropouts; data in federated learning is scattered on the client, and the central server needs to communicate with the client through a wireless channel, which is affected by the bandwidth of the uplink and downlink, resource blocks, 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 an asynchronous hierarchical federated learning method that can resist data heterogeneity under the above challenges is the key to ensuring the completion of various business areas in the IoT network. Summary of the invention
[0006] In view of this, the purpose of the present invention is to provide an asynchronous hierarchical federated learning method and system that can resist data heterogeneity. The method and system target the needs of deploying hierarchical federated learning services in an Internet of Things network, comprehensively consider the resource characteristics in the Internet of Things scenario, the heterogeneity between clients, and the feasibility of virtual data sets, and optimize the model performance of the hierarchical federated learning algorithm.
[0007] In order to achieve the above object, the present invention provides the following technical solutions:
[0008] An asynchronous hierarchical federated learning method that resists data heterogeneity includes the following steps:
[0009] S1: Building a hierarchical federated learning framework in IoT;
[0010] S2: Build asynchronous hierarchical federated learning algorithms in the Internet of Things that can resist data heterogeneity, system heterogeneity, and accidental dropouts, as well as communication and computing models in unreliable communication networks;
[0011] S3: Construct a virtual homogeneous learning method to resist client drift in federated learning;
[0012] S4: Considering the data distribution, heterogeneous delays and unexpected dropouts among different clients, we construct a learning utility quantification data distribution and a client selection method based on learning utility and delay.
[0013] Further, step S1 specifically includes the following steps:
[0014] S11: The hierarchical federated learning architecture in the Internet of Things is composed of cloud servers, edge servers, and clients, such as Figure 1 As shown. The cloud layer provides powerful cloud servers with abundant resources and effective processing capabilities. The edge server includes base stations and routers, acting as an intermediate layer connecting the cloud and edge devices. The underlying edge devices refer to small mobile systems such as sensors, smartphones, and drones, which are usually subject to limited resources and energy; the learning process starts from the cloud server and distributes the global model to the selected edge servers. The edge server then sends the model to the selected client devices, and then each device performs gradient descent training on its local data set and sends the updated model back to the edge server. The edge server aggregates the received model parameters and continues to send them to the selected clients for local training until the preset number of aggregations is reached and the model is uploaded to the cloud server. Finally, the cloud server aggregates the received models to obtain a new global model. Edge devices do not share local data sets, but only share updated models;
[0015] S12: In the hierarchical federated learning defined in the Internet of Things, the cloud server and the edge server have a transceiver system and an aggregation system. The set of all edge servers connected to the cloud server is represented by s:={1,2,...,j,...,S}, and there is a set of nodes n:={1,2,...,i,...,N} within the coverage of the base station, where the data set collected on node i is The typical goal of FL is to learn a unified model, deployed on all distributed devices, and satisfy the empirical risk minimization problem (ERM) on all devices as follows:
[0016]
[0017] Among them, F N (ω) represents the global loss function on the cloud server, F i (ω) represents the loss function on the i-th client, Representative model ω usage data The loss function for training.
[0018] Further, in step S2, it specifically includes:
[0019] S21: All edge servers have feasible paths to connect to the cloud servers, but a client may have multiple paths to multiple edge servers simultaneously. Reachability may be limited due to a variety of reasons such as range limitations of wireless technology, sensor device failures, or network backbones. All of the above factors are combined into a symbol to represent connectivity, where t represents the wall clock time of each round of the global model:
[0020]
[0021] The edge server triggers local training on the client, and the client needs to upload the returned model to the same edge server. But the client can switch to another edge server after aggregation. Define the decision variables for real-time client-edge server connection:
[0022]
[0023] S22: Computation and communication delays play a major role as system heterogeneity and are calculated using a general model. This paper focuses on the communication delay between the client and the edge server, because the bandwidth on this link is more limited and the client has lower transmission power. During the run, the round delay is measured, which is the time to complete an edge aggregation round between the edge server and the client. It consists of three parts:
[0024] (1) Downlink delay of the transmission model from edge server j to client i;
[0025] (2) The computational delay incurred by client i during local training;
[0026] (3) Uplink latency for transmitting updates to the model in the opposite direction.
[0027] Since edge servers and cloud servers usually have more computing resources, the computational delay of edge servers and cloud servers for aggregation is ignored. The round delay can be expressed as:
[0028]
[0029] S23: Bandwidth limitation is an upper limit on throughput or data rate. Unlike synchronous design, the throughput in asynchronous mode cannot be accurately simulated. Therefore, given a round delay of τ ij The FL model size is M, and the average data rate on the link from edge server j to client i is estimated as:
[0030] R ij =M / τ ij
[0031] Then the total data rate of all selected clients on edge server j is calculated as:
[0032]
[0033] S24: In asynchronous hierarchical federated learning, each edge server downloads the latest global model from the cloud server, and each client downloads the latest edge model from the edge server. After the client completes local training, it uploads the local model to the edge server, and the edge server immediately performs edge aggregation. When the edge server aggregation times reach a preset number, it uploads the model to the cloud server, and the cloud server immediately performs global aggregation. Cloud servers and edge servers perform stale-aware weight aggregation:
[0034] α t ←α·s(t-τ)
[0035] ω t ←(1-α t )ω t-1 +α t ω new
[0036] where ω new are the newly received model parameters, t is the current global round, and α t It is the staleness-aware weight calculated by multiplying the staleness function s(t-τ) by a constant α. Staleness-awareness refers to the difference in the number of global rounds since the last global update. For example, t is the current global aggregation round, and τ is the global round when the model was downloaded. Intuitively, a larger staleness-aware weight means that the model is too different from the current global model, so it should be given less attention. The staleness function s(t-τ) determines the exponential decay factor in the model aggregation process, which is calculated using a polynomial staleness function, as follows:
[0037] s q (t-τ) = (t-τ + 1) -q
[0038] Among them, the parameter q>0.
[0039] Further, in step S3, it specifically includes:
[0040] S31: Data heterogeneity stems from the differences in the data held by the clients. A straightforward solution to mitigate data heterogeneity is to send an additional public dataset to each client and minimize the local objectives of local data and shared data;
[0041] S32: It is proposed to introduce virtual datasets to reduce data heterogeneity, so that the shared virtual data does not contain private information and avoid the performance degradation of FL models on natural datasets. The key to improving FL performance using virtual datasets is to calibrate the natural feature distribution and the virtual feature distribution. The key challenge is how to ensure that the knowledge margin learned from the virtual dataset can be transferred to the natural dataset. Drawing inspiration from domain adaptation, the virtual dataset is used as the source domain and the natural dataset as the target domain, and domain adaptation is performed to reduce the generalization risk of the natural distribution. Based on the basic principles of domain adaptation, the two distributions are calibrated in the feature space. A conditional distribution mismatch penalty is introduced to alleviate dataset shift:
[0042]
[0043] 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 on the real data, and D(G(z)) represents the result of the discriminator on the generated data. 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.
[0044] Further, in step S4, it specifically includes:
[0045] S41: In order to quantify the learning contribution of aggregating each device’s local model to the global model, a learning utility that takes into account gradient diversity is designed to measure the data heterogeneity of the client. Compared with the loss value, gradient diversity contains fine-grained information about data heterogeneity, as follows:
[0046] γ i =ρ i +υ i
[0047]
[0048]
[0049] Among them, ρ i Used to evaluate the similarity between the client's gradient and the global gradient,υ i Used to evaluate the diversity of gradients among all clients. Combined with ρi and i , the learned utility value tends to select clients that are close to the global model or have very different data distributions during device selection;
[0050] S42: Based on the learning utility model constructed in step S41, design a client selection scheme that considers different data distributions, heterogeneous delays, and unexpected dropouts. The client selection scheme at the edge server level mainly selects a subset from the currently given set of clients connected to the edge server to trigger asynchronous training. Assume P i =1 means that client i is selected and the latest model is transmitted from the edge server to the client, but the locally updated model has not yet been returned from the client. Once returned, the client selection module at the edge server level records the gradient information to update the learning utility value. In real-time selection, clients with relatively large learning utility values and short round delays are preferred because these devices can make significant contributions to convergence in a fast manner. The client selection problem is modeled as a device selection state variable P with i The integer linear programming is:
[0051]
[0052]
[0053]
[0054] where k is a hyperparameter used to curve the contribution of global round delay to the client selection scheme. j is the bandwidth upper limit of the j-th edge server.
[0055] The present invention also provides an asynchronous hierarchical federated learning system that resists data heterogeneity.
[0056] The beneficial effects of the present invention are:
[0057] The present invention aims at the problem that the performance of the federated learning model is reduced due to data heterogeneity, system heterogeneity and accidental dropout in the Internet of Things network, and provides an asynchronous hierarchical federated learning method that resists data heterogeneity. Hierarchical federated learning is deployed in an unreliable Internet of Things network, and asynchronous aggregation is adopted on both the cloud server side and the edge server side, thereby avoiding long waiting times. In order to quantify data heterogeneity, a learning utility metric based on gradient diversity is designed to guide decision-making in asynchronous hierarchical federated learning. At the same time, in order to collaboratively optimize the model convergence under data heterogeneity, system heterogeneity and accidental dropout, a client selection module is designed at the edge server level. The client selection module selects diverse and fast edge devices to trigger local training in real time, which can reduce the communication overhead in federated learning training. The method provided by the present invention can effectively improve the performance of the hierarchical federated learning algorithm model and has broad application prospects.
[0058] 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
[0059] 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:
[0060] Figure 1 This is a diagram of the asynchronous hierarchical federated learning architecture of the present invention. DETAILED DESCRIPTION
[0061] 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.
[0062] Among them, the drawings are only used for illustrative explanations, and they only represent schematic diagrams rather than actual pictures, and should not be understood as limitations on the present invention. In order to better illustrate the embodiments of the present invention, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the size of actual products. For those skilled in the art, it is understandable that some well-known structures and their descriptions in the drawings may be omitted.
[0063] The same or similar numbers in the drawings of the embodiments of the present invention correspond to the same or similar parts; in the description of the present invention, it should be understood that if the terms "upper", "lower", "left", "right", "front", "rear", etc. indicate the orientation or position relationship, they are based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operate in a specific orientation. Therefore, the terms describing the position relationship in the drawings are only used for illustrative purposes and cannot be understood as limiting the present invention. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to specific circumstances.
[0064] See also Figure 1 The present invention provides an asynchronous hierarchical federated learning method for resisting data heterogeneity, which preferably specifically comprises the following steps:
[0065] Step 1: Construct an asynchronous hierarchical federated learning algorithm that resists data heterogeneity: Due to the impact of increased model parameters and the cost of frequent communications, the convergence performance of traditional federated learning deployed in the IoT network is easily affected. At the same time, due to the data heterogeneity, system heterogeneity and accidental dropouts between clients, the use of synchronous aggregation may not guarantee the performance of the model. Therefore, an asynchronous hierarchical federated learning framework that resists data heterogeneity is constructed. The preferred specific steps include:
[0066] Step 1.1: The hierarchical federated learning architecture in the Internet of Things is composed of cloud servers, edge servers, and clients, such as Figure 1 As shown in the figure. The cloud layer provides powerful cloud servers with abundant resources and effective processing capabilities. The edge server includes base stations and routers, acting as an intermediate layer connecting the cloud and edge devices. The underlying edge devices refer to small mobile systems such as sensors, smartphones, and drones, which are usually subject to limited resources and energy; the learning process starts from the cloud server and distributes the global model to the selected edge servers. The edge server then sends the model to the selected client devices, and then each device performs gradient descent training on its local dataset and sends the updated model back to the edge server. The edge server aggregates the received model parameters and continues to send them to the selected clients for local training until the preset number of aggregations is reached and the model is uploaded to the cloud server. Finally, the cloud server aggregates the received models to obtain a new global model. Edge devices do not share local datasets, but only share updated models.
[0067] Step 1.2: Define hierarchical federated learning in the Internet of Things. The cloud server and edge server have a transceiver system and an aggregation system. 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. The data set collected on node i is The typical goal of FL is to learn a unified model, deployed on all distributed devices, and satisfy the empirical risk minimization problem (ERM) on all devices as follows:
[0068]
[0069] Among them, F N (ω) represents the global loss function on the cloud server, F i (ω) represents the loss function on the i-th client, Representative model ω usage data The loss function for training.
[0070] Step 2: Construction of an asynchronous hierarchical federated learning algorithm to resist data heterogeneity, system heterogeneity and accidental lag: Based on the analysis of hierarchical federated learning and constraints in the IoT network in S1, an asynchronous hierarchical federated learning algorithm is designed to improve the performance of the hierarchical federated learning model after training and meet the requirements for deployment in heterogeneous networks with limited resources. The preferred algorithm specifically includes the following steps:
[0071] Step 2.1: All edge servers have feasible paths to connect to the cloud servers, but a client may have multiple paths to connect to multiple edge servers simultaneously. Reachability may be limited due to a variety of reasons such as range limitations of wireless technology, sensor device failures, or network backbones. All of the above factors are combined into a symbol to represent connectivity, where t represents the wall clock time of each round of the global model:
[0072]
[0073] The edge server triggers local training on the client, and the client needs to upload the returned model to the same edge server. But the client can switch to another edge server after aggregation. Define the decision variables for real-time client-edge server connection:
[0074]
[0075] Step 2.2: Computation and communication delays play a major role as system heterogeneity and are calculated using a general model. This paper focuses on the communication delay between the client and the edge server because the bandwidth on this link is more limited and the client has lower transmission power. During the run, the round delay is measured, which is the time to complete an edge aggregation round between the edge server and the client. It consists of three parts: (1) The downlink delay of the transmission model from edge server j to client i; (2) The computational delay incurred by client i during local training; (3) Uplink latency for transmitting updates to the model in the opposite direction.
[0076] Since edge servers and cloud servers usually have more computing resources, the computational delay of edge servers and cloud servers for aggregation is ignored, and the round delay can be expressed as:
[0077] Step 2.3: Bandwidth limitation is an upper limit on the throughput or data rate. Unlike synchronous design, the throughput in asynchronous mode cannot be accurately simulated. Therefore, given a round delay of τ ij The FL model size is M, and the average data rate on the link from edge server j to client i is estimated to be: R ij =M / τ ij . Then the total data rate of all selected clients on edge server j is calculated as:
[0078] Step 2.4: In asynchronous hierarchical federated learning, each edge server downloads the latest global model from the cloud server, and each client downloads the latest edge model from the edge server. After the client completes local training, it uploads the local model to the edge server, and the edge server immediately performs edge aggregation. When the edge server aggregation times reach a preset number, it uploads the model to the cloud server, and the cloud server immediately performs global aggregation. The cloud server and edge server perform stale-aware weight aggregation:
[0079] α t ←α·s(t-τ)
[0080] ω t ←(1-α t )ω t-1 +α t ω new
[0081] where ω new are the newly received model parameters, t is the current global round, and α tis the staleness-aware weight calculated by multiplying the staleness function s(t-τ) by a constant α. Staleness-awareness refers to the difference in the number of global rounds since the last global update. For example, t is the current global aggregation round, and τ is the global round when the model was downloaded. Intuitively, a larger staleness-aware weight means that the model is too different from the current global model and should be given less attention. The staleness function s(t-τ) determines the exponential decay factor in the model aggregation process and is calculated using a polynomial staleness function with the following formula: s q (t-τ) = (t-τ + 1) -q , where parameter q>0.
[0082] Step 3: In order to implement the asynchronous hierarchical federated learning algorithm proposed in step 2 to resist data heterogeneity, the generated virtual data set is sent to each client to implement virtual homogeneous learning, aiming to reduce the differences in data distribution and data volume between clients and improve model training performance. The preferred method specifically includes the following steps:
[0083] Step 3.1: Data heterogeneity stems from the differences in the data held by the clients. A straightforward solution to mitigate data heterogeneity is to send an additional public dataset to each client and minimize the local objective of local data and shared data;
[0084] Step 3.2: It is proposed to introduce virtual datasets to reduce data heterogeneity, so that the shared virtual data does not contain private information and avoid the performance degradation of FL models on natural datasets. The key to improving FL performance using virtual datasets is to calibrate the natural feature distribution and the virtual feature distribution. The key challenge is how to ensure that the knowledge margin learned from the virtual dataset can be transferred to the natural dataset. Drawing inspiration from domain adaptation, the virtual dataset is used as the source domain and the natural dataset as the target domain, and domain adaptation is performed to reduce the generalization risk of the natural distribution. Based on the basic principles of domain adaptation, the two distributions are calibrated in the feature space. A conditional distribution mismatch penalty is introduced to alleviate dataset shift:
[0085]
[0086] 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 on the real data, and D(G(z)) represents the result of the discriminator on the generated data. 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.
[0087] Step 4: Consider the differences in data distribution, heterogeneous delays, and accidental dropouts of different clients, and construct a method for quantifying data distribution based on learning utility and a client selection method based on learning utility and delay to improve the stability, efficiency, and accuracy of the learning system. The specific steps include:
[0088] Step 4.1: In order to quantify the learning contribution of aggregating each device’s local model to the global model, a learning utility that takes into account gradient diversity is designed to measure the data heterogeneity of the client. Compared with the loss value, gradient diversity contains fine-grained information about data heterogeneity, as follows:
[0089] γ i =ρ i +υ i
[0090]
[0091]
[0092] Among them, ρ i Used to evaluate the similarity between the client's gradient and the global gradient,υ i Used to evaluate the diversity of gradients among all clients. Combined with ρ i and i , the learned utility value tends to select clients that are close to the global model or have very different data distributions during the device selection process.
[0093] Step 4.2: Based on the learning utility model constructed in step 4.1, design a client selection scheme that considers different data distributions, heterogeneous delays, and unexpected dropouts. The client selection scheme at the edge server level mainly selects a subset from the current given set of clients connected to the edge server to trigger asynchronous training. Assume P i=1 means that client i is selected and the latest model is transmitted from the edge server to the client, but the locally updated model has not yet been returned from the client. Once returned, the client selection module at the edge server level records the gradient information to update the learning utility value. In real-time selection, clients with relatively large learning utility values and short round delays are preferred because these devices can make significant contributions to convergence in a fast manner. The client selection problem is modeled as a device selection state variable P with i The integer linear programming is:
[0094]
[0095]
[0096]
[0097] where k is a hyperparameter used to curve the contribution of global round delay to the client selection scheme. j is the bandwidth upper limit of the j-th edge server.
[0098] A person skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing related hardware through a program. The program can be stored in a computer-readable storage medium. When the program is executed, the steps of the method can be implemented. The storage medium, such as ROM / RAM, a disk, an optical disk, etc.
[0099] 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. An asynchronous hierarchical federated learning method that resists data heterogeneity, characterized by: The method comprises the following steps: S1: Building a hierarchical federated learning framework in IoT; S2: Build asynchronous hierarchical federated learning algorithms in the Internet of Things that can resist data heterogeneity, system heterogeneity, and accidental dropouts, as well as communication and computing models in unreliable communication networks; S3: Construct a virtual homogeneous learning method to resist client drift in federated learning; S4: Considering the data distribution, heterogeneous delays and unexpected dropouts among different clients, we construct a learning utility quantification data distribution and a client selection method based on learning utility and delay.
2. The asynchronous hierarchical federated learning method for resisting data heterogeneity according to claim 1, characterized in that: The step S1 specifically includes the following steps: S11: The hierarchical federated learning architecture in the Internet of Things is composed of a cloud server, an edge server and a client; the edge server includes a base station and a router, which acts as an intermediate layer connecting the cloud and edge devices; the underlying edge devices include but are not limited to sensors, smart phones, and drone small mobile systems; the learning process starts from the cloud server, and the global model is distributed to the selected edge server; the edge server then sends the model to the selected client device, and then each device performs gradient descent training on its local data set and sends the updated model back to the edge server; the edge server aggregates the received model parameters and continues to send them to the selected client for local training until the preset number of aggregations is reached and the model is uploaded to the cloud server; finally, the cloud server aggregates the received models to obtain a new global model; the edge devices do not share local data sets, but only share updated models; S12: In the hierarchical federated learning defined in the Internet of Things, the cloud server and the edge server have a transceiver system and an aggregation system. The set of all edge servers connected to the cloud server is represented by s:={1,2,...,j,...,S}, and there is a set of nodes n:={1,2,...,i,...,N} within the coverage of the base station, where the data set collected on node i is The typical goal of FL is to learn a unified model, deployed on all distributed devices, and satisfy the problem of minimizing the empirical risk on all devices: Among them, F N (ω) represents the global loss function on the cloud server, F i (ω) represents the loss function on the i-th client, Representative model ω usage data The loss function for training.
3. The asynchronous hierarchical federated learning method for resisting data heterogeneity according to claim 2, characterized in that: In step S2, it specifically includes: S21: All edge servers have feasible paths to connect to the cloud servers, but a client may have multiple paths to connect to multiple edge servers at the same time; all factors are combined into a symbol to represent connectivity, where t represents the wall clock time of each round of the global model: The edge server triggers local training on the client, and the client needs to upload the returned model to the same edge server; but the client can switch to another edge server after aggregation; define the decision variables for real-time client-edge server connection: S22: Computation and communication delays play a major role as system heterogeneity and are calculated using a general model; the round delay is measured during operation, i.e., the time to complete an edge aggregation round between the edge server and the client, which consists of three parts: (1) Downlink delay of the transmission model from edge server j to client i; (2) The computational delay incurred by client i during local training; (3) Uplink delay for transmitting updated models in the opposite direction; The round delay is expressed as: S23: Bandwidth limitation is an upper limit on throughput or data rate; given round delay is τ ij The FL model size is M, and the average data rate on the link from edge server j to client i is estimated as: R ij =M / t ij Then the total data rate of all selected clients on edge server j is calculated as: S24: In asynchronous hierarchical federated learning, each edge server downloads the latest global model from the cloud server, and each client downloads the latest edge model from the edge server; when the client completes local training, it uploads the local model to the edge server, and the edge server immediately performs edge aggregation; when the edge server aggregation times reach a preset number, it uploads the model to the cloud server, and the cloud server immediately performs global aggregation; the cloud server and the edge server perform stale-aware weight aggregation: a t ←α·s(t-τ) oh t ←(1-a t )oh t-1 +a t oh new where ω new are the newly received model parameters, t is the current global round, and α t It is the staleness-aware weight calculated by multiplying the staleness function s(t-τ) by a constant α; staleness-awareness refers to the difference in the number of global rounds since the last global update; a larger staleness-aware weight means that the model is too different from the current global model, so it should be given less attention; the staleness function s(t-τ) determines the exponential decay factor in the model aggregation process, and is calculated using a polynomial staleness function, as follows: s q (t-τ)=(t-τ+1) -q Among them, the parameter q>0.
4. The asynchronous hierarchical federated learning method for resisting data heterogeneity according to claim 3 is characterized in that: In step S3, it specifically includes: S31: Send an additional public dataset to each client and minimize the local objective of local data and shared data; S32: Take the virtual dataset as the source domain and the natural dataset as the target domain, and perform domain adaptation to reduce the generalization risk of the natural distribution; based on the basic principle of domain adaptation, calibrate the two distributions in the feature space, and introduce a conditional distribution mismatch penalty to alleviate the dataset shift: In which, 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 on the real data, and D(G(z)) represents the result of the discriminator on the generated data. 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 a 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.
5. The asynchronous hierarchical federated learning method for resisting data heterogeneity according to claim 4, characterized in that: In step S4, it specifically includes: S41: In order to quantify the learning contribution of aggregating each device’s local model to the global model, a learning utility that takes into account gradient diversity is designed to measure the data heterogeneity of the client; compared with the loss value, gradient diversity contains fine-grained information about data heterogeneity, as follows: c i =ρ i +u i Among them, ρ i Used to evaluate the similarity between the client's gradient and the global gradient,υ i Used to evaluate the diversity of gradients among all clients; combined with ρ i and i , the learned utility value tends to select clients that are close to the global model or have very different data distributions during device selection; S42: Based on the learning utility model constructed in step S41, design a client selection scheme that considers different data distributions, heterogeneous delays, and unexpected dropouts; the client selection scheme at the edge server level mainly selects a subset from the currently given set of clients connected to the edge server to trigger asynchronous training; assuming P i =1 means that client i is selected and the latest model is transmitted from the edge server to the client, but the locally updated model has not yet been returned from the client; once returned, the client selection module at the edge server level records the gradient information to update the learning utility value; in real-time selection, clients with relatively large learning utility values and short round delays are preferred; the client selection problem is modeled as a device selection state variable P i The integer linear programming is: where k is a hyperparameter used to curve the contribution of global round delay to the client selection scheme, B j is the bandwidth upper limit of the j-th edge server.
6. An asynchronous hierarchical federated learning system that resists data heterogeneity, characterized by: The system adopts the method as claimed in any one of claims 1 to 5.
Citation Information
Cited By
Asynchronous hierarchical federal learning method, system and device and medium
CN121119056A