Personalized federal learning method based on hierarchical self-adaption and momentum collaboration

Through the personalized federated learning method of hierarchical adaptive fusion and momentum collaboration, the problem of insufficient utilization of model-level characteristics and high communication costs in federated learning is solved, and more efficient model training and lower communication overhead are achieved.

CN120509459APending Publication Date: 2025-08-19ANHUI UNIVERSITY OF TECHNOLOGY
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510351903.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-24
Publication Date
2025-08-19

AI Technical Summary

Technical Problem

The lack of hierarchical adaptability in existing federated learning leads to the model being unable to fully utilize the model hierarchical characteristics, ignore historical information that does not participate in the client, and lack selectivity in communication strategies, which increases communication costs.

Method used

The hierarchical adaptive fusion mechanism is adopted to calculate the adaptive fusion parameters layer by layer, selectively upload the model layer with high contribution, and combine the server momentum buffer to store historical update information to generate global momentum.

Benefits of technology

It improves the adaptability and personalization performance of the model to heterogeneous data, improves the representativeness and robustness of the global model, reduces communication overhead, and is suitable for resource-constrained scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120509459A_ABST
    Figure CN120509459A_ABST
Patent Text Reader

Abstract

The invention provides a personalized federal learning method based on hierarchical self-adaption and momentum collaboration. Optimization is carried out aiming at the problems of data isomerism, client dynamic participation and communication efficiency. The method comprises the steps that after a client receives global momentum, local and global loss contribution degrees are calculated layer by layer, and self-adaptive fusion parameters are generated to initialize all layers of a model in a differentiated mode; training a local model by using stochastic gradient descent, and selectively uploading the model layer with the contribution degree higher than a threshold value to a server; and the server generates global momentum by hierarchically aggregating update parameters and combining historical multi-round update information in the momentum buffer area. The personalized precision of the model is improved through a hierarchical adaptive fusion mechanism, the stability and fairness of the global model are enhanced through momentum buffering, the communication cost is reduced based on hierarchical selection of contribution degrees, and the problem that the model performance is reduced due to dynamic participation of clients and data isomerism in federated learning is effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of federated learning, and in particular to a personalized federated learning method based on hierarchical adaptation and momentum collaboration. Background Art

[0002] With the rapid development of big data and artificial intelligence, federated learning, a distributed machine learning method, has been widely used in fields such as healthcare, finance, and the Internet of Things. It enables collaborative modeling across devices and organizations while protecting data privacy. The basic process of federated learning can be divided into three stages: First, the server initializes a global model and distributes it to all clients. Then, each client trains the model using local data, calculates parameter updates (such as gradients or weight differences), and uploads them to the server. Finally, the server aggregates these updates through methods such as weighted averaging to form a new global model and enter the next round of iteration. However, in practical applications, the performance of federated learning is constrained by various factors, the most notable of which are dynamic client participation and data heterogeneity.

[0003] To address the above issues, the invention patent (CN118569355A) discloses a heterogeneous federated learning method based on momentum alignment technology, which solves the model offset problem caused by data heterogeneity in distributed learning and improves the generalization of the model. However, the existing technology still has the following problems:

[0004] First, there is a lack of hierarchical adaptability, making it difficult to fully utilize the hierarchical characteristics of the model.

[0005] Existing technologies use a unified global momentum and a single initialization method to update the entire local model, without distinguishing between the functional differences between different layers of the model. In neural networks, different layers often have different functional tendencies. For example, shallow layers typically extract common features and tend to align with the global model, while deeper layers focus more on task-specific features and require more local adjustments. However, existing technologies do not design fusion strategies for each layer. When client data heterogeneity is concentrated in a specific layer, the global momentum may over-smoothe local features, resulting in the local model being unable to fully adapt to the heterogeneous data, ultimately reducing personalization performance.

[0006] Second, global momentum relies on the participants in the current round and ignores the historical information of non-participating clients.

