Federal learning robust aggregation method based on backdoor attack defense

By calculating the key parameter similarity score and dimensionality reduction of the updated model parameters, combined with unsupervised clustering and Euclid norm clipping, robust aggregation of federated learning global models is achieved, and maliciousness is solved in the non-independent and homogeneous distribution of data. Backdoor attack issues on the client improve robustness and privacy.

CN118965415APending Publication Date: 2024-11-15BEIJING INST OF TECH
View PDF 0 Cites 6 Cited by

Patent Information

Application Number
CN202410776571.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-17
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

In the non-independent and homogeneous distribution of data, it is difficult for the existing technology to effectively defend against backdoor attacks from a large number of malicious clients, and the method of relying on clean data sets may lead to data privacy leakage and cannot be applied to a large number of client scenarios.

Method used

The central server calculates the key parameter similarity scores of the updated model parameters, performs dimensionality reduction and unsupervised clustering, obtains the local proxy model, and uses average aggregation and Euclidean norm clipping to achieve robust aggregation of the federated learning global model.

Benefits of technology

This method can effectively resist malicious backdoor attacks with high amplitude values ​​without relying on clean data sets, improve the robustness and privacy of aggregation, and is suitable for non-independent and same-distribution scenarios of data, and can resist more malicious clients. .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118965415A_ABST
    Figure CN118965415A_ABST
Patent Text Reader

Abstract

The invention relates to a federated learning robust aggregation method based on backdoor attack defense, and belongs to the technical field of artificial intelligence security. The method comprises the following steps: 1, constructing an initialized federal learning global model; 2, training the federal learning global model; 3, aggregating the federal learning global model; and 4, repeating the step 2 and the step 3 until the federal learning global model aggregation reaches the expected precision or the pre-negotiated training round number, and completing the federal learning model training. According to the method, the similarity of key parameters of a federated learning global model is analyzed, dimension reduction and unsupervised clustering are performed on the model parameters, a local agent model is obtained through calculation, a malicious model and a benign model are divided through the cosine distance between the model parameters after dimension reduction, and the performance of outlier detection and unsupervised clustering is guaranteed. And the local agent model is cut through the Euclidean distance, so that the high-amplitude malicious backdoor attack can be effectively resisted, and the robustness of aggregation is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a federated learning robust aggregation method based on backdoor attack defense, belonging to the field of artificial intelligence security technology. Background Art

[0002] With the rapid development of information technologies such as the Internet of Things, big data, and cloud computing, data has become a new production factor and a national basic strategic resource. Full utilization of data value requires collaboration between data owners to conduct safe and efficient joint data computing. However, as the risk of privacy leakage increases, data owners are reluctant to share data resources to participate in joint computing, resulting in data islands. As a distributed machine learning paradigm, federated learning enables multiple parties to jointly train models without sharing local data, and achieves secure data circulation while protecting the data privacy of each data owner.

[0003] The participants in federated learning usually include a central server and multiple clients. At the beginning of each round of training, the central server sends the global model of the current round to the client. The client uses local data to train the model and sends the updated model parameters to the central server. The central server aggregates the model parameters to obtain a new round of global models. After multiple rounds of training, a global model with better performance is finally obtained. However, the client of federated learning is an untrusted entity and can be easily controlled by malicious adversaries, who can then launch backdoor attacks and affect the performance of the global model. There are two main types of existing federated learning methods that resist backdoor attacks:

[0004] The first category is clustering-based backdoor attack defense methods. In this type of method, the central server calculates the Euclidean distance of the model updates submitted by the client, and uses an unsupervised clustering algorithm to divide the model updates into multiple clusters, selects the cluster containing the largest number of model updates as the benign cluster, and finally uses the model updates in the benign cluster for aggregation to obtain the global model. This method requires the assumption that the proportion of malicious clients is less than 50% of the total number of clients, and cannot be applied to scenarios with a large number of clients.

