Multi-strategy federated learning method suitable for defending DLG attack

By combining conditional generation adversarial networks, adaptive differential privacy and knowledge distillation technologies in federated learning, the privacy and performance balance problems brought about by DLG attacks are solved, efficient privacy protection and model performance improvement are achieved, and the security of the model is significantly enhanced. Sex and accuracy.

CN119005248AActive Publication Date: 2024-11-22UNIV OF ELECTRONICS SCI & TECH OF CHINA

Patent Information

Application Number
CN202410956603.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-17
Publication Date
2024-11-22
Estimated Expiration
2044-07-17

AI Technical Summary

Technical Problem

When defending against deep gradient leakage (DLG) attacks, existing federated learning technologies often require sacrificing model performance or increasing computing and resource overhead, making it difficult to balance privacy protection and model accuracy.

Method used

Using a multi-strategy federated learning method of conditional generative adversarial network (cGAN), adaptive differential privacy technology and knowledge distillation technology, the feature extractor of the client is simulated through cGAN, adaptively adjust differential privacy noise, combine knowledge distillation strategy to optimize the global model, improve the Generalization capability and security of the model.

Benefits of technology

Significantly enhances the security of the model against DLG attacks, maintains high accuracy and training efficiency, dynamically adjusts the privacy budget, maximizes the practicality of data, solves the privacy and performance trade-offs without increasing computing and communication cost.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119005248A_ABST
    Figure CN119005248A_ABST
Patent Text Reader

Abstract

The invention discloses a multi-strategy federated learning method suitable for defending DLG attacks, which comprises the following steps: providing a conditional generative adversarial network cGAN for each client, locally executing a training generator by the cGAN, and enabling the generator to capture feature distribution of a feature extractor so as to simulate the feature extractor; in each round of FL communication, after local training of the client is completed, self-adaptive differential privacy processing is carried out on a generator and a classifier of the client, and then the generator and the classifier after self-adaptive differential privacy processing are sent to the server; the server aggregates the received generators and classifiers sent by all the clients by adopting a SemCKD algorithm, and constructs a global generator and a global classifier; and the client downloads the global generator and the global classifier to replace the generator and the classifier of the client, and starts the next training iteration. According to the method, the security of the model to the DLG attack is remarkably enhanced, relatively high model accuracy and training efficiency are kept, and extra calculation and communication cost is not introduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of federated learning technology, and in particular to a multi-strategy federated learning method suitable for defending against deep gradient leakage (DLG) attacks. Background Art

[0002] Federated learning is a machine learning technology that trains data models on multiple distributed nodes. It was first proposed by Google in 2016. The core idea of ​​this technology is that each participating node (usually a mobile device or edge device) retains its own data and only sends model updates (such as gradient information) to the server for aggregation, thereby avoiding centralized storage and processing of data and protecting data privacy to a certain extent. With the development of federated learning, this technology has been applied to many fields such as finance and medicine, and data security has become an important aspect of federated learning research.

[0003] Although federated learning protects the data privacy of participants by design, it may still face malicious attacks such as model poisoning, model inversion, and gradient leakage attacks. Among these attacks, gradient leakage attacks are more hidden and dangerous. Attackers can use the gradient information leaked from a single update to accurately reconstruct the original data involved in the training, and even restore personal sensitive features. Recent studies have shown that FedAvg and various federated learning frameworks based on FedAvg (such as FedProx, FedMA, FEDOPT, etc.) are vulnerable to gradient leakage attacks, especially deep gradient leakage (DLG) attacks, which exploit the basic mechanism that model gradients must be shared in federated learning. The core of the DLG attack is to reversely derive the input data based on gradient information. The gradient is essentially the partial derivative of the loss function with respect to the input data, reflecting how the input data affects the training loss. By reversely optimizing these gradient values, attackers can construct samples that are very close to the original data. This includes not only visible features such as images and text, but even sensitive attributes such as personal identity information may be leaked. Although DLG attacks are not undefendable, the main disadvantage of privacy protection strategies against DLG attacks in previous studies is that while improving privacy protection, model performance is often sacrificed, computing and resource overhead are increased, and in practical applications, especially when the sensitivity of data or models varies greatly, it is difficult to achieve a balance between privacy protection and model accuracy.

[0004] In federated learning, DLG attackers can reverse engineer almost complete data instances by analyzing the transmitted gradient values. This attack not only threatens data privacy, but also challenges the trust and availability of federated learning models. Geiping et al. further extended DLG to more realistic scenarios, where gradients are averaged over multiple iterations or multiple images. Their research shows that in these cases, user privacy cannot be protected, and as long as the attacker has access to enough gradient information, accurate personal data may be recovered even when using complex deep learning models. Stephen McLaughlin et al. explored how to conduct adversarial attacks on load forecasting models through gradient information in a smart grid environment. This provides a new perspective on DLG attacks, namely that gradient information can be used to affect not only the privacy of the model, but also the model's decisions and predictions. GRNN defines the data leakage attack as a regression problem, minimizing the distance between gradients by optimizing the two branches of the generative model. It can effectively recover image data from shared gradients in federated learning FL without the need for additional class label information, thereby improving the DLG attack.