[0007] In existing technologies, global momentum is calculated based only on the aggregated results of the participating clients in the current round. Due to the dynamic nature of client participation in federated learning (e.g., device offline or network interruption), if a client does not participate for multiple rounds, its local data characteristics are gradually lost in the global momentum and model, causing the global model to favor clients that frequently participate. This information loss reduces the representativeness of the global model, especially in long-term training, as the model's adaptability to non-participating clients deteriorates, ultimately affecting overall performance and fairness.

[0008] The third upload strategy lacks selectivity and has high communication costs.

[0009] Existing technologies require clients to upload their entire updated local model to the server, without providing a layer selection mechanism. In resource-heterogeneous scenarios (e.g., limited client bandwidth), uploading the entire model significantly increases communication overhead. If updates to certain layers contribute little to the global model, retaining these layers can further reduce communication overhead and improve system efficiency. Summary of the Invention

[0010] This paper aims to address these issues by proposing a personalized federated learning method based on adaptive hierarchical aggregation. This approach aims to address the performance degradation caused by dynamic client participation and data heterogeneity in federated learning. Compared to existing technologies, this paper achieves more efficient global aggregation and personalized local model training through layer-by-layer adaptive fusion, server momentum buffering, and client-level selection mechanisms.

[0011] To this end, the technical solution adopted by the present invention is as follows: a personalized federated learning method based on hierarchical adaptation and momentum collaboration, the specific steps of which include:

[0012] S101. The client receives the global momentum sent by the server and calculates the loss of the local model and the global momentum through a loss function; the local model and the global momentum have the same number of model layers;

[0013] By calculating the local loss reduction and global loss reduction and calculating the adaptive fusion parameters layer by layer, the loss contribution of local loss and global loss is evaluated;

[0014] The global momentum refers to the dynamic set of global model parameters;

[0015] S102, initializing the parameters of each layer of the local model according to the adaptive fusion parameters;

[0016] S103, using the stochastic gradient descent algorithm to train the initialized local model;

[0017] S104, the client adaptively uploads local model parameters in layers; that is, only uploads local model layers with adaptive fusion parameters greater than or equal to the set threshold to the server, and retains local model layers with adaptive fusion parameters less than the set threshold;

[0018] S105. The server aggregates the local model layers uploaded by all clients in layers to generate a global aggregation parameter. The server calculates the historical momentum parameters of all model layers by maintaining a momentum buffer. The server updates the global momentum by weighting the global aggregation parameter and the historical momentum parameter.

[0019] S106: The server sends the new global momentum to all clients and repeats steps S101 to S105 until a preset round is reached or the local model reaches a preset accuracy.

[0020] Furthermore, in the tth round of server training, the global momentum sent to client i is expressed as:

[0021]

[0022] Where L is the number of model layers; represents the l-th layer model parameter in the global momentum, 1≤l≤L; in the t-th round, client i contains its own local model and global momentum

[0023] Furthermore, the loss of the local model is the loss of the local model parameter of the lth layer of client i for the tth round of training Expressed as:

[0024]

[0025] The global momentum loss is the global momentum parameter loss of the lth layer of client i in the tth round of training. Expressed as:

[0026]

[0027] Among them S i is a subset of the local data on client i; represents the loss update of the layer l parameter of the local model of client i in the tth round, represents the loss update of the l-th layer parameter of the global momentum of client i in round t.

[0028] Furthermore, the local loss reduction is the local loss reduction of the lth layer of client i for the tth round of training and global momentum reduction The calculation formula is as follows:

[0029]

[0030] and reduce the amount according to local losses and the global loss reduction Calculate adaptive fusion parameters To evaluate the contribution of local momentum to global momentum, the calculation formula is as follows:

[0031]

[0032] Furthermore, the client initialization refers to generating local model initialization parameters for the t+1th round of training, which is expressed as follows:

[0033]

[0034] in, represents the layer l parameters of the local model of client i in round t+1.

[0035] After the client is initialized, the stochastic gradient descent (SGD) algorithm is used to train the local model for the t+1th round. See the formula:

[0036]

[0037] in, represents the gradient of the loss function, Indicates the temporary update parameters of client i.

