Heterogeneous data-oriented adversarial sample robustness federated learning method and system

By embedding backdoor triggers and bijective mapping relationships in federated learning, combined with supervised contrastive learning, the problem of adversarial sample attacks in federated learning in heterogeneous data environments is solved, the robustness and generalization ability of the model are improved, and the model is significantly reduced. The attack success rate of adversarial samples.

CN118863012APending Publication Date: 2024-10-29Chinese People's Liberation Army Cyberspace Force Information Engineering University

Patent Information

Application Number
CN202410827543.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-25
Publication Date
2024-10-29

AI Technical Summary

Technical Problem

Federated learning faces the threat of adversarial sample attacks in IoT scenarios, especially in heterogeneous data environments where the model's robustness is insufficient, causing model prediction results to be susceptible to disturbances. Existing defense methods are mainly aimed at centralized learning scenarios. Failure to effectively cope with the distributed nature of federated learning.

Method used

This paper proposes a robust federated learning method for adversarial samples oriented to heterogeneous data. By embedding backdoor triggers and bijective mapping relationships on the client, combined with supervised contrastive learning, it enhances the model's feature representation capabilities and resists adversarial sample attacks. Specific steps include server design and distribution of backdoor triggers and bijection mapping relationships to the client. The client embeds backdoor triggers in local data and maps labels to generate backdoor samples. The server distributes the global model and introduces supervised contrastive learning. Model After convergence, global aggregation is performed to obtain a robust model.

Benefits of technology

Effectively resist federated learning client-side adversarial sample attacks, improve the model's representation and generalization capabilities on heterogeneous data, significantly reduce the attack success rate of adversarial samples, while maintaining good main task performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118863012A_ABST
    Figure CN118863012A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of network information security, in particular to an adversarial sample robustness federated learning method and system for heterogeneous data, and the method comprises the steps: designing a server, and distributing a backdoor trigger and a bijection mapping relation to a client; embedding a backdoor trigger in a local data set by the client, mapping a label of the backdoor trigger, and generating a backdoor sample; the server distributes a global model to the client, the client trains a local model on a local clean sample and a backdoor sample embedded with a trigger, and supervised contrast learning is introduced in the training process; and after model convergence, the client uploads parameters to the server for global aggregation, and a global model capable of resisting federal confrontation sample attacks is obtained through multiple rounds of iteration. According to the method, the sample source class labels are mapped to the specific target class labels, the robustness of the model facing the adversarial attack is enhanced, supervised contrast learning is introduced, the representation ability of the model on heterogeneous data is improved, and feature representation has higher generalization ability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network information security technology, and in particular to a method and system for adversarial sample robustness federated learning for heterogeneous data. Background Art

[0002] With the widespread application of artificial intelligence and big data technologies in the Internet of Things, the importance of data has become increasingly prominent. As a national basic strategic resource, more and more countries have realized the importance of data security and user privacy, and have issued relevant laws, policies and guidelines to enhance data security protection and avoid data leakage. In the traditional Internet of Things environment, IoT devices collect a large amount of information through sensors. However, in order to ensure data security, companies holding private data cannot share private data, and machine learning models trained based on public data sets cannot achieve satisfactory results in specific tasks and scenarios. The emergence of Federated Learning (FL) provides a new solution to this problem, which has attracted widespread attention from industry and academia.

[0003] In order to improve computing efficiency and model performance without sharing private data, the federated learning proposed by Google has gradually become an effective paradigm for large-scale distributed training. Federated learning usually includes a central server and multiple local clients, and the server manages the clients to jointly train machine learning models. In the scenario of the present invention, the local clients are composed of IoT devices. In each round of federated learning training, the server first issues a global model to the client. The client uses its local data to train and optimize the global model, obtains local model updates, and uploads them to the server. The server aggregates the updates of multiple clients (usually weighted average) to obtain the global model of this round. After multiple rounds of iterations, federated learning enables clients to jointly train a global model with good performance without sharing private data, and has been widely used in various scenarios where privacy protection is required.