[0005] Conventional privacy protection methods have a certain defensive effect against DLG attacks. For example, differential privacy protects data privacy by adding noise to gradients, thereby limiting the ability to recover the original data through gradients. However, the added noise may reduce the accuracy of the model, especially when the amount of data is small or the model complexity is high. The introduction of noise needs to be carefully balanced to avoid excessive damage to the performance of the model. Homomorphic encryption allows operations on encrypted data, such as calculating gradients, without decryption. It provides strong security guarantees because the data remains encrypted throughout the training process. But the disadvantage is that the computational cost is high, which may lead to inefficient training process. The practical application of homomorphic encryption is limited by its large demand for resources. Secure multi-party computing completes computing tasks through multiple participants in a distributed system without exposing their respective input data, and can complete model training without revealing any participant data. But similar to homomorphic encryption, MPC has high computational and communication costs. Wagh et al. proposed efficient privacy protection using encryption technology. The authors proposed a convolutional neural network architecture designed specifically to provide efficient inference performance while maintaining privacy. The disadvantage is that it is very computationally intensive and is not applicable in real-time or resource-constrained environments. In order to protect data privacy while enjoying the advantages of federated learning, Gu et al. proposed the FED-SPLIT framework in 2021, which combines the concept of split learning with federated learning and divides the client network into private and public parts. This design helps to protect the privacy of user data by sending only the parameters of the public model part to the server for aggregation while keeping the private model locally. However, this approach also brings certain challenges. Because the private model does not participate in the update and aggregation process of the global model, this may lead to a decline in the overall performance of the model. This performance loss is mainly due to the inability of the private model to learn useful representations and features from other clients, which limits the learning efficiency and the generalization ability of the model. Wu et al. proposed FedCG, which decomposes the local network of each client into a private extractor and a public classifier, and keeps the extractor local to protect privacy. The client shares the client's generator with the server instead of the extractor to aggregate the client's shared knowledge to improve the performance of the model. FedCG is the first architecture to integrate cGAN into federated learning, but it still has room for improvement in terms of privacy protection strategies and model performance.

[0006] Li et al. proposed a method called FedMD, which uses knowledge distillation to transfer the knowledge of each client's local data by aligning the logits of multiple neural networks on a public dataset. In their study, Hardy et al. proposed a secure federated generative adversarial network (SGAN) that can generate synthetic data across multiple data sources while maintaining data privacy. Chen et al. proposed PerFED-GAN, which discussed how to allow clients to personalize their models in a federated learning environment without sharing model architecture or parameters. Rasouli et al. explored how to train GANs in a federated learning framework, especially how to synchronize the generator and discriminator models between the server and the client. Afl-gan proposed by Zhang et al. explored how to integrate GANs into federated learning, especially how to deal with model convergence and stability problems caused by non-independent and identically distributed data. These studies show that generative adversarial networks have broad application prospects in federated learning. They can not only improve the performance of cross-client models, but also enhance the robustness of models through diversified data while ensuring data privacy. These methods provide new perspectives and technical paths for the future development of federated learning. Summary of the invention

[0007] In view of the problems existing in the prior art of sacrificing model performance to enhance privacy protection, large computational and resource overhead, etc., the present invention provides a multi-strategy federated learning method suitable for defending against DLG attacks. By comprehensively using conditional generative adversarial network cGAN, adaptive differential privacy technology and knowledge distillation technology, the model performance is enhanced, the balance between data privacy protection and model learning is optimized, the model's flexibility is improved and the negative impact caused by client model heterogeneity is reduced.

[0008] In order to achieve the above object, the technical solution adopted by the present invention is as follows:

[0009] A multi-strategy federated learning method suitable for defending against DLG attacks, based on a federated learning framework, includes the following steps:

[0010] S10. For each client X holding a private dataset i Provide a conditional generative adversarial network cGAN, which locally executes a training generator so that the generator captures the feature distribution of the feature extractor of the client classification network to simulate the feature extractor of the client classification network, and then sends the generator of the cGAN and the classifier of the client classification network to the server for aggregation, while keeping the feature extractor of the client classification network and the discriminator of the cGAN locally on the client;

[0011] S20. In each round of FL communication, after the client completes local training and before sending it to the server, the client performs adaptive differential privacy processing on the generator of its conditional generative adversarial network cGAN and the classifier of the client classification network, and then sends the adaptive differential privacy processed generator and classifier to the server;

[0012] S30, the server aggregates all the generators and classifiers sent by the clients using the SemCKD algorithm as a knowledge distillation strategy to build a global generator and a global classifier;

[0013] S40: The client downloads the global generator and global classifier to replace its own generator and classifier, and starts the next training iteration.

[0014] Specifically, in step S10, each client X i There is a classification network, represented as The parameters are The feature extractor E i :X i →R d and the parameters are The classifier C i :R d →R c where d is the feature dimension and c is the number of classes; the conditional generative adversarial network cGAN consists of a parameter The generator G i :Z→R d and a parameterized The discriminator D i :R d →I, where Z is a Gaussian distribution and I represents a single scalar in the range [0,1].

[0015] Specifically, in step S10, each client adopts a two-stage client update algorithm to update the classification network and the conditional generative adversarial network cGAN respectively, wherein:

[0016] In the classification network update phase, each client X i Optimize its feature extractor E by minimizing the classification loss i and classifier C i , expressed as:

[0017]

[0018] Where Ω is the cross entropy function, x and y represent the input data and corresponding labels sampled from the data distribution respectively;

