Local differential privacy federal learning method based on homomorphic encryption

By using parameter pruning and random selection strategies to denoise or encrypt local model parameters in federated learning, combined with homomorphic encryption and differential privacy technology, the problem of data utility and computational overhead caused by a single differential privacy technology is solved, and high efficiency is achieved. Privacy protection and model accuracy improvement.

CN118761073APending Publication Date: 2024-10-11CHENGDU UNIV OF INFORMATION TECH
View PDF 0 Cites 3 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The single differential privacy technology in existing federated learning leads to a decrease in data utility, a reduction in global model accuracy, and difficulty in balancing privacy and practicality. At the same time, the high-security encryption operation of homomorphic encryption is time-consuming and poses the risk of information leakage.

Method used

The local differential privacy federated learning method based on dynamic encryption is used to noise or encrypt local model parameters through parameter clipping and random selection strategies. It combines homomorphic encryption and differential privacy technology to achieve safe aggregation and privacy protection of parameters.

Benefits of technology

It effectively reduces the amount of model parameters that need to be transmitted by the client after each round of training, reduces communication overhead, improves model accuracy and computing efficiency, coordinates privacy protection and data utility, and enhances attack resistance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118761073A_ABST
    Figure CN118761073A_ABST
Patent Text Reader

Abstract

The invention relates to a local differential privacy federated learning method based on homomorphic encryption, and aims to solve the problem of privacy disclosure in traditional federated learning. According to the method, firstly, an average parameter clipping strategy is used for reducing the parameter quantity needing to be transmitted by the client after each round of training, and the transmitted data quantity is effectively reduced by clipping the parameters lower than the average value. And then, a random selection strategy is adopted to randomly execute noise adding or encryption operation on the clipped parameters, so that the parameter security in the aggregation process is ensured, and meanwhile, the problem that a traditional differential privacy and homomorphic encryption method is insufficient in data effectiveness and calculation overhead is solved. Experimental results show that the method shows good robustness under different privacy requirements, the encryption and decryption efficiency is remarkably improved compared with an existing method, and meanwhile the strong privacy protection capability capable of resisting gradient leakage attacks is shown.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of machine learning data processing, and in particular to a local differential privacy federated learning method based on homomorphic encryption. Background Art

[0002] At present, homomorphic encryption and differential privacy are mainly used in federated learning to enhance privacy protection. Homomorphic encryption is an encryption algorithm that allows algebraic operations to be performed on encrypted data, and the decrypted operation results are the same as the original data operation results. The special properties of this encryption method provide high security for data privacy protection while maintaining the losslessness of data. Differential privacy protects individual privacy by adding random noise to the original data, making it impossible for attackers to recover the original data from the noisy data. Differential privacy technology has been widely used in the field of data privacy protection due to its lightweight, quantifiable and context-independent characteristics. In the federated learning system, differential privacy technology is combined with other technologies to provide a certain degree of privacy protection. In the federated learning process, privacy is protected by adding noise before parameter aggregation or hiding customer contributions during training. In the federated learning process, homomorphic encryption technology is used to encrypt the client model parameters before sending them to the server. A privacy protection scheme combining symmetric homomorphic encryption, weak encryption and differential privacy is adopted.

[0003] The shortcomings of existing technical solutions: Using a single differential privacy technology to add noise to the parameters will lead to a decrease in the utility of the data and a decrease in the accuracy of the global model. It is difficult to strike a balance between privacy and practicality. Although homomorphic encryption has high security and can provide lossless data privacy protection, the encryption operation has a large time overhead and will increase the computational overhead of federated learning. Combined privacy protection schemes need to rely on trusted managers, which poses a risk of information leakage. Summary of the invention

[0004] In view of the shortcomings of the prior art, the present invention proposes a local differential privacy federated learning method based on dynamic encryption. The federated learning method includes a server and N clients, wherein the server is responsible for distributing global model parameters and aggregating local models, and the client uses local data for training. The server and the client use a federated learning algorithm to train to obtain the final global model parameters. After the client obtains the local model parameters through local training, the local model parameters are compressed using a parameter clipping strategy. Subsequently, a random selection strategy is used to perform noise or encryption operations on the clipped local model parameters. Finally, the noisy or encrypted local model parameters are uploaded to the server for aggregation to obtain new global model parameters. Specifically, the method includes:

[0005] Step 1: In the initialization phase, the server initializes the global model parameter w0 and sends it to the client for local training. It also initializes the privacy budget for each round and the parameter processing center generates a key.

[0006] Step 2: In the local training phase, the client performs a round of training on the local data set based on the global model parameter w0 to obtain the local model parameter

[0007] Step 3: Client calculation phase: each client calculates the average value of the local model parameters

[0008] Step 4: Traverse the local model parameters and find the parameters below the average The position index windex;

[0009] Step 5: Set the local model parameters that are lower than the average parameters to 0 to obtain the trimmed local model parameters

[0010] Step 6: In the local model parameter processing stage, the parameter processing center generates a random variable from the Bernoulli distribution for subsequent random noise addition and encryption operations;

[0011] Step 7: When the random variable is equal to 1, use the homomorphic encryption function to perform encryption operations on the non-zero values ​​in the pruned local model parameters to obtain the encrypted parameters

[0012] Step 8: When the random variable is equal to 0, add Laplace noise of scale Δf / ε0 to the non-zero value in the pruned local model parameters to obtain the noise parameter

[0013] Step 9: Encryption parameters and noise parameters Upload to the server;

[0014] Step 10: Parameter aggregation phase, the server receives the encryption parameters of all local clients of the current training round and noise parameters After the information is encrypted, Decrypt, and then perform federated average aggregation on all private local model parameters to obtain the new global model parameter w t+1 ;

[0015] Step 11: Broadcast the global model. The server broadcasts the global model parameters w to all clients. t+1 , after receiving, each client performs a new round of local training;

[0016] Step 12: Repeat steps 2 to 11 until the global model converges.

[0017] Compared with the prior art, the solution of the present invention has the following technical effects:

[0018] 1. The method of the present invention adopts parameter clipping and security aggregation. Through the average parameter clipping strategy, the present invention can effectively reduce the amount of model parameters that need to be transmitted by the client after each round of training, reduce communication overhead, and improve model accuracy and computing efficiency.

[0019] 2. The present invention adopts a random selection strategy to randomly add noise or encrypt the pruned parameters, thereby ensuring the secure aggregation of the parameters.

[0020] 3. Coordinated privacy protection measures. The present invention coordinates the two privacy protection methods of homomorphic encryption and differential privacy, solving the limitations of a single method in data utility and computational overhead. This method not only maintains the high security of homomorphic encryption, but also utilizes the lightweight characteristics of differential privacy. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 is a processing flow chart of the method proposed in the present invention;

[0022] Figure 2 It is a framework diagram of the system of the present invention;

[0023] Figure 3 These are the accuracy curves of the three methods on different data sets when the privacy budget is 1;

[0024] Figure 4 This is the accuracy curve of the three methods on different data sets when the privacy budget is 0.1;

[0025] Figure 5 It is a successful graph of gradient leakage attack;

[0026] Figure 6 This is the gradient leakage failure graph. DETAILED DESCRIPTION

[0027] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention is further described in detail below in conjunction with specific embodiments and with reference to the accompanying drawings. It should be understood that these descriptions are only exemplary and are not intended to limit the scope of the present invention. In addition, in the following description, the description of well-known structures and technologies is omitted to avoid unnecessary confusion of the concept of the present invention.

[0028] The following is a detailed description with reference to the accompanying drawings.

[0029] The present invention provides a federated learning privacy protection scheme, which aims to solve the problems of traditional machine learning models in terms of privacy protection and data silos. While protecting the privacy in federated learning, the present invention improves the accuracy and computational efficiency of the model, has strong anti-attack capabilities, and provides an effective solution to the privacy protection problem in federated learning. Figure 2 It is the framework structure diagram of the system of the present invention. Figure 2 As shown, the system of the present invention has a server and N clients. Assuming that the server is an honest but curious manager, the N clients independently perform local training processes on their respective local private data, and aggregate local parameters on the cloud server. The goal of training is to obtain a model with higher model utility than a model trained only based on its own local data without leaking the privacy information of local private data. In order to address the potential threats mentioned above, the present invention proposes a new federated learning framework that effectively combines homomorphic encryption and differential privacy technologies. By adding personalized operations to the traditional federated learning steps, trusted federated learning that balances privacy protection, model accuracy, and algorithm efficiency is achieved. Figure 1 This is a processing flow chart of the federated learning method proposed in the present invention. Figure 1 and Figure 2 The novel federated learning method proposed in the present invention is described in detail.