[0005] The second category is the backdoor attack defense method based on clean data sets. In this type of method, the central server needs to sample part of the clean data set from each client before training begins, and then the central server uses the clean data set to train the global model. During the model parameter aggregation process, the central server compares the similarity between the model update submitted by the client and the model update obtained by training the clean data set, and calculates the trust score of the model update based on the similarity. Finally, the trust score is used as the weight value for weighted aggregation to obtain the global model. This type of method requires the central server to sample the client's local data set as a clean data set, which may lead to the leakage of the client's data privacy and is difficult to implement in actual scenarios. In addition, this type of method has poor backdoor attack defense effect in scenarios where the data is not independent and identically distributed.

[0006] Therefore, how to defend against backdoor attacks from a large number of malicious clients without relying on clean data sets in scenarios based on non-independent and identically distributed data and achieve robust aggregation of the global model of federated learning has become an urgent problem to be solved. Summary of the invention

[0007] The purpose of the present invention is to solve the problem of defending against backdoor attacks of a large number of malicious clients without relying on clean data sets in a scenario based on non-independent and identically distributed data, to achieve robust aggregation of the global model of federated learning, and to propose a robust aggregation method of federated learning based on backdoor attack defense.

[0008] The objective of the present invention is achieved through the following technical solutions:

[0009] A federated learning robust aggregation method based on backdoor attack defense of the present invention is applied to a plurality of clients and a central server, and comprises the following steps:

[0010] Step 1: Build an initialized federated learning global model. The central server initializes the parameters of the federated learning global model, and the client initializes the localized stochastic gradient descent method.

[0011] Step 2: Train the federated learning global model described in step 1.

[0012] Step 2.1: The central server distributes the global model to the clients.

[0013] Step 2.2: The client uses the local dataset to train the global model of federated learning. After completing the local training, it submits the updated model parameters to the central server.

[0014] Step 3: Aggregate based on the trained federated learning global model described in step 2.

[0015] Step 3.1: The central server calculates the key parameter similarity scores for updating the model parameters.

[0016] Step 3.1.1: The central server calculates the top-k parameters and bottom-k parameters of the updated model parameters submitted by each client, and obtains the top-k parameter set and bottom-k parameter set of the updated model parameters of each client.

[0017] Step 3.1.2: The central server calculates the Jaccard similarity and Spearman correlation coefficient between the top-k parameter sets of each client.

[0018] Step 3.1.3: The central server calculates the Jaccard similarity and Spearman correlation coefficient between the bottom-k parameter sets of each client.

[0019] Step 3.1.4: The central server calculates the key parameter similarity score of each client's updated model parameters based on the Jaccard similarity and Spearman correlation coefficient, as shown in formula (1).

[0020]

[0021] in represents the top-k parameter set of client i during the tth round of training, It represents the bottom-k parameter set of client i in the tth round of training. Jaccard() is the Jaccard similarity calculation function, ρ() is the Spearman correlation coefficient calculation function, and r() is the function that maps parameters to ranking positions.

[0022] Step 3.2: The central server calculates the average Euclidean norm of the updated model parameters.

[0023] Step 3.3: The central server performs dimensionality reduction on the updated model parameters.

[0024] Step 3.3.1: The central server flattens and concatenates the updated model parameters in the form of tensors submitted by the client.

[0025] Step 3.3.2: The central server uses the PCA principal component analysis method to reduce the dimension of the concatenated update model parameters to obtain the updated model parameters after dimension reduction.

[0026] Step 3.4: The central server calculates the cosine distance between the updated model parameters after dimensionality reduction, as shown in formula (2).

[0027]

[0028] Among them, cos t (i, j) represents the cosine similarity between the updated model parameters after dimensionality reduction of clients i and j in the tth round of training.

[0029] Step 3.4.1: The central server calculates the cosine similarity between the updated model parameters after dimensionality reduction.