[0019] Then client X iThe shared knowledge embedded in the global generator is integrated into its feature extractor by freezing the global generator G g , and optimize the feature extractor E by minimizing the mean square error loss i , expressed as:

[0020]

[0021] in, is the parameter of the global generator, z represents the noise vector sampled from the Gaussian distribution N(0,1);

[0022] Then, by minimizing the mean square error between the global classifier and all local classifier outputs, a regularization term is used to make the global model better take into account the characteristics of each client when aggregating updates, which is expressed as:

[0023]

[0024] Among them, σ is the activation function, N is the number of clients;

[0025] Finally, by combining the above three loss functions, we get the task loss L in the generator training phase: task , expressed as:

[0026] L task = l cls +αl dist +βl reg

[0027] Among them, α is a non-negative hyperparameter used to adjust the balance between the two loss terms, and the hyperparameter β is adaptively adjusted on [0,1].

[0028] Specifically, in step S10, during the conditional generative adversarial network cGAN update phase, each client X i The output of its local generator approximates the feature representation extracted by its local generator, by freezing the feature extractor E i Parameters And perform the cGAN training process to train the generator G i , the cGAN training process is:

[0029] cGAN samples a small batch of training data (x, y) and feeds the input data x to the feature extractor E i To obtain the feature representation h of the true value;

[0030] Then randomly generate Gaussian noise z with the same batch size and input the data sample (z, y) into the generator to generate the estimated feature representation

[0031] Then the feature representation h of the true value and the estimated feature representation Input to the discriminator D i , the discriminator loss l disc and the generator loss l gen Respectively expressed as:

[0032]

[0033] And add a regularization term l reg2 , expressed as:

[0034]

[0035] Finally, the discriminator loss l is minimized alternately disc , generator loss l gen and the regularization term l reg2 These three loss functions are used to optimize the generator G i and the discriminator D i .

[0036] Specifically, in step S20, the process in which the client performs adaptive differential privacy processing on the generator of its conditional generative adversarial network cGAN and the classifier of the client classification network is as follows: random noise that meets the privacy budget is added to the outputs of the generator and the classifier respectively. The intensity of the random noise is adaptively adjusted according to the real-time characteristics of the client model parameters and the training progress. The noise level is dynamically adjusted by monitoring the performance of the client model during the training process and the rate of change of updates.

[0037] Furthermore, the process of adaptive differential privacy processing in step S20 is expressed as:

[0038] Set the initial privacy budget ε, and the random noise adopts Gaussian distribution N(0,σ 2 ), σ is the noise standard deviation, and the sensitivity evaluation function Sens(θ,Δθ) and the performance evaluation function PerfEval(θ) are used.

[0039]

[0040]

[0041] n G =N(0,σ G 2 )

[0042] n C =N(0,σ C 2 )

[0043]

[0044] ε i =ε-(S G +S C )*r

[0045] In the above formula, r represents the privacy budget consumption rate, ε i represents the remaining privacy budget after each iteration in a given cycle, n G and n C denote the noise added to the generator and classifier respectively, and Client X i The output parameters of the generator and classifier after adaptive differential privacy processing.

[0046] Furthermore, the specific process of step S30 includes:

[0047] When the server receives the generators and classifiers sent by all clients, it initializes the global generator by weighted average. and the global classifier Parameters;

[0048] In the knowledge distillation process, the server first generates a small batch of training data (z, y), where the label y is sampled from the uniform distribution U(0, c) and the noise z is sampled from the Gaussian distribution N(0, 1);

[0049] Then according to

[0050]

[0051] The server feeds the training data (z, y) to all generators and calculates the class probability distribution P c (y,z) and P s (y,z), where P c (y,z) is the set of classifiers from all clients, P s (y,z) is a collection of global classifiers;

[0052] Finally, according to

[0053]

[0054] The server minimizes the aggregation phase loss l between the two class probability distributions SemCKD+ Divergence to optimize the global classifier and the global generator Where S and T represent the number of layers in the student and teacher networks respectively, and w ijk It is a weight parameter used to adjust the importance of different layers and the contribution of different samples.

[0055] Compared with the prior art, the present invention has the following beneficial effects:

[0056] (1) The present invention combines multiple strategies in federated learning. The conditional generative adversarial network cGAN is used to enhance the model performance and model robustness. The privacy budget is dynamically adjusted through adaptive differential privacy technology to optimize the balance between data privacy protection and model learning. The knowledge distillation technology is used to aggregate the model on the server side, which improves the generalization ability of the model and reduces the negative impact of client model heterogeneity. Overall, it not only significantly enhances the model's security against DLG attacks, but also maintains a high model accuracy and training efficiency. The present invention successfully solves the risks brought by DLG attacks and the trade-off between performance and privacy by introducing innovative training mechanisms and privacy protection strategies, and achieves this goal without introducing additional computing and communication costs.

[0057] (2) The present invention introduces conditional generative adversarial networks (cGAN) into federated learning to enhance the quality and diversity of data generation while protecting privacy. What is transmitted between the client and the server is not the model gradient but the client's generator and classifier, which effectively alleviates the risk of deep gradient leakage DLG attack. At the same time, the classifier and generator are trained in two stages, and a multi-loss function mechanism is introduced. A regularization term is added to evaluate the consistency and difference between the global classifier / global generator and the local model, which reduces the "drift" phenomenon in training and optimizes the generalization ability of the model. It not only improves the overall accuracy of the model, but also enhances the robustness of the model in the face of potential attacks.

