Personal federated learning method and system based on edge-end-cloud three-layer architecture
By employing a personalized federated learning method with an edge-device-cloud three-layer architecture, edge terminal devices perform local model aggregation on edge servers, while cloud servers update the global model. This solves the problems of low model update frequency and communication congestion in edge computing, and enables efficient personalized model training and data utilization.
Patent Information
- Application Number
- CN202410399086.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-03
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2044-04-03
AI Technical Summary
In existing edge computing technologies, edge terminal models are updated at a low frequency, cannot iterate at high speed, and massive amounts of personal terminal data cannot be effectively utilized, resulting in communication congestion and data privacy issues.
A personalized federated learning method based on an edge-device-cloud three-layer architecture is adopted. Local models are sent and updated to edge servers through edge terminal devices to form local models, and global models are updated by cloud servers. Edge servers perform model aggregation and transmission locally to reduce communication volume. Stochastic gradient descent and personalized federated learning algorithms are used to adapt to system heterogeneity.
It improves the update frequency and personalization effect of edge terminal models, solves the problems of communication congestion and data heterogeneity, protects data privacy, and enhances the real-time performance and efficiency of models.
Smart Images

Figure CN119761529B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to a personalized federated learning method and system based on a three-layer edge-end-cloud architecture, and belongs to the technical field of edge computing. BACKGROUND
[0002] With the emergence of new intelligent devices such as unmanned aerial vehicles, self-driving cars, and intelligent cameras, edge computing has become increasingly important. Edge computing brings computing power and data closer to end users by moving data processing capabilities down to edge devices, enabling low latency and real-time performance. For example, in modern city management, city managers deploy a large number of intelligent cameras in the city. In order to achieve real-time data analysis and provide decision support, these intelligent cameras typically perform data processing locally after collecting data, and then transmit the processed results to the city management center.
[0003] However, the above edge computing technology is still in the edge inference stage, i.e., edge terminal devices only have inference capabilities. This technology has the following problems: first, the model update frequency of edge terminals is low, and the training and storage of models need to rely on cloud servers. Cloud servers need a large amount of data and computing power for training, and then push the trained model to edge terminals. After that, edge terminals use the deployed model for inference operations. Because the training model is completed in the cloud, the update frequency of the deployed model is limited after the edge terminal is enabled, and high-speed iteration is not possible. Second, a large number of personal terminals cannot be accessed. The number of edge terminals in the current edge computing architecture is very limited. For example, in the city, the cameras are installed and deployed by city managers. The data collected by a large number of cameras installed by the public or intelligent cars driven by the public cannot be obtained and utilized. This data is very large and has a wide range of scenarios, and has great value. However, because the data collected by the public contains personal privacy and the public is unwilling to share their data, it is of great significance to effectively utilize the data of a large number of personal terminals to improve the model performance while ensuring user data privacy. SUMMARY
[0004] The present application aims to overcome the shortcomings of the prior art and provide a personalized federated learning method and system based on a three-layer edge-end-cloud architecture, which solves the data and system heterogeneity caused by environmental problems or different computing capabilities of edge terminal devices, and solves the problem of reduced transmission speed caused by communication congestion.
[0005] To solve the above technical problems, the present application adopts the following technical solutions:
[0006] In a first aspect, a personalized federated learning method based on a three-layer edge-end-cloud architecture includes:
[0007] The edge terminal device sends a local model and a local update to the edge server;
[0008] The edge server aggregates the local model to form a local area model, aggregates the local update to form a local area update, and sends the local area update to a cloud server;
[0009] The cloud server updates a global model according to the local area update sent by the edge terminal server to obtain a latest global model, and sends the latest global model to the edge server; the edge server sends the latest global model and the local area model to the edge terminal devices in the region to start the next round of iteration until the optimal global model and the local area model are found, so that the data loss of the edge terminal device is minimized.
[0010] In combination with the first aspect, further, the edge server receives the local model and the local update sent by the edge terminal device, comprising:
[0011] The edge terminal calculates the training rounds of the local model by the stochastic gradient descent method; based on the training rounds, a new local model is determined;
[0012] The traditional federated learning method FedAvg is used to update the global model at the edge terminal device to obtain a local update
[0013] The local update , the new local model are sent to the edge server.
[0014] In combination with the first aspect, further, the expression for calculating the training rounds of the local model is as follows:
[0015]
[0016] wherein, represents the local model generated by the edge terminal i after t+1 rounds of training; represents the local model generated by the edge terminal i after t rounds of training; represents the learning rate; represents the local computation amount; represents the local update; represents a strong constraint imposed on the local area model; represents the global model.
[0017] In combination with the first aspect, further, the aggregation formula for forming the local area model is as follows:
[0018]
[0019] wherein, denotes the local model after aggregation; denotes the proportion of local data of edge terminal device i to all data in the region to which it belongs; denotes the number of local models of edge terminal device.
[0020] In combination with the first aspect, further, the expression of the local area update is as follows:
[0021]
[0022] wherein, denotes the local area update.
[0023] In combination with the first aspect, further, the edge server waiting for the cloud server to update the global model comprises:
[0024] The cloud server waits for and receives the local area update sent by the edge server ;
[0025] Based on the local area update , the global model of the previous round is updated to obtain the latest global model ;
[0026] The cloud server broadcasts the latest global model to all edge servers.
[0027] In combination with the first aspect, further, the calculation expression of the latest global model is as follows:
[0028]
[0029] wherein, denotes the latest global model; k denotes a variable from 1 to k; K denotes the number of edge servers; denotes the proportion of local data of all edge terminal devices in the region to which edge server k belongs to all data.
[0030] In combination with the first aspect, further, the calculation expression of the minimum data loss of the edge terminal device is as follows:
[0031]
[0032] wherein, w denotes the global model of the cloud server; denotes the set of local models of edge servers; denotes the local model in the loss of data distribution of edge terminal device i.
[0033] In a second aspect, a personalized federated learning system based on a three-layer edge-end-cloud architecture comprises:
[0034] An edge terminal device sends a local model and a local update to an edge server.
[0035] The edge server aggregates the local models to form a local area model, aggregates the local updates to form a local area update, and sends the local area model and the local area update to a cloud server.
[0036] The cloud server updates a global model based on the local area update to obtain a latest global model, and sends the latest global model to the edge server.
[0037] In combination with the second aspect, the number of edge servers is less than the number of edge terminal devices.
[0038] Compared with the prior art, the present application has the following beneficial effects:
[0039] The present application constructs a federated learning architecture based on a three-layer edge-end-cloud mode.
[0040] Secondly, in order to alleviate system heterogeneity, the number of rounds of local training is calculated based on the available system resources using the stochastic gradient descent method, reducing the problem of terminal failure caused by system heterogeneity. BRIEF DESCRIPTION OF DRAWINGS
[0041] Figure 1 is a schematic diagram of a personalized federated learning method based on a three-layer edge-end-cloud architecture provided by an embodiment of the present application.
[0042] Figure 2 is a schematic diagram of a personalized federated learning system based on a side-end-cloud three-layer architecture provided by an embodiment of the present application.
[0043] Figure 3 is a comparison diagram of a side-end-cloud three-layer architecture and a traditional architecture provided by an embodiment of the present application. DETAILED DESCRIPTION
[0044] The technical solutions of the present application will be described in detail below with the aid of the accompanying drawings and specific embodiments. It should be understood that the specific features in the embodiments and the specific features in the embodiments are detailed descriptions of the technical solutions of the present application, and not limitations of the technical solutions of the present application. In the case of no conflict, the technical features in the embodiments and the embodiments can be combined with each other.
[0045] The term "and / or" in this paper is only a description of the association relationship between the associated objects, which means that there can be three kinds of relationships, for example, A and / or B, which can represent the three cases of A alone, A and B together, and B alone. In addition, the character " / " in this paper generally represents that the associated objects before and after are a "or" relationship. Embodiment 1
[0046] Figure 1 is a flowchart of a personalized federated learning method based on a side-end-cloud three-layer architecture in Embodiment 1 of the present application. The flowchart only shows the logical order of the method described in the embodiment. In the case of no conflict, the steps shown or described can be completed in an order different from that shown in other possible embodiments of the present application. Figure 1
[0047] Referring to Figure 1 , the method of the present embodiment specifically includes the following steps:
[0048] Step S1, the edge terminal device sends the local model and the local update to the edge server;
[0049] Step S2, the edge server aggregates the local model to form a local model, and aggregates the local update to form a local update, and sends the local update to the cloud server;
[0050] Step S3, the cloud server updates the global model according to the local update sent by the edge terminal server to obtain the latest global model, and sends the latest global model to the edge server;
[0051] Step S4, the edge server sends the latest global model and local model to the edge terminal devices in the region, and starts a new round of iteration until the optimal global model and local model are found, so that the data loss of the edge terminal devices is minimized.
[0052] Taking the edge terminal device i in the region responsible by the edge server k as an example, in order to minimize the data loss of the edge terminal device, a suitable global model and a local model, i.e. the local model aggregated local model, need to be found. The local loss function expression of the edge terminal i is as follows:
[0053] (1)
[0054] wherein, represents the local loss function of the edge terminal device i; represents the local model generated by the edge terminal i after t rounds of training; represents the global model; represents the global model the loss of the data distribution of the edge terminal i; represents the strong constraint imposed on the local model.
[0055] Further, when the edge terminal device i participates in the training in the tth round, it receives the regional model and the global model The edge terminal device i uses the regional model to replace its own local model to obtain the local model of this round, and the expression is as follows:
[0056] (2)
[0057] wherein, represents the gradient update of the local loss function of the edge terminal device i; represents the local update.
[0058] It should be noted that in formula (2) the global model is used to constrain the local model update not to deviate too far, and the edge terminal device performs multiple local updates without deviating too far from the global model, reducing the client drift.
[0059] Further, in order to adapt to different edge terminal devices and different training rounds, and reduce the influence of system heterogeneity of the edge terminal devices, the edge terminal device calculates the training rounds of the local model by using the stochastic gradient descent method, determines the optimal local model based on the training rounds, and updates the global model of the edge terminal device pair by using the traditional federated learning method FedAvg to obtain the local update , and the local update , the new local model is sent to the edge server.
[0060] It should be noted that not all edge terminal devices will send updates, as the computing power of edge terminals varies, some low-end terminal devices take a long time to train models, and the network environment of edge terminal devices is also heterogeneous, and a part of edge terminal devices are in poor network environment, the transmission rate is limited, and the time required for uploading the model is longer, resulting in a part of edge terminal devices appearing model uploading delay. In order to not affect the efficiency of federated learning, edge server k only needs to receive a part of the model updates sent by edge terminal devices for aggregation.
[0061] Further, the expression of the local model training round is as follows:
[0062] (3)
[0063] wherein, represents the local model generated by edge terminal i after t+1 rounds of training; represents the learning rate; represents the local computation amount.
[0064] Taking the model training of edge terminal device for t rounds as an example, edge server k receives the local model of edge terminal device, and aggregates it to form a local model , and the local model will not be sent to the cloud server, but will only be transmitted between the edge terminal device and the edge server, and its aggregation forms a local model The expression is as follows:
[0065] (4)
[0066] wherein, represents the aggregated local model; represents the proportion of local data of edge terminal device i to all data in its own area; represents the number of local models of edge terminal devices; i represents the number of edge terminal devices.
[0067] At the same time, edge server k aggregates the local update sent by edge terminal device to form a local update , and sends it to the cloud server, and the expression of the aggregated local update is as follows:
[0068] (5)
[0069] wherein, represents the local update.
[0070] Further, based on the aggregated local update , the global model of the previous round is updated to obtain the latest global model ;
[0071] The cloud server broadcasts the latest global model to all edge servers.
[0072] Further, the calculation expression of the latest global model is as follows:
[0073] (6)
[0074] wherein, represents the latest global model; k represents a variable from 1 to k; K represents the number of edge servers; represents the proportion of the local data of all edge terminal devices in the region to which the edge server k belongs in the total data.
[0075] It should be noted that the edge server receives the latest global model , in order to realize personalization, the global model is not used to replace the local model, but the personalized local model is continued to be maintained, and the edge terminal device also uses the local model as a new round of model for updating training, so as to better guarantee the personalized local model . At the same time, when the edge terminal device updates the local model, the global model is used to constrain the local model, which not only retains the information of the local model of the edge terminal, but also learns part of the information of the global model, so as to balance generalization and personalization, thereby solving the problem of data heterogeneity.
[0076] Further, by alternately updating the global model and the personalized local model, a global model w of the cloud server and k personalized local models are found, so that the data loss of the terminal device is minimized, and the calculation expression is as follows:
[0077] (7)
[0078] wherein, w represents the global model of the cloud server; represents the set of local models of the edge server; represents the local model of the edge terminal i.
[0079] It should be noted that, since the soft constraint condition is applied in formula 7, controlling the strength of the constraint imposed on the local model, when =0, the local model can completely ignore the global information, when The larger the distance between the local model and the global model, and also to The larger the impact on the model update speed, resulting in slow convergence speed problem. Embodiments
[0080] Referring to Figure 2 , the personalized federated learning system of the embodiment includes a plurality of edge terminal devices and at least one cloud server. Unlike traditional federated learning technology, the application constructs a personalized federated learning technology HierPerFed based on a three-layer architecture of edge-end-cloud. A plurality of edge servers are arranged between the edge terminal devices and the cloud server, and each edge server is responsible for the edge terminal devices in a certain area and is connected to the cloud server. The edge terminal device sends a local model and a local update to the edge server. The edge server aggregates the local model to form a local model, aggregates the local update to form a local update, and sends the local model and the local update to the cloud server. The edge server sends the latest global model returned by the cloud server together with the local model to a plurality of edge terminal devices in the region to start a new round of iteration until the optimal global model and local model are found, so that the data loss of the edge terminal device is minimized.
[0081] The cloud server updates the global model according to the local update to obtain the latest global model, and sends the latest global model to the edge server.
[0082] Further, the edge server has a relay function. After receiving the local update submitted by the edge terminal device and performing preliminary aggregation, it is sent to the cloud server and the aggregated local model is retained in the edge server, waiting for alternation with the local model. Then, after receiving the global model sent by the cloud server, the edge server forwards the global model together with the local model to the edge terminal devices in the region, updates the local model using the local model, and uses the global model to constrain the local model, which not only retains the information of the local model of the edge terminal, but also learns part of the information of the global model. And because the edge server is placed around the edge terminal device, the transmission distance is short, and the transmission rate is improved.
[0083] In addition, the edge server is deployed in different geographical locations and is physically relatively dispersed, and the number of edge servers is much smaller than the number of edge terminal devices, reducing the bandwidth occupied by the cloud server, and further solving the problem of network congestion caused by a large number of edge terminal devices uploading local models to the cloud server at the same time. Embodiments
[0084] Referring toFigure 3 In the traditional federated learning technique FedAvg, edge terminals replace local models with global models in each global iteration. The personalized effect is essentially a result of fine-tuning the global model on local data, resulting in poor personalization. In contrast, HierperFed, a personalized federated learning technique based on an edge-device-cloud architecture, introduces edge servers. Instead of replacing local models with global models, edge servers use their local models as the basis for updating and training the next round of models. The edge servers maintain several personalized local models, which better ensures the effectiveness of the personalized local models.
[0085] from Figure 3 As can be seen, the traditional federated learning technology FedAvg directly replaces a large number of local models with the global model, while the personalized federated learning technology HierperFed with the edge-end-cloud architecture only contacts the edge server. The local model on the edge server replaces the global model and continuously replaces the local model, which alleviates the computing power of the cloud server and improves the efficiency of federated learning.
[0086] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A personalized federated learning method based on an edge-device-cloud three-layer architecture, characterized in that, include: The edge terminal device sends a local model and a local update to the edge server; wherein, the edge server receives the local model and local update sent by the edge terminal device, including: The edge terminal calculates the number of training epochs of the local model using stochastic gradient descent. The expression for calculating the number of training epochs of the local model is as follows: ; in, This represents the local model generated by edge terminal i after training round t+1; The local model generated by edge terminal i after t rounds of training is shown. Indicates the learning rate; Indicates local computational load; Indicates local update; This indicates a strong constraint imposed on the local model; Global model; Based on the training rounds, a new local model is determined; FedAvg, a traditional federated learning method, updates the global model on edge devices to obtain local updates. ; The local update The new local model is sent to the edge server; The edge server aggregates the local model to form a local model, and aggregates the local update to form a local update, and sends the local update to the cloud server. The cloud server updates the global model based on the local update sent by the edge terminal server to obtain the latest global model, and then sends the latest global model to the edge server. The edge server sends the latest global model and local model to several edge terminal devices in its region, initiating a new round of iteration until the optimal global model and local model are found, minimizing the data loss of the edge terminal devices. The expression for minimizing the data loss of the edge terminal devices is as follows: ; in, Represents the global model of the cloud server; { } represents the set of local models of the edge server; Representation of local model Loss in data distribution at edge terminal device i; This represents the proportion of local data of edge terminal device i to all data in its region; K represents the number of edge servers; This represents the proportion of local data from all edge terminal devices in the region to which edge server k belongs to the total data. This indicates the number of local models on the edge terminal device.
2. The personalized federated learning method based on an edge-device-cloud three-layer architecture as described in claim 1, characterized in that, The aggregation formula for forming the local model is as follows: ; in, This represents the aggregated local model.
3. The personalized federated learning method based on an edge-device-cloud three-layer architecture as described in claim 1, characterized in that, The expression for the local update after aggregation is as follows: ; in, This indicates a local update.
4. The personalized federated learning method based on an edge-device-cloud three-layer architecture as described in claim 3, characterized in that, The edge server waits for the cloud server to update the global model, including: The cloud server waits for and receives local updates sent by the edge server. ; Based on the local update The previous global model is updated to obtain the latest global model. ; The cloud server will provide the latest global model. Broadcast to all edge servers.
5. The personalized federated learning method based on an edge-device-cloud three-layer architecture as described in claim 4, characterized in that, The latest global model The calculation expression is as follows: ; in, This represents the latest global model; k represents the variable from 1 to k; K represents the number of edge servers; This represents the proportion of local data from all edge terminal devices in the region to which edge server k belongs, relative to all total data.
6. A personalized federated learning system based on an edge-device-cloud three-layer architecture, characterized in that, include: An edge terminal device sends a local model and local updates to an edge server; wherein, the edge server receives the local model and local updates sent by the edge terminal device, including: The edge terminal calculates the number of training epochs of the local model using stochastic gradient descent. The expression for calculating the number of training epochs of the local model is as follows: ; in, This represents the local model generated by edge terminal i after training round t+1; The local model generated by edge terminal i after t rounds of training is shown. Indicates the learning rate; Indicates local computational load; Indicates local update; This indicates a strong constraint imposed on the local model; Global model; Based on the training rounds, a new local model is determined; FedAvg, a traditional federated learning method, updates the global model on edge devices to obtain local updates. ; The local update The new local model is sent to the edge server; The edge server aggregates the local model to form a local model, and aggregates the local updates to form a local update, which is then sent to the cloud server. Based on the latest global model returned by the cloud server, the local model is sent together with the local model to several edge terminal devices in the region to start a new round of iteration until the optimal global model and local model are found, so as to minimize the data loss of the edge terminal devices. The cloud server updates the global model based on the local update to obtain the latest global model, and then sends the latest global model to the edge server; wherein, the calculation expression for minimizing data loss of the edge terminal device is as follows: ; in, Represents the global model of the cloud server; { } represents the set of local models of the edge server; Representation of local model Loss in data distribution at edge terminal device i; This represents the proportion of local data of edge terminal device i to all data in its region; K represents the number of edge servers; This represents the proportion of local data from all edge terminal devices in the region to which edge server k belongs to the total data. This indicates the number of local models on the edge terminal device.
7. The personalized federated learning system based on an edge-device-cloud three-layer architecture according to claim 6, characterized in that, The number of edge servers is less than the number of edge terminal devices.
Citation Information
Patent Citations
Asynchronous federated learning method, system, device and terminal for mobile vehicle
CN114116198A