[0030] Step 3.4.2: The central server calculates the cosine distance between the updated model parameters after dimensionality reduction based on the cosine similarity.

[0031] Step 3.5: The central server performs OPTICS unsupervised clustering on the updated model parameters after dimensionality reduction according to the cosine distance described in step 3.3 to obtain multiple clusters.

[0032] Step 3.6: The central server calculates the local proxy model of the cluster.

[0033] Step 3.6.1: The central server obtains the updated model parameters in each cluster.

[0034] Step 3.6.2: The central server aggregates the updated model parameters in each cluster using average aggregation to obtain the local proxy model of each cluster.

[0035] Step 3.7: The central server calculates the key parameter similarity scores of the local proxy models.

[0036] Step 3.7.1: The central server sums the key parameter similarity scores of the multiple updated model parameters corresponding to each local proxy model calculated in step 3.1.

[0037] Step 3.7.2: The central server divides the sum of the key parameter similarity scores of multiple updated model parameters by the number of updated model parameters to obtain the key parameter similarity score of the local proxy model.

[0038] Step 3.8: The central server uses the average Euclidean norm of the updated model parameters described in step 3.2 to prune the local proxy model with the highest key parameter similarity score to obtain the federated learning global model, completing a round of federated learning global model aggregation.

[0039] Step 4: Repeat steps 2 and 3 until the federated learning global model aggregation reaches the expected accuracy or the pre-agreed number of training rounds, at which point the federated learning model training is completed.

[0040] The present invention utilizes step 3 of federated learning global model aggregation, analyzes the similarity of key parameters of the federated learning global model, performs dimensionality reduction and unsupervised clustering on the model parameters, and calculates the local proxy model. The cosine distance between the model parameters after dimensionality reduction divides the malicious model from the benign model, ensuring the performance of outlier detection and unsupervised clustering. By trimming the local proxy model through the Euclidean distance, it can effectively resist malicious backdoor attacks with high amplitude values, and improve the robustness of the aggregation.

[0041] Beneficial Effects

[0042] Compared with the prior art, the method of the present invention has the following beneficial effects:

[0043] 1. In the present invention, a robust aggregation method for federated learning based on backdoor attack defense is adopted. The central server reduces the dimension of the updated model parameters and then calculates the cosine distance, which solves the problem that the distance metric fails in high-dimensional space and ensures good performance of outlier detection and unsupervised clustering.

[0044] 2. The present invention provides a robust aggregation method for federated learning based on backdoor attack defense. After the central server completes the clustering of the updated model parameters, it performs local aggregation of the clustering clusters to obtain the local proxy model, and selects the global model based on the similarity scores of the key parameters of the local proxy model. Compared with the first type of existing methods, it can resist more malicious clients and has good robustness.

[0045] 3. In the present invention, a robust aggregation method of federated learning based on backdoor attack defense is adopted. The central server calculates the key parameter similarity score of the client according to the similarity of the top-k and bottom-k parameter sets of the updated model parameters. Since the top-k parameters and bottom-k parameters of the updated model parameters are less affected by the distribution of the local data set, compared with the second type of existing methods, it is better applicable to the scenario where the data are not independent and identically distributed, and has good effectiveness.

[0046] 4. The present invention provides a robust aggregation method for federated learning based on backdoor attack defense. Before model training begins, the central server does not need to sample a clean data set from the client. Compared with the second type of existing method, it ensures the privacy of the client's local data and has good privacy and practicality. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 It is a schematic diagram of the process of the present invention;

[0048] Figure 2 This is a structural diagram of the present invention. DETAILED DESCRIPTION

[0049] In order to better illustrate the purpose and advantages of the present invention, the invention is further described below in conjunction with the accompanying drawings and examples. It should be noted that the implementation of the present invention is not limited to the following embodiments, and any form of modification or change made to the present invention will fall within the protection scope of the present invention.

[0050] Example

