Dynamic federated learning defense framework for untargeted model poisoning attacks based on historical information

By introducing the trigger-free MSA attack framework and the DynHisFL defense framework into federated learning, the problem of non-target model attacks is solved, the model performance is reduced and the attack detection capability is improved under low attacker proportions, ensuring the reliability of model aggregation. sex.

CN118094566BActive Publication Date: 2024-09-17NANKAI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410363117.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-28
Publication Date
2024-09-17
Estimated Expiration
2044-03-28

AI Technical Summary

Technical Problem

There are non-target model attacks in existing federated learning, especially model poisoning attacks, which are difficult to effectively defend against. Especially in large-scale scenarios, when the proportion of attackers is low, the performance of the model is reduced.

Method used

Propose a trigger-free MSA attack framework (MSAP) based on horizontal federated learning and a general defense framework DynHisFL based on historical information. In the attack part, through steps such as shuffling, scaling, and malicious gradient clipping, it combines dynamic clustering and longitudinal historical model update information. Change analysis In the defense part, malicious models are identified and eliminated.

Benefits of technology

Enhance concealment in different privacy policies, reduce the performance of federated learning models, effectively identify and resist non-target model attacks, improve the detection capabilities of poisoning attacks, and ensure the reliability of model aggregation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118094566B
    Figure CN118094566B
Patent Text Reader

Abstract

The present invention provides a dynamic federated learning defense framework for non-targeted model poisoning attacks based on historical information, and relates to the technical field of poisoning attacks against federated learning. It includes an attack part and a defense part. The first part is a general framework derived from a triggerless MSA attack based on horizontal federated learning. It performs well beyond different privacy policies, enhances confidentiality, and continuously degrades the performance of the federated learning model even with only 2% attackers in large-scale scenarios. In addition, a general defense framework DynHisFL based on historical information is proposed for the existence of non-targeted model attacks. The framework is adaptive, capable of detecting malicious actors, and has been tested for effectiveness on various existing model attack methods. Finally, extensive experiments are conducted on common data sets and settings that have been popular in recent years. The most appropriate distance metric is found by comparing various model-specific statistical metrics.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of poisoning attacks against federated learning, and specifically involves two parts. The first part is a general framework derived from untriggered MSA attacks based on horizontal federated learning. It performs well beyond different privacy policies, enhances confidentiality, and continuously degrades the performance of federated learning models even with only 2% of attackers in large-scale scenarios. In addition, a general defense framework DynHisFL based on historical information is proposed to address the existence of non-targeted model attacks. The framework is adaptive, capable of detecting malicious actors, and has been tested for effectiveness on various existing model attack methods. Background Art

[0002] Federated Learning (FL) embodies a groundbreaking learning paradigm in which data owners - i.e., clients - collaborate to jointly train common machine learning models. This collaborative training is achieved without revealing their confidential training data. A central server (service provider, etc.) periodically consolidates model updates obtained from local client private data. The consolidation of these client updates is performed by applying different aggregation rules (AGRs). Eventually, the globally trained model (i.e., global model) is trained for the next round based on the consolidated client updates. These aggregated parameters are then propagated to a specified subset of clients, concluding each round of FL training. Federated Learning (FL) is widely used on various distributed platforms. Federated Learning (FL) has a wide range of applications on various distributed platforms, such as in word systems for predicting word suggestions and in medical imaging for speech recognition automation. In addition, FL has been strategically implemented at Microcosmos Bank, contributing to tasks such as object detection and various applications.

[0003] One of the key features of federated learning that makes it attractive for real-world production use is its ability to facilitate collaborative model training between clients that do not trust each other. Unfortunately, this mechanism makes federated learning (FL) vulnerable to a threat known as “poisoning” (see Appendix Figure 1 ). In this case, a small group of FL clients (referred to as compromised clients) owned or controlled by the adversary take malicious actions during the FL training process to corrupt the jointly trained global model. Specifically, the poisoned attacker aims to instruct its compromised clients to provide poisoned model updates during the FL training process, thereby corrupting FL and, in turn, contaminating the global model.