[0030] The federated learning method proposed in the present invention includes two types of entities, a server and N clients, wherein the server is responsible for distributing the global model and aggregating the local model, and each client uses local data for training. The server and the client use the federated learning algorithm to train the final global model parameters. After the client obtains the local model through local training, the parameter clipping strategy proposed in the present invention is used to compress the local model. Specifically, each client uses the local data set for training and calculates the average value of the final model parameters, and then clips the parameters below the average value. Since the average value is a statistic based on the parameters of the entire model, it can reflect the overall distribution of the model parameters. Through the average value parameter clipping method, the number of model parameters can be effectively reduced, the generalization ability of the model can be improved, and the communication overhead of transmitting parameters in federated learning can be reduced. Compared with the Top-K sparse method, clipping by calculating the average value is more intuitive and simple. It is clipped only based on whether the weight is lower than the average value. The Top-K sparse method needs to select the maximum K weights to be retained. Selecting an appropriate K value is a challenging task, because a smaller K value may be too sparse, and a larger K value may not effectively reduce the model size. The proposed average value clipping is not troubled by this choice. Subsequently, the random selection strategy proposed in the present invention is used to add noise or encryption to the pruned model. The algorithm reduces the number of parameters that need to be added with noise and encryption, reduces the problem of decreased data utility caused by parameter addition, and also reduces the problem of high computational overhead caused by parameter encryption. Finally, the model parameters that have been added with noise and encryption are uploaded to the server for aggregation.

[0031] Step 1: In the initialization phase, the server initializes the global model parameter w0 and sends it to the client for local training. It also initializes the privacy budget ε0 for each round to control the size of the noise to balance the trade-off between data availability and privacy protection. The parameter processing center generates a pair of keys, including a public key and a private key. The public key is used to encrypt plaintext data, and the private key is used to decrypt ciphertext data.

[0032] Step 2: In the local training phase, the client performs a round of training on the local data set based on the global model parameter w0 to obtain the local model parameter Where i=1,2,3…N.

[0033] Step 3: Client calculation phase: each client calculates the average value of the local model parameters

[0034] Step 4: Traverse the local model parameters and find the parameters below the average The position index windex;

[0035] Step 5: Set the local model parameters that are lower than the average parameters to 0 to obtain the trimmed local model parameters

[0036] Step 6: In the local model parameter processing stage, the parameter processing center generates a random variable from the Bernoulli distribution for subsequent random noise addition and encryption operations;

[0037] Step 7: When the random variable is equal to 1, use the homomorphic encryption function to perform encryption operations on the non-zero values ​​in the pruned local model parameters to obtain the encrypted parameters

[0038] Step 8: When the random variable is equal to 0, add Laplace noise of scale Δf / ε0 to the non-zero value in the pruned local model parameters to obtain the noise parameter Δf is the global sensitivity, which measures the maximum possible change in the output of a query function on any two adjacent data sets. In the present invention, the value is 1, and ε0 is the privacy budget in step 1.

[0039] Step 9: Encryption parameters and noise parameters Upload to the server;

[0040] Step 10: In the parameter aggregation phase, after receiving the encrypted parameters and noise parameter information of all clients in the current training round, the server decrypts the encrypted parameters and then performs federated average aggregation on all received private local model parameters to obtain the new global model parameters w t+1 ;

[0041] Step 11: Broadcast global model parameters. The server broadcasts the global model parameters w to all clients. t+1 , after receiving, each client performs a new round of local training;

[0042] Step 12: Repeat steps 2 to 11 until the global model parameters converge.

[0043] In the above steps, the parameter clipping strategy is used to reduce the amount of parameter transmission, which can increase the transmission speed between the client and the server. In the privacy protection process, homomorphic encryption or differential perturbation in step 8 is randomly selected to prevent the leakage of privacy information of local data. Compared with the method of only using homomorphic encryption to process parameters, it can significantly improve efficiency. Compared with only using differential perturbation, it can add greater noise to protect privacy without reducing the utility of the data.