[0004] Existing research has shown that neural networks face the threat of adversarial sample attacks, and smaller adversarial perturbations can greatly change the output of the model. Depending on the attacker's knowledge of the neural network model, it can be divided into black-box attacks and white-box attacks. In the black-box attack scenario, the attacker lacks access to the target model structure and algorithm, which poses a great challenge to the attack; in the white-box attack scenario, the attacker knows the complete training process and model parameters, so that adversarial samples can be made more targeted and achieve better attack effects. Today, adversarial sample attacks have been widely used in fields such as autonomous driving, anomaly detection, and face recognition. For example, the attacker adds perturbations to the malware so that the detection system identifies it as "benign", thereby bypassing the security system and completing the system intrusion.

[0005] The distributed and interactive characteristics of federated learning increase the probability of model leakage, making white-box attacks easier to implement. Attackers intentionally construct adversarial samples based on this, causing the model to make incorrect judgments. In addition, existing adversarial attack detection and defense methods are mainly aimed at centralized learning scenarios, while research in federated learning scenarios is still in the exploratory stage. Zhu et al. found that the backdoor embedded in the model can suppress the function of adversarial samples in most cases. Inspired by this, the present invention proposes to use backdoor triggers to resist the influence of adversarial samples on the prediction results of the model on the client side of federated learning.

[0006] Compared with traditional centralized learning, federated learning can improve model training efficiency and make full use of the computing resources of each client. However, client data in IoT scenarios is usually not independent and identically distributed (No-IID), with obvious heterogeneity and imbalance, which makes it difficult for model convergence and affects the stability of existing methods. The fundamental reason for this phenomenon is that the model's representation ability is insufficient and it is impossible to build an effective mapping between samples and labels. The flexibility and good performance of contrastive learning (CL) provide a solution to this problem. Summary of the invention

[0007] The purpose of the present invention is to solve the challenges faced in the current federated learning scenario, and propose a Federated Learning Method Against Sample Robustness for Heterogeneous Data (FLSR) and system to map sample source class labels to specific target class labels, enhance the robustness of the model against adversarial attacks, and introduce supervised contrastive learning to improve the representation ability of the model on heterogeneous data, so that the feature representation has stronger generalization ability.

[0008] In order to achieve the above object, the present invention adopts the following technical solutions:

[0009] A federated learning method for adversarial sample robustness against heterogeneous data, including:

[0010] Design of the server and distribution of backdoor triggers and bijective mappings to clients;

[0011] The client embeds the backdoor trigger in the local dataset and maps its label to generate a backdoor sample.

[0012] The server distributes the global model to the client, and the client trains the local model on local clean samples and backdoor samples with embedded triggers, introducing supervised contrastive learning during the training process;

[0013] After the model converges, the client uploads the parameters to the server for global aggregation. After multiple rounds of iterations, a global model that can resist federated adversarial sample attacks is obtained.

[0014] According to the adversarial sample robust federated learning method for heterogeneous data of the present invention, further, the bijective mapping relationship is to correspond the source class label to the target class label one by one; when the model predicts the result of the backdoor sample, inverse mapping is performed to obtain the correct source class label corresponding to the target class label through the bijective mapping relationship.

[0015] According to the adversarial sample robust federated learning method for heterogeneous data of the present invention, further, the backdoor trigger meets the following objectives:

[0016]

[0017]

[0018]

[0019]

[0020]

[0021] Formula (1) represents the performance of the model on clean samples; P represents the confidence level, M represents the prediction function of the model, Represents a clean sample with embedded backdoor trigger, represents the label obtained by mapping the original label of the clean sample through the bijective mapping relationship; x i represents a clean sample, y i Denotes the label corresponding to the clean sample, D test is the test set, ACC clean is the clean sample prediction accuracy threshold for embedding backdoor triggers;

[0022] Formula (2) represents the performance of the model on adversarial samples; represents an adversarial example with embedded backdoor trigger, It represents the label obtained by mapping the original label of the adversarial sample through the bijective mapping relationship. ACC ae is the prediction accuracy threshold of adversarial samples embedded with backdoor triggers;

[0023] In formula (3), m is the trigger mask matrix, and trigger is the trigger; Bijection in formulas (4) and (5) represents the bijective mapping relationship.

[0024] According to the adversarial sample robust federated learning method for heterogeneous data of the present invention, further, supervised contrastive learning includes: for a batch D of backdoor samples t Samples within Will have the same label Sample set Considered as positive samples, Sample sets other than Define the contrast loss function L supcon as follows:

[0025]

[0026] Among them, sim() represents the correlation measure of the samples, and γ is the temperature coefficient.