[0004] The main FL poisoning methods include targeted and non-targeted poisoning. In general, the purpose of non-targeted attacks is to degrade the performance of the classifier. In contrast, the purpose of targeted attacks is to corrupt the classifier so that it misclassifies samples of the specified class as the class desired by the adversary. Figure 1 These concepts are briefly explained. In the field of federated learning (FL) research, untargeted attacks are of great significance.

[0005] Modifying the internal structure or parameters of a trained model through model structure or parameter modification is mainly to effectively poison the model, which is more effective than injecting poisonous data. Some studies have explored model poisoning attacks on neural networks, such as proposing a method of using unimportant neurons for poisoning attacks. However, the model poisoning attack method in federated learning is different.

[0006] Common non-targeted attack methods include label flipping, scaling attacks, and Gaussian noise injection without prior access to the entire training data. In label flipping attacks, malicious clients manipulate the update signal by changing the class labels of the training data; while Gaussian noise attacks transmit random noise that reflects the distribution of the local model before the attack to replace benign client updates. For model shuffling attacks (MSA), it designs a unique method to shuffle and scale model parameters. The malicious model after MSA has higher accuracy on the test set, but reduces the global convergence speed of the model, and even causes the model to be discrete, which is destructive to the AGR of Krum and Trimmed Mean. Because the accuracy of joint learning under differential privacy cannot be compared with that of the noise-free model. Therefore, it is not suitable for joint learning systems that require higher accuracy. Not all joint learning uses differential privacy means. The MSA attack scheme has certain limitations.

[0007] Regarding defense schemes, in the process of seeking defense against poisoning attacks, recent research has delved into the development of Byzantine robust federated learning (FL) algorithms. These algorithms adopt robust aggregation techniques (AGR) in the central server, aiming to mitigate the impact of malicious model updates while maintaining the overall utility of the model. Most of these aggregation algorithms are based on FedAvg or FedSGD. FedAvg outperforms FedSGD with higher efficiency, faster convergence speed and lower communication overhead. Some aggregation strategies are proposed to improve the robustness of federated learning, while others are proposed to address specific attacks. These strategies are divided into model analysis and Byzantine robust aggregation. Based on the above discussion, the exploration of defense strategies specifically against non-targeted model poisoning attacks is still rare. Therefore, there is an urgent need to develop a comprehensive framework to defend against non-targeted model poisoning attacks. Summary of the invention

[0008] The purpose of the present invention is to propose an untargeted federated learning poisoning attack to address the shortcomings of existing MSP attack schemes, and to propose a multifunctional framework based on triggerless MSA attack, MSAP, for existing schemes. This framework can not only operate in strategies other than differential privacy (such as robust aggregation methods such as gradient aggregation), but also enhance concealment. Even in large-scale participation scenarios, it can continue to effectively reduce the performance of federated learning models in the face of attackers with a proportion as low as 2%. In response to the current untargeted model attacks, the present invention proposes a general defense framework based on historical information, DynHisFL. DynHisFL can not only resist MSAP attacks, but also identify malicious participants in algorithms designed for other non-targeted attacks. The present invention has conducted extensive experiments on general data sets and settings that have been popular in recent years. By comparing the statistics of various specific models side by side, the most appropriate distance quantity is found, demonstrating the effectiveness of the attack and defense methods.

[0009] The technical solution of the present invention:

[0010] The dynamic joint learning defense framework for non-targeted model poisoning attacks based on historical information is divided into two parts, including the attack part and the defense part.

[0011] In the attack section:

[0012] The attacker receives the global model W of round T-1 from the server T-1 And start training with clean data. In the forward propagation process, the present invention uses Represents the CNN layer of the model to be maliciously attacked, where represents the model to be attacked in the T-1th round of the global T rounds of the i-th CNN layer, and assumes is the weight from the i-1th layer to the i-th layer in the CNN layer, The weight deviation from layer i-1 to layer i when a malicious adversary conducts a misalignment attack;

[0013] In the defense section:

[0014] Dynamic clustering is performed using historical model update information. In each round of training, a filtering process is introduced to identify and exclude models that are marked as abnormal. This method can handle dynamic attack scenarios, that is, injecting multiple malicious models at the same time and refusing them to participate in the current round of aggregation. At the same time, the present invention minimizes false positives when identifying toxic models, ensuring the reliability of the current round of model aggregation.

