A personalized federated learning training method based on constructing inter-client collaboration graph

By constructing a collaboration graph among clients and utilizing KL divergence to quantify feature distribution differences, the problems of data heterogeneity and attacks in federated learning are solved, achieving robustness and performance improvement of personalized models.

CN119067199BActive Publication Date: 2026-02-27INSTITUTE OF INFORMATION ENGINEERING CHINESE ACADEMY OF SCIENCES
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411005467.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-25
Publication Date
2026-02-27
Estimated Expiration
2044-07-25

AI Technical Summary

Technical Problem

Traditional federated learning algorithms assume that client data is independent and identically distributed, which leads to data heterogeneity that hinders model performance and convergence. Personalized federated learning cannot accurately assess the differences in client feature distribution and achieve targeted collaboration.

Method used

By constructing a collaboration graph among clients, utilizing KL divergence to quantify feature distribution differences, constructing a directed collaboration graph and performing weighted summation, and combining local optimization and regularization, the aggregation of personalized models is achieved.

Benefits of technology

It improves the performance and generalization ability of the model in a federated environment, adapts to the specific needs of different clients, generates robust personalized models, and resists data heterogeneity and attacks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119067199B_ABST
    Figure CN119067199B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on the personalized federated learning training method of constructing inter-client cooperation graph, belong to federated learning technical field.The core steps of the application include:1) based on the feature distribution distance between client based on KL divergence calculation,2) based on the construction of normalized directed cooperation graph after adjacency matrix calculation,3) the model with structure information based on the aggregation of directed graph,4) local optimization.The application is mainly related to the challenge faced by data distribution heterogeneity, especially related to the modeling of potential relationship between client data distribution, by constructing client cooperation graph and proposing cooperation graph assisted personalized aggregation and training method, alleviate the challenge such as data heterogeneity, promote knowledge sharing in personalized federated learning.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of network security, and relates to federated learning technology, in particular to a personalized federated learning training method based on constructing a client collaboration graph, which realizes the robustness and effectiveness of the model and promotes knowledge sharing in personalized federated learning. BACKGROUND

[0002] With increasing concerns about data privacy and security, federated learning has become an important tool for multiple clients to jointly train shared models. However, traditional federated learning algorithms such as FedAvg are based on the assumption that the local data distribution of clients is independent and identically distributed. In actual situations, the data distribution of clients often differs. Some clients have abundant data in certain categories, while other clients have scarce data in these categories. This data heterogeneity hinders model performance and convergence, making it a significant challenge to learn a global model that meets the needs of all clients. Personalized federated learning, as a new paradigm, allows each client to train a personalized model to capture the specific characteristics of its data and benefit from the knowledge learned by other clients. However, personalized federated learning faces many challenges, including the variation of client feature distribution across different training rounds and the impact of different personalized aggregation mechanisms on fairness and efficiency.

[0003] Traditional personalized federated learning methods include incorporating regularization terms into the loss function to balance the local model performance and the aggregated model obtained through client collaboration. However, this method often fails to accurately assess the differences in client feature distribution and cannot achieve more targeted collaboration during aggregation. SUMMARY

[0004] To address the issue of uneven client data distribution in federated learning, the present patent aims to provide a unique personalized federated learning training method based on constructing a collaboration graph between clients. This method optimizes the aggregation process by integrating fine-grained client collaboration. A collaboration graph between clients is obtained based on the KL divergence method to quantify the differences in client feature distribution.

[0005] The method disclosed in this patent uses a feature distribution distance matrix between clients to construct a collaboration graph, which guides server-side aggregation and client regularization. This method breaks through the limitations of traditional federated learning, promotes knowledge sharing and collaboration between clients, and provides new ideas and methods for model training.

[0006] The method disclosed in this patent has achieved significant results in enhancing the overall performance and generalization ability of models in a federated environment. By introducing inter-client collaboration regularization, it can effectively adapt to the specific needs and data distribution of different clients, thereby generating personalized and robust models.