[0038] Furthermore, in step S015, for the global aggregation parameter of the model layer 1 in the t+1th round Expressed as:

[0039]

[0040] in is the model aggregation weight; n is the number of clients participating in the training; if no client uploads model layer l to the server, then

[0041] Furthermore, the momentum buffer stores the most recent M rounds of updates for all clients. The historical momentum parameter is calculated for each model layer l, and the formula is as follows:

[0042]

[0043] For model layers with less than M rounds of historical data, only the available rounds are used;

[0044] The dynamic buffer is updated in each training round; in the t+1th round, each model layer l of client i is updated as follows:

[0045]

[0046] Furthermore, for model layer 1, the update formula of the global momentum is:

[0047]

[0048] Among them, α is a hyperparameter used to balance the weight of the current round model update knowledge and the historical round knowledge. Sent to all clients.

[0049] At this point, the global momentum from round t is completed Global momentum to round t-1 The generation process

[0050] Compared with the prior art, the advantages of the present invention are

[0051] (1) This invention calculates adaptive fusion parameters layer by layer, distinguishes the functional characteristics of different layers of the model, and dynamically adjusts the fusion ratio of the local model and the global momentum. For scenarios with heterogeneous data, the client can retain more global knowledge for the shallow layers (common features) while focusing on local optimization for the deep layers (task-specific features). This effectively avoids the problem of the global model over-smoothing local features, significantly improving the model's adaptability and personalization performance for heterogeneous data.

[0052] (2) In the present invention, the server maintains a momentum buffer to store historical client update information and fuses multiple rounds of historical parameters when generating global momentum. Even if a client participates dynamically or is offline for a long time, its historical data characteristics still indirectly influence the global model update through the buffer, preventing the model from being biased towards frequently participating clients, improving the representativeness of the global model and its adaptability to non-participating clients, and ensuring the fairness and robustness of the training process.

[0053] (3) In this invention, the client only uploads the model layers whose adaptive fusion parameters exceed the threshold to the server, rather than the complete model. By dynamically evaluating the contribution of each layer update and selectively transmitting key layer parameters, redundant communication is reduced while ensuring model performance. This is particularly suitable for resource-constrained scenarios (such as low-bandwidth devices), significantly reducing communication overhead and improving the overall efficiency and scalability of the federated learning system. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0055] Figure 1 It is a framework diagram of the present invention;

[0056] Figure 2 Flowchart of the present invention. DETAILED DESCRIPTION

[0057] To achieve the above objectives, the present invention is implemented through the following technical solutions. The present invention provides a personalized federated learning method and system based on hierarchical adaptation and momentum collaboration. The following will elaborate on the system architecture and technical steps.

[0058] System architecture, combined with Figure 1 As shown:

[0059] The present invention relates to a personalized federated learning system based on hierarchical adaptation and momentum collaboration, comprising a server module and multiple client modules:

[0060] Server module: responsible for receiving model layer updates uploaded by the client, performing layered aggregation, maintaining the momentum buffer, and generating global momentum and sending it to the client.

[0061] Client module: responsible for local training, layer selection based on loss contribution, and layer-by-layer initialization, adapting to local data distribution.

[0062] Technical steps, combined Figure 2 As shown:

[0063] For the above system, the present invention discloses a personalized federated learning method based on hierarchical adaptation and momentum collaboration to realize the above system functions.

[0064] S101. The client calculates adaptive fusion parameters layer by layer:

[0065] For client i that has undergone round t of training, the adaptive fusion parameter calculation process is as follows:

[0066] S1011. The client receives the global momentum sent by the server, which is a dynamic set of global model parameters. At this time, the client includes its own local model and the global model sent by the server. The local model and the global momentum have the same number of model layers.

[0067] The global momentum parameter is expressed as Where L is the number of model layers; represents the l-th layer model parameter in the global momentum, 1≤l≤L;

[0068] S1022. Evaluate the contributions of local model loss and global momentum loss respectively through the loss function; and calculate the fusion coefficient layer by layer by evaluating the local loss reduction and the global loss reduction.

