Personalized federal learning training method based on construction of collaboration diagram between clients

By constructing a client collaboration graph based on KL divergence, quantifying the differences in client feature distribution, the data heterogeneity and personalized aggregation mechanism efficiency problems in traditional federated learning are solved, and personalized and robust model training is realized, and the model is improved Performance and robustness.

CN119067199AActive Publication Date: 2024-12-03INSTITUTE OF INFORMATION ENGINEERING CHINESE ACADEMY OF SCIENCES
View PDF 5 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Traditional federated learning algorithm assumes that the client data distribution is independent and homogeneous, resulting in data heterogeneity hindering model performance and convergence. Personalized federated learning faces the influence of changes in client feature distribution and aggregation mechanism on fairness and efficiency.

Method used

By building a client collaboration graph based on KL divergence, quantify the differences in client feature distribution, guide server-side aggregation and client regularization, and realize personalized and robust model training.

Benefits of technology

Improve the performance and generalization capabilities of the model in a federated environment, adapt to the data distribution of different clients, generate personalized and robust models, solve the challenges related to data heterogeneity and attacks, and ensure model robustness and performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119067199A_ABST
    Figure CN119067199A_ABST
Patent Text Reader

Abstract

The invention discloses a personalized federated learning training method based on construction of a collaboration diagram between clients, and belongs to the technical field of federated learning. The method comprises the core steps of 1) calculating a feature distribution distance between clients based on KL divergence, 2) constructing a directed collaboration graph based on normalization of a calculated adjacency matrix, 3) aggregating a model with structural information based on the directed graph, and 4) performing local optimization. The method mainly relates to challenges confronted by data distribution heterogeneity, in particular to potential relation modeling among client data distribution, the challenges of data heterogeneity and the like are relieved by constructing a client collaboration diagram and providing a collaboration diagram assisted personalized aggregation and training method, and knowledge sharing in personalized federal learning is promoted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of network security technology and relates to federated learning technology, and in particular to a personalized federated learning training method based on building a client collaboration graph, which achieves the robustness and effectiveness of the model and promotes knowledge sharing in personalized federated learning. Background Art

[0002] With the increasing attention paid to data privacy and security, the paradigm of 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 the client is independent and identically distributed, while in reality, the data distribution of clients often varies. 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 huge challenge to learn a global model that meets the needs of all clients. As an emerging paradigm, personalized federated learning allows each client to train a personalized model to capture the specific features of its data and benefit from the knowledge learned by other clients. However, personalized federated learning faces many challenges, including changes in the distribution of client features between 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 achieve a balance between local model performance and the aggregated model obtained through client collaboration. However, this approach often fails to accurately evaluate the differences in client feature distributions and fails to achieve more targeted collaboration during aggregation. Summary of the invention

[0004] In response to the problem of uneven distribution of client data in federated learning, this patent aims to provide a unique personalized federated learning training method based on building a collaboration graph between clients. This method integrates fine-grained client collaboration to optimize the aggregation process. A collaboration graph between clients is obtained by quantifying the differences in client feature distribution based on the KL divergence method.

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

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

[0007] The method disclosed in this patent can effectively solve the challenges related to data heterogeneity and attacks. Through carefully designed collaboration graphs 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 solution of the present invention is:

[0009] A personalized federated learning training method based on building a collaboration graph between clients, the steps of which include:

[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 2 , and send it to the server;

[0011] 2) For any two clients i and j, the server distributes the client data features according to the client data features.

[0012] The distribution of client j data characteristics Calculate the KL divergence D of the feature distribution between client i and client j ij ;in, 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 according to the KL divergence of the feature distribution between the clients; wherein the element D in the i-th row and j-th column of the matrix D is 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, and a directed collaboration graph is constructed based on the adjacency matrix; wherein each client corresponds to a node in the directed collaboration graph, and the weight of the edge between the two nodes is determined according to the normalized value between the two nodes in the adjacency matrix;

[0014] 4) The server obtains the weight of the edge between each client i and all nodes according to 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 uses the local training data set to train the aggregation model and calculate the loss function

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

[0017] θ i ′ is the model parameter of the aggregation model of client i, λ is the scale factor, θ K are the model parameters of the shared model on client K;

[0018] 6) Client i uses the shared model after training and update to process the local training data to obtain the mean μ and variance σ of the feature distribution of the data. 2 And send it and the updated shared model parameters to the server;

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

[0020] Further, using The matrix D is normalized.

[0021] Furthermore, Among them, the size of the feature representation is H×W, C is the number of channels of the feature representation, N i is the number of local training data of client i, h(x n ) is the training data x n Input to the feature extractor to obtain the feature representation.

[0022] Furthermore,