[0027] According to the adversarial sample robust federated learning method for heterogeneous data of the present invention, further, the classification loss function L is defined as Classifier as follows:

[0028] L Classifier =E(M(x t ), y t ) (7)

[0029] Among them, E represents the cross entropy loss, y t represents the true label of the clean backdoor sample, M(x t ) represents the label prediction value of the clean backdoor sample.

[0030] According to the adversarial sample robust federated learning method for heterogeneous data of the present invention, further, the total loss function of the client model is as follows:

[0031] L=λ 1 L supcon +λ 2 L classifier (8)

[0032] where λ 1 and λ 2 are dynamic hyperparameters, representing the loss weights of the enhancement and downstream fine-tuning stages, respectively. L is used in the enhancement stage. Supcon The encoding layer and projection layer of the training model are used in the downstream fine-tuning stage. Classifier Train the encoding layer and classification head of the model.

[0033] Furthermore, the present invention also proposes a robust federated learning system for adversarial samples of heterogeneous data, comprising: a distribution module, a backdoor sample module, a training module and an aggregation module, wherein:

[0034] The distribution module is used for server-side design and distribution of backdoor triggers and bijective mapping relationships to clients;

[0035] The backdoor sample module is used by the client to embed the backdoor trigger in the local data set and map its label to generate the backdoor sample;

[0036] The training module is used by the server to distribute the global model to the client. The client trains the local model on the local clean samples and the backdoor samples with embedded triggers, and introduces supervised contrastive learning in the training process.

[0037] The aggregation module is used for uploading parameters from the client to the server for global aggregation after the model converges. After multiple rounds of iterations, a global model that can resist attacks from federated adversarial samples is obtained.

[0038] Compared with the prior art, the present invention has the following advantages:

[0039] 1. The adversarial sample robust federated learning method for heterogeneous data of the present invention proposes to embed a backdoor trigger in the sample to control the model prediction results and resist the perturbation of the adversarial sample. Specifically, the present invention proposes to use the backdoor trigger to resist the influence of adversarial samples on the model prediction results on the client side of the federated learning. Different from the traditional backdoor that maps all labels to a single target label, the present invention designs a bijective backdoor; in the local training stage, the trigger is embedded in the sample, and the sample source class label is mapped one by one to the specific target class label. After multiple iterations, the model will output a specific result on the sample with the trigger, and then the result can be reversely mapped to obtain the correct sample label.

[0040] 2. In order to further improve the defense effect and stability, the present invention designs a backdoor sample representation enhancement method based on supervised contrastive learning to generate more discriminative feature representations. Given that contrastive learning can capture the similarities and differences between samples, extract features important for classification, and enhance data representation. Inspired by this, the present invention introduces supervised contrastive learning in the trigger training process to improve the feature space, thereby better coping with the challenge of heterogeneous data. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0042] Figure 1 It is a flowchart of a method for adversarial sample robust federated learning for heterogeneous data according to an embodiment of the present invention;

[0043] Figure 2 4 is a framework diagram of a federated learning method for robust adversarial samples for heterogeneous data according to an embodiment of the present invention;

[0044] Figure 3 is a sample prediction example diagram of an embedded trigger according to an embodiment of the present invention;

[0045] Figure 4 It is the t-sne dimensionality reduction representation of the adversarial sample in the MNIST-IID scenario of the embodiment of the present invention;

[0046] Figure 5 It is the t-sne dimensionality reduction representation of the adversarial sample in the MNIST-No-IID scenario of an embodiment of the present invention;

[0047] Figure 6 It is the t-sne dimensionality reduction representation of the adversarial sample in the CIFAR-10-IID scenario of the embodiment of the present invention;

[0048] Figure 7 It is the t-sne dimensionality reduction representation of the adversarial sample in the CIFAR-10-No-IID scenario of an embodiment of the present invention. DETAILED DESCRIPTION

[0049] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0050] like Figure 1 and Figure 2 As shown, the adversarial sample robust federated learning method for heterogeneous data in this embodiment includes the following steps:

[0051] Step S101: The server designs and distributes backdoor triggers and bijective mapping relationships to the client.

[0052] Step S102: The client embeds the backdoor trigger in the local data set and maps its label to generate a backdoor sample.

