Federated learning privacy protection method and system
Through homomorphic encryption and blockchain technology, the problems of gradient information leakage and high computing overhead in federated learning are solved, and the security protection and full life cycle maintenance of model data are achieved.
Patent Information
- Application Number
- CN202410837475.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-26
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2044-06-26
AI Technical Summary
Existing federated learning aggregation methods have problems such as gradient information leakage and high computational overhead for participants, making it difficult to implement multi-party secure joint modeling in an environment with limited resources.
The homomorphic encryption algorithm is used to encrypt the gradient data, and the central server performs decryption calculations, and utilizes the non-tampering and certificate protection features of the blockchain to achieve full life cycle maintenance of model data.
It effectively protects the security of the participants' private data, reduces the computing overhead of the participants, and realizes the full life cycle maintenance of model data through the blockchain to store certificates.
Smart Images

Figure CN118381600B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of federated learning, and in particular to a method and system for protecting privacy in federated learning. Background Art
[0002] Federated learning (FL), as a distributed machine learning method, has attracted the attention of many researchers in recent years and has been widely used in smart government affairs, smart finance, smart healthcare and other fields. According to the overlap of data of participants, federated learning can be divided into horizontal federated learning, vertical federated learning and transfer learning; according to the number of participating nodes and node characteristics, federated learning can be divided into cross-silo federated learning and cross-device federated learning. In addition, there are three architectures for federated learning, namely decentralized federated learning architecture, centralized federated learning architecture and semi-centralized federated learning architecture. In the decentralized federated learning structure, participants not only need to train their own data models, but also need to receive and aggregate the data models of other participants, and then perform iterative training; in the centralized federated learning architecture, participants train based on local data, upload the training model to the central server for aggregation and distribution, and iterate until the training model reaches the convergence condition; the semi-centralized federated learning architecture is to solve the problem of high communication overhead of participants who are far away. Servers are added to the decentralized architecture for model interaction, which reduces the communication overhead of participants.
[0003] However, most of the current federated learning aggregation methods fail to consider computational overhead and gradient leakage at the same time, and lack protection for model integrity. They are difficult to apply to multi-party secure joint modeling in resource-limited environments. Therefore, how to design a secure and efficient federated learning security aggregation method has become an unresolved problem. Summary of the invention
[0004] The present invention provides a federated learning privacy protection method and system to solve the problems of gradient information leakage and high computational overhead of participants in existing federated learning aggregation methods, and to achieve integrity protection of the model.
[0005] To this end, the present invention provides the following technical solutions:
[0006] In one aspect, the present invention provides a method for protecting privacy in federated learning, the method comprising:
[0007] The central server receives the gradient ciphertext based on homomorphic encryption sent by each participant;
[0008] Aggregate and decrypt the gradient ciphertexts received from each participant to obtain aggregated gradient information;
[0009] Digitally signing the aggregated gradient information to obtain a signature group, wherein the signature group includes the signature information and the aggregated gradient information;
[0010] Sending the signature group to the consensus node;
[0011] The consensus node performs consensus verification on the signature information in the signature group, and uploads the aggregated gradient information in the signature group to the blockchain network after the verification is passed.
[0012] Optionally, the method further comprises:
[0013] Each participant obtains the global model and trains the global model based on local private data to obtain gradient data;
[0014] Encrypting the gradient data using the public key and the homomorphic key of the central server to obtain a gradient ciphertext based on homomorphic encryption;
[0015] The gradient ciphertext is sent to the central server.
[0016] Optionally, the each participant obtaining the global model includes: each participant obtaining the global model from the blockchain network.
[0017] Optionally, the gradient ciphertext includes: a first ciphertext and a second ciphertext; and the method further includes:
[0018] Each participant receives the random key of the participant sent by the key generation center;
[0019] The step of encrypting the gradient data using the public key and the homomorphic key of the central server to obtain the gradient ciphertext includes:
[0020] Randomly pick a random number;
[0021] generating a first ciphertext of the gradient data using the random number;
[0022] The second ciphertext of the gradient data is generated by using the random key of the participant, the public key of the central server and the homomorphic key.
[0023] Optionally, the method further includes: the central server randomly selecting a secret random factor as a private key of the central server, and generating a public key of the central server based on the secret random factor.
[0024] Optionally, the method further comprises:
[0025] The central server receives the homomorphic key sent by the key generation center through a secure channel;
[0026] The step of aggregating and decrypting the gradient ciphertexts received from each participant to obtain the aggregated gradient information includes:
[0027] Aggregate the gradient ciphertexts received from each participant to obtain aggregate information;
[0028] The aggregate information is decrypted using the homomorphic key to obtain aggregate gradient information.
[0029] Optionally, digitally signing the aggregated gradient information to obtain a signature group includes: digitally signing the aggregated gradient information using a private key of a central server to obtain a signature group.
[0030] Optionally, the method further comprises:
[0031] The key generation center generates homomorphic keys based on public parameters;
[0032] Sending the homomorphic key to the central server through a secure channel, and uploading the public parameters to the blockchain network;
[0033] Generate a random key for each participant, and send the random key to the corresponding participant through a secure channel;
[0034] An aggregate key is generated according to the random key, and the aggregate key is sent to the central server through a secure channel.
[0035] On the other hand, the present invention also provides a federated learning privacy protection system, the system comprising: a central server, a consensus node, a blockchain network, and at least two participant nodes;
[0036] The participant node is used to obtain a global model, perform training based on local private data and the global model to obtain gradient data, encrypt the gradient data using the public key and homomorphic key of the central server to obtain a gradient ciphertext based on homomorphic encryption, and send the gradient ciphertext to the central server;
[0037] The central server is used to receive the gradient ciphertext sent by each participant node, aggregate and decrypt the received gradient ciphertext of each participant to obtain aggregated gradient information, digitally sign the aggregated gradient information to obtain a signature group, and send the signature group to the consensus node;
[0038] The consensus node is used to perform consensus verification on the signature information in the signature group, and upload the aggregated gradient information in the signature group to the blockchain network after the verification is passed.
[0039] Optionally, the system further comprises:
[0040] The key generation center is used to generate a homomorphic key based on the public parameters, send the homomorphic key to the central server through a secure channel, and upload the public parameters to the blockchain network; generate a random key for each participant, and send the random key to the corresponding participant through a secure channel; generate an aggregate key based on the random key, and send the aggregate key to the central server through a secure channel.
[0041] On the other hand, the present invention also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the federated learning privacy protection method are executed.
[0042] The federated learning privacy protection method and system provided by the present invention uses a homomorphic encryption algorithm to solve the problem of gradient data leakage, implements decryption calculations through a central server, effectively protects the security of private data of each participant, and reduces the computing overhead of the participants. Furthermore, based on the characteristics of blockchain such as immutability and evidence protection, key data in the data training process is stored on the chain, thereby achieving full life cycle maintenance of model data. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0044] Figure 1 It is a flow chart of the privacy protection method for federated learning provided by the present invention;
[0045] Figure 2 It is a flow chart of generating and sending gradient ciphertext by participants in the federated learning incentive method provided by the present invention;
[0046] Figure 3 It is a structural schematic diagram of the federated learning privacy protection system provided by the present invention;
[0047] Figure 4 It is a schematic diagram of the process in which the key generation center generates keys for the central server and each participant node in the federated learning privacy protection system provided by the present invention;
[0048] Figure 5 It is a flowchart of model training and uploading to the blockchain network in the federated learning privacy protection system provided by the present invention. DETAILED DESCRIPTION
[0049] The specific implementation of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the present invention, and is not used to limit the present invention.
[0050] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0051] In view of the problems existing in the existing federated learning aggregation methods, the present invention provides a method and system for protecting the privacy of federated learning, which uses a homomorphic encryption algorithm to solve the problem of gradient data leakage, implements decryption calculations through a central server, and effectively reduces the computing overhead of the participants. Furthermore, based on the characteristics of blockchain such as immutability and evidence protection, the key data in the data training process is stored on the chain to achieve full life cycle maintenance of the model data.
[0052] Homomorphic encryption is a type of encryption method with special natural properties. Compared with general encryption algorithms, in addition to basic encryption operations, homomorphic encryption can also realize multiple calculation functions between ciphertexts, that is, calculation first and then decryption is equivalent to decryption first and then calculation. This feature is of great significance for protecting the security of information. Using homomorphic encryption technology, multiple ciphertexts can be calculated before decryption, without having to decrypt each ciphertext and incur high computational costs; using homomorphic encryption technology, the calculation of ciphertext by the keyless party can be realized, and the ciphertext calculation does not need to go through the key party, which can reduce the communication cost and transfer the calculation task, thereby balancing the calculation cost of each party; using homomorphic encryption technology, the decryption party can only know the final result, but cannot obtain the message of each ciphertext, which can improve the security of information.
[0053] In essence, homomorphic encryption refers to an encryption function that performs addition and multiplication operations on the plaintext in a ring and then encrypts it, and the results are equivalent to the corresponding operations on the ciphertext after encryption. Due to this good property, people can entrust a third party to process the data without leaking information. An encryption function with homomorphic properties refers to an encryption function in which two plaintexts a and b satisfy Dec(En(a)⊙En(b))=a⊕b, where En is the encryption operation, Dec is the decryption operation, and ⊙ and ⊕ correspond to the operations on the plaintext and ciphertext domains respectively. When ⊕ represents addition, the encryption is called additive homomorphic encryption; when ⊕ represents multiplication, the encryption is called multiplicative homomorphic encryption.
[0054] Fully homomorphic encryption refers to an encryption function that satisfies both the homomorphic properties of addition and multiplication, and can perform any number of addition and multiplication operations. Expressed in mathematical formulas, Dec(f(En(m1), En(m2), …, En(mk))) = f(m1, m2, …, mk), or written as: f(En(m1), En(m2), …, En(mk)) = En(f(m1, m2, …, mk)). If f is an arbitrary function, it is called fully homomorphic encryption.
[0055] like Figure 1 It is a flow chart of the privacy protection method for federated learning provided by the present invention, comprising the following steps:
[0056] In step 101, the central server receives the gradient ciphertext based on homomorphic encryption sent by each participant.
[0057] The gradient ciphertext is the encrypted data of the gradient data obtained by the participant using local private data to train the global model.
[0058] The global model can be stored on the blockchain network, and accordingly, each participant obtains the global model from the blockchain network.
[0059] The process of the participants generating and sending the gradient ciphertext is as follows: Figure 2 As shown, the following steps are included:
[0060] In step 201, a participant obtains a global model and trains the global model based on local private data to obtain gradient data.
[0061] Specifically, the participant P i Get the global model by accessing the blockchain network, and based on local privacy data data i Train with the global model to get the corresponding model gradient grad i A non-limiting specific process is as follows:
[0062] First, for t +1 federated model iteration training, participant Pi runs the Stochastic Gradient Descent (SGD) algorithm, and the calculated gradient is:
[0063]
[0064] Among them, ▽ represents the gradient calculation algorithm, Minimize the loss function for the Federated SGD (FedSGD) algorithm. datai It is the participant P i Local training data samples, grad t are the global model weights.
[0065] The SGD algorithm is an iterative method for optimizing the parameters of a machine learning model. The basic idea is that in each step, only one sample is used to calculate the gradient and update the parameters. This can reduce the amount of calculation, accelerate convergence, and help avoid falling into a local minimum. The advantages of the SGD algorithm include efficiency, parallelization, adaptability, and can be used for online learning. It is efficient on large-scale data sets because only one sample is used in each iteration. In addition, since only one sample is used in each iteration, the algorithm can be easily parallelized. It can also adapt well to changes in data, especially suitable for online learning scenarios.
[0066] Secondly, the participant P i Calculate local update parameters ,in It is t +1 round of communication with party P i The local model weights, η is the learning rate, which means the step size of the model update.
[0067] Finally, the participant P i The local model update parameters are quantized, and the quantized local model weights are:
[0068] ;
[0069] in, Represents the parameter quantization algorithm.
[0070] It should be noted that in practical applications, different variant algorithms can be selected according to specific tasks and data sets, and the parameters and hyperparameters of the algorithms can be adjusted according to experimental results to achieve optimal performance. Of course, other algorithms suitable for joint training can also be used to implement model training, which is not limited in the embodiments of the present invention.
[0071] Step 202: Encrypt the gradient data using the public key and homomorphic key of the central server to obtain a gradient ciphertext based on homomorphic encryption.
[0072] The public key and homomorphic key of the central server can be obtained by the participating parties from the central server, wherein the homomorphic key can be generated by a key generation center and sent to the central server through a secure channel.
[0073] For example, the key generation center randomly selects two large prime numbers p and q , and calculateN = p × q , and further calculate , and then randomly select a homomorphic key e c ,satisfy , where gcd() represents the greatest common divisor (GCD).
[0074] At the same time, the key generation center can use homomorphic keys e c Calculate the homomorphic private key d c ,in d c satisfy .
[0075] In addition, the key generation center can also define a hash function H (·):{0,1} * → G , randomly generate a prime number N 1 The cyclic multiplicative group G of has generators g ,in N 1 <N And gcd (N 1 ,N) = 1.
[0076] Accordingly, the key generation center can output the public parameters , such as outputting the public parameters to the blockchain network and sending the homomorphic key e c and homomorphic private key d c Sent to the central server via a secure channel.
[0077] Accordingly, the central server can randomly select a secret random factor ,in, Representation model The set of integers below Is a positive integer.
[0078] Will s As its own private key, based on the generator of the above cyclic multiplication group G g Calculate the public key S= g s .
[0079] Furthermore, at the beginning of the learning task, each participant can submit a key generation request to the key generation center. i Generate the corresponding random key ,Will Sent to participant P via a secure channel i ; At the same time, let the aggregate key ,in, Represents a multiplication operation, which aggregates the key z Sent to the central server via a secure channel.
[0080] Accordingly, the participant P i The server's public key and homomorphic key can be used to encrypt the gradient data obtained through training to obtain the gradient ciphertext based on homomorphic encryption. For example:
[0081] Participant P i Randomly pick a random number r i,t+1 , the gradient data Through the central server's public key S The gradient ciphertext corresponding to the gradient data is obtained by encryption calculation:
[0082] , (1)
[0083] in, Represents the participant P i The first ciphertext generated in round t+1; ” indicates a multiplication operation.
[0084] Represents the participant P i The second ciphertext generated in round t+1; g It is the generator of the cyclic multiplication group G, which can be obtained from the blockchain network. g ; r i,t+1 Represents the participant P i Generated random numbers;
[0085] represents the gradient of training; S is the public key of the central server; For the participant P i The random key is generated by the key generation center and sent to the participant P through a secure channel i ; e c is the homomorphic key obtained from the central server.
[0086] It should be noted that the above-mentioned participants Pi The encryption method for gradient data is only an exemplary description. In specific applications, it is not limited to the above specific method. As long as the gradient data obtained through training is encrypted based on the homomorphic encryption algorithm to obtain the corresponding gradient ciphertext based on homomorphic encryption, it will suffice.
[0087] Step 203: Send the gradient ciphertext to the central server.
[0088] Continue to refer to Figure 1 , in step 102, the gradient ciphertexts received from each participant are aggregated and decrypted to obtain aggregated gradient information.
[0089] In the t In the +1 round of training, the central server receives the gradient ciphertext sent by each participant , aggregate and decrypt these gradient ciphertexts. The specific process is as follows:
[0090] First, the central server aggregates , where C represents a multiplication operation; then using the homomorphic private key d c Decrypt the calculation and get the aggregated gradient information:
[0091] (2)
[0092] In the formula, The first ciphertext representing the aggregation of the central server in round t+1; Represents the participant P i The second ciphertext generated in round t+1; d c Homomorphic private key of the central server; Represents the participant P i Gradient data of the t+1th round of training; For the participant P i A random key.
[0093] Since the aggregate key ,so:
[0094] (3)
[0095] In the formula, Represents the participant P i Gradient data of the t+1th round of training; For the participant P i A random key; The aggregation key of the central server.
[0096] Step 103: digitally sign the aggregated gradient information to obtain a signature group, wherein the signature group includes the signature information and the aggregated gradient information.
[0097] The central server aggregates the results, i.e. the above aggregated gradient information Digitally sign using your own private key s Get signature group , which can be expressed as:
[0098] (4)
[0099] In the formula, Represents the signature group of the central server in round t+1; Indicates the signature of the central server in round t+1; Represents the participant P i The gradient data of the t+1th round of training; H is the hash function; s The private key of the central server.
[0100] Step 104: Send the signature group to the consensus node.
[0101] Step 105: The consensus node performs consensus verification on the signature information in the signature group, and uploads the aggregated gradient information in the signature group to the blockchain network after the verification is passed.
[0102] The consensus node can perform consensus verification on the signature group using the following formula (5):
[0103] (5)
[0104] In the formula, e represents a bilinear pairing map; represents the signature of the central server in round t+1; g is the generator of the cyclic multiplication group G; Represents the participant P i The gradient data of the t+1th round of training; H is the hash function; S The public key of the central server.
[0105] If the above formula (5) holds true, the verification is successful; otherwise, the signature group is rejected.
[0106] Participant P i Obtained by accessing the blockchain network Wheel Aggregation Model , and then iteratively train the model based on local data until the global model converges.
[0107] The privacy protection method for federated learning provided by the present invention uses a homomorphic encryption algorithm to solve the problem of gradient data leakage, implements decryption calculations through a central server, effectively protects the security of private data of each participant, and reduces the computing overhead of the participants. Furthermore, based on the characteristics of blockchain such as immutability and evidence protection, key data in the data training process is stored on the chain, thereby achieving full life cycle maintenance of model data.
[0108] Accordingly, the embodiment of the present invention also provides a federated learning privacy protection system, such as Figure 3 The figure shows a structural diagram of the system.
[0109] The federated learning privacy protection system includes: a central server 301, a consensus node 302, a blockchain network 303, and at least two participant nodes 304. Among them:
[0110] The participant node 304 is used to obtain the global model, train the global model based on the local private data to obtain gradient data, encrypt the gradient data using the public key and homomorphic key of the central server 301, obtain the gradient ciphertext based on homomorphic encryption, and send the gradient ciphertext to the central server 301;
[0111] The central server 301 is used to receive the gradient ciphertext sent by each participant node 304, aggregate and decrypt the received gradient ciphertext of each participant to obtain aggregated gradient information, digitally sign the aggregated gradient information to obtain a signature group, and send the signature group to the consensus node 302;
[0112] The consensus node 302 is used to perform consensus verification on the signature information in the signature group, and upload the aggregated gradient information in the signature group to the blockchain network after the verification is passed.
[0113] In order to facilitate the management of keys, Figure 3 As shown, the federated learning privacy protection system may further include: a key generation center 305, which is used to generate a homomorphic key based on the public parameters, send the homomorphic key to the central server 301 through a secure channel, and upload the public parameters to the blockchain network 303; and generate a random key for each participant, and send the random key to the corresponding participant through a secure channel; generate an aggregate key based on the random key, and send the aggregate key to the central server 301 through a secure channel.
[0114] Figure 4 The process of generating keys for the central server and each participating node by the key generation center in the federated learning privacy protection system provided by the present invention is shown.
[0115] In step 401, the key generation center randomly selects a homomorphic key e c , using homomorphic keys e c Calculate the homomorphic private key d c .
[0116] In step 402, the key generation center generates the homomorphic key e c Calculate the homomorphic private key d c Sent to the central server.
[0117] In step 403, the key generation center generates the public parameters related to the encryption and decryption algorithm. pk Sent to the blockchain network so that the central server and each participant’s node can obtain these parameters from the blockchain network.
[0118] In step 404, the key generation center generates a key for each participant node P i Generate the corresponding random key , and based on the nodes P of each participant i Generate aggregate key from random key z .
[0119] In step 405, the key generation center generates a random key Sent to the participating node P i .
[0120] In step 406, the key generation center generates the aggregate key z Sent to the central server.
[0121] In step 407, the central server selects a private key and generates a public key based on the public parameters obtained from the blockchain network and the private key.
[0122] Reference Figure 5 , is a flowchart of model training and uploading to the blockchain network in the federated learning privacy protection system provided by the present invention.
[0123] In step 501, each participating node obtains the global model from the blockchain network, and trains the global model based on local private data to obtain gradient data, homomorphically encrypts the gradient data to obtain gradient ciphertext; and sends the gradient ciphertext to the central server.
[0124] In step 502, after receiving the gradient ciphertexts from the nodes of each participant, the central server aggregates and decrypts the gradient ciphertexts to obtain aggregated gradient information; digitally signs the aggregated gradient information to obtain a signature group; and sends the signature group to the consensus node.
[0125] In step 503, the consensus node performs consensus verification on the signature information in the signature group, and uploads the aggregated gradient information in the signature group to the blockchain network after the verification is passed.
[0126] It can be seen that the solution proposed by the present invention not only effectively protects the security of the private data of each participant and reduces the computing overhead of the participants, but also realizes the full life cycle maintenance of the model data.
[0127] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0128] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0129] In several embodiments provided by the present invention, it should be understood that the disclosed device can be implemented in other ways.
[0130] The present invention also provides a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and the computer program can be executed when it is run. Figure 1 or Figure 2 or Figure 4 or Figure 5 The storage medium may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc. The storage medium may also include a non-volatile memory (non-volatile) or a non-transitory memory, etc.
[0131] The above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination thereof. When implemented using software, the above embodiments may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired or wireless means.
[0132] The embodiments of the present invention are described in detail above. The present invention is described in detail using specific implementation methods herein. The description of the above embodiments is only used to help understand the method and system of the present invention. It is only a part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should belong to the scope of protection of the present invention, and the content of this specification should not be understood as limiting the present invention. Therefore, any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for protecting privacy in federated learning, characterized in that: The method comprises: The central server receives the gradient ciphertext based on homomorphic encryption sent by each participant; Aggregate and decrypt the gradient ciphertexts received from each participant to obtain aggregated gradient information; Digitally signing the aggregated gradient information to obtain a signature group, wherein the signature group includes the signature information and the aggregated gradient information; Sending the signature group to the consensus node; The consensus node performs consensus verification on the signature information in the signature group, and uploads the aggregated gradient information in the signature group to the blockchain network after the verification is passed; Each participant obtains a global model and trains the global model based on local private data to obtain gradient data; Encrypting the gradient data using the public key and homomorphic key of the central server to obtain a gradient ciphertext based on homomorphic encryption; Sending the gradient ciphertext to the central server; Each participant obtains a global model and trains the global model based on local private data to obtain gradient data including: First, for t +1 federated model iterative training, participant Pi runs the stochastic gradient descent SGD algorithm, and the calculated gradient is: Among them, ▽ represents the gradient calculation algorithm, Minimize the loss function for the Federated Learning Stochastic Gradient Descent (FedSGD) algorithm. data i is the local training data sample of participant Pi, grad t is the global model weight; Secondly, participant Pi calculates the local update parameter ,in is the local model weight of participant Pi in the t+1th round of communication, η is the learning rate, which indicates the step size of the local model update; Finally, participant Pi quantizes the local model update parameters, and the quantized local model weight is: ; in, represents the parameter quantization algorithm; The step of aggregating and decrypting the gradient ciphertexts received from each participant to obtain the aggregated gradient information includes: Aggregate the gradient ciphertexts received from each participant to obtain aggregate information; Decrypting the aggregate information using the homomorphic key to obtain aggregate gradient information; The public key and homomorphic key of the central server are obtained by the participating parties from the central server, wherein the homomorphic key is generated by the key generation center and sent to the central server through a secure channel.
2. The method for protecting privacy in federated learning according to claim 1, characterized in that: The acquisition of the global model by each participant includes: Each participant obtains the global model from the blockchain network.
3. The method for protecting privacy in federated learning according to claim 2, characterized in that: The gradient ciphertext includes: a first ciphertext and a second ciphertext; the method further includes: Each participant receives the random key of the participant sent by the key generation center; The step of encrypting the gradient data using the public key and the homomorphic key of the central server to obtain the gradient ciphertext includes: Randomly pick a random number; Generate a first ciphertext of the gradient data using a random number; The second ciphertext of the gradient data is generated by using the random key of the participant, the public key of the central server and the homomorphic key.
4. The method for protecting privacy in federated learning according to claim 3, characterized in that: The method further comprises: The central server randomly selects a secret random factor as the private key of the central server, and generates the public key of the central server based on the secret random factor.
5. The method for protecting privacy in federated learning according to claim 1, wherein: The digitally signing the aggregated gradient information to obtain a signature group includes: The aggregated gradient information is digitally signed using the private key of the central server to obtain a signature group.
6. The method for protecting privacy in federated learning according to any one of claims 1 to 5, characterized in that: The method further comprises: The key generation center generates homomorphic keys based on public parameters; Sending the homomorphic key to the central server through a secure channel and uploading the public parameters to the blockchain network; Generate a random key for each participant, and send the random key to the corresponding participant through a secure channel; An aggregate key is generated according to the random key, and the aggregate key is sent to the central server through a secure channel.
7. A federated learning privacy protection system, characterized in that the system comprises: Central server, consensus node, blockchain network, and at least two participant nodes; The participant node is used to obtain a global model, perform training based on local private data and the global model to obtain gradient data, encrypt the gradient data using the public key and homomorphic key of the central server to obtain a gradient ciphertext based on homomorphic encryption, and send the gradient ciphertext to the central server; The central server is used to receive the gradient ciphertext sent by each participant node, aggregate and decrypt the received gradient ciphertext of each participant to obtain aggregated gradient information, digitally sign the aggregated gradient information to obtain a signature group, and send the signature group to the consensus node; The consensus node is used to perform consensus verification on the signature information in the signature group, and upload the aggregated gradient information in the signature group to the blockchain network after the verification is passed; A key generation center is used to generate a homomorphic key based on the public parameters, send the homomorphic key to the central server through a secure channel, and upload the public parameters to the blockchain network; generate a random key for each participant, and send the random key to the corresponding participant through a secure channel; generate an aggregate key based on the random key, and send the aggregate key to the central server through a secure channel; The global model is obtained, and the gradient data is obtained by training the local private data with the global model, including: First, for t +1 federated model iterative training, participant Pi runs the stochastic gradient descent SGD algorithm, and the calculated gradient is: Among them, ▽ represents the gradient calculation algorithm, Minimize the loss function for the Federated Learning Stochastic Gradient Descent (FedSGD) algorithm. data i is the local training data sample of participant Pi, grad t is the global model weight; Secondly, participant Pi calculates the local update parameter ,in is the local model weight of participant Pi in the t+1th round of communication, η is the learning rate, which indicates the step size of the local model update; Finally, participant Pi quantizes the local model update parameters, and the quantized local model weight is: ; in, represents the parameter quantization algorithm; The step of aggregating and decrypting the gradient ciphertexts received from each participant to obtain the aggregated gradient information includes: Aggregate the gradient ciphertexts received from each participant to obtain aggregate information; Decrypting the aggregate information using the homomorphic key to obtain aggregate gradient information; The public key and homomorphic key of the central server are obtained by the participating parties from the central server, wherein the homomorphic key is generated by the key generation center and sent to the central server through a secure channel.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the federated learning privacy protection method according to any one of claims 1 to 6 are performed.