[0051] like Figure 1 As shown, taking an image classification task as an example, the federated learning robust aggregation method based on backdoor attack defense of the present invention is applied to Figure 2In the architecture shown, the specific implementation steps are as follows:

[0052] Step 1: Build an initialized federated learning global model. The central server initializes the parameters of the federated learning global model, and the client initializes the localized stochastic gradient descent method.

[0053] In the embodiment, an image classification task is initialized and n nodes are selected to participate in the federated learning training, where n nodes include 1 central server and n-1 clients. The n is set to 21, including 1 central server S and 20 clients C. i (i=0,1,...,19). The client local dataset is CIFAR-10. The image classification labels are 0 to 9. Furthermore, the neural network model structure is set to the residual neural network ResNet18, and the number of training rounds is 600.

[0054] Step 2: Train the federated learning global model described in step 1.

[0055] Step 2.1: The central server distributes the global model to the clients.

[0056] Step 2.2: The client uses the local dataset to train the global model of federated learning. After completing the local training, it submits the updated model parameters to the central server.

[0057] In the embodiment, the central server S sets the global model parameter θ of the current round t (t=0,1,...,599) is sent to each client. Where t is the current training round number, θ t The client uses the local dataset CIFAR-10 to train the model. After completing the local training, it submits the updated model parameters to the central server. Where i is the number of each client, t is the current training round number, Client C in round t i Submit updated model parameters.

[0058] Step 3: Aggregate based on the trained federated learning global model described in step 2.

[0059] Step 3.1: The central server calculates the key parameter similarity scores for updating model parameters.

[0060] Step 3.1.1: The central server calculates the top-k parameters and bottom-k parameters of the updated model parameters submitted by each client, and obtains the top-k parameter set and bottom-k parameter set of the updated model parameters of each client.

[0061] In the embodiment, each client C i (i=0,1,...,19) Update the top-k parameter set of model parameters and bottom-k parameter set Where i is the number of each client, t is the current training round number, Client C in round t i The top-k parameter set submitted for updating model parameters, Client C in round t i The bottom-k parameter set submitted for updating model parameters.

[0062] Step 3.1.2: The central server calculates the Jaccard similarity and Spearman correlation coefficient between the top-k parameter sets of each client.

[0063] Step 3.1.3: The central server calculates the Jaccard similarity and Spearman correlation coefficient between the bottom-k parameter sets of each client.

[0064] Step 3.1.4: The central server calculates the key parameter similarity score of each client's updated model parameters based on the Jaccard similarity and Spearman correlation coefficient, as shown in formula (1).

[0065]

[0066] in represents the top-k parameter set of client i during the tth round of training, It represents the bottom-k parameter set of client i in the tth round of training. Jaccard() is the Jaccard similarity calculation function, ρ() is the Spearman correlation coefficient calculation function, and r() is the function that maps parameters to ranking positions.

[0067] Step 3.2: The central server calculates the average Euclidean norm of the updated model parameters.

[0068] In this embodiment, the average Euclidean norm L() is a function for calculating the Euclidean norm of a vector.

[0069] Step 3.3: The central server performs dimensionality reduction on the updated model parameters.

[0070] Step 3.3.1: The central server flattens and concatenates the updated model parameters in the form of tensors submitted by the client.

[0071] Step 3.3.2: The central server uses the PCA principal component analysis method to reduce the dimension of the concatenated update model parameters to obtain the updated model parameters after dimension reduction.

[0072] In the embodiment, the central server uses the PCA principal component analysis method to update the model parameters after splicing Perform dimensionality reduction to obtain the updated model parameters after dimensionality reduction Among them, the updated model parameters after dimensionality reduction The dimension is less than 20, and the PCA principal component analysis selects to retain the principal components that satisfy the cumulative contribution rate of the principal component variance to reach 90%. The dimension of the updated model parameters after dimensionality reduction is less than the total number of clients.

[0073] Step 3.4: The central server calculates the cosine distance between the updated model parameters after dimensionality reduction, as shown in formula (2).