[0053] Step S103: The server distributes the global model to the client. The client trains the local model on the local clean samples and the backdoor samples of the embedded trigger. During the training process, supervised contrastive learning is introduced to enhance the embedded representation.

[0054] Step S104: After the model converges, the client uploads the parameters to the server for global aggregation. After multiple rounds of iterations, a global model that can resist the attack of federated adversarial samples is obtained.

[0055] Algorithm 1 summarizes the above process.

[0056]

[0057] For the convenience of description, Table 1 shows the symbols used in this application and their corresponding meanings.

[0058] Table 1 Symbols and meanings

[0059]

[0060] This solution mainly studies the client-side adversarial sample defense method in the federated learning scenario. In the model prediction stage, the attacker adds subtle disturbances to the sample, thereby affecting the prediction results of the model and causing it to misjudge. The distributed nature of federated learning increases the risk of model leakage. In order to prove the defense performance of the present invention, the present invention uses it as the upper bound of the attacker to maximize the effectiveness of the attack: assuming that the attacker can master the victim's client model structure, network parameters, and federated learning algorithm, and generate arbitrary adversarial samples in a non-targeted white-box attack manner.

[0061] The client embeds triggers in samples to improve robustness against adversarial samples. The key idea is that, through training, the backdoor trigger controls the behavior of the model in a specific mode, thereby resisting adversarial sample attacks. The backdoor trigger should meet the following goals: ensure the performance of clean samples on the main task; reduce the success rate of adversarial sample attacks; formally expressed as follows:

[0062]

[0063]

[0064]

[0065]

[0066]

[0067] Formula (1) represents the performance of the model on clean samples; P represents the confidence level, M represents the prediction function of the model, Represents a clean sample with embedded backdoor trigger, represents the label obtained by mapping the original label of the clean sample through the bijective mapping relationship; x i represents a clean sample, y i Denotes the label corresponding to the clean sample, D test is the test set. For clean samples in the test set, the accuracy after embedding the trigger should be greater than ACC clean, that is, the trigger has little impact on the performance of the model on the main task.

[0068] Formula (2) represents the performance of the model on adversarial samples; represents an adversarial example with a slight perturbation embedded in a backdoor trigger, It represents the label obtained by mapping the original label of the adversarial sample through the bijective mapping relationship. For adversarial samples embedded with backdoor triggers, its accuracy should be greater than ACC ae , that is, the attack success rate of adversarial samples is low.

[0069] In formula (3), m is the trigger mask matrix, and trigger is the trigger. Bijection in formulas (4) and (5) represents the bijective mapping relationship. Formula (5) indicates that even with adversarial perturbations, the labels of the original labels of the adversarial samples after mapping can still be obtained.

[0070] Algorithm 2 summarizes the above process.

[0071]

[0072] Traditional backdoor triggers map all source class labels to the same target class label, which cannot be applied to the scenario of the present invention. Figure 3 As shown, a bijective relationship is designed to correspond the source class label to the target class label one by one. When the model predicts the result of the backdoor sample, an inverse mapping is performed to obtain the correct source class label corresponding to the target class label through the bijective mapping relationship.

[0073] For example, in Figure 3 In the upper middle part, traditional adversarial examples add perturbations to the original examples, causing the model to misclassify, mispredicting label 0 as label 6, mispredicting label 1 as label 7, and mispredicting label 2 as label 5. Figure 3 In the middle and lower parts, in order to resist adversarial sample perturbations, the server first predefines a one-to-one mapping table (i.e., bijective mapping relationship), such as source label 0 is mapped to target label 9, source label 1 is mapped to target label 0, and source label 2 is mapped to target label 1. Then, after local training, samples with source label 0 can be predicted by the model as samples with label 9; samples with source label 1 can be predicted by the model as samples with label 0 after local training; samples with source label 2 can be predicted by the model as samples with label 1 after local training. Even if the attacker adds perturbations to the source label, due to the constraints of the designed loss function, it will still be mapped to a pre-specified label after local training, thereby resisting adversarial sample perturbations. Finally, it is only necessary to inversely map the target label to restore it to the correct source label according to the mapping relationship.

[0074] In order to enhance the stability of the model in real scenarios and further improve the defense performance, a sample representation enhancement method based on client-side supervised contrastive learning is designed. Training is carried out on clean backdoor samples to improve the generalization ability of the model, as shown in Algorithm 3.