[0007] The method disclosed in the patent can effectively solve the challenges related to data heterogeneity and attacks. Through the carefully designed collaboration graph and client regularization, the robustness and performance of the model can be maintained when dealing with data heterogeneity and pollution, providing an effective solution for the stable operation of the federated learning system.

[0008] The technical solutions of the present application are:

[0009] A personalized federated learning training method based on constructing a collaboration graph between clients, comprising the following steps:

[0010] 1) Deploy an initially identical shared model on each client; divide the shared model of each client into a feature extractor and a classifier; each client inputs local training data into the feature extractor to obtain feature representation and sends it to the classifier; at the same time, the client calculates the mean μ and variance σ of the data feature distribution and sends them to the server; 2

[0011] 2) For any two clients i and j, the server calculates the KL divergence D

[0012] between the feature distributions of client i and client j based on the mean and variance of the data feature distribution of client i and the mean and variance of the data feature distribution of client j ij ; wherein, is the mean and variance of the feature distribution corresponding to the local training data of client i, is the mean and variance of the feature distribution corresponding to the local training data of client j;

[0013] 3) The server constructs a matrix D based on the KL divergence between the feature distributions of each client; wherein the element D ij in the ith row and jth column of the matrix D is the KL divergence D ij ; then normalize the elements of each row of the matrix D, and the obtained normalized matrix is used as an adjacency matrix, based on which a directed collaboration graph is constructed; wherein each client corresponds to a node in the directed collaboration graph, and the weight of the edge between the corresponding two nodes is determined according to the normalized value between the two nodes in the adjacency matrix;

[0014] 4) The server obtains the edge weight of each client i with all nodes based on the directed collaboration graph; for each client i, the server performs weighted summation on the shared models of the adjacent clients of the client i according to the weight corresponding to the client i, obtains the aggregated model of the client i, and sends it to the client i; i = 1 ~ K, K is the total number of clients;​

[0015] 5) Client i trains the aggregated model using the local training dataset and computes the loss function

[0016] Then the local shared model is updated using the stochastic gradient descent method according to the loss function value; wherein, F i () is the empirical loss function, θ i is the model parameter of the shared model on the client i,

[0017] θ i ′ is the model parameter of the aggregated model of the client i, λ is a proportional coefficient, θ K is the model parameter of the shared model on the client K;

[0018] 6) Client i processes the local training data using the updated shared model to obtain the mean μ and variance σ of the feature distribution of the data 2 and sends it to the server side with the updated shared model parameter;

[0019] 7) Repeat steps 2) to 6) until each client reaches a predetermined number of iterations or the shared model converges.

[0020] Further, the matrix D is normalized.

[0021] Further, wherein the size of the feature representation is HxW, C is the number of channels of the feature representation, N i is the number of local training data of the client i, h(x n ) is the feature representation obtained by inputting the training data x n to the feature extractor.

[0022] Further,

[0023] Further,

[0024] Further, the local training data is image data labeled with image categories.

[0025] An image recognition method, characterized in that a to-be-recognized image is input to the shared model trained by the above method to obtain the image category of the to-be-recognized image.

[0026] Compared with the prior art, the above technical scheme has the following advantages:

[0027] ​1) The method quantifies the difference in client feature distribution based on KL divergence, which can accurately describe the relationship between clients.

[0028] 2) The fine-grained collaboration graph is constructed, providing a structured and explicit representation of client knowledge contribution.

[0029] 3) Based on the inspiration of GCN technology, the personalized aggregation method based on directed graph is adopted, considering the correlation and collaboration strength between clients, which promotes effective and robust knowledge sharing. BRIEF DESCRIPTION OF DRAWINGS

[0030] Figure 1 The personalized federated learning aggregation method framework based on the construction of the collaboration graph between clients.

[0031] Figure 2 Convergence comparison chart under attack-free scenario;