[0058] (3) The present invention also proposes an adaptive differential privacy strategy that maximizes the practicality of data while protecting user privacy. Compared with traditional differential privacy applications, the present invention can dynamically adjust the intensity of privacy protection according to the sensitivity of the data and the training stage. Through this adaptive mechanism, the model of the present invention can effectively maintain learning performance while ensuring a high degree of privacy protection, solving the problem of the difficulty in balancing privacy and performance in previous differential privacy technologies.

[0059] (4) In the model aggregation process on the server side, the present invention adopts an improved knowledge distillation strategy to optimize the training efficiency and accuracy of the global model by extracting more refined and key knowledge from the local model. This method improves the adaptability and prediction accuracy of the global model in complex data environments by effectively transferring key information in the local model. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 It is a schematic diagram of a flow chart of an embodiment of the present invention.

[0061] Figure 2It is a schematic diagram of the overall process framework of an embodiment of the present invention.

[0062] Figure 3 It is a schematic diagram of the process framework of the classification network update stage in an embodiment of the present invention.

[0063] Figure 4 This is a schematic diagram of the process framework of the conditional generative adversarial network update phase in an embodiment of the present invention.

[0064] Figure 5 It is a schematic diagram of the process framework of the server aggregation stage in an embodiment of the present invention.

[0065] Figure 6 This is a comparison chart of the convergence speed of five federated learning algorithms on the CIFAR dataset in the experiment of the embodiment of the present invention.

[0066] Figure 7 This is a comparison chart of the convergence speed of five federated learning algorithms on the FMNIST dataset in the experiment of the embodiment of the present invention.

[0067] Figure 8 This is a comparison chart of the convergence speed of five federated learning algorithms on a PACS dataset in the experiment of an embodiment of the present invention.

[0068] Fig. 9 This is a comparison chart of the convergence speed of five federated learning algorithms on the DOMAIN NET dataset in the experiment of the embodiment of the present invention.

[0069] Fig.10 This is a comparison chart of the convergence speed of five federated learning algorithms on the CIFAR (non-IID) dataset in the experiment of the embodiment of the present invention.

[0070] Fig.11 This is a comparison chart of the convergence speed of five federated learning algorithms on the FMNIST (non-IID) dataset in the experiment of the embodiment of the present invention. DETAILED DESCRIPTION

[0071] The present invention is further described below in conjunction with the accompanying drawings and examples. The embodiments of the present invention include but are not limited to the following examples.

[0072] Example

[0073] like Figures 1 to 5 As shown in the figure, the multi-strategy federated learning method suitable for defending against DLG attacks is based on the federated learning framework, which uses a central server and n clients {X1,X2,...,X n}; The server’s private datasets share the same feature space but have different sample spaces. Each client X i There is a classification network, represented as The classification network is divided into two parts, with parameters The feature extractor E i :X i →R d and the parameters are The classifier C i :R d →R c In order to protect privacy and maintain competitive performance, a conditional generative adversarial network cGAN is provided to each client. The conditional generative adversarial network cGAN consists of a parameter The generator G i :Z→R d and a parameterized The discriminator D i :R d →I, where Z is a Gaussian distribution and I represents a single scalar in the range [0,1]. The training process of cGAN is performed locally to train the generator G i To approximate the feature extractor E i , so that G i (z,y) capture E i (x|y) extracts the feature distribution and simulates the feature extractor.

[0074] In each round of FL communication, after the client completes local training, the client performs adaptive differential privacy processing on the generator of its conditional generative adversarial network cGAN and the classifier of the client classification network, and then sends the generator and classifier after adaptive differential privacy processing to the server; at the same time, the feature extractor of the client classification network and the discriminator of cGAN are retained locally on the client to strengthen privacy protection.

[0075] Then, the server aggregates the generators and classifiers received from all clients using the SemCKD algorithm as the knowledge distillation strategy to build a global generator and a global classifier.

[0076] Next, the client downloads the global generator and global classifier to replace its own generator and classifier, and starts the next training iteration.

[0077] 1. The specific update algorithm process of the client is as follows:

[0078] Each client adopts a two-stage client update algorithm to update the classification network and the conditional generative adversarial network cGAN respectively.

[0079] In the classification network update phase, each client X i Optimize its feature extractor E by minimizing the classification lossi and classifier C i , expressed as:

[0080]

[0081] Where Ω is the cross entropy function, x and y represent the input data and corresponding labels sampled from the data distribution respectively;

[0082] Then client X i The shared knowledge embedded in the global generator is integrated into its feature extractor by freezing the global generator G g , and optimize the feature extractor E by minimizing the mean square error loss i , expressed as:

[0083]

[0084] in, is the parameter of the global generator, z represents the noise vector sampled from the Gaussian distribution N(0,1);

[0085] Then, by minimizing the mean square error between the global classifier and all local classifier outputs, a regularization term is used to make the global model better take into account the characteristics of each client when aggregating updates, which is expressed as:

[0086]

[0087] Among them, σ is the activation function, N is the number of clients;

[0088] Finally, by combining the above three loss functions, we get the task loss L in the generator training phase: task , expressed as:

[0089] L task = l cls +αl dist +βl reg

[0090] Among them, α is a non-negative hyperparameter used to adjust the balance between the two loss terms, and the hyperparameter β is adaptively adjusted on [0,1].