[0075]

[0076] The key idea of ​​contrastive learning is to shorten the distance between similar samples in the feature representation space and increase the distance between heterogeneous samples, thereby enhancing feature representation. Different from self-supervised contrastive learning, for a batch of backdoor samples D t Samples within. Will have the same label Sample set Considered as positive samples, Sample sets other than Define the contrast loss function L supcon as follows:

[0077]

[0078] Wherein, sim() represents the correlation measure of the samples, which is calculated by dot product in this embodiment; γ is the temperature coefficient, which is used to increase the penalty for difficult negative samples.

[0079] like Figure 2 As shown in (b), the client model includes an encoding layer, a projection layer, and a classification head. The training process is divided into a representation enhancement phase and a downstream fine-tuning phase. In the representation enhancement phase, the model trains the encoding layer and the projection layer based on the above positive and negative sample sets. supcon Under the influence of , the model tends to output consistent representations for similar samples. Based on this, the model can learn the hidden knowledge in the label, regularize the model encoding layer, generate a more effective embedding space, improve the defense capability against client-side adversarial samples, and achieve stable performance in the No-IID scenario.

[0080] In the downstream fine-tuning stage, the projection layer is discarded, the classification head is added for supervised learning image classification training, the local client model is trained on the clean backdoor samples, and the classification loss function L is defined Classifier as follows:

[0081] L Classifier =E(M(x t ),y t ) (7)

[0082] Among them, E represents the cross entropy loss, y t represents the true label of the clean backdoor sample, M(x t) represents the label prediction value of the clean backdoor sample.

[0083] The contrast loss and classification loss are optimized together, and the total loss function is as follows:

[0084] L=λ 1 L Supcon +λ 2 L Classifier (8)

[0085] where λ 1 and λ 2 are dynamic hyperparameters, representing the loss weights of the enhancement and downstream fine-tuning stages respectively.

[0086] Corresponding to the above method, this embodiment also proposes an adversarial sample robust federated learning system for heterogeneous data, comprising: a distribution module, a backdoor sample module, a training module and an aggregation module, wherein:

[0087] The distribution module is used for server-side design and distribution of backdoor triggers and bijective mapping relationships to clients.

[0088] The backdoor sample module is used by the client to embed backdoor triggers in the local dataset and map their labels to generate backdoor samples.

[0089] The training module is used by the server to distribute the global model to the client. The client trains the local model on local clean samples and backdoor samples with embedded triggers, and introduces supervised contrastive learning during the training process.

[0090] The aggregation module is used for uploading parameters from the client to the server for global aggregation after the model converges. After multiple rounds of iterations, a global model that can resist attacks from federated adversarial samples is obtained.

[0091] In order to verify the effectiveness of this solution, the following is a further explanation based on the test data:

[0092] This paper implements FLSR based on Pytorch, conducts extensive experiments on different data distributions of the MNIST and CIFAR10 datasets, uses four mainstream adversarial attack methods to generate adversarial samples, and compares them with the baseline defense method to evaluate its effectiveness. All experiments are carried out on the NVIDIA RTX 3090 GPU.

[0093] ① Experimental setup

[0094] Two benchmark datasets for image classification are used in the experiment of the present invention, namely MNIST and CIFAR-10.

[0095] MNIST is a dataset consisting of 70,000 grayscale handwritten digit images of size 28×28, including 60,000 training sets and 10,000 test sets. MNIST contains 10 categories of grayscale images from 0 to 9.

[0096] CIFAR-10 is a dataset consisting of 60,000 three-channel color images of size 32×32, including 50,000 training images and 10,000 test images. CIFAR-10 contains 10 categories of images, including "airplane", "ship", and "dog", with 6,000 samples in each category.

[0097] The classification models on both datasets use a CNN network with two convolutional layers, with a total of 10 clients, a batch size of 50, a learning rate of 0.005, 300 communication rounds, and 1 and 4 local training for MNIST and CIFAR-10, respectively. In the representation enhancement stage, λ 1 =1,λ 2 =0; in the task fine-tuning stage, λ 1 =0,λ 1 =1.

[0098] The present invention conducts extensive experiments on independent and identically distributed (IID) and non-independent and identically distributed (No-IID) data distributions, wherein the Dirichlet method is used for non-independent and identically distributed data, and the alpha=0.1 scenario with a large degree of data discreteness is set to verify the effectiveness of the method of the present invention in general scenarios.