[0069] The loss function is defined as:

[0070]

[0071] Among them, D i is the local data of client i; Loss(·) is the cross entropy loss function; L i is the loss of client i; represents the local model parameters of client i in round t, x i Represents the input features of local data, y i Represents x i The corresponding true label.

[0072] Calculate the per-layer parameter loss of client i’s local model and the per-layer parameter loss of the global model for client i See formulas (2) and (3):

[0073]

[0074] Among them S i ∈D i , is a subset of the local data on client i, which is approximated by small batch data to reduce the computing cost; represents the parameter loss update of each layer of the local model of client i in round t, Represents the parameter loss update of each layer of the global model of client i in round t.

[0075] Then calculate the local loss reduction and the global loss reduction See formulas (4) and (5) respectively:

[0076]

[0077] Reduction based on local losses and the global loss reduction Calculate adaptive fusion parameters To evaluate the contribution of the local model and the global momentum, see formula (6):

[0078]

[0079] S102: The client uses the adaptive fusion parameters obtained in S101 to initialize each layer of the local model, as shown in formula (7):

[0080]

[0081] in, represents the layer l parameters of the local model of the initialized client i.

[0082] S103. After the client is initialized, the stochastic gradient descent (SGD) algorithm is used to train the local model, see formula (8):

[0083]

[0084] in, represents the gradient of the loss function, Indicates the temporary update parameters of client i.

[0085] S104, Adaptive hierarchical upload optimization based on loss contribution: To reduce communication cost, the client Select which layers to upload by setting a threshold ∈. It is considered that the client model update parameters of this layer It is more in line with the local data distribution, so it is not uploaded to the server to reduce communication overhead. Otherwise, it is considered that the client model of this layer updates the parameters More in line with the global goal, upload to the server.

[0086] S105, server layer fusion and global momentum generation: The server receives the clients C participating in this round of training = {c1, c2, ..., c n ,}Uploaded model Then, do the following:

[0087] S1051, hierarchical aggregation: Since the number of model layers uploaded by each client is different, the server hierarchically aggregates the global aggregation parameters of the current t+1 round The aggregation method of model layer l is shown in formula (9):

[0088]

[0089] in is the model aggregation weight. If a layer has no client upload, then

[0090] S1052, Momentum Buffer: The server maintains a momentum buffer to store the latest M rounds of updates from all clients Calculate the historical momentum parameter for each model layer l, see formula (10):

[0091]

[0092] If the historical data of a certain layer is less than M rounds, only the available rounds are considered when taking the average.

[0093] S1053, Momentum Buffer Update: For client i, update the momentum for each model layer l, see formula (11):

[0094]

[0095] S1054 Global Momentum Generation: For each model layer l, combined and Generate global momentum parameters:

[0096]

[0097] Among them, α is a hyperparameter used to balance the weight of the current round model update knowledge and the historical round knowledge. Sent to all clients.

[0098] So far, the global momentum has been completed from the tth round To round t-1 The generation process.

[0099] The above process is repeated until the preset number of rounds or the preset accuracy is reached to generate a personalized model with good performance for each client.

[0100] The present invention significantly improves the personalized accuracy of the model through layer-by-layer adaptive fusion, especially in scenarios with strong data heterogeneity. Specifically, the present invention introduces the adaptive fusion coefficient Based on the loss contribution of each layer and Adaptively adjust the ratio of local and global updates. Since each layer is calculated independently The client can selectively integrate global knowledge for heterogeneous distribution. This hierarchical differentiation directly improves the model's adaptability to local data.

[0101] The present invention enhances the adaptability of the system to the dynamic participation of clients through the momentum buffer mechanism, ensuring that the global model is applicable to scenarios with frequent client changes. Specifically, the present invention introduces a momentum buffer on the server side to store the latest M rounds of updates of all clients. and through Integrate into global parameter generation. This mechanism ensures that historical contributions from non-participating clients can still influence Because the momentum buffer retains information from past rounds, even if a client does not participate in this round, its data features are indirectly involved in aggregation through historical updates.

