Personalized federated element learning method based on gradient dynamic clustering

By adopting gradient dynamic clustering and dynamic learning rate adjustment methods in federated learning, the model aggregation problem of traditional federated learning under non-independent homogeneous data and the problem of neglecting personalized needs is solved, and more efficient model convergence and personalized performance are achieved.

CN119691480APending Publication Date: 2025-03-25SHANGHAI UNIV OF ENG SCI
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411511786.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-28
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

When federated learning processes non-independent and homogeneous data, traditional methods find it difficult to effectively aggregate local models, resulting in poor convergence of the global model and ignores the personalized needs of the client, and cannot make personalized adjustments to the data distribution and needs of different clients.

Method used

A personalized federated meta-learning method based on gradient dynamic clustering is adopted. By clustering clients with similar gradients into the same group, the differences within the group are reduced, and a dynamic learning rate adjustment mechanism is introduced to flexibly adjust the learning rate according to the personalized needs of the client.

Benefits of technology

It improves the convergence and accuracy of the global model, significantly improves the performance of the personalized model, effectively deals with data heterogeneity, and enhances the adaptability of the personalized model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119691480A_ABST
    Figure CN119691480A_ABST
Patent Text Reader

Abstract

The invention discloses a personalized federated element learning method based on gradient dynamic clustering, and belongs to the technical field of federated element learning. Comprising the steps that all clients receive a randomly initialized global model sent by a server as an initial local model, local data of the global model is used for model training, and gradient information is calculated; all the clients upload trained local model parameters and gradient information to the server; the server obtains the attention weight of each client based on an attention mechanism; clustering the clients with similar gradients to obtain a plurality of client groups; aggregation of client local model parameters is carried out based on the client group; and the server issues the attention weight and the updated global model parameters to all clients. According to the method, through gradient clustering, interference among different data distribution clients is reduced, convergence and accuracy of a global model are improved, and through dynamic learning rate adjustment, performance of a personalized model is remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of federated meta-learning, and in particular to a personalized federated meta-learning method based on gradient dynamic clustering. Background Art

[0002] Federated Learning (FL), an emerging distributed machine learning approach, allows multiple clients to collaboratively train models without sharing the original data. By keeping data local to the device, FL can leverage datasets distributed across clients to improve model performance while protecting data privacy and security. Consequently, FL has been widely adopted in fields requiring data privacy, such as healthcare, financial services, and smart devices.

[0003] However, federated learning faces many challenges in practical applications, especially when dealing with non-independent and identically distributed (Non-IID) data. Non-IID data refers to data distributions that differ significantly across different clients. This data heterogeneity can lead to degraded global model performance and make it difficult to effectively aggregate local models. Due to differences in user behavior, preferences, and environments, the data distribution of each client is often highly diverse. Traditional federated learning methods, which typically employ unified model update and aggregation strategies, struggle to adequately address this data heterogeneity. Specifically, Non-IID data raises the following two main issues:

[0004] First, under non-IID data conditions, traditional model aggregation methods struggle to effectively process local models from different clients, resulting in poor convergence of the global model. In some cases, the global model may even underperform the client's local model. Due to heterogeneous data distribution, different clients may contribute unevenly to the model, and a unified aggregation strategy would ignore these differences, ultimately affecting the overall model performance.

[0005] Second, existing federated learning methods mostly ignore the personalized needs of clients. With the growing application of federated learning in areas such as personalized recommendations and personalized medicine, the need for model personalization has become increasingly important. Traditional federated learning methods are unable to tailor the data distribution and needs of each client, which not only affects the model's performance on the client side but also limits its potential in personalized applications.

[0006] To address these issues, researchers have proposed the Federated Meta-Learning method, which accelerates the learning of new tasks by learning shared initialization models across multiple tasks. However, under the Federated Meta-Learning framework, how to effectively handle data heterogeneity and enhance the ability of personalized models remains an unresolved key challenge. Summary of the Invention

[0007] To address the shortcomings of the existing technology, this paper proposes a personalized federated meta-learning method based on gradient dynamic clustering (GCA-FML). By clustering clients with similar gradients into the same group, intra-group differences are reduced, ensuring more accurate aggregation of model parameters within each group. A dynamic learning rate adjustment mechanism is also introduced. Through the attention mechanism, the learning rate is flexibly adjusted according to the personalized needs of the client to avoid overfitting or underfitting, thereby better adapting to the data distribution and personalized needs of different clients, solving the problem of data heterogeneity, and improving the performance of personalized models.

[0008] To achieve the above objectives, the present invention provides a personalized federated meta-learning method based on gradient dynamic clustering, comprising the following steps:

[0009] (1) All clients receive the randomly initialized global model sent by the server as the initial local model;

[0010] (2) Each client uses its local data to train a local model, obtains trained local model parameters by minimizing the loss function, and calculates gradient information;

[0011] (3) All clients upload their trained local model parameters and gradient information to the server;

[0012] (4) The server obtains the attention weight of each client based on the gradient information of each client based on the attention mechanism, which is used to update the learning rate of the client;

[0013] (5) The server calculates the gradient similarity between the clients based on the received gradient information of each client, and clusters the clients with similar gradients to obtain several client groups;

[0014] (6) The server aggregates the client local model parameters based on the client group to obtain the updated global model parameters;

[0015] (7) The server sends the attention weights and updated global model parameters to all clients to update the local models and start the next round of training.

[0016] Furthermore, the gradient information is:

[0017]

[0018] Where: θ is the local model parameter; D i is the local dataset; L i (θ; D i ) is the loss function of the local model;

[0019] By minimizing the loss function Get the trained local model parameters and calculate the gradient information.

[0020] Furthermore, the step (4) is specifically as follows:

[0021]

[0022] Where: j = 1, 2, ..., N, N represents the number of the client; λ is the attention parameter set in the initialization phase; g i is the gradient information of the i-th client; Attention(g i , λ) is the attention weight of the i-th client.

[0023] Furthermore, the step (5) is specifically as follows:

[0024] (5.1) using the cosine similarity formula to measure the similarity between the clients;

[0025]

[0026] Where: g i 、g j are the gradient information of the i-th and j-th clients respectively;

[0027] (5.2) Based on the gradient similarity, a hierarchical clustering method is used to gradually merge clients with similar gradients according to the similarity until a predetermined number of clusters is reached, and the clients with similar gradients are clustered to obtain several client groups.

[0028] Furthermore, the step (6) is specifically as follows:

[0029] (6.1) obtaining an intra-group aggregation weight in each client group according to the data volume of each client;

[0030]

[0031] Where: N i is the data volume of the i-th client, n c is the number of clients in group c;

[0032] (6.2) performing weighted aggregation of the local model parameters of the clients in the group according to the intra-group aggregation weights to obtain an aggregation result of the group model parameters;

[0033]

[0034] Where: θ i is the local model parameter of the i-th client;

[0035] (6.3) further aggregating the aggregation results of the group of model parameters based on the total amount of data of all client terminals in each client group to obtain the updated global model parameters of the server;

[0036]

[0037] Where: C is the number of client groups; k is the number of all clients; N i is the data volume of the i-th client; θ t+1 are the updated global model parameters.

[0038] Furthermore, the updating of the new local model in step (7) includes:

[0039] (7.1) adjusting the learning rate according to the attention weight;

[0040]

[0041] in: is the learning rate of the i-th client in the t-th round, is the learning rate of the i-th client in the t+1th round; Attention(g i , λ) is the attention weight issued by the server;

[0042] (7.2) Update the local model according to the adjusted learning rate;

[0043]

[0044] in: are the updated local model parameters, are the local model parameters before updating; is the current gradient information.

[0045] The present invention also provides a personalized federated meta-learning system based on gradient dynamic clustering, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described above when executing the computer program.

[0046] The present invention also provides a computer storage medium having a computer program stored thereon, which implements the steps of the above method when executed by a processor.

[0047] Beneficial effects of the present invention:

[0048] 1. The present invention reduces the interference between clients with different data distributions through gradient clustering, thereby improving the convergence and accuracy of the global model.

[0049] 2. The present invention adjusts the learning rate dynamically, so that the model can be flexibly adjusted according to the personalized needs of the client, significantly improving the performance of the personalized model.

[0050] 3. This invention can effectively handle the data heterogeneity problem in federated learning and enhance the adaptability of personalized models, making it widely applicable to various privacy protection scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 Schematic diagram of the overall framework of the personalized federated meta-learning method based on gradient dynamic clustering in an embodiment of the present invention.

[0052] Figure 2 Schematic diagram of the gradient clustering effect in an embodiment of the present invention.

[0053] Figure 3 Schematic diagram comparing the effects of the method according to the embodiment of the present invention and the traditional federated learning method. DETAILED DESCRIPTION

[0054] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0055] like Figure 1 As shown, an embodiment of the present invention provides a personalized federated meta-learning method based on gradient dynamic clustering, including:

[0056] S101. All clients receive a randomly initialized global model sent by a server as an initial local model.

[0057] In the initial stage of federated learning, the server randomly initializes the global model parameters θ 0 and sends it to all clients participating in training.

