A federated learning model training method based on conditional privacy set intersection
By adopting a federated learning model training method based on the intersection of conditional privacy sets in vertical federated learning, and using encryption technology and differential privacy mechanisms, the problem in the existing technology that the server may speculate on the client's training data is solved, and data privacy is achieved. Improvement of security protection and model training efficiency.
Patent Information
- Application Number
- CN202210012540.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-06
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2042-01-06
AI Technical Summary
The existing privacy set intersection protocol cannot effectively protect the client's intention in vertical federated learning, causing the server to speculate on its training data, affecting data privacy and security.
A federated learning model training method based on the intersection of conditional privacy sets is adopted. The model training parameters are initialized by the client and the server respectively, and encryption technology and differential privacy mechanisms are used for model training to ensure that the server cannot infer the client's training data.
It realizes the security protection of data in vertical federated learning, ensuring that the client's intentions are not leaked, while improving the training efficiency and accuracy of the model.
Smart Images

Figure CN114386069B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of data security technology, and specifically relates to a federated learning model training method based on conditional privacy set intersection. Background Art
[0002] In real life, if institutions can share their data for data mining or machine learning, there will be greater and greater potential benefits. In order to break down data barriers, federated learning methods are used to enable all participants to obtain a global model without sharing their private data. In 2017, McMahan et al. formally proposed the concept of federated learning for the first time, which is to use training data scattered on mobile devices for local calculations, and then update the learning shared model by aggregating these local calculations. Federated learning usually uses a basic architecture such as client-server to achieve collaborative model training of decentralized data. Many clients (which can be mobile devices or independent organizations, institutions, etc.) train models in a collaborative manner under the coordination of a central server, and the clients do not need to upload or exchange data, and always maintain control over their local private data. Compared with traditional machine learning methods, this method reduces the potential data storage, data management and other costs brought about by collecting data together before model training, while meeting the increasingly stringent requirements for data privacy and security protection. Federated learning can uniformly model data from multiple parties without compromising data privacy and security.
[0003] In vertical federated learning, sample alignment must be performed before subsequent joint training models can be performed. In order to protect the data privacy of both parties, the existing solutions generally use the Private Set Intersection (PSI) protocol to complete the sample alignment operation. Conditional Private Set Intersection (CPSI) is a variant of the PSI protocol. It allows the client to propose a condition (which is invisible to the server), and the final intersection is data that satisfies the condition and is also the intersection of both parties. When the CPSI protocol is used for sample alignment, it can also enable both parties to obtain the secret share of the intersection that satisfies the condition on the server, and then the two parties conduct two-party vertical federated learning. In this scenario, the client can even initiate a federated learning in which the server is completely unaware of the client's intentions, thus protecting the client's intentions. For example, in a risk control scenario, an institution obviously does not want other institutions (especially competitors) to know its next move. The superiority of the CPSI protocol is that it can make the server completely unaware of the client's intentions, so how to conduct federated learning based on conditional private set intersection is an urgent problem to be solved. Summary of the invention
[0004] In order to solve the problems existing in the above-mentioned prior art, the present invention proposes a federated learning model training method based on conditional privacy set intersection, the method comprising: the client and the server use the conditional privacy set intersection protocol to process their respective data to obtain a training data set; the client and the server initialize the model training parameters respectively; and perform model training according to the initialized model training parameters and the training data set.
[0005] Preferably, using the conditional privacy set intersection protocol to process the respective data includes: the client sets a condition ρ, the client and the server perform the conditional privacy set intersection protocol on their respective data according to the condition set by the client, and the client obtains the identifier intersection I that satisfies the condition c , the server obtains the server data share that meets the conditions The client uses the identifier intersection I c Get client training data X c , client data share that meets the conditions
[0006] Preferably, the process of training the model includes:
[0007] S1: Set the training round T;
[0008] S2: The client uses its own public key to encrypt the data in the training set and obtains the ciphertext And send the encrypted ciphertext to the server; Indicates the client data share, pk c Represents the client public key;
[0009] S3: Based on the server's initial parameters and the server's data share calculate And use the client public key to calculate Encrypt and get the ciphertext The server receives the ciphertext from the client And calculate the ciphertext parameters based on the encrypted ciphertext itself Send the calculated ciphertext parameters to the client; where ω s Represents the initial model parameters of the server
[0010] S4: Client ciphertext parameters Decrypt and get the plaintext ω s X s ; Calculate the client's residual ωX-2Y based on the decrypted plaintext, the client's training set data, and the client's initial model training parameters; and send the calculated residual to the server; The formula for calculating the residual is: ωX-2Y=ω c X c+ω s X s -2Y, where Y represents the label of the dataset, X s represents the data share of the client and the server, X c represents the training data of the client, and ω represents the model parameters;
[0011] S5: The client calculates the gradient of this round and updates the model training parameters according to the calculated gradient;
[0012] S6: The client generates noise Z that satisfies the Laplace mechanism based on the updated parameters t ; Client residual after parameter update based on noise calculation Send the calculation results to the server;
[0013] S7: The server sends the residual ωX-2Y and Calculate the server-side gradient and update the server-side training parameters based on the calculated gradient;
[0014] S8: Repeat steps S2 to S7 until the training round is over and the client obtains model W c , the server gets the model W s ; The server will model W s Send to the client;
[0015] S9: The client obtains the complete model based on the model sent by the server.
[0016] Furthermore, the formula for calculating the gradient on the client side is:
[0017]
[0018] X=X c +X s
[0019] Among them, B represents the amount of data for each round of training, X c represents the training data of the client, X s represents the data share of the client and the server, and X represents the data set shared by the client and the server.
[0020] Furthermore, the client updates the model training parameters including:
[0021] ω c =ω c -g c
[0022] Among them, ω c represents the training parameters of the client model, g c Represents the gradients computed by the client.
[0023] Furthermore, the gradient formula for calculating the server is:
[0024]
[0025] Among them, B represents the amount of data for each round of training. Indicates the server data share. represents the client data share, Z t represents the noise that satisfies ε-differential privacy.
[0026] The server updates the model training parameters including:
[0027] ω s =ω s -g s
[0028] Among them, ω s Represents the training parameters of the server model, g s Represents the gradient calculated by the server.
[0029] To achieve the above objectives, the present invention also provides a computer-readable storage medium on which a federated learning model training program is stored. When the federated learning model training program is executed by a processor, it implements any of the above-mentioned federated learning model training methods based on conditional privacy set intersection.
[0030] To achieve the above-mentioned objectives, the present invention also provides a federated learning model training device based on conditional privacy set intersection, comprising a processor and a memory; the memory is used to store a federated learning model training program; the processor is connected to the memory, and is used to execute the federated learning model training program stored in the memory, so that the federated learning model training device based on conditional privacy set intersection performs any of the above-mentioned federated learning model training methods based on conditional privacy set intersection.
[0031] Advantages of the present invention:
[0032] The differential privacy technology is added to the federated learning model training method proposed in the present invention, so that the server cannot infer its training data from the obtained model, thereby safely protecting the data of both parties and helping the client to obtain the target model; when the model is used, the server can help the client to use the model together, or the server can hand over the model to the client at the end of training, and the client can use it alone, thereby improving the training efficiency and training accuracy of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 The figure shows an overall flow chart of a federated learning model training method based on conditional privacy set intersection according to the present invention.
[0034] Figure 2 A training flow chart of the federated learning model of the present invention is shown. DETAILED DESCRIPTION
[0035] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0036] A federated learning model training method based on conditional privacy set intersection, such as Figure 1 Taking two-party longitudinal logistic regression as an example, the federated learning model training method proposed in the present invention is introduced. The method includes: the client and the server obtain training data using a conditional privacy set intersection protocol; the client and the server respectively initialize model training parameters; and the client and the server perform model training.
[0037] The conditional privacy set intersection protocol is used to process the respective data, including: the client sets a condition ρ (the condition is invisible to the client), the client and the server perform the conditional privacy set intersection protocol on their respective data according to the condition set by the client, and the client obtains the identifier intersection I that meets the condition c , the server obtains the server data share that meets the conditions The client uses the identifier intersection I c Get client training data X c , client data share that meets the conditions The set conditions can be arbitrary and need to be determined according to customer needs, such as requiring data with age < 35 and income > 100,000.
[0038] The server and client initialize their own model training parameters ω, etc. Among them, the initial model of the server is ω s , the initial model of the client is ω c , mini-batch gradient descent is used for model training, and Taylor expansion is used for Sigmod function fitting. The number of rounds of model training is T, and the amount of data for each round of training is B. The client holds the key (pk c ,sk c ).
[0039] like Figure 2 As shown in Figure 1, the process of training the model includes:
[0040] S1: Set the training round T;
[0041] S2: The client uses its own public key to encrypt the data in the training set and obtains the ciphertext And send the encrypted ciphertext to the server; Indicates the client data share, pk c Represents the client public key;
[0042] S3: Based on the server's initial parameters and the server's data share calculate And use the client public key to calculate Encrypt and get the ciphertext The server receives the ciphertext from the client And calculate the ciphertext parameters based on the encrypted ciphertext itself Send the calculated ciphertext parameters to the client; where ω s Represents the initial model parameters of the server
[0043] S4: Client ciphertext parameters Decrypt and get the plaintext ω s X s ; Calculate ωX-2Y=ω based on the decrypted plaintext, the client's training set data, and the client's initial model training parameters c X c +ω s X s -2Y, and send the calculated ωX-2Y to the server; where Y represents the label of the dataset, X s represents the data share between the client and the server, and ω represents the model parameter;
[0044] S5: The client calculates the gradient of this round and updates the model training parameters according to the calculated gradient;
[0045] The formula for calculating the gradient on the client side is:
[0046]
[0047] X=X c +X s
[0048] Among them, B represents the amount of data for each round of training, X c represents the training data of the client, X represents the dataset shared by the client and the server, and X s Indicates the data share of the client and the server.
[0049] The client updates the model training parameters including:
[0050] ω c =ω c-g c
[0051] Among them, ω c represents the training parameters of the client model, g c Represents the gradients computed by the client.
[0052] S6: The client generates noise Z that satisfies ε-differential privacy using the Laplace mechanism or Gaussian mechanism based on the updated parameters t , and calculate Send the calculation results to the server;
[0053] S7: The server receives the ωX-2Y and Calculate the server-side gradient and update the server-side training parameters based on the calculated gradient;
[0054]
[0055] Among them, B represents the amount of data for each round of training. Indicates the server data share. represents the client data share, Z t represents the noise that satisfies ε-differential privacy.
[0056] The parameter update formula on the server side is:
[0057] ω s =ω s -g s
[0058] Among them, ω s Represents the model training parameters on the server side, g s Represents the gradient of model training on the server.
[0059] S8: Repeat steps S2 to S7 until the training round is over and the client obtains model W c , the server gets the model W s ; The server will model W s Send to the client;
[0060] S9: The client obtains the complete model based on the model sent by the server.
[0061] After completing T rounds of training, the client obtains model W c , the server gets the model W s At this point, the server can use the model W s Send it directly to the client, so that the client can get the complete model W = W c +W s , and can also assist the client in using the model in subsequent model use.
[0062] In one embodiment of the present invention, the present invention also includes a computer-readable storage medium on which a federated learning model training program is stored. When the program is executed by a processor, any of the above-mentioned federated learning model training methods based on conditional privacy set intersection is implemented.
[0063] A person skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to the federated learning model training program. The aforementioned federated learning model training program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk, etc., various media that can store program codes.
[0064] A federated learning model training device based on conditional privacy set intersection, comprising a processor and a memory; the memory is used to store a federated learning model training program; the processor is connected to the memory and is used to execute the federated learning model training program stored in the memory, so that the federated learning model training device based on conditional privacy set intersection performs any of the above-mentioned federated learning model training methods based on conditional privacy set intersection.
[0065] Specifically, the memory includes: ROM, RAM, magnetic disk, USB flash drive, memory card or optical disk, etc., which can store program codes.
[0066] Preferably, the processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0067] The above embodiments further illustrate the purpose, technical solutions and advantages of the present invention in detail. It should be understood that the above embodiments are only preferred implementation modes of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made to the present invention within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A federated learning model training method based on conditional privacy set intersection, characterized in that: The method comprises: a client and a server use a conditional privacy set intersection protocol to process their respective data to obtain a training data set; the client and the server respectively initialize model training parameters; and perform model training according to the initialized model training parameters and the training data set; and the client and the server use a conditional privacy set intersection protocol to process their respective data, wherein the client sets a condition ρ, and the client and the server perform a conditional privacy set intersection protocol on their respective data according to the set condition, wherein the client obtains an identifier intersection I that satisfies the condition. c , the server obtains the server data share X that meets the conditions s1 ; The client uses the intersection of identifiers I c Get client training data X c And the client data share X that meets the conditions s2 ; The process of training the model includes: S1: Set the training round T; S2: The client uses its own public key to encrypt the data in the training set and obtains the ciphertext [X s2 ] pkc ; and send the encrypted ciphertext to the server; where X s2 Indicates the client data share, pk c Represents the client public key; S3: Based on the server's initial parameters and server's data share X s1 Calculate ω s X s1 , and uses the client public key to calculate ω s X s1 Encrypt and get the ciphertext [ω s X s1 ] pkc ; The server receives the client's ciphertext [X s2 ] pkc , and calculate the ciphertext parameter [ω s X s ] pkc ; Send the calculated ciphertext parameters to the client; where ω s Represents the training parameters of the server model; S4: The client checks the ciphertext parameters [ω s X s ] pkc Decrypt and get the plaintext ω s X s ; Calculate the client's residual ωX-2Y based on the decrypted plaintext, the client's training set data, and the client's initial model training parameters; and send the calculated residual to the server; The formula for calculating the residual is: ωX-2Y=ω c X c +ω s X s -2Y, where Y represents the label of the dataset, X s represents the data share of the client and the server, X c represents the training data of the client, ω represents the model parameters; X represents the dataset shared by the client and the server, ω c Represents the training parameters of the client model; S5: The client calculates the gradient of this round and updates the model training parameters according to the calculated gradient; S6: The client generates noise Z that satisfies the Laplace mechanism based on the updated parameters t ; Client residual (ωX-2Y)X after updating the noise calculation parameters s2 +Z t , and send the calculation results to the server; S7: The server sends the residual ωX-2Y and (ωX-2Y)X s2 +Z t Calculate the server-side gradient and update the server-side training parameters based on the calculated gradient; S8: Repeat steps S2 to S7 until the training round is over and the client obtains model W c , the server gets the model W s ; The server will model W s Send to the client; S9: The client obtains the complete model based on the model sent by the server.
2. According to claim 1, a federated learning model training method based on conditional privacy set intersection is characterized in that: The formula for calculating the gradient on the client side is: X=X c +X s Among them, B represents the amount of data for each round of training, X c represents the training data of the client, X s Indicates the data share of the client and the server.
3. According to the method for training a federated learning model based on conditional privacy set intersection in claim 1, it is characterized in that: The client updates the model training parameters including: oh c =ω c -g c Among them, g c Represents the gradients computed by the client.
4. According to the method for training a federated learning model based on conditional privacy set intersection in claim 1, it is characterized in that: The gradient formula for calculating the server is: Among them, B represents the amount of data for each round of training, X s1 Indicates the server data share, X s2 represents the client data share, Z t represents the noise that satisfies ε-differential privacy.
5. According to the method for training a federated learning model based on conditional privacy set intersection in claim 1, it is characterized in that: The server updates the model training parameters including: oh s =ω s -g s Among them, g s Represents the gradient calculated by the server.
6. A computer-readable storage medium having a federated learning model training program stored thereon, characterized in that: The federated learning model training program is executed by a processor to implement the steps of any one of claims 1 to 5 of the federated learning model training method based on conditional privacy set intersection.
7. A federated learning model training device based on conditional privacy set intersection, characterized in that: It includes a processor and a memory; the memory is used to store a federated learning model training program; the processor is connected to the memory and is used to execute the federated learning model training program stored in the memory, so that the three-factor query device based on the intersection of privacy-preserving sets performs the steps of any one of the federated learning model training methods based on conditional privacy set intersection in claims 1 to 5.