[0102] The present invention significantly reduces communication overhead and improves the operating efficiency of the federated learning system through the layer selection mechanism based on loss contribution. Layer update Due to the upload volume and Hooking means that the client dynamically adjusts the communication content based on the knowledge contribution. This selective transmission reduces communication overhead and thus improves the overall efficiency of the system.

[0103] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A personalized federated learning method based on hierarchical adaptation and momentum collaboration, characterized by: S101. The client receives the global momentum sent by the server and calculates the loss of the local model and the global momentum through a loss function; the local model and the global momentum have the same number of model layers; By calculating the local loss reduction and global loss reduction and calculating the adaptive fusion parameters layer by layer, the loss contribution of local loss and global loss is evaluated; The global momentum refers to the dynamic set of global model parameters; S102, initializing the parameters of each layer of the local model according to the adaptive fusion parameters; S103, using the stochastic gradient descent algorithm to train the initialized local model; S104, the client adaptively uploads local model parameters in layers; that is, only uploads local model layers with adaptive fusion parameters greater than or equal to the set threshold to the server, and retains local model layers with adaptive fusion parameters less than the set threshold; S105: The server aggregates the local model layers uploaded by all clients in layers to generate global aggregation parameters; The server calculates the historical momentum parameters of all model layers by maintaining a momentum buffer; updates the global momentum by weighting the global aggregation parameter and the historical momentum parameter; S106: The server sends the new global momentum to all clients and repeats steps S101 to S105 until a preset round is reached or the local model reaches a preset accuracy.

2. The method according to claim 1, characterized in that In the tth round of server training, the global momentum sent to client i is expressed as: Where L is the number of model layers; represents the l-th layer model parameter in the global momentum, 1≤l≤L; In round t, client i contains its own local model and global momentum 3. The method according to claim 2, characterized in that The loss of the local model is the loss of the local model parameter of the lth layer of client i for the tth round of training Expressed as: The global momentum loss is the global momentum parameter loss of the lth layer of client i in the tth round of training. Expressed as: Among them S i is a subset of the local data on client i; represents the loss update of the layer l parameter of the local model of client i in the tth round, represents the loss update of the l-th layer parameter of the global momentum of client i in round t.

4. The method according to claim 3, characterized in that The local loss reduction is the local loss reduction of the lth layer of client i for the tth round of training and global momentum reduction The calculation formula is as follows: and reduce the amount according to local losses and the global loss reduction Calculate adaptive fusion parameters To evaluate the contribution of local momentum to global momentum, the calculation formula is as follows: 。 5. The method according to claim 1 or 4, characterized in that The client initialization refers to generating the local model initialization parameters for the t+1th round of training, which are expressed as follows: in, represents the layer l parameters of the local model of client i in round t+1; After the client is initialized, the stochastic gradient descent (SGD) algorithm is used to train the local model for the t+1th round. See the formula: in, represents the gradient of the loss function, Indicates the temporary update parameters of client i.

6. The method according to claim 5, characterized in that In step S015, for the global aggregation parameter of the t+1th round and model layer 1, Expressed as: in Aggregate weights for the model; n is the number of clients participating in the training; if no client uploads model layer l to the server, then 7. The method according to claim 6, characterized in that The momentum buffer stores the most recent M rounds of updates from all clients. The historical momentum parameter is calculated for each model layer l, and the formula is as follows: For model layers with less than M rounds of historical data, only the available rounds are used; The dynamic buffer is updated in each training round; in the t+1th round, each model layer l of client i is updated as follows: 。 8. The method according to claim 1 or 7, characterized in that For model layer 1, the update formula of the global momentum is: Among them, α is a hyperparameter used to balance the weight of the current round model update knowledge and the historical round knowledge. Send to all clients; At this point, the global momentum from round t is completed Global momentum to round t-1 The generation process.

Citation Information

Patent Citations

  • Heterogeneous federal learning method based on momentum alignment technology

    CN118569355A