[0099] ②Attack method and baseline setting

[0100] To prove the effectiveness of the FLSR defense method, this paper assumes that the attacker has full knowledge of the client model structure, network parameters and other related information, and is able to perform white-box attacks in the prediction phase. Specifically, this paper adopts the following four adversarial sample attack methods and sets them as untargeted attacks. The attack parameter settings are shown in Table 2.

[0101] Table 2 Attack parameter settings

[0102]

[0103] (1) The Fast Gradient Sign Method (FGSM) uses the idea of ​​back propagation in the neural network training process to add perturbations in the gradient direction through one iteration to maximize the impact on the prediction results.

[0104] (2) The Basic Iterative Method (BIM) is an improved version of FGSM. It shortens the step size through multiple iterations to find the optimal perturbation.

[0105] (3) Project Gradient Descent (PGD) is also an extended form of FGSM. Unlike BIM, PGD restricts the generated adversarial samples to a specific neighborhood of the sample by projection, thereby limiting the size of the perturbation.

[0106] (4) C&W attack is an optimization-based adversarial sample attack method that introduces three distance metrics and narrows the gap between adversarial samples and clean samples by designing a loss function.

[0107] The following three methods are selected as the baseline experiments of the present invention:

[0108] (1) No-Defense: No defense method is added. It is used to test the performance of the model on the main task and the effect of adversarial sample attacks.

[0109] (2) Adversarial training (ADT): The client actively constructs adversarial samples, adds perturbations to clean samples, and then adds them to the dataset for training, which enhances the robustness of the model to a certain extent.

[0110] (3) Image Compression JPEC: Discrete cosine transform is used to suppress high-frequency information and selectively blur the image input to eliminate disturbances.

[0111] The main task performance Accuracy (ACC) and attack success rate Attack Success Rate (ASR) are used as evaluation indicators to evaluate the performance of each defense method against adversarial samples. The main task performance refers to the performance of the model on the original image classification task, that is, Where N represents the total number of test samples, n correct Indicates the number of correctly classified samples; if the prediction results of the adversarial sample with perturbation are different from those of the clean sample, it is considered a successful attack, that is, the attack success rate Where M(x) represents the prediction result of the model on sample x.

[0112] ③Performance evaluation

[0113] For the four distribution scenarios of the two datasets, the above attack method is used to add perturbations to the test set samples to generate four adversarial samples. FLSR has a good performance in resisting adversarial sample attacks, and the experimental results are shown in Tables 3 and 4. In the IID scenario, FLSR reduces the attack success rate by an average of 68.05% on the dataset; in the No-IID scenario, FLSR reduces the attack success rate by an average of 61.14% on the dataset. In addition, in terms of the main task performance, since contrastive learning introduces additional information to the model, FLSR improves by 0.02% and 2.24% in the IID and No-IID scenarios, respectively.

[0114] Table 3 Performance of different defense methods in IID scenario

[0115]

[0116] Table 4 Performance of different defense methods in No-IID scenario

[0117]

[0118] (1) Performance comparison in IID scenario

[0119] In the IID scenario, ADT has a certain defense capability, and the attack success rate on MNIST and CIFAR-10 decreased by 73.34% and 23.36% respectively, and the average success rate decreased by 48.35%. The attack success rate of JPEC only decreased by 20.41% and 14.04% respectively, and even increased when facing FGSM and BIM attacks on MNIST. In comparison, the attack success rate of FLSR decreased by 89.55% and 46.55% respectively, and the average attack success rate decreased by 68.05%, achieving a good defense effect.

[0120] The defense methods show similar trends in the main task performance. Adversarial training has less accuracy loss on MNIST, only 0.12%, while the accuracy loss on CIFAR-10 is 4.21%, indicating that the adversarial target affects the learning ability of the model to a certain extent, and it is more obvious on relatively difficult tasks. FLSR can maintain good main task performance on both datasets, with an improvement of 0.12% on MNIST and only 0.09% accuracy loss on CIFAR-10. This is because the labels of the embedded trigger samples have a one-to-one correspondence with the original labels. The model learns this bijective relationship instead of the adversarial target, thereby reducing complexity and accuracy loss. At the same time, contrastive learning introduces class representation information to the model.