[0074]

[0075] Among them, cos t (i, j) represents the cosine similarity between the updated model parameters after dimensionality reduction of clients i and j in the tth round of training.

[0076] Step 3.4.1: The central server calculates the cosine similarity between the updated model parameters after dimensionality reduction.

[0077] Step 3.4.2: The central server calculates the cosine distance between the updated model parameters after dimensionality reduction based on the cosine similarity.

[0078] In the embodiment, the central server calculates the cosine similarity between the updated model parameters after dimensionality reduction cos() is the cosine similarity calculation function for vectors. The cosine distance between the updated model parameters after dimensionality reduction The cosine distance

[0079] Step 3.5: The central server performs OPTICS unsupervised clustering on the updated model parameters after dimensionality reduction according to the cosine distance described in step 3.3 to obtain multiple clusters.

[0080] In the embodiment, the central server is based on the cosine distance Update model parameters after dimensionality reduction Perform OPTICS unsupervised clustering to obtain multiple clusters Among them, m is the number of clusters. The OPTICS unsupervised clustering sets the smallest cluster preference value to 3, and the minimum number of samples in the neighborhood considered as a core point is 2.

[0081] Step 3.6: The central server calculates the local proxy model of the cluster.

[0082] Step 3.6.1: The central server obtains the updated model parameters in each cluster.

[0083] Step 3.6.2: The central server aggregates the updated model parameters in each cluster using average aggregation to obtain the local proxy model of each cluster.

[0084] In the embodiment, the central server aggregates each cluster using an average aggregation method. Update model parameters in Get the local proxy model for each cluster The local proxy model Cluster The number of updated model parameters after dimensionality reduction contained in .

[0085] Step 3.7: The central server calculates the key parameter similarity scores of the local proxy models.

[0086] Step 3.7.1: The central server sums the key parameter similarity scores of the multiple updated model parameters corresponding to each local proxy model calculated in step 3.1.

[0087] Step 3.7.2: The central server divides the sum of the key parameter similarity scores of multiple updated model parameters by the number of updated model parameters to obtain the key parameter similarity score of the local proxy model.

[0088] In the embodiment, the central server sums the key parameter similarity scores of multiple updated model parameters use Divide by clusters The number of updated model parameters included Get the key parameter similarity score of the local proxy model

[0089] Step 3.8: The central server uses the average Euclidean norm of the updated model parameters described in step 3.2 to prune the local proxy model with the highest key parameter similarity score to obtain the federated learning global model, completing a round of federated learning global model aggregation.

[0090] In one embodiment, the central server updates the model parameters using the average Euclidean norm Crop the local proxy model with the highest key parameter similarity score to obtain the global model θ t , completing a round of model training.

[0091] Step 4: Repeat steps 2 and 3 until the federated learning global model aggregation reaches the expected accuracy or the pre-agreed number of training rounds, at which point the federated learning model training is completed.

[0092] To further illustrate the superiority of the present invention, as shown in Table 1, combined with the above embodiments, an experimental verification is performed. Through verification analysis, it can be seen that the present method has good performance in the scenario where the data is not independent and identically distributed and the malicious clients account for 60%.

[0093] Table 1 Comparison of experimental results

[0094] First category method The second method Method of the present invention Main task accuracy % 74.70 70.71 75.14 Backdoor attack success rate % 30.81 75.99 5.67 Aggregate malicious percentage 91.78 - 0.53

[0095] The method of the present invention is superior to the first and second methods in terms of the three indicators of main task accuracy, backdoor attack success rate and aggregated malicious ratio.

Claims