[0058] S102. Each of the clients uses its local data to train a local model and calculates gradient information by minimizing a loss function.

[0059] The client uses local data to train the model. Assume that the i-th client holds a local dataset Di Each client i uses a local dataset Di and the initial modelθ 0 to train the model and minimize the loss function L i (θ; D i )Calculate the gradient:

[0060]

[0061] Where: θ is the local model parameter; D i is the local dataset; L i (θ; D i ) is the loss function of the local model.

[0062] S103: All clients upload their local model parameters and gradient information to the server.

[0063] All clients set their local model parameters θ i and gradient information g i Upload to the server for subsequent aggregation updates.

[0064] S104. The server obtains the attention weight of each client according to the gradient information of each client based on the attention mechanism, which is used to update the learning rate of the client.

[0065] The attention weight is calculated based on the gradient information of each client based on the attention mechanism:

[0066]

[0067] Where: j = 1, 2, ..., N, N represents the number of clients; λ is the attention parameter set in the initialization phase; g i is the gradient information of the i-th client; Attention(g i ,λ) is the attention weight of the i-th client.

[0068] S105 , the server receives the gradient information uploaded by each client, calculates the gradient similarity between the clients, and clusters the clients with similar gradients to obtain several client groups.

[0069] (1) Use the cosine similarity formula to measure the similarity between clients;

[0070]

[0071] Where: g i 、g j are the gradient information of the i-th and j-th clients respectively.

[0072] By calculating the gradient similarity between all clients, the server is able to evaluate the data distribution differences of the clients.

[0073] (2) Using the hierarchical clustering method, clients with similar gradients are gradually merged based on gradient similarity until the predetermined number of clusters is reached. Clients with similar gradients are clustered to obtain several client groups.

[0074] Based on gradient similarity, clients with similar gradients are clustered into the same group, and clients within each group will share an aggregated intra-group model, such as Figure 2 shown.

[0075] S106: The server aggregates the client local model parameters based on the client group to obtain the updated global model parameters.

[0076] (1) Intra-group model parameter aggregation

[0077] (1.1) Each client group obtains the intra-group aggregation weight based on the data volume of each client;

[0078]

[0079] Where: N i is the data volume of the i-th client (each client will send data volume information to the server), n c is the number of clients in group c.

[0080] (1.2) performing weighted aggregation of the local model parameters of the clients in the group according to the aggregation weight within the group to obtain the aggregation result of the model parameters of the group;

[0081]

[0082] in: θ , is the local model parameter of the i-th client.

[0083] This formula ensures that clients with larger data volumes have a greater impact on the update of the model within the group, thereby improving the accuracy of the model within the group.

[0084] (2) Global model update: The aggregated results of the model parameters of each client group are further aggregated based on the total amount of data from all client terminals in the client group to obtain the updated global model parameters of the server;

[0085]

[0086] Where: C is the number of client groups; k is the number of all clients; N i is the data volume of the i-th client; θ t+1 are the updated global model parameters.

[0087] The aggregated global model θ t+1Will be used for the next round of client local model updates.

[0088] S107: The server sends the attention weights and updated global model parameters to all clients to update the local models and start the next round of training.

[0089] In each round of training, the client needs to update its local model parameters based on the learning rate and updated global model parameters, and train the model based on local data. To better adapt to the data distribution of different clients, the learning rate is dynamically adjusted during training based on the attention weights sent by the server.

[0090] (1) Adjust the learning rate according to the attention weight:

[0091]

[0092] in: is the learning rate of the i-th client in the t-th round, is the learning rate of the i-th client in the t+1th round; Attention(g i , λ) is the attention weight sent by the server.

[0093] Dynamic learning rate can help clients learn their personalized models more effectively and avoid overfitting or underfitting.

[0094] (2) Update the local model according to the adjusted learning rate;

[0095]

[0096] in: are the updated local model parameters, are the local model parameters before updating; is the current gradient information.

[0097] In order to verify the effectiveness of the personalized federated meta-learning method (GCA-FML) based on gradient dynamic clustering of the present invention, the performance of the inventive method was compared with that of traditional federated learning methods (FedAvg, FedMeta, FedProx and Per-FedAvg) on ​​different data sets. In particular, in the non-independent and identically distributed (Non-IID) data environment, the performance of GCA-FML and traditional federated learning methods in terms of model convergence speed, global model performance and personalization ability were compared. Among them, GCA_FML and GCA-FML_p represent the attention-free framework and the attention-based framework, respectively.