[0044] In order to verify the performance of the method of the present invention, the present invention uses the public data sets MNIST and Fashion MNIST for simulation experiment evaluation. In order to simulate the scenario of multiple client training in federated learning, the present invention randomly and evenly distributes 60,000 training images in the MNIST data set into 20 parts, representing 20 clients. Table 1 shows the parameter settings of the present invention when training on the two data sets.

[0045] Table 1 Model parameter settings

[0046]

[0047]

[0048] The Fashion MNIST dataset is processed in the same way. This random uniform distribution method conforms to independent and identical distribution. According to the characteristics of the selected dataset, the existing convolutional neural network MNIST-CNN suitable for the MNIST dataset and the Fashion MNIST dataset is used for training. MNIST-CNN consists of 3 convolutional layers, 2 pooling layers, and 2 fully connected layers. The relevant parameters used in the experiment are given in Table 1. Among them, the convolution kernel size of the 3 convolutional layers is 3×3, the first layer channel is 1, the second layer channel is 32, and the third layer channel is 64; the pooling window size is 2×2; the number of neurons in the fully connected layer is 64, and the activation function is ReLu.

[0049] To evaluate the performance of the method of the present invention, the present invention is compared with two methods with a traditional homomorphic encryption and differential privacy combined framework. Method 1: A federated average aggregation algorithm that performs noise addition on all parameters before parameter aggregation and then performs encryption operations. Method 2: A federated optimized heterogeneous network algorithm that performs noise addition on all parameters before parameter aggregation and then performs encryption operations.

[0050] Figure 3 These are the accuracy curves of the three methods on different data sets when the privacy budget is 1; Figure 3 a) is a comparison chart of the accuracy curve on the FashionMNIST dataset. Figure 3 b) is a comparison chart of the accuracy curves on the MNIST dataset. Figure 3 As shown in the figure, when the privacy budget for each round of training is 1, the three methods perform well on both datasets. The accuracy is 0.98 when converged on the MNIST dataset and 0.9 when converged on the Fashion MNIST dataset. The two datasets have different accuracy at convergence due to different data characteristics, label distribution, and data distribution.

[0051] Figure 4This is the accuracy curve of the three methods on different data sets when the privacy budget is 0.1; Figure 4 a) is a comparison chart of the accuracy curve on the Fashion MNIST dataset. Figure 4 b) is a comparison chart of the accuracy curve on the MNIST dataset. Figure 4 As shown in Figure 2, when the privacy budget is 0.1, the performance of the three methods on the two datasets is quite different. Method 1 and Method 2 with the combined privacy framework add too much noise, which makes the network parameters trained by the client no longer suitable for training, and the accuracy also decreases. Figure 4 It can also be seen that the proposed method performs better under the same privacy budget, with an accuracy of 0.86 on the Fashion MNIST dataset and 0.95 on the MNIST dataset.

[0052] contrast Figure 3 and Figure 4 It can be seen that the accuracy of the same algorithm with different privacy budgets has decreased. The reason is that when the privacy budget is low, the noise added by the client before parameter aggregation is too large, which leads to a decrease in the model utility. Therefore, a reasonable privacy budget should be selected when using differential privacy to achieve the privacy protection effect of federated learning.

[0053] The method of the present invention effectively improves the model accuracy and computational efficiency. Experimental results show that the scheme of the present invention can maintain good performance under different privacy requirements. When the privacy budget per round is 0.1, compared with method 2, the model accuracy of this method is improved by 22.4%.

[0054] In order to compare the good performance of the method of the present invention in encryption time and decryption efficiency, the present invention also conducts a comparative analysis of encryption time and decryption time. Table 2 shows the encryption and decryption time of the three methods under different key lengths. As shown in Table 2, it can be seen that under the same key length, the method of the present invention requires the least time when performing homomorphic encryption and decryption. When the key length is 1024, the encryption time required is 89.36% more efficient than method 1, and the decryption time efficiency is improved by 82.6%. This is because the method of the present invention uses parameter clipping before performing homomorphic encryption and noise addition, clips the parameters below the average value, and then selects only half of the clipped parameters when performing encryption, reducing the parameters that need to be encrypted, and all encryption and decryption efficiency is significantly improved. At the same time, it can also be seen that as the key length increases, the encryption and decryption time of the three methods increases accordingly. Therefore, when using homomorphic encryption to provide privacy protection for federated learning, the key length should be reasonably selected to ensure the ability to maintain efficient performance while providing strong privacy.