[0023] Furthermore,

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

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

[0026] Compared with the prior art, the present invention adopts the above technical solution and has the following advantages:

[0027] 1) This method uses the KL divergence method to quantify the differences in client feature distribution and can accurately describe the relationship between clients.

[0028] 2) Constructing a refined collaboration graph, which provides a structured and explicit representation of client knowledge contributions.

[0029] 3) Inspired by GCN technology, a personalized aggregation method based on directed graph is adopted, which takes into account the correlation and collaboration intensity between clients and promotes effective and robust knowledge sharing. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 A personalized federated learning aggregation method framework based on building a collaboration graph between clients.

[0031] Figure 2 This is a comparison chart of convergence in the scenario without attack;

[0032] (a) Performance of various methods on the cifar10 dataset in the non-attack scenario under the Dir (0.01) heterogeneous distribution.

[0033] (b) Performance of each method on the cifar10 dataset in the non-attack scenario under the Dir (0.1) heterogeneous distribution.

[0034] (c) Performance of various methods on the cifar100 dataset in the non-attack scenario under the Dir (0.01) heterogeneous distribution

[0035] (d) Performance of various methods on the cifar100 dataset in the non-attack scenario under the Dir (0.1) heterogeneous distribution.

[0036] Figure 3 This is a comparison chart of convergence under two attack scenarios;

[0037] (a) Performance of various methods on the cifar10 dataset under Dir(0.1) heterogeneous distribution and in the scenario with noise injection.

[0038] (b) Performance of various methods on the cifar10 dataset under the Dir(0.1) heterogeneous distribution and in the scenario of random label flipping. DETAILED DESCRIPTION

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

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

[0041] The following is a detailed introduction to each key step and its sub-steps.

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

[0043] a) Initialize an identical 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 into the feature extractor, and output the feature representation h(x n ). If the output feature representation size is H×W and has C channels. Then the output feature

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

[0045]

[0046]

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

[0048]

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

[0050] a) Assuming there are K clients, the feature distribution distance between clients is described as a matrix, where each element D ij It 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 and express them using the following formula.

[0053]

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

[0055] (3) Aggregation model with structural information based on directed collaboration graph:

[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 calculates the weight {w ij |j=1,2,...,K} for its and neighboring clients

[0057] {θ j |j=1,2,...,K} to perform weighted summation and provide fine-grained aggregation for each client, thus obtaining an aggregation model θ specific to the client. i ′ , and then 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 ′ , use the data of the local dataset for training, output the new feature representation through the feature extractor, and calculate the mean of the feature distribution of the client at the t+1th iteration according to the description of step (1) and variance

[0062] b) During the training process, is the local experience loss function, and a regularization term is added after the local experience loss function to constrain the local model parameter θ i and the model parameter θ with structural information i ′ The distance between them. The proportional coefficient λ is used to balance the generalization and personalization 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 the predetermined number of local iterations is reached. Then the updated local model parameters, mean and variance of the feature distribution are sent back to the server.

[0067] (5) Iteration:

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

[0069] This shared model, trained in a scenario where data from each client is heterogeneous, can perform accurate image recognition on the client, input images, and output image categories.

[0070] Experimental verification

[0071] In order to prove the innovation of this patent, three data sets, MNIST, Cifar10, and Cifar100, were used to conduct experimental comparisons with related methods such as FedAvg and Ditto. Based on accuracy as an indicator, this patent evaluates the effectiveness of the personalized model in different data heterogeneity scenarios and evaluates the robustness of the personalized model in different attack scenarios. The evaluation of the experimental results is as follows.

[0072] 1) Validity:

[0073] This patent adopts Dirichlet distribution as a data partitioning strategy to simulate heterogeneous distribution across clients. The degree of heterogeneity of each client is controlled by adjusting parameters, represented by Dir(α). The smaller α is, the higher the level of heterogeneity. Conversely, a higher α means that the datasets between clients have more similarities. In the experiment, we set α to 0.1 and 0.01, representing a moderate degree of data heterogeneity. We select 20 clients in each communication round. We also set the local training epoch to 1, and the global communication round is uniformly set to 100 in all datasets.

[0074] Table 1 Test accuracy in non-attack scenarios

[0075]

[0076] In the absence of external disturbances, the ICCR method proposed in this patent outperforms other methods in average test accuracy, which is 2.62% and 3.51% higher than the highest values ​​of other methods on the Cifar10 and Cifar100 datasets respectively. The collaboration graph enables each client to share knowledge more effectively among clients, thereby generating a more accurate global model.