[0098] The contrast effect is as follows Figure 3As shown in the figure, GCA-FML shows significant advantages over these methods, especially in the case of large data heterogeneity, and can better maintain the stability and high performance of the global model. The specific performance is shown in the following table (performance after 800 rounds of communication):

[0099] Table 1

[0100]

[0101] As can be seen, on the MNIST dataset, GCA-FML's global model achieves a test accuracy of 93.78% after 800 rounds of communication, while the traditional FedAvg achieves an accuracy of 91.89% under the same number of rounds. FedProx and Per-FedAvg achieve accuracies of 91.90% and 92.58%, respectively. On the synthetic dataset, GCA-FML's global model accuracy is 82.85%, a significant improvement over FedAvg (78.11%) and FedProx (76.29%). Although Per-FedAvg achieves an accuracy of 81.26%, it is still lower than the performance of GCA-FML.

[0102] The above describes in detail the preferred embodiments of the present invention. It should be understood that those skilled in the art can make numerous modifications and variations based on the concepts of the present invention without inventive effort. Therefore, any technical solutions that can be derived by those skilled in the art through logical analysis, reasoning, or limited experimentation based on the concepts of the present invention and the prior art should be within the scope of protection defined by the claims.

Claims

1. A personalized federated meta-learning method based on gradient dynamic clustering, characterized in that: The steps include: (1) All clients receive the randomly initialized global model sent by the server as the initial local model; (2) Each of the clients uses its local data to train a local model, obtains trained local model parameters by minimizing the loss function, and calculates gradient information; (3) All clients upload their trained local model parameters and gradient information to the server; (4) The server obtains the attention weight of each client according to the gradient information of each client based on the attention mechanism, which is used to update the learning rate of the client; (5) The server calculates the gradient similarity between the clients based on the received gradient information of each client, and clusters the clients with similar gradients to obtain a number of client groups; (6) The server aggregates the local model parameters of the clients based on the client group to obtain updated global model parameters; (7) The server sends the attention weights and updated global model parameters to all clients to update the local models and start the next round of training.

2. The personalized federated meta-learning method based on gradient dynamic clustering according to claim 1, characterized in that: The gradient information is: Where: θ is the local model parameter; D i is the local dataset; L i (θ; D i ) is the loss function of the local model; By minimizing the loss function Get the trained local model parameters and calculate the gradient information.

3. The personalized federated meta-learning method based on gradient dynamic clustering according to claim 1, characterized in that: The step (4) is specifically: Where: jj = 1, 2, ..., N, N represents the number of the client; λ is the attention parameter set in the initialization phase; g i is the gradient information of the i-th client; Attention(g i , λ) is the attention weight of the i-th client.

4. The personalized federated meta-learning method based on gradient dynamic clustering according to claim 1, characterized in that: The step (5) is specifically as follows: (5.1) using the cosine similarity formula to measure the similarity between the clients; Where: g i , g j are the gradient information of the i-th and i-th clients respectively; (5.2) Based on the gradient similarity, a hierarchical clustering method is used to gradually merge clients with similar gradients according to the similarity until a predetermined number of clusters is reached, and the clients with similar gradients are clustered to obtain a number of client groups.

5. The personalized federated meta-learning method based on gradient dynamic clustering according to claim 1, characterized in that: The step (6) is specifically as follows: (6.1) obtaining an intra-group aggregation weight in each of the client groups according to the amount of data of each client; Where: N i is the data volume of the i-th client, n c is the number of the clients in group c; (6.2) performing weighted aggregation of the local model parameters of the clients in the group according to the aggregation weight within the group to obtain an aggregation result of the model parameters of the group; Where: θ i is the local model parameter of the i-th client; (6.3) further aggregating the aggregation results of the group of model parameters according to the total amount of data of all the client terminals in each of the client groups to obtain the global model parameters updated by the server; Where: C is the number of client groups; k is the number of all clients; N i is the data volume of the i-th client; θ t+1 are the updated global model parameters.

6. The personalized federated meta-learning method based on gradient dynamic clustering according to claim 1, characterized in that: The updating of the new local model in step (7) includes: (7.1) adjusting the learning rate according to the attention weight; in. is the learning rate of the i-th client in the t-th round, is the learning rate of the i-th client in the t+1th round; Attention(g i , λ) is the attention weight sent by the server; (7.2) Update the local model according to the adjusted learning rate; in: is the updated local model parameter, is the local model parameter before updating; is the current gradient information.

7. A personalized federated meta-learning system based on gradient dynamic clustering, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.

8. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Cited By

  • Federal learning data processing method and device and storage medium

    CN121903031A

  • Federated learning data processing method and apparatus, and storage medium

    CN121903031B