[0121] (2) Performance comparison in No-IID scenario

[0122] From Table 4, we can see that adversarial training is not very effective in defending against adversarial sample attacks on CIFAR-10, with the attack success rate only decreasing by 9.18%; while it can achieve better defense effects on MNIST, with the attack success rate decreasing by 61.62%. However, in terms of defense performance, this method is far behind FLSR, with the average attack success rate being 25.74% higher than FLSR. FLSR is also superior to image compression methods, which, although showing superior performance in the face of CW attacks, are almost unable to cope with FGSM and BIM attacks. In addition, in terms of main task performance, adversarial training decreases by an average of 3.96%, while FLSR improves accuracy by 2.24%.

[0123] It can be seen that adversarial training has a good defensive effect on MNIST. The reason is that the variance of MNIST data distribution is small, and the model can better balance the main task and the adversarial target. The variance of CIFAR-10 data distribution is large, and model learning is quite complex. In the No-IID scenario, the performance of adversarial training further decreases with the increase of the variance of the data set, which verifies the above conclusion. At the same time, adversarial training has the disadvantages of high training cost and high computational overhead. Image compression methods eliminate disturbances by reducing image quality and blurring high-frequency information. They have certain effects in specific attack scenarios. However, when the attack intensity continues to increase, this method is difficult to resist attacks. FLSR associates the model prediction results of embedded trigger samples with the original labels based on the bijective backdoor, which can improve the robustness of the model to various disturbances even in the No-IID scenario. At the same time, the representation enhancement method based on supervised contrastive learning induces the model to capture the consistency and difference between images and generate trigger representations with more obvious classification boundaries. Traditional deep learning methods only extract abstract features of images and cannot significantly distinguish samples of different classes.

[0124] ④Visual analysis

[0125] In order to further analyze the defense effect of the method in the face of adversarial samples, we explore the defense without defense (None), defense based on bijective trigger (BAEDFL) and defense based on supervised contrastive learning (FLSR). The test sample is input into the model. In order to better compare the results, the sample representation is reduced to two-dimensional space based on t-sne dimensionality reduction, while retaining its global and local structures, such as Figures 4 to 7 shown.

[0126] It is observed that if no defense strategy is added to the model, various adversarial samples will be intertwined in the embedding space, making it difficult for the model to distinguish them. Even a small perturbation will cause the model to make wrong predictions. The FLSR method proposed in the present invention can clearly distinguish the representations of different classes in the IID scenario, and keep a certain distance between the classes. However, in the No-IID scenario with a high degree of data discreteness, the abstract features extracted by the model are not sufficient to completely separate the representations. Under the guidance of the task goal of supervised contrastive learning, the FLSR model iteratively optimizes the encoder and learns features that are more conducive to classification on the same training data, so as to better resist adversarial sample attacks.

[0127] At the same time, it can be analyzed that since the CIFAR-10 dataset contains three-channel color images, it contains more information, has a larger image size, and is composed of real objects in the real world, contains a lot of noise, and is difficult to learn. Therefore, there is still room for improvement for FLSR on CIFAR-10.

[0128] In summary, the present invention aims to solve the problem that adversarial samples on the client side of federated learning affect the model prediction results through small disturbances, and proposes a defense solution FLSR based on a double-shot backdoor trigger to control the behavior of the model on samples with triggers and enhance the robustness of the model against adversarial attacks. In view of the problem that client data in federated learning scenarios is heterogeneous and difficult to extract effective feature representations, a trigger representation enhancement method based on supervised contrastive learning is proposed to map similar samples into similar embedding spaces, while expanding the distance between heterogeneous samples, so that the feature representation has stronger generalization ability and improves the model's defense performance and stability.

[0129] Unless otherwise specifically stated, the relative steps, numerical expressions and values ​​of the components and steps set forth in these embodiments do not limit the scope of the present invention.

[0130] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0131] The units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. A person of ordinary skill in the art may use different methods to implement the described functions for each specific application, but such implementation is not considered to be beyond the scope of the present invention.

[0132] Those skilled in the art will appreciate that all or part of the steps in the above method can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, such as a read-only memory, a disk or an optical disk. Optionally, all or part of the steps in the above embodiment can also be implemented using one or more integrated circuits, and accordingly, each module / unit in the above embodiment can be implemented in the form of hardware or in the form of software function modules. The present invention is not limited to any specific form of combination of hardware and software.