[0032] (a) Under Dir(0.01) heterogeneous distribution, in the attack-free scenario, the performance of each method on the cifar10 dataset,

[0033] (b) Under Dir(0.1) heterogeneous distribution, in the attack-free scenario, the performance of each method on the cifar10 dataset,

[0034] (c) Under Dir(0.01) heterogeneous distribution, in the attack-free scenario, the performance of each method on the cifar100 dataset

[0035] (d) Under Dir(0.1) heterogeneous distribution, in the attack-free scenario, the performance of each method on the cifar100 dataset.

[0036] Figure 3 Convergence comparison chart under two attack scenarios;

[0037] (a) Under Dir(0.1) heterogeneous distribution, in the noise injection scenario, the performance of each method on the cifar10 dataset,

[0038] (b) Under Dir(0.1) heterogeneous distribution, in the label random flip scenario, the performance of each method on the cifar10 dataset. DETAILED DESCRIPTION

[0039] In order to make the technical solutions of the present application more obvious and easy to understand, examples are given and combined with the drawings to clearly and completely describe the technical solutions in the embodiments of the present application.

[0040] The main core steps of the personalized aggregation method for constructing inter-client collaborative graph disclosed in the patent include: (1) calculating the feature distribution distance between clients based on KL divergence, (2) constructing a directed collaborative graph based on the normalized adjacency matrix calculated, (3) a model with structural information based on the aggregation of the directed graph, (4) local optimization, and the framework diagram is as shown in Figure 1

[0041] The details of each key step and its sub-step will be introduced below.

[0042] (1) Calculate the feature distribution distance between clients based on KL divergence:

[0043] a) Initialize a same shared model for each client, and divide the shared model of each client into a feature extractor (bottom convolutional layer) and a classifier (top linear layer). Input all local training data of the i-th client into the feature extractor, and output the feature representation h(x n ). If the output feature representation has a size of HxW with C channels, the output feature

[0044] The mean μ and variance σ of the feature distribution output by the feature extractor of each client are obtained by the following formula 2 .

[0045]

[0046]

[0047] b) Calculate the KL divergence of the feature distribution between two clients, which is represented by the following formula.

[0048]

[0049] (2) Construct a directed collaborative graph based on the normalized adjacency matrix calculated:

[0050] a) Assume that there are K clients, and describe the feature distribution distance between the clients as a matrix, where each element D ij represents the KL divergence distance between the i-th client and the j-th client, and the information in the i-th row represents the KL divergence distance between the i-th client and all other clients.

[0051]

[0052] b) Normalize the elements of each row, which is represented by the following formula.

[0053]

[0054] ​​c) Treat the normalized matrix as an adjacency matrix and construct a directed cooperation graph, where each value of the matrix corresponds to the weight of each edge, and each client is represented by a node. Edges are determined based on the adjacency matrix, and an edge connects any two nodes.

[0055] (3) Aggregation of structural information based on directed collaboration graphs:

[0056] After obtaining the directed collaboration graph, the weight of the edge between each client i and all nodes is {w}. ij |j=1,2,...,K}. For each client i, the server determines the weights based on the weights {w}. ij Model of |j=1,2,...,K} and its neighboring clients

[0057] {θ j We perform a weighted summation on |j=1,2,...,K} to provide fine-grained aggregation for each client, resulting in an aggregation model θ specific to that client. i ′ Then it is sent back to the corresponding client.

[0058] The formula is as follows:

[0059]

[0060] (4) Local optimization:

[0061] a) Each client receives the model parameters θ sent back by the server. i ′ The local dataset is used for training, and a new feature representation is output through the feature extractor. The mean of the feature distribution of the client at the (t+1)th iteration is calculated according to the description in step (1). and variance

[0062] b) During the training process It is the local empirical loss function. By adding a regularization term to the local empirical loss function, the local model parameters θ are constrained. i With model parameters θ containing structural information i ′ The distance between them. A scaling factor λ is used to balance generalization and individualization capabilities. The final objective function is as follows:

[0063]

[0064] c) Update the local model parameters using stochastic gradient descent with a learning rate of η.

[0065]

[0066] d) Repeat steps b and c until a predetermined number of local iterations. Then send back the updated local model parameters, mean and variance of the feature distribution to the server side.

[0067] (5) Iteration:

[0068] Repeat steps (1) to (4) until each client reaches a predetermined number of iterations or reaches convergence.

[0069] The shared model trained in the scenario of heterogeneous data at each client can perform accurate image recognition at the client, input image, and output image category.

[0070] Experimental verification

[0071] In order to prove the innovation of the patent, MNIST, Cifar10, Cifar100 three data sets are used, and the classic method FedAvg, Ditto and other related methods are compared. The patent uses accuracy as an indicator to evaluate the effectiveness of the personalized model in different data heterogeneous scenarios, and to evaluate the robustness of the personalized model in different attack scenarios. The evaluation of the experimental results is as follows.

[0072] 1) Effectiveness:

[0073] The patent uses Dirichlet distribution as the data division strategy, simulates the heterogeneous distribution across clients, and adjusts the parameters to control the heterogeneity of each client, represented by Dir(α). The smaller α, the higher the heterogeneity level. On the contrary, higher α indicates that the data sets between clients have more similarity. In the experiment, we set α to 0.1 and 0.01 to represent moderate data heterogeneity. We select 20 clients in each communication round, and we also set the local training period to 1, and the global communication round is uniformly set to 100 in all data sets.

[0074] Table 1 Test accuracy without attack scenario

[0075]

[0076] Without external disturbance, the method ICCR proposed in the patent is superior to other methods in terms of average test accuracy, with a maximum value of 2.62% and 3.51% respectively on Cifar10 and Cifar100 data sets. The collaborative graph enables each client to share knowledge more effectively between clients, thereby generating a more accurate global model.

[0077] Figure 2The convergence process of ICCR in different non-i.i.d scenarios is demonstrated. Compared with other methods, ICCR achieves higher accuracy on Cifar10 and Cifar100 under the heterogeneous condition of α = 0.01, and maintains stable performance after convergence without significant fluctuations. When α = 0.1, ICCR still has significant advantages in convergence and accuracy.

[0078] 2) Robustness:

[0079] This patent evaluates the robustness under two attack settings. One is Gaussian noise injection, where we directly inject Gaussian noise into the parameters of the model for selected clients to confuse the learned representation. The other is label randomization, where the true labels of the data are replaced with random class labels, misleading the model optimization during gradient descent.

[0080] Table 2 Test accuracy under two attack scenarios

[0081]

[0082] Table 2 shows the performance advantage of ICCR under different attacks. Under the influence of Gaussian noise, ICCR shows significant robustness, with an increase of 3.65%, 6.60%, and 0.01% in accuracy compared to the best method in other methods on CIFAR-10, CIFAR-100, and MNIST datasets, respectively. In the label randomization scenario, ICCR still performs well. Collaborative graphs help to reduce the impact of malicious clients by emphasizing the similarity in feature representation, thus maintaining the integrity of model predictions. On the CIFAR-10 and CIFAR-100 datasets, ICCR is 3.55% and 4.22% higher than the highest value of other baselines, respectively.

[0083] Figure 3 The comparison of all methods under two attacks is shown. ICCR shows superior convergence and robustness, indicating that our method of constructing fine-grained collaboration graphs between clients can modify the hidden collaboration relationship between clients and hidden clients when some clients are attacked. This allows us to reduce the impact of noisy clients by assigning smaller weights based on the disturbed feature distribution, ensuring the stability, accuracy, and robustness of the global model.

[0084] 3) Hyperparameter analysis:

[0085] This patent has a regularization coefficient as a hyperparameter in the optimization objective formula of each client. To study the impact of regularization, we set the coefficient λ to 0.01, 0.1, 0.5, and 5.0 for experiments, and evaluate the model accuracy on Cifar10 and Cifar100 datasets.

