A lightweight federated learning privacy protection method under edge computing
By adopting cloud-edge-end hierarchical federated learning architecture and differential privacy and homomorphic encryption technologies in edge computing scenarios, the problems of privacy leakage and high communication costs in federated learning are solved, and efficient privacy protection and efficient privacy protection under edge computing are achieved. Fast model updates.
Patent Information
- Application Number
- CN202211503349.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-28
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2042-11-28
AI Technical Summary
Existing federated learning methods have privacy leak risks and high communication costs in edge computing scenarios, and cannot meet the real-time and efficient and low-cost transmission requirements.
Adopting a cloud-edge-end hierarchical federated learning architecture, combined with differential privacy and homomorphic encryption technology, through model training on the terminal device and parameter aggregation between edge servers and cloud servers, differential perturbation and homomorphic encryption are used to protect the model. parameters, achieve privacy protection, and implement multiple iterative update strategies on the local and edge server sides.
It effectively reduces communication delay, reduces the risk of privacy leakage, improves model update efficiency, and achieves efficient and low-cost data transmission in edge computing scenarios.
Smart Images

Figure CN117294460B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of privacy protection under edge computing, and in particular to a lightweight federated learning privacy protection method under edge computing. Background Art
[0002] With the continuous development of edge computing, federated learning has been widely used as a method that perfectly fits the edge computing model, can retain data on terminal devices, reduce the risk of data leakage, and solve the problem of data islands. However, with the rise of attack methods such as gradient leakage attacks and collusion attacks, and the problem of high communication latency in traditional federated computing, many researchers have also carried out many targeted optimizations under the federated learning framework and proposed solutions such as task offloading to solve the above problems. However, most of the existing methods cannot reduce the large amount of communication costs brought about by privacy protection, and have great limitations in edge computing scenarios.
[0003] In summary, the existing federated learning improvement scheme has the following shortcomings:
[0004] 1) Existing solutions for reducing the communication latency of federated learning have the risk of privacy leakage when uploading data from terminal devices to edge servers.
[0005] 2) Existing solutions to the risk of privacy leakage in federated learning consume a lot of time and space, consume a lot of communication costs, and are not suitable for real-time application scenarios under edge computing.
[0006] The shortcomings of the above-mentioned existing technologies will affect the realization of reliable privacy protection and efficient data communication in federated learning, making it unable to meet the efficient and low-cost transmission requirements in edge computing scenarios. Therefore, the present invention proposes a lightweight federated learning privacy protection solution under edge computing. Summary of the invention
[0007] The purpose of the present invention is to solve the risk of privacy leakage in the process of federated learning, which consumes a lot of time and space, consumes a lot of communication costs, and is not suitable for real-time application scenarios under edge computing.
[0008] In order to achieve the above-mentioned purpose, the present invention adopts the following technical means:
[0009] A lightweight federated learning privacy protection scheme under edge computing includes the following steps:
[0010] S1: Establish a cloud-edge-end hierarchical federated learning architecture: different terminal devices are used to train the neural network model, while the edge server and cloud server aggregate the neural network model parameters;
[0011] S2: A two-layer privacy protection scheme based on differential privacy and homomorphic encryption is adopted: after the terminal device trains to obtain the neural network model parameters, it performs differential perturbations on them and then uploads them to the edge server. After the edge server iteratively trains to obtain the neural network model parameters, it performs homomorphic encryption on the neural network model parameters and transmits them to the cloud server for aggregation;
[0012] S3: Implement a strategy of multiple iterative updates locally and on the edge server side: Set a training round number threshold on the terminal device. When the number of updates reaches the threshold, upload the local model to the edge server. At the same time, set another threshold on the edge server. When the number of training rounds reaches the threshold, upload the neural network model parameters to the cloud server for aggregated updates.
[0013] In the above technical solution, the detailed description of the cloud-edge-end hierarchical federated learning architecture in S1 is as follows:
[0014] S11: The terminal device is responsible for data collection and preprocessing, obtains the neural network model framework from the edge server, periodically updates the neural network model locally, obtains local model parameters, and uploads the local model parameters to the edge server;
[0015] S12: The edge server obtains the neural network framework to be trained from the cloud, sends it to the terminal devices participating in the training, aggregates the neural network model parameters uploaded by the terminal devices, and obtains the local model parameters after aggregation, that is, the model parameters on the edge server;
[0016] S13: The central cloud server aggregates the local model parameters uploaded by each edge server to obtain the global model parameters, and sends the aggregated global model parameters to the edge server to obtain a new neural network model framework. The edge server sends the global model parameters to the terminal device, and the terminal device uses the parameters to update the neural network model on the device for the next round of training.
[0017] According to a lightweight federated learning privacy protection scheme under edge computing according to claim 1, it is characterized in that, in S2, a detailed description of the model parameter protection mechanism based on differential privacy is as follows.
[0018] S211: terminal device d i Have a dataset D i , dataset D i Include data X i and label T i , the data set D i The training set D is divided into two parts according to the ratio of 7:3. train and the test set D test , and then the training set D trainAs the input of the neural network model on the terminal device for model training, let the output of the neural network model on the terminal device be Y, then:
[0019] Y = f(X i ) (1)
[0020] S212: After each round of training, the test set D test Input into the neural network model on the terminal device and compare Y with the label T i The calculated loss value is f(X i )-T i :
[0021] Terminal equipment i The gradient calculation formula of the t-th round neural network model on is as follows:
[0022]
[0023] in The model parameters are derived through the loss value;
[0024] The gradient of the neural network model is clipped, and the clipping formula is as follows:
[0025]
[0026] S213: Assume that the neural network model parameters on the terminal device trained k times are Dataset D i The mapping function to the neural network model parameters is h, and the training data set divided during the kth training is D k , the neural network model parameters on the terminal device and the training data set D k The mapping formula is as follows:
[0027]
[0028] S214: Neural network model parameters The probability of being stolen by an attacker is p. According to the mapping relationship between the data set and the parameters of the neural network model on the terminal device, the privacy budget is Add additive noise to the model parameters of the k-th training. The noise is added as follows:
[0029]
[0030] Where lap is the Laplace distribution, Δg is the query sensitivity, After differential perturbation of the neural network model parameters, upload them to the edge server. is the data set D used by terminal device i i Model parameters obtained after the tth round of training; It means that the terminal device i is using another data set D′ i The model parameters obtained after training for t rounds. In the above technical solution, in S2, the homomorphic encryption mechanism for edge-cloud model transmission is described in detail as follows:
[0031] S221: After receiving the request from the edge server, the key management center (KMC) creates a key pair and distributes it to the edge server. The key generation adopts the Paillier algorithm that satisfies additive homomorphism. The key generation and distribution algorithm is as follows:
[0032] Enter the edge server set E
[0033] For j in E:
[0034] 1. Randomly select large prime numbers p and q such that the greatest common factor of p*q and (p-1)*(q-1) is 1
[0035] 2. Let p*q be n, and the least common multiple of (p-1) and (q-1) be λ;
[0036] 3. Randomly select G and satisfy the order of G (mod n 2 ) is a multiple of n;
[0037] 4. Generate a public-private key pair, the public key is (n, g), and the private key is λ;
[0038] 5. Send the public and private key pair to edge server j;
[0039] S222: Use the homomorphic encryption algorithm to encrypt the uploaded parameters. The model update formula is as follows:
[0040]
[0041] E() is homomorphic encryption, is the parameter of edge server j after iterative aggregation k times in the tth round of training, is the model parameter obtained after k iterations of training for terminal device i in the tth round of training, d is the total number of terminal devices, and e is the total number of edge servers;
[0042] S223: The specific encryption algorithm for model parameters is as follows:
[0043] ω t is the model parameter obtained by aggregation after the tth round of iterations
[0044] Input: Model parameters ω t ,ω t It is the model parameter obtained by aggregation after the tth round of iteration;
[0045] Generate a random vector r using random()
[0046] Calculate ciphertext
[0047] calculate
[0048] Decryption
[0049] In the above technical solution, the detailed description of the strategy of multiple iterative updates of the local and edge servers in S3 is as follows:
[0050] S31: After obtaining the model gradient of the kth training, determine whether k is less than k1. If k is less than the threshold k1, update the model parameters locally. The update formula is as follows:
[0051]
[0052] η represents the learning rate. If k is equal to k1, the model parameters Send to edge server for aggregation:
[0053] S32: When the edge server aggregates and updates the model parameters, k1 represents the threshold of the number of iterations on the terminal device in each round of training, and k2 represents the threshold of the number of iterations on the edge server. When the number of iterations does not reach k1*k2 times in the training round number t, the edge server aggregates the model parameters uploaded by d terminal devices and performs homomorphic encryption to obtain When the number of iterations reaches k1*k2, the model parameters decrypted by the edge server are updated and the next round of training is carried out.
[0054] Due to the adoption of the above technical solution, the beneficial effects of the present invention are:
[0055] 1. The present invention provides a lightweight federated learning privacy protection scheme under edge computing, establishes a cloud-edge-end hierarchical federated learning architecture, allows multiple edge servers to perform partial model aggregation, avoids the problem of limited number of server access clients, better realizes the communication-computing trade-off, and greatly shortens the communication delay.
[0056] 2. The present invention provides a lightweight federated learning privacy protection scheme under edge computing. Innovative differential privacy technology and homomorphic encryption algorithm are introduced into the uploading of model parameters, Laplace noise is added to the locally trained model parameters for privacy protection, and homomorphic encryption is performed when the edge server and the central cloud server aggregate the model parameters. This not only reduces the number of encryption times, but also ensures the privacy of the model parameters, thereby realizing the privacy protection of local data sets and model parameters.
[0057] 3. The present invention provides a lightweight federated learning privacy protection scheme under edge computing. It adopts a periodic update strategy on the terminal device and performs multiple updates in one round of training to avoid the waste of resources caused by the different computing power of terminal devices in traditional synchronous federated learning. At the same time, multiple aggregation updates are also used when local aggregation is performed on the edge server, which makes the model update more efficient and achieves faster convergence of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 A schematic diagram of the structure of a lightweight federated learning privacy protection solution under edge computing provided for the implementation of the present invention;
[0059] Figure 2 A model update strategy diagram provided for the implementation of the present invention;
[0060] Figure 3 Graph of the local differential privacy model provided for the implementation of the present invention. DETAILED DESCRIPTION
[0061] The following is a detailed description of the embodiments of the present invention. Although the present invention will be described and illustrated in conjunction with some specific embodiments, it should be noted that the present invention is not limited to these embodiments. On the contrary, modifications or equivalent substitutions made to the present invention should all be included in the scope of the claims of the present invention.
[0062] In addition, in order to better illustrate the present invention, numerous specific details are given in the following specific embodiments. It will be understood by those skilled in the art that the present invention can also be implemented without these specific details.
[0063] A lightweight federated learning privacy protection scheme under edge computing includes the following steps:
[0064] S1: Establish a cloud-edge-end hierarchical federated learning architecture: different terminal devices are used to train the neural network model, while the edge server and cloud server aggregate the neural network model parameters;
[0065] S2: A two-layer privacy protection scheme based on differential privacy and homomorphic encryption is adopted: after the terminal device trains to obtain the neural network model parameters, it performs differential perturbations on them and then uploads them to the edge server. After the edge server iteratively trains to obtain the neural network model parameters, it performs homomorphic encryption on the neural network model parameters and transmits them to the cloud server for aggregation;
[0066] S3: Implement a strategy of multiple iterative updates locally and on the edge server side: Set a training round number threshold on the terminal device. When the number of updates reaches the threshold, upload the local model to the edge server. At the same time, set another threshold on the edge server. When the number of training rounds reaches the threshold, upload the neural network model parameters to the cloud server for aggregated updates.
[0067] In the above technical solution, the detailed description of the cloud-edge-end hierarchical federated learning architecture in S1 is as follows:
[0068] S11: The terminal device is responsible for data collection and preprocessing, obtains the neural network model framework from the edge server, periodically updates the neural network model locally, obtains local model parameters, and uploads the local model parameters to the edge server;
[0069] S12: The edge server obtains the neural network framework to be trained from the cloud, sends it to the terminal devices participating in the training, aggregates the neural network model parameters uploaded by the terminal devices, and obtains the local model parameters after aggregation, that is, the model parameters on the edge server;
[0070] S13: The central cloud server aggregates the local model parameters uploaded by each edge server to obtain the global model parameters, and sends the aggregated global model parameters to the edge server to obtain a new neural network model framework. The edge server sends the global model parameters to the terminal device, and the terminal device uses the parameters to update the neural network model on the device for the next round of training.
[0071] According to a lightweight federated learning privacy protection scheme under edge computing according to claim 1, it is characterized in that, in S2, a detailed description of the model parameter protection mechanism based on differential privacy is as follows.
[0072] S211: terminal device d i Have a dataset D i , dataset D i Include data X i and label T i , the data set D i The training set D is divided into two parts according to the ratio of 7:3. train and the test set D test , and then the training set D train As the input of the neural network model on the terminal device for model training, let the output of the neural network model on the terminal device be Y, then:
[0073] Y = f(X i ) (1)
[0074] S212: After each round of training, the test set D testInput into the neural network model on the terminal device and compare Y with the label T i The calculated loss value is f(X i )-T i :
[0075] Terminal equipment i The gradient calculation formula of the t-th round neural network model on is as follows:
[0076]
[0077] in The model parameters are derived through the loss value;
[0078] The gradient of the neural network model is clipped, and the clipping formula is as follows:
[0079]
[0080] S213: Assume that the neural network model parameters on the terminal device trained k times are Dataset D i The mapping function to the neural network model parameters is h, and the training data set divided during the kth training is D k , the neural network model parameters on the terminal device and the training data set D k The mapping formula is as follows:
[0081]
[0082] S214: Neural network model parameters The probability of being stolen by an attacker is p. According to the mapping relationship between the data set and the parameters of the neural network model on the terminal device, the privacy budget is Add additive noise to the model parameters of the k-th training. The noise is added as follows:
[0083]
[0084] Where lap is the Laplace distribution, Δg is the query sensitivity, After differential perturbation of the neural network model parameters, upload them to the edge server. is the data set D used by terminal device i i Model parameters obtained after the tth round of training; It means that the terminal device i is using another data set D′ i The model parameters obtained after training for t rounds. In the above technical solution, in S2, the homomorphic encryption mechanism for edge-cloud model transmission is described in detail as follows:
[0085] S221: After receiving the request from the edge server, the key management center (KMC) creates a key pair and distributes it to the edge server. The key generation adopts the Paillier algorithm that satisfies additive homomorphism. The key generation and distribution algorithm is as follows:
[0086] Enter the edge server set E
[0087] For j in E:
[0088] 1. Randomly select large prime numbers p and q such that the greatest common factor of p*q and (p-1)*(q-1) is 1
[0089] 2. Let p*q be n, and the least common multiple of (p-1) and (q-1) be λ;
[0090] 3. Randomly select G and satisfy the order of G (mod n 2 ) is a multiple of n;
[0091] 4. Generate a public-private key pair, the public key is (n, g), and the private key is λ;
[0092] 5. Send the public and private key pair to edge server j;
[0093] S222: Use the homomorphic encryption algorithm to encrypt the uploaded parameters. The model update formula is as follows:
[0094]
[0095] E() is homomorphic encryption, is the parameter of edge server j after iterative aggregation k times in the tth round of training, is the model parameter obtained after k iterations of training for terminal device i in the tth round of training, d is the total number of terminal devices, and e is the total number of edge servers;
[0096] S223: The specific encryption algorithm for model parameters is as follows:
[0097] ω t is the model parameter obtained by aggregation after the tth round of iterations
[0098] Input: Model parameters ω t ,ω t It is the model parameter obtained by aggregation after the tth round of iteration;
[0099] Generate a random vector r using random()
[0100] Calculate ciphertext
[0101] calculate
[0102] Decryption
[0103] In the above technical solution, the detailed description of the strategy of multiple iterative updates of the local and edge servers in S3 is as follows:
[0104] S31: Set different thresholds k1 for terminal devices with different computing power and data sets. Suppose terminal device d i Have a dataset D i , including data X i and label T i , the data set is divided into training set D according to the ratio of 7:3 train and the test set D test , and then use the training set as the input of the neural network model for model training:
[0105] S32: After obtaining the model gradient of the kth training, determine whether k is less than k1. If k is less than the threshold k1, update the model parameters locally. The update formula is as follows:
[0106]
[0107] η represents the learning rate. If k is equal to k1, the model parameters Send to edge server for aggregation:
[0108] S33: When the edge server aggregates and updates the model parameters, k1 represents the threshold of the number of iterations on the terminal device in each round of training, and k2 represents the threshold of the number of iterations on the edge server. When the number of iterations does not reach k1*k2 times in the training round number t, the edge server aggregates the model parameters uploaded by d terminal devices and performs homomorphic encryption to obtain When the number of iterations reaches k1*k2, the model parameters decrypted by the edge server are updated and the next round of training is carried out.
Claims
1. A lightweight federated learning privacy protection method under edge computing, characterized in that: include: S1: Establish a cloud-edge-end hierarchical federated learning architecture: different terminal devices are used to train the neural network model, while the edge server and cloud server aggregate the neural network model parameters; S2: A two-layer privacy protection scheme based on differential privacy and homomorphic encryption is adopted: after the terminal device trains to obtain the neural network model parameters, it performs differential perturbations on them and then uploads them to the edge server. After the edge server iteratively trains to obtain the neural network model parameters, it performs homomorphic encryption on the neural network model parameters and transmits them to the cloud server for aggregation; S3: Multiple iterative update strategies for terminal devices and edge servers: Set a training round number threshold on the terminal device. When the number of updates reaches the threshold, upload the local model to the edge server. At the same time, set another threshold on the edge server. When the number of training rounds reaches the threshold, upload the neural network model parameters to the cloud server for aggregate update. In S2, the detailed description of the model parameter protection mechanism based on differential privacy is as follows; S211: Terminal equipment Own a dataset , dataset Include data and tags , the data set Divide into training sets in a ratio of 7:3 and test set , and then the training set As the input of the neural network model on the terminal device for model training, let the output of the neural network model on the terminal device be Y, then: S212: After each round of training, the test set Input into the neural network model on the terminal device and compare Y and label The calculated loss value is : Terminal equipment The gradient calculation formula of the t-th round neural network model on is as follows: in The model parameters are derived through the loss value; The gradient of the neural network model is clipped, and the clipping formula is as follows: S213: Assume that the neural network model parameters on the terminal device trained k times are , dataset The mapping function to the neural network model parameters is h, and the training data set divided during the kth training is , neural network model parameters and training data sets on terminal devices The mapping formula is as follows: S214: Neural network model parameters The probability of being stolen by an attacker is p. According to the mapping relationship between the data set and the parameters of the neural network model on the terminal device, the privacy budget is , add additive noise to the model parameters of the k-th training, the noise is added as follows: in is the Laplace distribution, To query sensitivity, , after differentially perturbing the neural network model parameters, upload them to the edge server, It is the terminal device i data set Model parameters obtained after the tth round of training; It means that the terminal device i is using another data set Model parameters obtained after t rounds of training; In S2, the homomorphic encryption mechanism for edge-cloud model transmission is described in detail as follows; S221: After receiving the request from the edge server, the key management center KMC creates a key pair and distributes it to the edge server. The key generation adopts the Paillier algorithm that satisfies additive homomorphism. The key generation and distribution algorithm is as follows: Enter the edge server set E For j in E: a1. Randomly select large prime numbers p and q such that the greatest common factor of p*q and (p-1)*(q-1) is 1; a2. Let p*q be n, the least common multiple of (p-1) and (q-1) is ; a3. Randomly select G and satisfy the order of G (mod ) is a multiple of n; a4. Generate a public-private key pair, the public key is (n,g), the private key is ; a5. Send the public and private key pair to edge server j; S222: Use the homomorphic encryption algorithm to encrypt the uploaded parameters. The model update formula is as follows: E() is homomorphic encryption, is the parameter of edge server j after iterative aggregation k times in the tth round of training, is the model parameter obtained after k iterations of training for terminal device i in the tth round of training, d is the total number of terminal devices, and e is the total number of edge servers; S223: The specific encryption algorithm for model parameters is as follows: Input: Model parameters , It is the model parameter obtained by aggregation after the tth round of iteration; Use random() to generate a random vector r Calculate ciphertext calculate Decryption ; In S3, the detailed description of the strategy of multiple iterative updates of the terminal device and edge server is as follows: S31: After obtaining the model gradient of the kth training, determine whether k is less than k1. If k is less than the threshold k1, update the model parameters locally. The update formula is as follows: Represents the learning rate. If k is equal to k1, the model parameters Send to edge server for aggregation: S32: When the edge server aggregates and updates the model parameters, k1 represents the threshold of the number of iterations on the terminal device in each round of training, and k2 represents the threshold of the number of iterations on the edge server. In the training round number t, when the number of iterations does not reach k1*k2 times, the edge server aggregates the model parameters uploaded by d terminal devices and performs homomorphic encryption to obtain ; When the number of iterations reaches k1*k2, the model parameters decrypted by the edge server are updated and the next round of training is carried out.
2. According to a lightweight federated learning privacy protection scheme under edge computing according to claim 1, it is characterized in that: The detailed description of the cloud-edge-end hierarchical federated learning architecture in S1 is as follows: S11: The terminal device is responsible for data collection and preprocessing, obtains the neural network model framework from the edge server, periodically updates the neural network model locally, obtains local model parameters, and uploads the local model parameters to the edge server; S12: The edge server obtains the neural network framework to be trained from the cloud, sends it to the terminal devices participating in the training, aggregates the neural network model parameters uploaded by the terminal devices, and obtains the local model parameters after aggregation, that is, the model parameters on the edge server; S13: The cloud server aggregates the local model parameters uploaded by each edge server to obtain the global model parameters, and sends the aggregated global model parameters to the edge server to obtain a new neural network model framework. The edge server sends the global model parameters to the terminal device, and the terminal device uses the parameters to update the neural network model on the device for the next round of training.