[0091] In the conditional generative adversarial network cGAN update phase, each client X i The output of its local generator approximates the feature representation extracted by its local generator, by freezing the feature extractor E i Parameters And perform the cGAN training process to train the generator G i , the cGAN training process is:

[0092] cGAN samples a small batch of training data (x, y) and feeds the input data x to the feature extractor E i To obtain the feature representation h of the true value;

[0093] Then randomly generate Gaussian noise z with the same batch size and input the data sample (z, y) into the generator to generate the estimated feature representation

[0094] Then the feature representation h of the true value and the estimated feature representation Input to the discriminator D i , the discriminator loss l disc and the generator loss l gen Respectively expressed as:

[0095]

[0096] And add a regularization term l reg2 , expressed as:

[0097]

[0098] Finally, the discriminator loss l is minimized alternately disc , generator loss l gen and the regularization term l reg2 These three loss functions are used to optimize the generator G i and the discriminator D i .

[0099] Once local training is complete, each client X i Let its generator G i and classifier C i Sent to the server for aggregation.

[0100] 2. Conventional differential privacy mechanisms prevent attackers from accurately reconstructing any personal data from shared information by adding random noise to data or model updates. However, fixed noise addition strategies may unnecessarily damage model performance, especially in scenarios where the sensitivity of data or model updates is constantly changing. Therefore, the present invention proposes an adaptive differential privacy strategy that adjusts the intensity of noise based on the real-time characteristics of the data and the training progress. The adaptive differential privacy processing algorithm of the present invention applies noise that satisfies the privacy budget ε to the model update based on the definition of differential privacy, and selects the noise distribution as a Gaussian distribution N(0,σ 2 ), σ is the noise standard deviation, which is suitable for continuous data release.

[0101] For each client's model parameter, the required noise standard deviation is calculated based on its sensitivity and added to the transmission of the generator and classifier. The specific process is expressed as:

[0102] Set the initial privacy budget ε, and the random noise adopts Gaussian distribution N(0,σ 2 ), σ is the noise standard deviation, and the sensitivity evaluation function Sens(θ,Δθ) and the performance evaluation function PerfEval(θ) are used.

[0103]

[0104]

[0105] n G =N(0,σ G 2 )

[0106] n C =N(0,σ C 2 )

[0107]

[0108] ε i =ε-(S G +S C )*r

[0109] In the above formula, r represents the privacy budget consumption rate, ε i represents the remaining privacy budget after each iteration in a given cycle, n G and n C denote the noise added to the generator and classifier respectively, and Client X i The output parameters of the generator and classifier after adaptive differential privacy processing.

[0110] The algorithm dynamically adjusts the noise level by monitoring the performance of the model during training and the rate of change of updates. This includes reducing the noise of parameters that have less impact on performance, while increasing the noise of parameters that are more critical to privacy protection. This approach not only protects user privacy, but also optimizes the learning process and balances the trade-off between privacy and accuracy.

[0111] 3. In terms of server aggregation algorithm, the present invention is different from traditional federated learning in that the present invention adopts knowledge distillation for aggregation and selects SemCKD algorithm as the knowledge distillation strategy. Compared with the conventional KD strategy, SemCKD algorithm not only focuses on the exact matching of model outputs, but also pays more attention to consistency at the semantic level, which means that it improves the generalization ability of the model by ensuring that the outputs of different models are semantically consistent. At the same time, through knowledge distillation at the semantic level, SemCKD algorithm helps student models to show better robustness when facing novel or abnormal data. This method enables student models to understand and imitate the behavior of teacher models more deeply through more comprehensive knowledge transfer. Most importantly, SemCKD is more suitable for federated learning environments. In a federated learning environment, since the data is usually non-independent and identically distributed (non-IID), traditional knowledge distillation may not be sufficient to handle data differences between clients. SemCKD helps models better adapt to various data distributions by enhancing the semantic consistency of the model when processing different data sources. Based on SemCKD, a temperature parameter is added to adjust the softening degree of the teacher model output, so that categories with low probability can also occupy a more prominent position in the output of the teacher model, which is conducive to the student model to learn richer knowledge. Especially when the output of the teacher model is very complex or has many categories, it can enhance the generalization ability of the student model and enable it to better understand the subtle differences between different categories.

[0112] The specific process includes:

[0113] When the server receives the generators and classifiers sent by all clients, it initializes the global generator by weighted average. and the global classifier Parameters;

[0114] In the knowledge distillation process, the server first generates a small batch of training data (z, y), where the label y is sampled from the uniform distribution U(0, c) and the noise z is sampled from the Gaussian distribution N(0, 1);

[0115] Then according to

[0116]

[0117] The server feeds the training data (z, y) to all generators and calculates the class probability distribution P c (y,z) and P s (y,z), where P c (y,z) is the set of classifiers from all clients, P s (y,z) is a collection of global classifiers;

[0118] Finally, according to

[0119]

[0120] The server minimizes the aggregation phase loss l between the two class probability distributions SemCKD+ Divergence to optimize the global classifier and the global generator Where S and T represent the number of layers in the student and teacher networks respectively, and w ijk It is a weight parameter used to adjust the importance of different layers and the contribution of different samples.

[0121] The effect of the present invention is verified by experiments below. The federated learning framework of the present invention is named FEDMSAD (FED Multi-Strategy Against DLG).