[0086] Table 3 compares the accuracy of the method under different hyperparameters

[0087]

[0088]

[0089] The coefficient 0.01 emphasizes personalization by reducing the regularization impact, while 5.0 promotes the global model approach, enhancing stability and robustness. The intermediate values of 0.1 and 0.5 provide a balance that facilitates in-depth research into the optimal regularization required for effective learning in different federated environments. As shown in Table 3, different values of λ can improve the average test accuracy. When λ = 0.01 and 0.1, the performance decreases compared to λ = 0.5 and 5.0, as lower λ means lower regularization and results in local models learning less inter-client knowledge from neighboring clients. The best performance is achieved when λ is 5.0. This means that λ = 5.0 achieves a better balance between personalization and generalization on the dataset.

[0090] The above examples are only used to illustrate the technical solutions of the present application but not to limit it, and the ordinary skilled in the art can modify or equivalently replace the technical solutions of the present application, and the protection scope of the present application is subject to the claims.

Claims

1. A personalized federated learning training method based on constructing an inter-client collaborative graph, comprising the following steps: 1) deploying an initial same shared model on each client; dividing the shared model of each client into a feature extractor and a classifier; Each of the clients inputs local training data to a feature extractor to obtain a feature representation and sends it to a classifier; meanwhile, the clients compute the mean μ and variance σ of the data feature distribution and send them to the server 2 end 2) For any two clients i, client j, the server side calculates the KL divergence D between the feature distribution of client i and the feature distribution of client j according to the feature distribution of the client data ij ; wherein, is the mean and variance of the feature distribution corresponding to the local training data of client i, is the mean and variance of the feature distribution corresponding to the local training data of client j;​ 3) the server constructs a matrix D according to the KL divergence of the feature distribution between each client; wherein the element D ij is the KL divergence D ij ; then the elements of each row of the matrix D are normalized, and the obtained normalized matrix is used as an adjacency matrix, based on which a directed collaborative graph is constructed; wherein each client corresponds to a node in the directed collaborative graph, and the weight of the edge between two nodes is determined according to the normalized value between the two nodes in the adjacency matrix; 4) the server obtaining the weight of the edge between each client i and all nodes according to the directed collaborative graph; for each client i, the server performs weighted summation on the shared models of the neighboring clients of the client i according to the corresponding weight of the client i, obtains the aggregated model of the client i, and sends it to the client i; i = 1 ~ K, K is the total number of clients; 5) Client i trains the aggregated model using the local training dataset and computes the loss function Then the local shared model is updated according to the loss function value using the stochastic gradient descent method; wherein, F i () is the empirical loss function, θ i is the model parameter of the shared model on the client i, θ i ′ are model parameters of the aggregated model for client i, λ is a scaling factor, θ K are model parameters of the shared model on client K; 6) Client i processes the local training data using the updated shared model to obtain the mean μ and variance σ of the feature distribution of the data 2 and sends it to the server side with the updated shared model parameters; 7) repeating steps 2) ~ 6) until each client reaches a predetermined number of iterations or the shared model converges.

2. The method of claim 1, wherein, Utilizing normalizing the matrix D.

3. The method of claim 1, wherein, where the size of the feature representation is H x W, C is the number of channels of the feature representation, N i is the number of local training data for client i, h(x n ) is the feature representation obtained by inputting the training data x n to the feature extractor.

4. The method of claim 1, wherein, 5. The method of claim 1, wherein, 6. The method of claim 1, wherein, The local training data is image data labeled with image categories.

7. An image recognition method characterized by, Inputting a to-be-identified image into the shared model trained by the method of claim 1 to obtain the image category of the to-be-identified image.

Citation Information

Patent Citations

  • Personalized federal learning method based on super network and layer-level collaborative graph aggregation

    CN117892805A

  • Heterogeneous federated learning privacy protection method and system based on diffusion model

    CN118211268A