[0133] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A federated learning method for adversarial sample robustness against heterogeneous data, It is characterized in that Include: Design of the server and distribution of backdoor triggers and bijective mappings to clients; The client embeds the backdoor trigger in the local dataset and maps its label to generate a backdoor sample. The server distributes the global model to the client, and the client trains the local model on local clean samples and backdoor samples with embedded triggers, introducing supervised contrastive learning during the training process; After the model converges, the client uploads the parameters to the server for global aggregation. After multiple rounds of iterations, a global model that can resist federated adversarial sample attacks is obtained.

2. The adversarial sample robust federated learning method for heterogeneous data according to claim 1, It is characterized in that The bijective mapping relationship is to correspond the source class label to the target class label one by one; when the model predicts the result of the backdoor sample, inverse mapping is performed to obtain the correct source class label corresponding to the target class label through the bijective mapping relationship.

3. The adversarial sample robust federated learning method for heterogeneous data according to claim 1, It is characterized in that The backdoor trigger meets the following goals: Formula (1) represents the performance of the model on clean samples; P represents the confidence level, M represents the prediction function of the model, Represents a clean sample with embedded backdoor trigger, represents the label obtained by mapping the original label of the clean sample through the bijective mapping relationship; x i represents a clean sample, y i Denotes the label corresponding to the clean sample, D test is the test set, ACC clean is the clean sample prediction accuracy threshold for embedding backdoor triggers; Formula (2) represents the performance of the model on adversarial samples; represents an adversarial example with embedded backdoor trigger, It represents the label obtained by mapping the original label of the adversarial sample through the bijective mapping relationship. ACC ae is the prediction accuracy threshold of adversarial samples embedded with backdoor triggers; In formula (3), m is the trigger mask matrix, and trigger is the trigger; Bijection in formulas (4) and (5) represents the bijective mapping relationship.

4. The adversarial sample robust federated learning method for heterogeneous data according to claim 3, It is characterized in that Supervised contrastive learning includes: for a batch D of backdoor samples t Samples within Will have the same label Sample set Considered as positive samples, Sample sets other than Define the contrast loss function L Supcon as follows: Among them, sim() represents the correlation measure of the samples, and γ is the temperature coefficient.

5. The adversarial sample robust federated learning method for heterogeneous data according to claim 4, It is characterized in that Define the classification loss function L Classifier as follows: L Classifier =E(M(x t ),y t ) (7) Among them, E represents the cross entropy loss, y t represents the true label of the clean backdoor sample, M(x t ) represents the label prediction value of the clean backdoor sample.

6. The adversarial sample robust federated learning method for heterogeneous data according to claim 5, It is characterized in that The total loss function of the client model is as follows: L=λ 1 L Supcon +λ 2 L Classifier (8) where λ 1 and λ 2 are dynamic hyperparameters, representing the loss weights of the enhancement and downstream fine-tuning stages, respectively. L is used in the enhancement stage. Supcon The encoding layer and projection layer of the training model are used in the downstream fine-tuning stage. Classifier Train the encoding layer and classification head of the model.

7. A federated learning system robust to adversarial examples for heterogeneous data, It is characterized in that Contains: distribution module, backdoor sample module, training module and aggregation module, among which: The distribution module is used for server-side design and distribution of backdoor triggers and bijective mapping relationships to clients; The backdoor sample module is used by the client to embed the backdoor trigger in the local data set and map its label to generate the backdoor sample; The training module is used by the server to distribute the global model to the client. The client trains the local model on the local clean samples and the backdoor samples with embedded triggers, and introduces supervised contrastive learning in the training process. The aggregation module is used for uploading parameters from the client to the server for global aggregation after the model converges. After multiple rounds of iterations, a global model that can resist attacks from federated adversarial samples is obtained.

Citation Information

Patent Citations

  • Federal learning backdoor defense method and device based on adversarial sample detection

    CN115796273A

  • Federal learning backdoor defense method and system based on comparative learning

    CN117422130A

  • Model training method and communication apparatus

    WO2024017001A1

Cited By

  • Defense method and system for model backdoor attack

    CN119670844A

  • Robust federated learning architecture for image classification

    CN120031108A

  • Robust Federated Learning Method for Image Classification

    CN120031108B