[0122] In the experiment, the present invention uses the LeNet-5 deep learning model, which consists of two convolutional layers, each followed by a pooling layer, and three fully connected layers.

[0123] On the LeNet network, we evaluate the performance of the client on four image classification datasets, namely FMNIST, CIFAR10, PACS, and DomainNet. FMNIST is a widely used image dataset containing 70,000 grayscale images divided into 10 categories with an image size of 28*28. Each category represents different types of clothes and shoes. CIFAR-10 is another very popular image dataset containing 60,000 color images of 32*32 pixels divided into 10 categories with 6,000 images in each category. These categories cover animals and vehicles such as cats, dogs, cars, and airplanes, which are suitable for basic training and testing of object recognition. PACS is a computer vision dataset commonly used in domain adaptation research. PACS is an abbreviation for four domains: Photo, Art painting, Cartoon, and Sketch. Each domain contains seven categories: dog, elephant, giraffe, house, horse, person, and truck. DomainNet is one of the largest multi-source domain adaptation datasets, containing about 600,000 images from six different domains, covering 345 categories. These domains include clipart, sketches, paintings, real images, quick doodles, and photos, providing great challenges and opportunities for cross-domain visual recognition research. In terms of experimental design, FMNIST and CIFAR10 simulated IID and non-IID settings, while Digit5 and DomainNet simulated non-IID settings based on domain division.

[0124] In terms of baseline models, we selected four federated learning baseline models, namely FedAvg, FedProx, FedSPLIT, and FedCG. FedAvg updates the global model after averaging the model updates of multiple clients. This method is simple, efficient, and suitable for most federated learning scenarios. FedProx adds an approximation term on the basis of FedAvg to address the problem of data heterogeneity between clients. This method limits the deviation between the client model and the global model by adding a regularization term, thereby improving the stability and performance of the model on non-IID data. FedSPLIT combines split learning and federated learning, dividing the client model into private and public parts, and only uploading the public model parameters to the server for aggregation. This strategy helps to protect user data privacy, but may sacrifice some model performance due to the lack of sufficient global information. FedCG introduces conditional generative adversarial networks into federated learning, improving the diversity and quality of data through the collaboration of generators and classifiers.

[0125] In terms of experimental configuration, 300 rounds of global communication and 20 rounds of local training on each client were included. All experiments used a batch size of 8 data, optimized with the Adam optimizer, a learning rate of 0.0003, and a weight decay coefficient of 0.0001. For the FedProx method, we tested a batch of approximation factors and selected the one with the best performance.

[0126] For the FedCG and FedMSAD frameworks, we performed 2000 model fusions on the server, processing 16 batches each time. For the IID distribution of the FMNIST and CIFAR10 datasets, we ensured that the data distribution of each client was consistent with the distribution of the entire dataset. Specifically, we randomly selected 3000 images for each client as the local training set to ensure that the data of each client was evenly distributed across categories. For the non-IID partitions of the FMNIST and CIFAR10 datasets, category partitioning was adopted, and each client contained k categories. For the Digit5 and DomainNet datasets, we adopted a data partitioning strategy consistent with the category distribution of the original dataset. Each client uses the data of its domain as the local training set. This partitioning method may lead to uneven data distribution among clients, thereby simulating the uneven data distribution phenomenon that may exist in the real world.

[0127] To ensure the reliability of the experimental results, we used five different random seeds and reported the best test accuracy on the client's validation set and test set.

[0128] Experimental Results

[0129] 1. Performance Evaluation

[0130] First, the performance of FEDMSAD is evaluated by comparing the accuracy of the server model with four baseline models on six datasets. As can be seen from Table 1, the FEDMSAD of the present invention achieves the best accuracy in 4 of the 6 scenarios, demonstrating its competitive performance, and on the FMNIST (IID) dataset, its accuracy is only 0.04% lower than FEDCG, ranking second. Specifically, FEDMSAD achieves the best accuracy in 4 non-IID scenarios:

[0131] FMNIST (Non-IID): FEDMSAD achieves an accuracy of 91.34%, which is 0.08% higher than FEDCG’s 91.27%.

[0132] CIFAR10 (Non-IID): FEDMSAD achieves an accuracy of 65.49%, which is 2.36% higher than FEDCG’s 63.98%.

[0133] PACS: The accuracy of FEDMSAD is 58.34%, which is 0.66% higher than that of FEDCG at 57.96%.

[0134] DOMAINNET: The accuracy of FEDMSAD is 54.53%, which is 3.32% higher than that of FEDCG (52.78%).

[0135]

[0136] Table 1 Performance evaluation comparison

[0137] In non-IID data distribution, there are significant differences in data features between different clients, which puts higher requirements on the generalization ability of the model. The FEDMSAD of the present invention uses a knowledge distillation strategy to more effectively capture and integrate these diverse data features, thereby improving the generalization ability of the model on different data sources. At the same time, an additional regularization term is added to the generator trained on the client, providing the server with sufficient information for model updates without leaking sensitive information. In the IID scenario, the advantage of FED-PROX is that it aggregates the complete local network without the negative transfer effect caused by data heterogeneity. Therefore, its overall performance is better than FEDMSAD, especially on CIFAR10, where the accuracy of FEDPROX is 53.02% while that of FEDMSAD is 50.93%. However, FEDPROX is vulnerable to DLG attacks, which will be discussed in the privacy protection evaluation.

[0138] 2. Privacy Protection Assessment

