A decentralized federated learning approach for heterogeneous edge computing environments
By adopting a decentralized federated learning method in an edge computing environment, matching and collaboration between edge nodes, selecting neighbors with high similarity for model training, the problems of single point failure and performance migration in traditional federated learning methods are solved, and efficient model training is achieved.
Patent Information
- Application Number
- CN202310033009.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-10
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2043-01-10
AI Technical Summary
In an edge computing environment, traditional federated learning methods rely on central servers, have a risk of single point failure, and the data distribution between heterogeneous edge nodes is inconsistent, resulting in low model training efficiency and performance migration.
A decentralized federated learning method for heterogeneous edge computing environment is proposed. Through matching and collaboration between edge nodes, the Monte Carlo method is used to select neighbors with high similarity for model training, and the aggregation model is obtained through consensus.
This method can effectively collaboratively train the model without relying on a central server, saving computing and communication latency, and improving the efficiency and performance of model training.
Smart Images

Figure CN116319368B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of big data computing and relates to a decentralized federated learning method for a heterogeneous edge computing environment. Background Art
[0002] Today, the Internet of Things (IoT) is booming, and devices such as smartphones, smart cities, and smart factories are generating a large amount of data, which has promoted the emergence of data-driven methods such as machine learning. In the traditional ML paradigm, models are trained using large data sets collected by central servers. However, in many practical applications of IoT, data may be privacy-sensitive, and it is impractical to aggregate large data sets on central servers for model training. In this case, the training data is usually distributed on different IoT clients, such as sensors, phones, or other information sources. And passing these raw data from devices to central servers will consume a lot of bandwidth resources and may cause privacy leakage. With the emergence of edge computing (EC), it is able to distribute deep learning models to edge nodes (or terminal devices) close to the data source and perform distributed model training on the edge (or on the device). This model training paradigm is also called federated learning, which not only guarantees data privacy, but also makes full use of the large computing resources at the edge of the network.
[0003] In general FL systems, a central server coordinates training tasks based on the data of the clients. In each round of training, each participating client updates the model individually based on its local dataset and then sends the updated model to the server. After receiving the models from all participating clients in the current round, the server averages the models and broadcasts the updated models to the participating clients in the next round. Although the above FL systems are promising, they face many challenges. Although large organizations can play the role of central servers in some IoT applications, it is difficult to find central servers that are both reliable and powerful in edge computing environments. In addition, the failure of the central server will cause a single point of failure for the entire network, resulting in high communication pressure and high vulnerability. In order to overcome the above shortcomings of using a central server, decentralized FL (DFL) methods that do not require a central server are very worthy of study. In DFL, clients directly exchange their model parameters in a peer-to-peer manner. In fact, the advantage of DFL is not only that the single point of failure of the central server is eliminated, but also that scalability can be achieved in a cheap way because no additional infrastructure is required. However, in edge computing, the bandwidth of edge nodes is always limited or even scarce. The data between edge nodes is usually not independent and distributed in the same way. Edge nodes may have heterogeneous data distributions and thus different learning tasks. If the models of all edge nodes are merged into a global model, it will lead to negative transfer of local model performance. Therefore, it is challenging to use DFL for effective model training in edge computing. Summary of the invention
[0004] In view of this, an object of the present invention is to provide a decentralized federated learning method for a heterogeneous edge computing environment.
[0005] In order to achieve the above object, the present invention provides the following technical solutions:
[0006] A decentralized federated learning method for a heterogeneous edge computing environment, the method comprising the following steps:
[0007] Step 1: In the federated learning system, the edge node initializes its own model;
[0008] Step 2: The edge node calculates the communication cost function based on its own communication rate and computing power. The cost function represents the degree of matching between edge nodes. The node selects the adjacent node with the smaller cost function as the matching set based on the greedy algorithm.
[0009] Step 3: For each edge node, the similarity between edge node models is measured based on gradient and weight, and the Monte Carlo method is used to select neighbors from the matching set, that is, the neighbors in the previous round and the current randomly sampled adjacent nodes are put into the candidate list, and the top k candidate nodes with the greatest similarity are selected from the candidate list as the neighbors of the current round;
[0010] Step 4: The node receives weights and updates the model from its neighbors, and obtains the aggregate model ψ through consensus based on the obtained data t,i ;
[0011] Step 5: The node calculates the gradient descent through the aggregation model, updates the model, and sends it to neighbors.
[0012] Optionally, the federated learning system consists of a central server and a node set c = (1, 2, ..., n) including n nodes, each node having its own data; the central server is responsible for issuing training tasks, selecting nodes, and completing model aggregation; the selected nodes in the node set c receive the current round parameters issued by the central server, perform training on local data using the data volume selected by the central server, and upload the updated parameters to the central server;
[0013] Nodes rely on local cooperation with neighbor nodes and the local network to jointly train models; the interaction topology of the network is modeled as a directed graph represents the set of nodes, ξ represents the edge connecting the nodes, and the neighbor set of node K is represented by N k .
[0014] Optionally, the step 1 is specifically as follows: the edge node initializes the model W at time t0 0,k ;
[0015] The step 2 is specifically as follows: the communication rate between nodes is represented by R, and the computing power is represented by CPU frequency f; to determine the overhead between clients, the following strategy is adopted:
[0016] Cij=1 / Rij+μ(fi-fj) 2
[0017] Among them C ij represents the connection overhead between nodes i and j, indicating the difference in their communication status and computing power; the communication rate between nodes i and j is represented by the variable R ij Indicated by f i and f j Indicates; this strategy describes the matching degree between nodes; a low C value indicates a higher communication rate between nodes and a closer computing power; node i determines its own matching set ζ i , using a greedy algorithm strategy:
[0018] C i,k <ε×C min
[0019] Among them C min represents the lowest communication cost among all nodes; when the communication cost between nodes i and k is less than a certain threshold, node k belongs to the matching set ζ of node i i ;
[0020] Step 3 is as follows: according to the matching set ζ of the above node i i , determine the neighbor set of node i based on gradient and cumulative weight update;
[0021] The cosine similarity of the gradient g is used to measure the consistency of the optimization target. The function is expressed as:
[0022]
[0023] The accumulated weight updates h in the initial model represent the historical optimization direction, while the cosine similarity of the weight updates h represents the consistency of the goal:
[0024]
[0025] The final model similarity is calculated by S i,j measure:
[0026]
[0027] The Monte Carlo method is used to select neighbors from the matching set, that is, the neighbors in the previous round and the current randomly sampled adjacent nodes are put into the candidate list, and the top k candidate nodes with the greatest similarity are selected from the candidate list as the neighbors of the current round, that is:
[0028]
[0029]
[0030] Step 4 is as follows: Node i receives weight α from neighbor node k in round t of communication. i,k and update the model Based on the obtained data and its own model W t,i , the aggregation model ψ is obtained through consensus t,i :
[0031]
[0032]
[0033] Step 5 is as follows: the nodes are aggregated through the model ψ t,k , calculate the gradient descent and update the model W t+1,i , and send it to other neighbors;
[0034]
[0035] The beneficial effect of the present invention is that: based on the Monte Carlo method, neighbors are selected for each edge node, so that edge nodes with similar data distribution can jointly train the model to save additional calculation and communication delay. Then, the decentralized federated learning training model is performed based on the consensus federated average.
[0036] 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
[0037] 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:
[0038] Figure 1 This is a flow chart of model training of the present invention. DETAILED DESCRIPTION
[0039] 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.
[0040] 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.
[0041] 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.
[0042] See also Figure 1 , a decentralized federated learning method for heterogeneous edge computing environments, including the following training steps:
[0043] Step 1: The edge node initializes its own model.
[0044] Step 2: The edge node calculates the communication cost function based on its own communication rate and computing power. The cost function represents the degree of matching between edge nodes. The node selects the adjacent nodes with the smaller cost function as the matching set based on the greedy algorithm.
[0045] Step 3: For each edge node, the similarity between edge node models is measured based on gradient and weight, and the Monte Carlo method is used to select neighbors from the matching set. That is, the neighbors in the previous round are put into the candidate list together with the current randomly sampled adjacent nodes, and the top k candidate nodes with the greatest similarity are selected from the candidate list as the neighbors of the current round.
[0046] Step 4: The node receives weights and updates the model from its neighbors, and obtains the aggregate model ψ through consensus based on the obtained data t,i .
[0047] Step 5: The node calculates the gradient descent through the aggregation model, updates the model, and sends it to neighbors.
[0048] The federated learning system consists of a central server and a node set c = (1, 2, ..., n) containing n nodes, each of which has its own data. The central server is responsible for issuing training tasks, selecting nodes, and completing model aggregation; the selected nodes in the node set c receive the parameters of this round issued by the central server, use the data volume selected by the central server for training on local data, and upload the updated parameters to the central server.
[0049] Although large organizations can play the role of central servers in some IoT applications, it is difficult to find a central server that is both reliable and powerful in an edge computing environment. In addition, the failure of the central server will cause a single point of failure in the entire network, resulting in high communication pressure and high vulnerability. In order to overcome the above-mentioned shortcomings of using a central server, the present invention uses decentralized federated learning to perform model training in an edge computing environment. The decentralized federated learning method proposed in the present invention allows nodes to collaboratively train models relying only on local cooperation with neighbor nodes and the local network. The interactive topology of the network is modeled as a directed graph represents the set of nodes, ξ represents the edge connecting the nodes, and the neighbor set of node K is represented by N k In edge computing environments, the dynamic changes in the communication environment lead to different delays, so the topology needs to be adjusted dynamically to optimize system performance. Due to the heterogeneity of nodes and different location distributions, the key issue that limits the optimal topology is how to select better neighbors in the network to save additional computing and communication delays. Therefore, a decentralized federated learning method for heterogeneous edge computing environments is proposed, which includes the following steps:
[0050] Step 1: The edge node initializes the model W at time t0 0,k .
[0051] Step 2: Due to the heterogeneity of nodes, fast nodes need to wait for slow nodes to transmit their parameters before they can aggregate the model, resulting in performance waste of nodes with high processing power. Therefore, it is necessary to analyze the differences in computing power and communication quality between nodes. The communication rate between nodes is represented by R, and the computing power is represented by CPU frequency f. Then, in order to determine the overhead between clients, the following strategy is adopted:
[0052] C ij =1 / R ij +μ(fi -f j ) 2
[0053] Among them C ij represents the connection overhead between nodes i and j, indicating both their communication status and the difference in their computing power. The communication rate between nodes i and j is represented by the variable R ij Indicated by f i and f j This strategy describes the degree of matching between nodes. A low C value indicates a higher communication rate between nodes and a closer computing power. In order for node i to determine its matching set ζ i , using a greedy algorithm strategy:
[0054] C i,k <ε×C min
[0055] Among them C min represents the lowest communication cost among all nodes. When the communication cost between nodes i and k is less than a certain threshold, node k belongs to the matching set ζ of node i. i .
[0056] Step 3: According to the matching set ζ of the above node i i , determine the neighbor set of node i based on the gradient and accumulated weight update.
[0057] The cosine similarity of the gradient g is used to measure the consistency of the optimization target. The function can be expressed as:
[0058]
[0059] The accumulated weight updates h in the initial model can represent the historical optimization direction, while the cosine similarity of the weight updates h can also represent the consistency of the target:
[0060]
[0061] Therefore, the final model similarity is calculated by S i,j measure:
[0062]
[0063] Then, the Monte Carlo method is used to select neighbors from the matching set, that is, the neighbors in the previous round are put into the candidate list together with the current randomly sampled adjacent nodes, and the top k candidate nodes with the greatest similarity are selected from the candidate list as the neighbors of the current round, that is:
[0064]
[0065]
[0066] Step 4: Node i receives weight α from neighbor node k in round t of communication i,k and update the model Based on the obtained data and its own model W t,i , the aggregation model ψ is obtained through consensus t,i :
[0067]
[0068]
[0069] Step 5: Nodes are aggregated through the model ψ t,k , calculate the gradient descent and update the model W t+1,i , and send it to other neighbors.
[0070]
[0071] 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 decentralized federated learning method for heterogeneous edge computing environments, characterized by: The method comprises the following steps: Step 1: In the federated learning system, the edge node initializes its own model; Step 2: The edge node calculates the communication cost function based on its own communication rate and computing power. The cost function represents the degree of matching between edge nodes. The node selects the adjacent nodes with the smallest cost function as the matching set based on the greedy algorithm. Step 3: For each edge node, the similarity between edge node models is measured based on gradient and weight, and the Monte Carlo method is used to select neighbors from the matching set, that is, the neighbors in the previous round and the current randomly sampled adjacent nodes are put into the candidate list, and the top k candidate nodes with the greatest similarity are selected from the candidate list as the neighbors of the current round; The edge node initializes the model W at time t0 0,k ; The communication rate between nodes is represented by R, and the computing power is represented by CPU frequency f; to determine the overhead between clients, the following strategy is adopted: C ij =1 / R ij +μ(f i -f j ) 2 Among them C ij represents the connection overhead between nodes i and j, indicating the difference in their communication status and computing power; the communication rate between nodes i and j is represented by the variable R ij Indicated by f i and f j Indicates; this strategy describes the matching degree between nodes; a low C value indicates a higher communication rate between nodes and a closer computing power; node i determines its own matching set ζ i , using a greedy algorithm strategy: C i,k <ε×C min Among them C min represents the lowest communication cost among all nodes; when the communication cost between nodes i and k is less than a certain threshold, node k belongs to the matching set ζ of node i i ; According to the matching set ζ of node i above i , determine the neighbor set of node i based on gradient and cumulative weight update; The cosine similarity of the gradient g is used to measure the consistency of the optimization target. The function is expressed as: The accumulated weight updates h in the initial model represent the historical optimization direction, while the cosine similarity of the weight updates h represents the consistency of the goal: The final model similarity is calculated by S i,j measure: The Monte Carlo method is used to select neighbors from the matching set, that is, the neighbors in the previous round and the current randomly sampled adjacent nodes are put into the candidate list, and the top k candidate nodes with the greatest similarity are selected from the candidate list as the neighbors of the current round, that is: Step 4: The node receives weights and updates the model from its neighbors, and obtains the aggregate model ψ through consensus based on the obtained data t,i ; In round t of communication, node i receives weight α from neighbor node k i,k and update the model W t,k , Based on the obtained data and its own model W t,i , the aggregation model ψ is obtained through consensus t,i : Step 5: The node calculates the gradient descent through the aggregation model, updates the model, and sends it to neighbors; Nodes are aggregated through the model ψ t,k , calculate the gradient descent and update the model W t+1,i , and send it to other neighbors; 2. A decentralized federated learning method for heterogeneous edge computing environments according to claim 1, characterized in that: The federated learning system consists of a central server and a node set c = (1, 2, ..., n) containing n nodes, each of which has its own data; the central server is responsible for issuing training tasks, selecting nodes, and completing model aggregation; the selected nodes in the node set c receive the current round parameters issued by the central server, perform training on local data using the data volume selected by the central server, and upload the updated parameters to the central server; Nodes rely on local cooperation with neighbor nodes and the local network to jointly train models; the interaction topology of the network is modeled as a directed graph ν=(1,2,……,K) represents the set of nodes, ξ represents the edge connecting the nodes, and the neighbor set of node K is represented by N k .
Citation Information
Patent Citations
Popularity prediction method based on federated Bayesian learning in fog wireless access network
CN115080888A
Multi-device federated learning system based on SDN networking
CN115174404A