[0055] Table 2 Encryption and decryption time of three methods under different key lengths (unit: s)

[0056]

[0057] In order to prove that the method of the present invention can resist some attacks, a gradient leakage experiment is used to verify the defensiveness of the method of the present invention, and the MNIST image changes are used as a comparison. Figure 5 is a successful graph of gradient leakage attack, such as Figure 5 As shown, the original image information is decrypted after about 20 iterations. In the federated learning framework that does not adopt the present invention, due to the lack of necessary privacy protection mechanism, as the number of iterations increases, the attacker can infer the real feature vector and restore the image.

[0058] When the method of the present invention is used, the attacker can only obtain the encrypted and noisy parameters, and thus cannot infer the real feature vector, and the real picture cannot be restored. Figure 6 is the gradient leakage failure graph. Figure 6 As shown, this experiment proves that even if the original image information is not decrypted after 290 iterations, the method of the present invention can successfully resist gradient leakage attacks and demonstrate strong privacy protection capabilities.

[0059] In a gradient leakage attack, an attacker may attempt to infer the gradient information of a model by observing the model's response to input data (e.g., by querying the model's output or gradient information). In this way, the attacker may be able to reverse engineer the features of the training data or the parameters of the model. Figure 5 and Figure 6 The “iter” in represents the iteration step that the attacker tries to recover the model parameters.

[0060] It should be noted that the above specific embodiments are exemplary, and those skilled in the art can come up with various solutions inspired by the disclosure of the present invention, and these solutions also belong to the disclosure scope of the present invention and fall within the protection scope of the present invention. Those skilled in the art should understand that the present invention description and its drawings are illustrative and do not constitute a limitation of the claims. The protection scope of the present invention is defined by the claims and their equivalents.

Claims

1. A local differential privacy federated learning method based on dynamic encryption, characterized in that: The federated learning method includes a server and N clients, wherein the server is responsible for distributing global model parameters and aggregating local models, and the client uses local data for training. The server and the client use the federated learning algorithm to train to obtain the final global model parameters. After the client obtains the local model parameters through local training, the local model parameters are compressed using a parameter clipping strategy. Subsequently, a random selection strategy is used to perform noise or encryption operations on the clipped local model parameters. Finally, the noisy or encrypted local model parameters are uploaded to the server for aggregation to obtain new global model parameters, specifically including: Step 1: In the initialization phase, the server initializes the global model parameter w0 and sends it to the client for local training. It also initializes the privacy budget for each round and the parameter processing center generates a key. Step 2: In the local training phase, the client performs a round of training on the local data set based on the global model parameter w0 to obtain the local model parameter Step 3: Client calculation phase: each client calculates the average value of the local model parameters Step 4: Traverse the local model parameters and find the parameters below the average The position index windex; Step 5: Set the local model parameters that are lower than the average parameters to 0 to obtain the trimmed local model parameters Step 6: In the local model parameter processing stage, the parameter processing center generates a random variable from the Bernoulli distribution for subsequent random noise addition and encryption operations; Step 7: When the random variable is equal to 1, use the homomorphic encryption function to perform encryption operations on the non-zero values ​​in the pruned local model parameters to obtain the encrypted parameters Step 8: When the random variable is equal to 0, add Laplace noise of scale Δf / ε0 to the non-zero value in the pruned local model parameters to obtain the noise parameter Step 9: Encryption parameters and noise parameters Upload to the server; Step 10: Parameter aggregation phase, the server receives the encryption parameters of all local clients of the current training round and noise parameters After the information is encrypted, Decrypt, and then perform federated average aggregation on all private local model parameters to obtain the new global model parameter w t+1 ; Step 11: Broadcast the global model. The server broadcasts the global model parameters w to all clients. t+1 , after receiving, each client performs a new round of local training; Step 12: Repeat steps 2 to 11 until the global model converges.

Citation Information

Cited By

  • Privacy protection method for industrial data transmission

    CN119885275A

  • Systematic privacy protection federated learning method and system based on multi-receiver encryption and differential privacy

    CN120146223A

  • Method and system for privacy data protection in big data analysis process

    CN121525099A