[0139] We calculated the mean squared error (MSE) to measure the similarity between the original image and the image restored from DLG. Table 2 compares the model performance of the proposed FEDMSAD with FEDAVG, FEDSPLIT, and FEDCG in terms of PSNR measurement accuracy and privacy protection ability between the real image and the restored image restored using DLG. Compared with FEDAVG and FEDSPLIT, FEDMSAD has competitive accuracy on all three datasets. However, FEDAVG and FEDPROX have a higher risk of data leakage (low MSE values), while FEDSPLIT, FEDCG, and FEDMSAD effectively protect data privacy (high MSE values). On the other hand, although FEDSPLIT and FEDCG have improved the privacy protection level (high MSE values), the accuracy of the model may be sacrificed. In contrast, the proposed FEDMSAD not only provides high accuracy, but also effectively improves the privacy protection level, thanks to its innovative network design and adaptive differential privacy strategy.

[0140]

[0141] Table 2 Privacy protection evaluation

[0142] Compared with the traditional method of transmitting model gradients in federated learning, the FEDMSAD of the present invention uses cGAN to partition the local network and only transmits classifiers and generators with adaptive differential privacy when interacting with the server, thereby reducing the amount of information that can be recovered by the attacker. Unlike FEDSPLIT, FEDMSAD does not need to sacrifice the participation of the local model in the update. Through carefully designed knowledge distillation and parameter aggregation methods, it maintains the learning ability of the model and the practicality of the data while improving privacy protection. This method of balancing performance and privacy has great potential in practical applications, especially in fields with strict privacy requirements, such as medical and financial services. FEDMSAD demonstrates its advantages in resisting DLG attacks, which is crucial to improving the overall security and reliability of federated learning systems.

[0143] 3. Convergence speed evaluation

[0144] In this experiment, we compared the convergence speed of different federated learning algorithms on six datasets, including CIFAR (IID), FMNIST (IID), PACS, DOMAIN NET, CIFAR (non-IID), and FMNIST (non-IID). We selected five algorithms: FEDAVG, FedMSAD (our algorithm), FEDCG, FEDPROX, and FEDSPLIT, and recorded the average test accuracy (Avg Test Acc) of each round to observe the convergence speed of the model. Figures 6 to 11As shown in Figure 2, the experimental results show that FedMSAD usually converges quickly on all datasets, especially quickly reaching high test accuracy within the first 100 rounds. This shows that the FedMSAD algorithm has good generalization ability and convergence performance on different datasets.

[0145] Specifically, on the CIFAR dataset, FEDAVG and FedMSAD converge faster within the first 100 rounds, especially FedMSAD reaches a high test accuracy in about 50 rounds, while FEDPROX and FEDCG converge slightly slower than FEDAVG and FedMSAD. On the FMNIST dataset, FEDAVG and FedMSAD quickly reach a stable state within the first 50 rounds, showing extremely fast convergence speed. On the PACS dataset, FedMSAD and FEDAVG show good convergence speed, reaching a stable state within the first 100 rounds, while FEDPROX and FEDCG are slightly slower. On the DOMAIN NET dataset, FedMSAD and FEDAVG show fast convergence within the first 100 rounds, especially FedMSAD outperforms other algorithms. On the CIFAR (non-IID) dataset, FedMSAD and FEDAVG converge relatively quickly, especially FedMSAD converges very well within the first 100 rounds. On the FMNIST (non-IID) dataset, FedMSAD and FEDAVG converge very quickly and reach a stable state almost within the first 50 rounds. In contrast, FEDCG and FEDPROX converge slightly slower, while FEDSPLIT converges significantly slower than the other algorithms. Therefore, the FedMSAD algorithm has a significant advantage in improving the convergence speed of the federated learning model.

[0146] The above embodiments are only preferred embodiments of the present invention and are not intended to limit the protection scope of the present invention. Any changes made by adopting the design principles of the present invention and performing non-creative work on this basis should fall within the protection scope of the present invention.

Claims

1. A multi-strategy federated learning method suitable for defending against DLG attacks, characterized in that: Based on the federated learning framework, the following steps are included: S10. For each client X holding a private dataset i Provide a conditional generative adversarial network cGAN, which locally executes a training generator so that the generator captures the feature distribution of the feature extractor of the client classification network to simulate the feature extractor of the client classification network, and then sends the generator of the cGAN and the classifier of the client classification network to the server for aggregation, while keeping the feature extractor of the client classification network and the discriminator of the cGAN locally on the client; S20. In each round of FL communication, after the client completes local training and before sending it to the server, the client performs adaptive differential privacy processing on the generator of its conditional generative adversarial network cGAN and the classifier of the client classification network, and then sends the adaptive differential privacy processed generator and classifier to the server; S30, the server aggregates all the generators and classifiers sent by the clients using the SemCKD algorithm as a knowledge distillation strategy to build a global generator and a global classifier; S40: The client downloads the global generator and global classifier to replace its own generator and classifier, and starts the next training iteration.

2. A multi-strategy federated learning method suitable for defending against DLG attacks according to claim 1, characterized in that: In step S10, each client X i There is a classification network, denoted as E i ,C i =[θ Ei ,θ Ci ], with the parameter θ Ei The feature extractor E i :X i →R d and the parameter is θ Ci The classifier C i :R d →R c where d is the feature dimension and c is the number of classes; the conditional generative adversarial network cGAN consists of a parameter θ Gi The generator G i :Z→R d and a parameterized as θ Di The discriminator D i :R d →I, where Z is a Gaussian distribution and I represents a single scalar in the range [0,1].