[0077] Figure 2The convergence process of ICCR in different non-iid scenarios is demonstrated. Under heterogeneous conditions of α = 0.01, ICCR achieves higher accuracy on Cifar10 and Cifar100 compared with other methods, 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 robustness under two attack settings. One is Gaussian noise injection. For selected clients, we inject Gaussian noise directly into the model parameters to confuse the learned representation. The other is label randomization, which replaces the real label of the data with a random category label, thereby misleading the model optimization during the gradient descent process.

[0080] Table 2 Test accuracy under two attack scenarios

[0081]

[0082] Table 2 shows the performance advantages of ICCR under different attacks. Under the influence of Gaussian noise, ICCR shows significant robustness, and improves the best accuracy of other methods by 3.65%, 6.60% and 0.01% on CIFAR-10, CIFAR-100 and MNIST datasets respectively. ICCR still performs better in the scenario of label randomization. Collaboration graph helps to mitigate the impact of malicious clients by emphasizing similarities in feature representations, thereby maintaining the integrity of model predictions. On CIFAR-10 and CIFAR-100 datasets, ICCR is 3.55% and 4.22% higher than the highest values ​​of other baselines, respectively.

[0083] Figure 3 Comparisons of all methods under two attacks are shown. ICCR shows superior convergence and robustness, indicating that our approach of constructing a fine-grained collaboration graph between clients can modify the implicit collaboration relationships between clients when some clients are attacked. This enables us to reduce the impact of noisy clients by assigning smaller weights based on the perturbed feature distribution, thus 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. In order to study the impact of regularization, we conducted experiments by setting the coefficient λ to 0.01, 0.1, 0.5, and 5.0, and evaluated the model accuracy on the Cifar10 and Cifar100 datasets.

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

[0087]

[0088]

[0089] The coefficient 0.01 emphasizes personalization by reducing the regularization effect, while 5.0 promotes a global model approach and enhances stability and robustness. The intermediate values ​​of 0.1 and 0.5 provide a balance that helps to further study the optimal regularization required for effective learning in different federated environments. As shown in Table 3, different λ values ​​can improve the average test accuracy. When λ = 0.01 and 0.1, the performance decreases compared to λ = 0.5 and 5.0, because lower λ means lower regularization and causes the local model to learn 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 embodiments are only used to illustrate the technical solutions of the present invention rather than to limit the same. A person skilled in the art may modify or replace the technical solutions of the present invention with equivalents. The protection scope of the present invention shall be subject to the claims.

Claims

1. A personalized federated learning training method based on building a collaboration graph between clients, the steps of which include: 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 the local training data into the feature extractor to obtain the feature representation and sends it to the classifier; at the same time, the client calculates the mean μ and variance σ of the data feature distribution 2 , and send it to the server; 2) For any two clients i and j, the server distributes the client data features according to the client data features. The distribution of client j data characteristics Calculate the KL divergence D of the feature distribution between client i and client j ij ;in, 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 the clients; wherein the element D in the i-th row and j-th column of the matrix D is 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, and a directed collaboration graph is constructed based on the adjacency matrix; wherein each client corresponds to a node in the directed collaboration graph, and the weight of the edge between the two nodes is determined according to the normalized value between the two nodes in the adjacency matrix; 4) The server obtains the weight of the edge between each client i and all nodes according to 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; 5) Client i uses the local training data set to train the aggregation model and calculate the loss function Then, the local shared model is updated using the stochastic gradient descent method according to the loss function value; where F i () is the empirical loss function, θ i are the model parameters of the shared model on client i, θ i ′ is the model parameter of the aggregation model of client i, λ is the scale factor, θ K are the model parameters of the shared model on client K; 6) Client i uses the shared model after training and update to process the local training data to obtain the mean μ and variance σ of the feature distribution of the data. 2 And send it and the updated shared model parameters to the server; 7) Repeat steps 2) to 6) until each client reaches a predetermined number of iterations or the shared model converges.

2. The method according to claim 1, characterized in that use The matrix D is normalized.

3. The method according to claim 1, characterized in that Among them, the size of the feature representation is H×W, C is the number of channels of the feature representation, N i is the number of local training data of client i, h(x n ) is the training data x n Input to the feature extractor to obtain the feature representation.

4. The method according to claim 1, characterized in that:

5. The method according to claim 1, characterized in that 6. The method according to claim 1, characterized in that The local training data is image data labeled with image categories.

7. An image recognition method, characterized in that: An image to be identified is input into the shared model trained by the method of claim 1 to obtain the image category of the image to be identified.

Citation Information

Patent Citations

  • Federal learning method and system for classification prediction of connection data of Internet of Vehicles terminal

    CN116227631A

  • Personalized federal learning method based on model and data distillation

    CN117035057A

  • 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

  • Personalized federal learning training method, system and equipment based on consistency modeling

    CN118228841A