[0015] Furthermore, the attack part includes the following steps:

[0016] Step 1, shuffle: MSA requires swapping the first and second layers in a convolutional layer. This swap is then extended to the following convolutional and linear layers in the same order. The linear layer reflects these changes in the current and subsequent layers to maintain consistency:

[0017]

[0018] Step 2, Scaling Operation: MSA operates the parameters of the CNN layer by multiplying them by a scaling factor and performs a corresponding reduction operation on the next layer. The purpose is to disrupt the back propagation of the model by introducing parameter scaling β while ensuring the accuracy of the output results during the forward propagation process.

[0019]

[0020]

[0021] Step 3, malicious gradient clipping: Using an alternating training pattern, we alternate between malicious and benign tasks, intricately optimizing the alternating minimization process to ensure high accuracy within the attacked model.

[0022]

[0023]

[0024] The malicious model receives the global model W sent by the server in round T T , by calculating the maximum value of the model update for all global models received by the malicious actor and minimum value Malicious actors are trained to alternately compute MSA empirical model parameters and benign model updates.

[0025] Furthermore, the defense part includes the following steps:

[0026] Step 1: DyhisFL is used in the malicious actor detection algorithm. The server obtains the global model of the dataset in T rounds of global updates, denoted as W T , and sends it to the local clients participating in this round of updates. Each local client will perform a local update based on each batch. becomes w t+1 ←w t , the local models obtained after T+1 rounds of updates are expressed as Then send it back to the server;

[0027] Step 2: After receiving the T+1 local model update, the server retrieves the corresponding local model from the previous round according to the ID of the corresponding client, including both benign and malicious models.

[0028]

[0029]

[0030] Respectively expressed as Then, the distribution change between the historical update and the current round is calculated using the following formula:

[0031]

[0032] Step 3: The server normalizes the longitudinal change values ​​of all customers into scores, namely:

[0033]

[0034] Then, the customers are clustered according to their suspicious scores. In order to determine the optimal K-top size, the GapStatistics method is used to cluster the confidence scores using k-means to obtain the clusters {Ci} and mean μ after clustering.

[0035] Calculate all clusters

[0036]

[0037] Then calculate

[0038]

[0039] Then calculate

[0040]

[0041]

[0042]

[0043]

[0044] Select the condition Gap(k)≥Gap(k+1)+s' k+1 The minimum k of is taken as the optimal number of clusters. If yes, it means there is more than one category in it. Calculate the average silhouette coefficient of each cluster

[0045]

[0046] To verify the rationality and adaptability of K-top in determining the number of clusters;

[0047] Step 4: If the cluster value K is greater than 1, Perform binary clustering and malicious score The higher client clusters are marked as “malicious”, discarded and excluded from this round of clustering, and then a new set of local model updates are added to form a new clustering group;

[0048] Step 5, group the other clusters into a new training dataset and perform normal global model aggregation. Compute a new round of the global model.

[0049] Advantages and beneficial effects of the present invention:

[0050] (1) Based on MSA, by implementing gradient clipping, the update value is limited to the acceptable range of the server, thereby effectively preventing the aggregation algorithm from detecting gradient anomalies. The effectiveness of alternating minimization of malicious models and benign models during local updates has been confirmed. The experiments in this invention can further prove that the aggressiveness of MSAP is influential even in non-differential privacy systems.

[0051] (2) In the defense scheme of the present invention, the server determines whether the local model has been attacked by poisoning by comparing the performance of the local model with the previous round of local historical updates submitted by the same client. This method takes into account the consistency between the current round of updates and the client's historical model, thereby improving the detection capability of poisoning attacks.

[0052] While previous methods required participants to compare models using metrics such as cosine similarity, Euclidean distance, and other statistics-based horizontal and horizontal comparisons, DyhisFL focuses on the longitudinal information contained in the local model. This emphasis is placed on the consistency of changes in the client itself, which is a crucial aspect. Regarding the calculation of the amount of change: Various methods for measuring the amount of change between historical models and current models were measured, and MMD was finally selected because in the experiment, MMD of high-dimensional model parameter changes had the highest true positive rate (TPR). After calculating the amount of variation, the k-means clustering algorithm is applied. This method uses dynamic profiling and gap statistics in the k-means clustering algorithm to discover potential outliers in the clusters. The present invention divides the clusters into two groups, effectively converting the k-means algorithm into a dynamic text filter for each round. This adjustment can effectively identify areas with significant changes. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 It is an illustration of the targeted and non-targeted attacks described in the background technology of the present invention.