3. A multi-strategy federated learning method suitable for defending against DLG attacks according to claim 2, characterized in that: In step S10, each client uses a two-stage client update algorithm to update the classification network and the conditional generative adversarial network cGAN respectively, wherein: In the classification network update phase, each client X i Optimize its feature extractor E by minimizing the classification loss i and classifier C i , expressed as: Where Ω is the cross entropy function, x and y represent the input data and corresponding labels sampled from the data distribution respectively; Then client X i The shared knowledge embedded in the global generator is integrated into its feature extractor by freezing the global generator G g , and optimize the feature extractor E by minimizing the mean square error loss i , expressed as: in, is the parameter of the global generator, z represents the noise vector sampled from the Gaussian distribution N(0,1); Then, by minimizing the mean square error between the global classifier and all local classifier outputs, a regularization term is used to make the global model better take into account the characteristics of each client when aggregating updates, which is expressed as: Among them, σ is the activation function, N is the number of clients; Finally, by combining the above three loss functions, we get the task loss L in the generator training phase: task , expressed as: L task =l cls +αl dist +βl reg Among them, α is a non-negative hyperparameter used to adjust the balance between the two loss terms, and the hyperparameter β is adaptively adjusted on [0,1].

4. A multi-strategy federated learning method suitable for defending against DLG attacks according to claim 3, characterized in that: In step S10, during the conditional generative adversarial network cGAN update phase, each client X i The output of its local generator approximates the feature representation extracted by its local generator, by freezing the feature extractor E i Parameters And perform the cGAN training process to train the generator G i , the cGAN training process is: cGAN samples a small batch of training data (x, y) and feeds the input data x to the feature extractor E i To obtain the feature representation h of the true value; Then randomly generate Gaussian noise z with the same batch size and input the data sample (z, y) into the generator to generate the estimated feature representation Then the feature representation h of the true value and the estimated feature representation Input to the discriminator D i , the discriminator loss l disc and the generator loss l gen Respectively expressed as: And add a regularization term l reg2 , expressed as: Finally, the discriminator loss l is minimized alternately disc , generator loss l gen and the regularization term l reg2 These three loss functions are used to optimize the generator G i and the discriminator D i .

5. A multi-strategy federated learning method suitable for defending against DLG attacks according to claim 4, characterized in that: In step S20, the process in which the client performs adaptive differential privacy processing on the generator of its conditional generative adversarial network cGAN and the classifier of the client classification network is as follows: random noise that meets the privacy budget is added to the outputs of the generator and the classifier respectively, and the intensity of the random noise is adaptively adjusted according to the real-time characteristics of the client model parameters and the training progress. The noise level is dynamically adjusted by monitoring the performance of the client model during the training process and the update rate of change.

6. A multi-strategy federated learning method suitable for defending against DLG attacks according to claim 5, characterized in that: The process of adaptive differential privacy processing in step S20 is expressed as: Set the initial privacy budget ε, and the random noise adopts Gaussian distribution N(0,σ 2 ), σ is the noise standard deviation, and the sensitivity evaluation function Sens(θ,Δθ) and the performance evaluation function PerfEval(θ) are used. n G =N(0,σ G 2 ) n C =N(0,σ C 2 ) e i =ε-(S G +S C )*r In the above formula, r represents the privacy budget consumption rate, ε i represents the remaining privacy budget after each iteration in a given cycle, n G and n C denote the noise added to the generator and classifier respectively, and Client X i The output parameters of the generator and classifier after adaptive differential privacy processing.

7. A multi-strategy federated learning method suitable for defending against DLG attacks according to claim 6, characterized in that: The specific process of step S30 includes: When the server receives the generators and classifiers sent by all clients, it initializes the global generator by weighted average. and the global classifier Parameters; In the knowledge distillation process, the server first generates a small batch of training data (z, y), where the label y is sampled from the uniform distribution U(0, c) and the noise z is sampled from the Gaussian distribution N(0, 1); Then according to The server feeds the training data (z, y) to all generators and calculates the class probability distribution P c (y,z) and P s (y,z), where P c (y,z) is the set of classifiers from all clients, P s (y,z) is a collection of global classifiers; Finally, according to The server minimizes the aggregation phase loss l between the two class probability distributions SemCKD+ Divergence to optimize the global classifier and the global generator Where S and T represent the number of layers in the student and teacher networks respectively, and w ijk It is a weight parameter used to adjust the importance of different layers and the contribution of different samples.

Citation Information

Patent Citations

  • Federal learning privacy evaluation method under cross-domain heterogeneous scene

    CN115952507A

  • Disturbance-based privacy disclosure defense method in federated learning

    CN116861487A

  • Medical image classification method based on privacy protection

    CN118015331A

  • Defense method of deep learning model aiming at adversarial attacks

    US11783037B1

Cited By

  • Data security sharing decision-making method, system and server of electric power Internet of Things

    CN115293488A

  • A data security sharing decision method, system and server of a power internet of things

    CN115293488B

  • Federal element learning privacy protection method based on data set compression

    CN119203248A

  • Federal learning-based privacy data calculation method and system

    CN120162828A

  • Minkowski distance-based federal learning backdoor defense method

    CN120296727A