1. A robust aggregation method for federated learning based on backdoor attack defense, applied to a plurality of clients and a central server, characterized in that: The following steps are included: Step 1: Build an initialized federated learning global model. The central server initializes the parameters of the federated learning global model, and the client initializes the localized stochastic gradient descent method. Step 2: Train the federated learning global model described in step 1; Step 3: Aggregate according to the trained federated learning global model described in step 2; Step 3.1: The central server calculates the key parameter similarity scores for updating model parameters; Step 3.1.1: The central server calculates the top-k parameters and bottom-k parameters of the updated model parameters submitted by each client, and obtains the top-k parameter set and bottom-k parameter set of the updated model parameters of each client; Step 3.1.2: The central server calculates the Jaccard similarity and Spearman correlation coefficient between the top-k parameter sets of each client; Step 3.1.3: The central server calculates the Jaccard similarity and Spearman correlation coefficient between the bottom-k parameter sets of each client; Step 3.1.4: The central server calculates the key parameter similarity score of each client's updated model parameters based on the Jaccard similarity and the Spearman correlation coefficient, as shown in formula (1); in represents the top-k parameter set of client i during the tth round of training. represents the bottom-k parameter set of client i in the tth round of training, Jaccard() is the Jaccard similarity calculation function, ρ() is the Spearman correlation coefficient calculation function, and r() is the function that maps parameters to ranking positions; Step 3.2: The central server calculates the average Euclidean norm of the updated model parameters; Step 3.3: The central server performs dimension reduction on the updated model parameters; Step 3.3.1: The central server flattens and concatenates the updated model parameters in the form of tensors submitted by the client; Step 3.3.2: The central server uses the PCA principal component analysis method to reduce the dimension of the concatenated update model parameters to obtain the updated model parameters after dimension reduction; Step 3.4: The central server calculates the cosine distance between the updated model parameters after dimensionality reduction, as shown in formula (2); Among them, cos t (i, j) represents the cosine similarity between the updated model parameters of clients i and j after dimensionality reduction in the tth round of training; Step 3.4.1: The central server calculates the cosine similarity between the updated model parameters after dimensionality reduction; Step 3.4.2: The central server calculates the cosine distance between the updated model parameters after dimensionality reduction based on the cosine similarity; Step 3.5: The central server performs OPTICS unsupervised clustering on the updated model parameters after dimensionality reduction according to the cosine distance described in step 3.3 to obtain multiple clusters; Step 3.6: The central server calculates the local proxy model of the cluster; Step 3.6.1: The central server obtains the updated model parameters in each cluster; Step 3.6.2: The central server aggregates the updated model parameters in each cluster using average aggregation to obtain the local proxy model of each cluster; Step 3.7: The central server calculates the key parameter similarity scores of the local proxy models; Step 3.7.1: The central server sums the key parameter similarity scores of the multiple updated model parameters corresponding to each local proxy model calculated in step 3.1; Step 3.7.2: The central server divides the sum of the key parameter similarity scores of multiple updated model parameters by the number of updated model parameters to obtain the key parameter similarity score of the local proxy model; Step 3.8: The central server uses the average Euclidean norm of the updated model parameters described in step 3.2 to prune the local proxy model with the highest key parameter similarity score to obtain the federated learning global model, completing a round of federated learning global model aggregation; Step 4: Repeat steps 2 and 3 until the federated learning global model aggregation reaches the expected accuracy or the pre-agreed number of training rounds, at which point the federated learning model training is completed.

2. The method for robust aggregation of federated learning based on backdoor attack defense as claimed in claim 1, characterized in that: Step 2 is implemented as follows: Step 2.1: The central server distributes the global model to the client; Step 2.2: The client uses the local dataset to train the global model of federated learning. After completing the local training, it submits the updated model parameters to the central server.

Citation Information

Cited By

  • Implementation method of federal learning security aggregation scheme

    CN119760703A

  • Collaborative distributed learning defense method and system based on cloud side end

    CN119945761A

  • Federal learning aggregation defense method and device based on hierarchical clustering

    CN120069003A

  • Multi-party collaborative data availability security detection method and system

    CN120342738A

  • A multi-party collaborative data availability security detection method and system

    CN120342738B