[0054] Figure 2 This is the shuffling and scrambling part of the MSAP attack of the present invention.

[0055] Figure 3 This is the part where the parameters of the MSAP attack of the present invention are tailored.

[0056] Figure 4 This is the overall flow chart of the defense method DynHisFL.

[0057] Figure 5 Detailed diagram of historical information calculation for the defense method DynHisFL.

[0058] Figure 6 This is an implementation flow chart of the present invention, including an attack part and a defense part. DETAILED DESCRIPTION

[0059] The specific implementation of the present invention is described in detail below in conjunction with the accompanying drawings and embodiments. This embodiment is implemented based on the technical solution of the present invention so that technicians in the relevant field can better understand the technical features and functional features of the present invention, but the protection scope of the present invention is not limited to the following embodiments.

[0060] In this embodiment, all experiments are run on a server equipped with an Intel Core i7-8700K CPU 3.70GHz×12, a GeForce RTX 2080Ti GPU, and Ubuntu 18.04.3LTS using the Pytorch platform. The default number of clients of the FL system under study is set to n=100, and the proportion of clients selected for each FL iteration is set to 0.9. In the untargeted attack set in , the number of attacked clients defaults to 0.02, 0.05, and 0.1. In order to improve the authenticity and reliability of the model, the client trains its local model for 15 iterations before submitting the model update. The total number of iterations of FL is T=100. The optimizer uses SGD and adam, with learning rates of 0.001, 0.01, 0.2, etc., respectively. In addition, the scaling factor is set to 0.5~2.

[0061] The specific implementation process is divided into two parts, including the attack part and the defense part.

[0062] (1) Technical solutions for attacks

[0063] A simple way to use limited knowledge to conduct model poisoning attacks is to use random noise as a fake local model update. This approach aims to use noise to evade the detection of anomaly attacks. However, an important problem arises because the accuracy of federated learning under differential privacy cannot be compared with that of noise-free models. Differential privacy presents some disadvantages (such as decreased model accuracy, increased communication overhead, limited applicability, and complexity of parameter adjustment). Therefore, it is not suitable for federated learning systems that require higher accuracy. Not all federated learning uses differential privacy means. The MSA attack scheme has certain limitations.

[0064] Secondly, MSA sets the attack rate at 25%-50%, and it is impractical to let a large number of terminal devices withstand a 50% attack rate. Therefore, the attack method of the present invention can enhance this attack without using differential privacy, while ensuring a certain degree of concealment and realizing an adaptive MSA attack against the model structure. Even if the attack ratio is small, it can ensure a certain impact on the model. MSA destroys the model structure by affecting the gradient descent in forward propagation and backward propagation, ensuring a significant impact on the normal value.

[0065] Therefore, by implementing gradient clipping, the update value is limited to the acceptable range of the server, thereby effectively preventing the aggregation algorithm from detecting gradient anomalies. The effectiveness of alternating minimization of malicious models and benign models during local updates has been demonstrated. The present invention can further prove that the aggressiveness of MSAP is influential even in non-differential privacy systems.

[0066] In the attack section (attached to the instruction manual) Figure 2 ):

[0067] The attacker receives the global model W of round T-1 from the server T-1 And start training with clean data. During the forward propagation, use Represents the CNN layer of the model to be maliciously attacked, where represents the model to be attacked in the T-1th round of the global T rounds of the i-th CNN layer, and assumes is the weight from the i-1th layer to the i-th layer in the CNN layer, It is the weight deviation from layer i-1 to layer i when the malicious adversary conducts a misalignment attack. The attack scheme includes the following steps:

[0068] Step 1 - Shuffle: MSA requires swapping the first and second layers in a convolutional layer. This swap is then extended to the following convolutional and linear layers in the same order. The linear layer reflects these changes in the current and subsequent layers to maintain consistency:

[0069]

[0070] Step 2 - Scaling Operation MSA can manipulate the parameters of the CNN layer by multiplying them by a scaling factor and performing a corresponding reduction operation in the next layer. The purpose of this method is to disrupt the back propagation of the model by introducing parameter scaling β while ensuring the accuracy of the output results during the forward propagation process.

[0071]

[0072]

[0073] Step 3 - Malicious Gradient Clipping (Instructions attached Figure 3 ), in the traditional MSA setting, "malicious" local model updates submitted to the server are carefully pruned to ensure that they are confined to the "safe zone" demarcated by historical model updates. The present invention utilizes an alternating training mode, alternating between malicious and benign tasks, intricately optimizing the alternating minimization process, thereby ensuring high accuracy within the attacked model.

[0074]

[0075]

[0076] Note: The malicious model receives the global model W sent by the server in round T T , by calculating the maximum value of the model update for all global models received by the malicious actor and minimum value Malicious actors are trained to alternately compute MSA empirical model parameters and benign model updates.

[0077] (2) Technical solutions for defense

[0078] The defense scheme of the present invention is mainly based on the following two key points:

[0079] Adversarial Manipulation of Model Updates: In the case where the adversary makes the global model unavailable for model poisoning, the adversary continues to receive global model updates in each round as the starting point for its local updates. It converges using its clean dataset before being excluded from the global model aggregation. However, the adversary's strategic goal is to make the update vector deviate from the normal converged model.

[0080] Malicious Adversary's Model History: As long as the local model converges, the benign adversary will strive to keep the update direction and magnitude of its local model consistent with the global model. If the server keeps a record of the non-aggregated model for each round, capturing the behavior of the current and past rounds, the adversary will strive to keep the update vector consistent with the normally converged model. It is critical to record the non-aggregated model for each round (including the behavior of the current and past rounds). The difference and distance between the two non-aggregated historical models must be significantly larger than the benign model, reflecting that the malicious adversary's local model is inherently more "chaotic".

[0081] In the defense section:

[0082] Specifically, DyhisFL adopts a defense mechanism that uses historical model update information for dynamic clustering (see the manual). Figure 4). In each round of training, the present invention introduces a filtering process to identify and exclude models marked as abnormal. In this way, dynamic attack scenarios can be handled, that is, multiple malicious models are injected at the same time and they are rejected from participating in the current round of aggregation. At the same time, the present invention minimizes false positives when identifying toxic models, ensuring the reliability of the current round of model aggregation.

[0083] The following steps are included:

[0084] Step 1: DyhisFL is used in the malicious actor detection algorithm. The server obtains the global model of the dataset (denoted as W) in T rounds of global updates. T ) and sends it to the local clients participating in this round of updates. Each local client will perform a local update based on each batch. becomes w t+1 ←w t , the local models obtained after T+1 rounds of updates are expressed as Then send it back to the server.

[0085] Step 2-After receiving the T+1 local model update, the server retrieves the corresponding local model from the previous round based on the ID of the corresponding client, including both the benign model and the malicious model

[0086]

[0087]

[0088] Respectively expressed as Then, it calculates the distribution change between the historical update and the current round (see the manual). Figure 5 ), the calculation formula is as follows:

[0089]

[0090] Step 3 The server normalizes the longitudinal change values ​​of all customers into scores, namely:

[0091]

[0092] Then, the customers are clustered according to their suspicious scores. In order to determine the optimal K-top size, the present invention uses the Gap Statistics method, k-means to cluster the confidence scores, and obtains the clusters {Ci} and mean μ after clustering.

[0093] Calculate all clusters

[0094]

[0095] Then calculate

[0096]

[0097] Then calculate

[0098]

[0099]

[0100]

[0101]

[0102] Select the condition Gap(k)≥Gap(k+1)+s' k+1 The minimum k of is taken as the optimal number of clusters. If yes, it means there is more than one category in it. Calculate the average silhouette coefficient of each cluster

[0103]

[0104] To verify the rationality and adaptability of K-top in determining the number of clusters.

[0105] Step 4: If the cluster value K is greater than 1, for all Perform binary clustering. Malicious score The higher client clusters are marked as “malicious”, discarded and excluded from this round of clustering. Subsequently, a new set of local model updates are added to form a new clustering group.

[0106] Step 5 groups the other clusters into a new training dataset and performs normal global model aggregation. Compute a new round of the global model.

[0107] The effect of the present invention can be verified by the following performance analysis:

[0108] Evaluation indicators

[0109] Attack impact: In non-targeted attacks, the focus is on reducing the availability of the global model, which is evaluated by model accuracy (MACC), which includes local and global model accuracy, such as

[0110] I imp =MACC No_attack -MACC attack

[0111] True Positive Rate (TPR): measures the ability of a defense system to detect poisoned models. It is calculated as the ratio of correctly classified poisoned models (True Positives - TP) to the total number of models classified as poisoned:

[0112]

[0113] Where FP stands for false positive, which indicates the number of benign clients that are incorrectly classified as malicious.

Claims

1. A dynamic joint learning defense framework for non-targeted model poisoning attacks based on historical information, which is characterized by: The specific implementation process is divided into two parts, including the attack part and the defense part. In the attack section: The attacker receives the global model W of round T-1 from the server T-1 And start training with clean data. During the forward propagation, use Represents the CNN layer of the model to be maliciously attacked, where represents the model to be attacked in the T-1th round of the global T rounds of the i-th CNN layer, and assumes is the weight from the i-1th layer to the i-th layer in the CNN layer, The weight deviation from layer i-1 to layer i when a malicious adversary conducts a misalignment attack; The attack part consists of the following steps: Step 1, shuffle: MSA requires swapping the first and second layers in a convolutional layer. This swap is then extended to the following convolutional and linear layers in the same order. The linear layer reflects these changes in the current and subsequent layers to maintain consistency: Step 2, Scaling Operation: MSA operates the parameters of the CNN layer by multiplying them by a scaling factor and performs a corresponding reduction operation on the next layer. The purpose is to disrupt the back propagation of the model by introducing parameter scaling β while ensuring the accuracy of the output results during the forward propagation process. Step 3, malicious gradient clipping: Using an alternating training pattern, we alternate between malicious and benign tasks, intricately optimizing the alternating minimization process to ensure high accuracy within the attacked model. The malicious model receives the global model W sent by the server in round T T , by calculating the maximum value of the model update for all global models received by the malicious actor and minimum value Malicious actors are trained to alternately compute MSA empirical model parameters and benign model updates; In the defense section: Using historical model update information for dynamic clustering, a filtering process is introduced in each round of training to identify and exclude models marked as abnormal. This approach can handle dynamic attack scenarios, that is, injecting multiple malicious models at the same time and refusing them to participate in the current round of aggregation. At the same time, it minimizes false positives when identifying toxic models and ensures the reliability of the current round of model aggregation. The defense part includes the following steps: Step 1: DyhisFL is used in the malicious actor detection algorithm. The server obtains the global model of the dataset in T rounds of global updates, denoted as W T , and sends it to the local clients participating in this round of updates. Each local client will perform a local update based on each batch. becomes w t+1 ←w t , the local models obtained after T+1 rounds of updates are expressed as Then send it back to the server; Step 2: After receiving the T+1 local model update, the server retrieves the corresponding local model from the previous round according to the ID of the corresponding client, including both benign and malicious models. Respectively expressed as Then, the distribution change between the historical update and the current round is calculated using the following formula: Step 3: The server normalizes the longitudinal change values ​​of all customers into scores, namely: Then, the customers are clustered according to their suspicious scores. In order to determine the optimal K-top size, the GapStatistics method is used to cluster the confidence scores using k-means to obtain the clusters {Ci} and mean μ after clustering. Calculate all clusters Then calculate Then calculate Select the condition Gap(k)≥Gap(k+1)+s' k+1 The minimum k of is taken as the optimal number of clusters. If yes, it means there is more than one category in it. Calculate the average silhouette coefficient of each cluster To verify the rationality and adaptability of K-top in determining the number of clusters; Step 4: If the cluster value K is greater than 1, Perform binary clustering and malicious score The higher client cluster is marked as "malicious", discarded and excluded from this round of clustering, and then a new set of local model updates are added to form a new clustering group; Step 5, group the other clusters into a new training dataset and perform normal global model aggregation. Compute a new round of the global model.