Vertical federated learning method, device, system and storage medium for improving security
By using random number encrypted gradient values and homomorphic encryption keys in longitudinal federated logistic regression modeling, the problem of low security in the existing technology is solved, secure updating and protection of data is achieved, and data leakage is avoided.
Patent Information
- Application Number
- CN201911128849.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-11-18
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2039-11-18
AI Technical Summary
The existing implementation scheme of jointly conducting longitudinal federated logistic regression modeling with a third party has the problem of low security. The third party can deduce the original data by stealing the encrypted gradient value of the data party, leading to data leakage.
By transmitting encrypted gradient values with random numbers between the collaborator and the data party, the collaborator decrypts and returns them to the data party. The data party eliminates the random numbers to update the model parameters, ensuring the security of the gradient values and using homomorphism when necessary. The encryption key performs encryption and decryption operations.
It effectively avoids the possibility of third parties stealing data, improves the security of longitudinal federated logistic regression modeling, and prevents data leakage.
Smart Images

Figure CN110704860B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of machine learning technology, and in particular to a vertical federated learning method, device, system and storage medium for improving security. Background Art
[0002] With the development of machine learning technology, logistic regression models are currently widely used in various classification problems. When the training data of the logistic regression model is vertically distributed among various data parties, since the training data owned by each data party may involve privacy, in order to ensure that the modeling process does not leak the data privacy of each data party, each data party can perform joint modeling through vertical federation. However, in the existing implementation scheme of vertical federated logistic regression modeling with a third party, when calculating the gradient in each round, the data party sends the encrypted gradient value to the third party (collaborating party). If the third party and one of the parties work together to steal the data of the other party, the complete model can be obtained, and the original data of the other party may be derived, resulting in the leakage of the original data of the other party. Therefore, the current implementation scheme of vertical federated logistic regression modeling with a third party has the problem of low security. Summary of the invention
[0003] The main purpose of the present invention is to provide a longitudinal federated learning method, device, system and storage medium with improved security, aiming to solve the problem of low security in the current implementation scheme of longitudinal federated logistic regression modeling in conjunction with a third party.
[0004] To achieve the above object, the present invention provides a method for improving security of vertical federated learning, which is applied to collaborators participating in vertical federated logistic regression modeling, wherein the collaborators are connected in communication with data parties that have training data, and each data party has a part of the logistic regression model. The method for improving security of vertical federated learning includes:
[0005] Receiving the random number-added encrypted gradient value sent by each data party, wherein each data party encrypts and exchanges the intermediate results used to calculate the gradient value, calculates and obtains the encrypted gradient value corresponding to each model parameter, and adds the respective first random number to the encrypted gradient value to obtain the random number-added encrypted gradient value;
[0006] Decrypting the random number encrypted gradient value to obtain a random number encrypted gradient value;
[0007] Returning the random number added gradient value to each data party accordingly, so that each data party can eliminate the random number from the random number added gradient value to obtain a gradient value, and use the gradient value to update their own model parameters;
[0008] The training is iterated until the preset stopping condition is detected to obtain a trained logistic regression model.
[0009] Optionally, after the step of decrypting the random number encrypted gradient value to obtain the random number encrypted gradient value, the method further comprises:
[0010] Adding a second random number to the random number added gradient value to update the random number added gradient value, and encrypting the second random number to obtain an encrypted random number, wherein the second random number is different from the first random number;
[0011] The step of returning the random number gradient value to each data party accordingly comprises:
[0012] Returning the updated random number gradient value and the encrypted random number to each data party accordingly, so that each data party can use the encrypted random number to eliminate the random number of the random number gradient value, and use the result of eliminating the random number to update their respective encryption model parameters;
[0013] The step of iteratively training until a preset stop condition is detected to obtain a trained logistic regression model comprises:
[0014] Iterate the training until the preset stop condition is met, and receive the encrypted model parameters of the completed training sent by each data party;
[0015] The trained encrypted model parameters are decrypted to obtain a trained logistic regression model.
[0016] Optionally, before the step of receiving the random number encrypted gradient value sent by each data party, the step further includes:
[0017] Send homomorphically encrypted encryption keys to each data party;
[0018] The step of receiving the random number encrypted gradient value sent by each data party includes:
[0019] Receiving the random number-added encrypted gradient value sent by each data party, wherein each data party uses the encryption key to encrypt and exchange the intermediate result for calculating the gradient value, calculates the encrypted gradient value corresponding to each model parameter, and adds the respective first random number to the encrypted gradient value to obtain the random number-added encrypted gradient value;
[0020] The step of decrypting the random number encrypted gradient value to obtain the random number encrypted gradient value comprises:
[0021] The random number encrypted gradient value is decrypted using a decryption key corresponding to the encryption key to obtain a random number encrypted gradient value.
[0022] In addition, to achieve the above-mentioned purpose, the present invention further provides a method for improving security of vertical federated learning, which is applied to data parties participating in vertical federated logistic regression modeling, wherein the data parties are in communication connection with the collaborating parties and other data parties, and each data party has a part of the logistic regression model, and the method for improving security of vertical federated learning includes:
[0023] Encrypted exchange of intermediate results used to calculate gradient values with other data parties to obtain encrypted gradient values corresponding to local model parameters;
[0024] Adding a first random number to the encrypted gradient value to obtain a random number-added encrypted gradient value;
[0025] Sending the random number encrypted gradient value to the collaborating party, so that the collaborating party can decrypt the random number encrypted gradient value sent by each data party to obtain the random number encrypted gradient value, and return it to each data party accordingly;
[0026] Eliminating random numbers from the random number-added gradient value received from the collaborating party to obtain a gradient value, and using the gradient value to update the local model parameters;
[0027] The training is iterated until the preset stopping condition is detected to obtain a trained logistic regression model.
[0028] Optionally, before the step of encrypting and exchanging intermediate results for calculating gradient values with other data parties to calculate encrypted gradient values corresponding to local model parameters, the step further includes:
[0029] Receive the homomorphically encrypted encryption key sent by the collaborating party;
[0030] The step of encrypting and exchanging intermediate results for calculating gradient values with other data parties to calculate encrypted gradient values corresponding to local model parameters comprises:
[0031] The encryption key is used to encrypt and exchange intermediate results used to calculate gradient values with other data parties, and the encrypted gradient values corresponding to the local model parameters are calculated;
[0032] The step of sending the random number encrypted gradient value to the collaborating party so that the collaborating party can decrypt the random number encrypted gradient value sent by each data party to obtain the random number encrypted gradient value, and return the random number encrypted gradient value to each data party accordingly includes:
[0033] The random number encrypted gradient value is sent to the collaborating party, so that the collaborating party can use the decryption key corresponding to the encryption key to decrypt the random number encrypted gradient value sent by each data party, obtain the random number encrypted gradient value and return it to each data party accordingly.
[0034] Optionally, the data party is a data application party with a data tag, the intermediate result includes a first encrypted intermediate result for calculating a gradient value and a second encrypted intermediate result obtained by calculation, and the step of using the encryption key to encrypt and exchange the intermediate result for calculating the gradient value with other data parties to calculate the encrypted gradient value corresponding to the local model parameter includes:
[0035] Receiving a first encrypted intermediate result for calculating a gradient value sent by other data parties, wherein the other data parties use their own local feature data and basic model parameters in this round of parameter update to calculate the first intermediate result, and use the encryption key to encrypt the first intermediate result to obtain the first encrypted intermediate result;
[0036] The second encrypted intermediate result is calculated using the first encrypted intermediate results and the local data tag;
[0037] Returning the second encrypted intermediate result to other data parties, so that other data parties can use the second encrypted intermediate result and their own local feature data to calculate encrypted gradient values corresponding to their own model parameters;
[0038] The encrypted gradient value corresponding to the local model parameter is calculated using the second encrypted intermediate result and the local feature data.
[0039] In addition, to achieve the above-mentioned objectives, the present invention also provides a vertical federated learning device for improving security, wherein the vertical federated learning device for improving security is the collaborating party as described above, and the vertical federated learning device for improving security includes a memory, a processor, and a vertical federated learning program for improving security stored in the memory and executable on the processor, and when the vertical federated learning program for improving security is executed by the processor, the steps of the vertical federated learning method for improving security as described above are implemented.
[0040] In addition, to achieve the above-mentioned objectives, the present invention also provides a vertical federated learning device for improving security, wherein the vertical federated learning device for improving security is the data party as described above, and the vertical federated learning device for improving security includes a memory, a processor, and a vertical federated learning program for improving security stored in the memory and executable on the processor, and when the vertical federated learning program for improving security is executed by the processor, the steps of the vertical federated learning method for improving security as described above are implemented.
[0041] In addition, to achieve the above-mentioned purpose, the present invention also provides a vertical federated learning system with improved security, wherein the vertical federated learning system with improved security includes the collaborating party as described above and at least one data party as described above.
[0042] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, on which a vertical federated learning program for improving security is stored, and when the vertical federated learning program for improving security is executed by a processor, the steps of the vertical federated learning method for improving security as described above are implemented.
[0043] In the present invention, the collaborating party receives the random number encrypted gradient value sent by each data party, wherein each data party encrypts and exchanges the intermediate results used to calculate the gradient value, calculates the encrypted gradient value corresponding to each model parameter, and adds their own random numbers to the encrypted gradient value to obtain the random number encrypted gradient value; the collaborating party decrypts the random number encrypted gradient value to obtain the random number encrypted gradient value and returns it to the corresponding data party, so that each data party can eliminate the random number from the random number encrypted gradient value to obtain the gradient value, and use the gradient value to update their own model parameters, and iterate the training until a trained logistic regression model is obtained. In the scheme of longitudinal federated logistic regression modeling with a third party, the possibility of a third party collaborating with one of the parties to steal data is avoided, thereby improving the security of logistic regression modeling. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 It is a schematic diagram of the structure of the hardware operating environment involved in the embodiment of the present invention;
[0045] Figure 2 A flowchart of a first embodiment of a vertical federated learning method for improving security according to the present invention;
[0046] Figure 3 A schematic diagram of a process of performing longitudinal federated logistic regression modeling in conjunction with a third party according to an embodiment of the present invention;
[0047] Figure 4 The present invention is a flowchart of another method of performing longitudinal federated logistic regression modeling in cooperation with a third party according to an embodiment of the present invention.
[0048] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0049] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0050] The embodiment of the present invention provides a vertical federated learning device for improving security. The vertical federated learning device for improving security is a collaborator participating in vertical federated logistic regression modeling. Figure 1 , Figure 1 It is a structural diagram of the hardware operating environment involved in the embodiment of the present invention.
[0051] It should be noted that Figure 1 The structural diagram of the hardware operating environment of the vertical federated learning device for improving security is shown in FIG. The vertical federated learning device for improving security in the embodiment of the present invention can be a PC, or a terminal device with a display function such as a smart phone, a smart TV, a tablet computer, or a portable computer.
[0052] like Figure 1 As shown, the vertical federated learning device for improving security may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0053] Optionally, the vertical federated learning device for improving security may also include a camera, an RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi module, etc. Those skilled in the art will appreciate that Figure 1 The structure of the vertical federated learning device for improving security shown in the figure does not constitute a limitation of the vertical federated learning device for improving security, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0054] like Figure 1 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a vertical federated learning program for improving security.
[0055] exist Figure 1 In the vertical federated learning device for improving security shown, the network interface 1004 is mainly used to connect various data parties participating in the vertical federated logistic regression modeling and perform data communication with each data party; the user interface 1003 is mainly used to connect to the client (user end) and perform data communication with the client; and the processor 1001 can be used to call the vertical federated learning program for improving security stored in the memory 1005, and perform the following operations:
[0056] Receiving the random number-added encrypted gradient value sent by each data party, wherein each data party encrypts and exchanges the intermediate results used to calculate the gradient value, calculates and obtains the encrypted gradient value corresponding to each model parameter, and adds the respective first random number to the encrypted gradient value to obtain the random number-added encrypted gradient value;
[0057] Decrypting the random number encrypted gradient value to obtain a random number encrypted gradient value;
[0058] Returning the random number added gradient value to each data party accordingly, so that each data party can eliminate the random number from the random number added gradient value to obtain a gradient value, and use the gradient value to update their own model parameters;
[0059] The training is iterated until the preset stopping condition is detected to obtain a trained logistic regression model.
[0060] Further, after the step of decrypting the random number encrypted gradient value to obtain the random number gradient value, the processor 1001 may be used to call the vertical federated learning program for improving security stored in the memory 1005, and further perform the following operations:
[0061] Adding a second random number to the random number added gradient value to update the random number added gradient value, and encrypting the second random number to obtain an encrypted random number, wherein the second random number is different from the first random number;
[0062] The step of returning the random number gradient value to each data party accordingly comprises:
[0063] Returning the updated random number gradient value and the encrypted random number to each data party accordingly, so that each data party can use the encrypted random number to eliminate the random number of the random number gradient value, and use the result of eliminating the random number to update their respective encryption model parameters;
[0064] The step of iteratively training until a preset stop condition is detected to obtain a trained logistic regression model comprises:
[0065] Iterate the training until the preset stop condition is met, and receive the encrypted model parameters of the completed training sent by each data party;
[0066] The trained encrypted model parameters are decrypted to obtain a trained logistic regression model.
[0067] Furthermore, before the step of receiving the random number encrypted gradient value sent by each data party, the processor 1001 can be used to call the vertical federated learning program for improving security stored in the memory 1005, and further perform the following operations:
[0068] Send homomorphically encrypted encryption keys to each data party;
[0069] The step of receiving the random number encrypted gradient value sent by each data party includes:
[0070] Receiving the random number-added encrypted gradient value sent by each data party, wherein each data party uses the encryption key to encrypt and exchange the intermediate result for calculating the gradient value, calculates the encrypted gradient value corresponding to each model parameter, and adds the respective first random number to the encrypted gradient value to obtain the random number-added encrypted gradient value;
[0071] The step of decrypting the random number encrypted gradient value to obtain the random number encrypted gradient value comprises:
[0072] The random number encrypted gradient value is decrypted using a decryption key corresponding to the encryption key to obtain a random number encrypted gradient value.
[0073] In addition, an embodiment of the present invention further proposes a vertical federated learning device for improving security, wherein the vertical federated learning device for improving security is a data entity participating in vertical federated logistic regression modeling, and the vertical federated learning device for improving security comprises: a memory, a processor, and a vertical federated learning device program for improving security stored in the memory and executable on the processor, wherein when the vertical federated learning device program for improving security is executed by the processor, the steps of the vertical federated learning device method for improving security are implemented as follows:
[0074] Encrypted exchange of intermediate results used to calculate gradient values with other data parties to obtain encrypted gradient values corresponding to local model parameters;
[0075] Adding a first random number to the encrypted gradient value to obtain a random number-added encrypted gradient value;
[0076] Sending the random number encrypted gradient value to the collaborating party, so that the collaborating party can decrypt the random number encrypted gradient value sent by each data party to obtain the random number encrypted gradient value, and return it to each data party accordingly;
[0077] Eliminating random numbers from the random number-added gradient value received from the collaborating party to obtain a gradient value, and using the gradient value to update the local model parameters;
[0078] The training is iterated until the preset stopping condition is detected to obtain a trained logistic regression model.
[0079] Furthermore, before the step of encrypting and exchanging intermediate results for calculating gradient values with other data parties to obtain encrypted gradient values corresponding to local model parameters, the processor may be used to call a vertical federated learning program for improving security stored in a memory, and further perform the following operations:
[0080] Receive the homomorphically encrypted encryption key sent by the collaborating party;
[0081] The step of encrypting and exchanging intermediate results for calculating gradient values with other data parties to calculate encrypted gradient values corresponding to local model parameters comprises:
[0082] The encryption key is used to encrypt and exchange intermediate results used to calculate gradient values with other data parties, and the encrypted gradient values corresponding to the local model parameters are calculated;
[0083] The step of sending the random number encrypted gradient value to the collaborating party so that the collaborating party can decrypt the random number encrypted gradient value sent by each data party to obtain the random number encrypted gradient value, and return the random number encrypted gradient value to each data party accordingly includes:
[0084] The random number encrypted gradient value is sent to the collaborating party, so that the collaborating party can use the decryption key corresponding to the encryption key to decrypt the random number encrypted gradient value sent by each data party, obtain the random number encrypted gradient value and return it to each data party accordingly.
[0085] Furthermore, the data party is a data application party with a data tag, the intermediate result includes a first encrypted intermediate result for calculating a gradient value and a second encrypted intermediate result obtained by calculation, and the step of using the encryption key to encrypt and exchange the intermediate result for calculating the gradient value with other data parties to calculate the encrypted gradient value corresponding to the local model parameter includes:
[0086] Receiving a first encrypted intermediate result for calculating a gradient value sent by other data parties, wherein the other data parties use their own local feature data and basic model parameters in this round of parameter update to calculate the first intermediate result, and use the encryption key to encrypt the first intermediate result to obtain the first encrypted intermediate result;
[0087] The second encrypted intermediate result is calculated using the first encrypted intermediate results and the local data tag;
[0088] Returning the second encrypted intermediate result to other data parties, so that other data parties can use the second encrypted intermediate result and their own local feature data to calculate encrypted gradient values corresponding to their own model parameters;
[0089] The encrypted gradient value corresponding to the local model parameter is calculated using the second encrypted intermediate result and the local feature data.
[0090] Based on the above hardware structure, various embodiments of the vertical federated learning method for improving security of the present invention are proposed.
[0091] Reference Figure 2 , the first embodiment of the longitudinal federated learning method for improving security of the present invention provides a longitudinal federated learning method for improving security. It should be noted that although the logical order is shown in the flowchart, in some cases, the steps shown or described can be performed in a different order than here. The longitudinal federated learning method for improving security is applied to the collaborating parties participating in the longitudinal federated logistic regression modeling. The collaborating parties are connected in communication with each data party that has training data. Each data party has a part of the logistic regression model. The collaborating parties and data parties can be servers or terminal devices such as PCs, smart phones, smart TVs, tablet computers, portable computers, etc. The longitudinal federated learning method for improving security includes:
[0092] Step S10, receiving the random number encrypted gradient value sent by each data party, wherein each data party encrypts and exchanges the intermediate result used to calculate the gradient value, calculates and obtains the encrypted gradient value corresponding to each model parameter, and adds the respective first random number to the encrypted gradient value to obtain the random number encrypted gradient value;
[0093] In order to solve the problem that in the current implementation scheme of longitudinal federated logistic regression modeling with a third party, if the third party joins hands with one party to steal the data of the other party, the complete model can be obtained, so that the original data of the other party can be derived according to the results of multiple parameter updates, resulting in the leakage of the other party's data and low security of the joint modeling, in this embodiment, a secure modeling method of a longitudinal federated logistic regression model is proposed.
[0094] Specifically, each data party has a part of the training data locally, and the data of each party overlaps less in the feature dimension and more in the user dimension. One of the data parties has the data label; the parties can use the encrypted sample alignment method to determine the users owned by all parties, and then use the data corresponding to the common users of all parties to jointly train the logistic regression model. In this embodiment, the data party with the data label is called the data application party (Guest), and the data party with only the feature data is called the data provider (Host). There can be multiple data providers.
[0095] It should be noted that logistic regression modeling refers to the process of training the logistic regression model through training data to determine the various model parameters in the logistic regression model. The training process is the process of iteratively updating the model parameters.
[0096] In a model parameter update process, the collaborator (Arbiter) receives the random number encrypted gradient value sent by each data party. Among them, each data party encrypts and exchanges the intermediate results used to calculate the gradient value, calculates the encrypted gradient value corresponding to each model parameter, and adds the first random number to the encrypted gradient value corresponding to each model parameter to obtain the random number encrypted gradient value. Each data party can generate the first random number using a random number generation algorithm in its own local area. It should be understood that the first random number of each data party is randomly generated locally by each data party, so the collaborator and other data parties cannot know the first random number. The first random number used by a data party in multiple model updates can be the same, but in order to avoid the collaborator from offsetting the random number through the random number encrypted gradient value sent by the data party in multiple model updates, thereby obtaining the gradient value of the data party, and then deriving the original data of the data party, the first random number used by the data party in multiple model updates is preferably different.
[0097] It should be noted that the encryption key used by each data party to encrypt the intermediate result used to calculate the gradient value can be sent in advance by the collaborating party, or it can be sent by other devices, such as a key server specifically used to send keys. If sent by the collaborating party, the collaborating party locally has a decryption key corresponding to the encryption key. If sent by the key server, the key server sends the decryption key corresponding to the encryption key to the collaborating party. The encryption key and the decryption key can be keys generated by a homomorphic encryption algorithm, which can be a Paillier algorithm. The effect of the homomorphic encryption algorithm is to process the homomorphically encrypted data to obtain an output, and decrypt this output. The result is the same as the output result obtained by processing the unencrypted original data in the same way.
[0098] Step S20, decrypting the random number encrypted gradient value to obtain a random number encrypted gradient value;
[0099] The collaborating party decrypts the random number encrypted gradient value corresponding to each data party to obtain the random number encrypted gradient value corresponding to each data party. It should be noted that the collaborating party uses the decryption key corresponding to the encryption key of the data party to decrypt the random number encrypted gradient value.
[0100] Step S30, returning the random number added gradient value to each data party accordingly, so that each data party can eliminate the random number from the random number added gradient value to obtain a gradient value, and use the gradient value to update their own model parameters;
[0101] The collaborating party returns the random number-added gradient value corresponding to each data party to each data party. Each data party eliminates the random number from its own random number-added gradient value to obtain the gradient value corresponding to its own model parameter, and uses the gradient value corresponding to its own model parameter to update its own model parameter. Specifically, each data party subtracts its own first random number from its own random number-added gradient value to obtain the gradient value corresponding to its own model parameter.
[0102] Step S40, iterative training is performed until a preset stop condition is detected to be met to obtain a trained logistic regression model.
[0103] Iterative training, i.e., using the above method of calculating gradient values and updating model parameters, updates the model parameters of each data cube multiple times until the training is stopped when the preset stop condition is detected. The final model parameters obtained are used as the model parameters of the trained logistic regression model. The preset stop condition may be the convergence of the loss function, or the difference between the model parameters in the previous and next rounds of parameter updates is less than a preset threshold, or the number of iterative training is greater than a preset number, or the iterative training time is greater than a preset time.
[0104] It should be noted that after the training is completed, each data party can send the model parameters of the partial logistic regression model they own to other data parties, so that each data party has a complete logistic regression model, and then use the complete logistic regression model alone to complete the classification task. Alternatively, each data party may have a part of the model parameters of the logistic regression model, and each data party and the collaborating party may use the logistic regression model to complete the classification task.
[0105] Furthermore, before step S10, the following steps are also included:
[0106] Step S50, sending the homomorphically encrypted encryption key to each data party;
[0107] The collaborating party can use the preset homomorphic encryption algorithm to generate encryption keys and decryption keys, and distribute the encryption keys to each data party, retaining the decryption keys. Since the decryption keys are retained by the collaborating party, the data party cannot decrypt the data encrypted with the encryption key, and thus cannot obtain the original data.
[0108] The step S10 comprises:
[0109] Step S101, receiving the random number encrypted gradient value sent by each data party, wherein each data party uses the encryption key to encrypt and exchange the intermediate result for calculating the gradient value, calculates the encrypted gradient value corresponding to each model parameter, and adds the respective first random number to the encrypted gradient value to obtain the random number encrypted gradient value;
[0110] The collaboration party receives the random number encrypted gradient value sent by each data party, wherein each data party uses the encryption key to encrypt and exchange the intermediate results for calculating the gradient value, calculates the encrypted gradient value corresponding to each model parameter, and adds the first random number to the encrypted gradient value corresponding to each model parameter to obtain the random number encrypted gradient value. Specifically, each data party calculates the intermediate result for calculating the gradient value, encrypts the intermediate result with the encryption key, exchanges the encrypted intermediate results, and uses the encrypted intermediate results to calculate the encrypted gradient value corresponding to each model parameter.
[0111] The step S20 comprises:
[0112] Step S201, using a decryption key corresponding to the encryption key to decrypt the random number encrypted gradient value to obtain a random number encrypted gradient value.
[0113] The collaborating party uses the decryption key corresponding to the encryption key to decrypt the random number encrypted gradient value corresponding to each data party, and obtains the random number encrypted gradient value corresponding to each data party.
[0114] In this embodiment, the collaborating party receives the encrypted gradient value plus random numbers sent by each data party. Since each data party adds its own random number to the encrypted gradient value, and the collaborating party cannot know the random number of the data party, even if the collaborating party has the decryption key, it can use the decryption key to decrypt the encrypted gradient value plus random numbers and obtain the gradient value plus random numbers instead of the original gradient value of the data party. As a result, the collaborating party cannot steal the complete model in conjunction with one of the parties, and cannot derive the original data of the other party, thereby improving the security of longitudinal federated logistic regression modeling in conjunction with a third party.
[0115] Reference Figure 3 The principle and process of joint modeling between the collaboration party and the data party in this embodiment are described below:
[0116] The logistic regression model is a supervised learning classification model that implements a mapping of a given data set to {0,1}. The loss function of the logistic regression model is calculated by the following formula for the gradient value of the model parameters:
[0117] (1)
[0118] (2)
[0119] Where N is the number of samples, w is the model parameter in the logistic regression model, y is the data label, x is the feature variable, and α is the correlation coefficient. The Taylor expansion of equation (1) gives the following equation (2). Equation (2) only contains multiplication and addition operations, so it can be calculated using ciphertext under additive homomorphic encryption. The last term αW is a high-order infinitesimal and can be ignored.
[0120] The above formula (2) is divided into two parts, d and x, where d is defined as:
[0121] (3)
[0122] Where y is set to 1 or -1, so the above formula (3) can be written as:
[0123]
[0124] Define u = wx. Host is the host with characteristic data x h The data provider of Guest is the one with feature data x g and data labels y g Data application. Both Host and Guest have part of the logistic regression model, that is, Host has the feature data x h The model parameter w of the corresponding part of the model h , Guest has the same feature data x g The model parameter w of the corresponding part of the model g In order to distinguish the host and guest u, we define them as u h =w h x h ,u g =w g x g .
[0125] Host and Guest need to calculate the gradient values of the model parameters of their respective parts of the logistic regression model, which are g h and g g , the above u h 、u g And d are the intermediate results used to calculate the gradient value.
[0126] 1. The host uses local feature data x h and the basic model parameters w for this round of parameter update h Calculate u h , and for u h Encrypt to get [[u h ]], change [[u h]] is sent to the Guest. [[]] represents homomorphic encryption.
[0127] 2. The guest uses local feature data x g and the basic model parameters w for this round of model parameter update g Calculate u g , according to [[u h ]],u g and the local data label y g Calculate [[d]] and send [[d]] to the Host. Specifically,
[0128]
[0129] 3. Host uses [[d]] and its own x h , calculate the encrypted gradient value of the model parameters of this part of the logistic regression model [[g h ]], and add the random number r1 h , and get the random number encrypted gradient value [[g h ]]+r1 h , sent to Arbiter.
[0130] 4. Guest also uses [[d]] and its own x g , calculate the encrypted gradient value of the model parameters of this part of the logistic regression model [[g g ]], and add the random number r1 g , and get the random number encrypted gradient value [[g g ]]+r1 g , sent to Arbiter.
[0131] 5. Arbiter vs. h ]]+r1 h Decrypted to get g h +r1 h , for [[g g ]]+r1 g Decrypted to get g g +r1 g . h +r1 h Return to the Host, and g +r1 g Return to the Guest.
[0132] 6. Host-side g h +r1 h Eliminate the random number, that is, subtract r1 h Get g h , according to g hUpdate w h .
[0133] 7. Guest-side g g +r1 g Eliminate the random number, that is, subtract r1 g Get g g , according to g g Update w g .
[0134] Since the Arbiter can only obtain the sum of the gradient values of the Host and Guest plus the random numbers, and cannot obtain the random numbers generated locally by the Host and Guest, the Arbiter cannot cooperate with one party to steal the gradient value of the other party, and thus cannot deduce the original number of the other party.
[0135] Therefore, in this embodiment, the collaborative party receives the random number encrypted gradient value sent by each data party, wherein each data party encrypts and exchanges the intermediate results used to calculate the gradient value, calculates the encrypted gradient value corresponding to each model parameter, and adds their own random numbers to the encrypted gradient value to obtain the random number encrypted gradient value; the collaborative party decrypts the random number encrypted gradient value to obtain the random number encrypted gradient value and returns it to the corresponding data party, so that each data party can eliminate the random number of the random number encrypted gradient value to obtain the gradient value, and use the gradient value to update their own model parameters, and iterate the training until the trained logistic regression model is obtained. In the scheme of joint third party for longitudinal federated logistic regression modeling, the possibility of third party and one of the parties stealing data is avoided, and the security of logistic regression modeling is improved.
[0136] Further, based on the above first embodiment, the second embodiment of the vertical federated learning method for improving security of the present invention provides a vertical federated learning method for improving security. In this embodiment, after the step S20, it also includes:
[0137] Step S60, adding a second random number to the random number added gradient value to update the random number added gradient value, and encrypting the second random number to obtain an encrypted random number, wherein the second random number is different from the first random number;
[0138] Furthermore, based on the first embodiment, since the collaborating party can decrypt the gradient value encrypted with random numbers sent by the data party, and provides a decryption interface for the data party, the data party may maliciously send the encrypted intermediate results sent by other data parties to the collaborating party for decryption, thereby obtaining the intermediate results of other data parties, and then inferring the original data of other data parties based on the intermediate results. In this embodiment, in order to further solve this problem, a mechanism for the collaborating party to perform security protection by adding random numbers is proposed.
[0139] Specifically, after decrypting and obtaining the random number gradient values corresponding to each data party, the collaborating party adds a second random number to each random number gradient value to update the random number gradient value, that is, the updated random number gradient value is a random number added to the original random number gradient value. The second random number can be a random number generated by the collaborating party through a random number generation algorithm, or multiple different random numbers can be generated and added to each random number gradient value, or the same random number can be added to each random number gradient value. The second random number added by the collaborating party in each round of parameter update can be the same, but in order to avoid the data party offsetting the random number through the random number gradient value sent by the collaborating party in multiple model updates, thereby obtaining the original random number gradient value, the second random number used by the collaborating party in multiple model updates can be different. Since the first random number is generated by the random number of the data party and the second random number is generated by the random number of the collaborating party, the second random number is different from the first random number, so neither party can know the other party's random number.
[0140] The collaboration party encrypts the second random number, and the encryption key used for encryption is the same as the encryption key used by the data party.
[0141] The step S30 comprises:
[0142] Step S301, returning the updated random number gradient value and the encrypted random number to each data party accordingly, so that each data party can use the encrypted random number to eliminate the random number of the random number gradient value, and use the result of eliminating the random number to update the respective encryption model parameters;
[0143] The collaborating party returns the updated random number gradient value and encrypted random number to each data party accordingly. Each data party uses the encrypted random number to eliminate the random number of its own random number gradient value. Specifically, each data party subtracts the encrypted random number and its own first random number from its own random number gradient value to obtain the result of eliminating the random number. Since the encrypted random number is subtracted from the random number gradient value, according to the principle of obtaining ciphertext by subtracting ciphertext from plaintext in homomorphic encryption, the result of eliminating the random number is the encrypted gradient value. Each data party uses the encrypted gradient value obtained by eliminating the random number to update its own encrypted model parameters. It should be noted that since each data party uses the encrypted gradient value to update the model parameters, during the iterative training process, each data party can only obtain the encrypted model parameters, and the encrypted model parameters are also updated using the encrypted gradient value.
[0144] The step S40 comprises:
[0145] Step S401, iterative training is performed until a preset stop condition is met, and the training is stopped, and the encrypted model parameters of the trained model sent by each data party are received;
[0146] The collaborating party and each data party perform iterative training according to the above method of calculating gradient values and updating model parameters until the preset stopping condition is detected and the training is stopped. Each data party sends the trained encrypted model parameters to the collaborating party, and the collaborating party receives the trained encrypted model parameters sent by each data party.
[0147] Step S402, decrypting the trained encrypted model parameters to obtain a trained logistic regression model.
[0148] The collaborating party decrypts the encrypted model parameters of each trained model to obtain the trained model parameters corresponding to each data party, and the combined model is the trained complete logistic regression model. The collaborating party can send the complete logistic regression model to each data party, or send the part of the model corresponding to each data party to each data party.
[0149] Reference Figure 4 , based on the principle and process of the joint modeling between the collaboration party and the data party in the first embodiment, the principle and process of the collaboration party plus random number scheme in this embodiment are further described below:
[0150] 1. The host uses local feature data x h And the basic model parameters of this round of parameter update [[w h ]]Calculate [[u h ]], change [[u h ]]Sent to the Guest.
[0151] 2. The guest uses local feature data x g And the basic model parameters of this round of model parameter update [[w g ]]Calculate [[u g ]], according to [[u h ]]、[[u g ]] and local data label y g Calculate [[d]] and send [[d]] to the Host. Specifically,
[0152]
[0153] 3. Host uses [[d]] and its own x h , calculate the encrypted gradient value of the model parameters of this part of the logistic regression model [[g h ]], and add the random number r1 h , and get the random number encrypted gradient value [[g h ]]+r1 h , sent to Arbiter.
[0154] 4. Guest also uses [[d]] and its own x g , calculate the encrypted gradient value of the model parameters of this part of the logistic regression model [[g g ]], and add the random number r1 g , and get the random number encrypted gradient value [[g g ]]+r1 g , sent to Arbiter.
[0155] 5. Arbiter vs. h ]]+r1 h Decrypted to get g h +r1 h , for [[g g ]]+r1 g Decrypted to get g g +r1 g After that, Arbiter h +r1 h Add r2 to get g h +r1 h +r2, in g g +r1 g Add r2 to get g g +r1 g +r2, and encrypt r2 to get [[r2]]. Arbiter will g h +r1 h +r2 and [[r2]] are returned to the Host, and g g +r1 g +r2 and [[r2]] are returned to the Guest.
[0156] 6. The host uses [[r2]] and r1 h For g h +r1 h +r2 eliminates the random number and gets [[g h ]], and adopt [[g h ]]Update[[w h ]]. After the training is completed, [[w h ]]Sent to Arbiter.
[0157] 7. The guest uses [[r2]] and r1 g For g g +r1 g +r2 eliminates the random number and gets [[g g ]], and adopt [[g g ]]Update[[w g]]. After the training is completed, [[w g ]]Sent to Arbiter.
[0158] 8. Arbiter vs. h ]]Decryption gets w h , for [[w g ]]Decryption gets w g , w h and w g These are the final model parameters of the trained logistic regression model.
[0159] In this embodiment, after decrypting the random number encrypted gradient value sent by each data party, the collaborating party does not send the decryption result directly to each data party, but adds its own random number to the decryption result, so that the data party cannot obtain the decrypted original data, and thus cannot use the decryption interface of the collaborating party to steal the data of other data parties, thereby further improving the security of the vertical federated logistic regression modeling in conjunction with a third party. In addition, the collaborating party sends its own random number to the data party in an encrypted manner, so that the data party can eliminate the random number in the random number gradient value without exposing its own random number. When the training is finally completed, the encrypted model parameters of each data party are decrypted to obtain the final trained logistic regression model, thereby preventing the data party from stealing the data of another data party during the training process.
[0160] Further, based on the above first and second embodiments, the third embodiment of the vertical federated learning method for improving security of the present invention provides a vertical federated learning method for improving security. In this embodiment, the vertical federated learning method for improving security is applied to data parties participating in vertical federated logistic regression modeling, the data parties are connected to the collaborating parties and other data parties in communication, and each data party has a part of the logistic regression model. The vertical federated learning method for improving security includes:
[0161] Step A10, encrypting and exchanging intermediate results for calculating gradient values with other data parties, and calculating encrypted gradient values corresponding to local model parameters;
[0162] During a model parameter update, the data party encrypts and exchanges the intermediate results used to calculate the gradient value with other data parties, and calculates the encrypted gradient value corresponding to the local model parameter. Similarly, other data parties also calculate the encrypted gradient value corresponding to their respective local model parameters.
[0163] It should be noted that the encryption key used by each data party to encrypt the intermediate result used to calculate the gradient value can be sent in advance by the collaborating party, or it can be sent by other devices, such as a key server specifically used to send keys. If sent by the collaborating party, the collaborating party locally has a decryption key corresponding to the encryption key. If sent by the key server, the key server sends the decryption key corresponding to the encryption key to the collaborating party. The encryption key and the decryption key can be keys generated by a homomorphic encryption algorithm, which can be a Paillier algorithm. The effect of the homomorphic encryption algorithm is to process the homomorphically encrypted data to obtain an output, and decrypt this output. The result is the same as the output result obtained by processing the unencrypted original data in the same way.
[0164] Step A20, adding a first random number to the encrypted gradient value to obtain a random number-added encrypted gradient value;
[0165] The data party adds the first random number to the encrypted gradient value corresponding to the local model parameter to obtain the random number encrypted gradient value. Each data party may generate the first random number using a random number generation algorithm locally. It should be understood that the first random number of each data party is randomly generated locally by each data party, so the collaborating party and other data parties cannot know the first random number. The first random number used by a data party in multiple model updates may be the same, but in order to avoid the collaborating party offsetting the random number through the random number encrypted gradient value sent by the data party in multiple model updates, thereby obtaining the data party's gradient value and then deriving the data party's original data, the first random number used by the data party in multiple model updates is preferably different.
[0166] Step A30, sending the random number encrypted gradient value to the collaboration party, so that the collaboration party can decrypt the random number encrypted gradient value sent by each data party to obtain the random number encrypted gradient value, and return it to each data party accordingly;
[0167] The data party sends the random number encrypted gradient value to the collaboration party. The collaboration party receives the random number encrypted gradient value sent by each data party, decrypts the random number encrypted gradient value corresponding to each data party, and obtains the random number encrypted gradient value corresponding to each data party. It should be noted that the collaboration party uses the decryption key corresponding to the encryption key of the data party to decrypt the random number gradient value.
[0168] Step A40, removing the random number from the random number-added gradient value received from the collaborating party to obtain a gradient value, and using the gradient value to update the local model parameters;
[0169] The collaboration party returns the random number-added gradient value corresponding to each data party to each data party. The data party eliminates the random number from the received random number-added gradient value to obtain the gradient value corresponding to the local model parameter, and uses the gradient value corresponding to the local model parameter to update the local model parameter. Specifically, each data party subtracts its first random number from its random number-added gradient value to obtain the gradient value corresponding to its model parameter.
[0170] Step A50, iterative training until a preset stop condition is detected to obtain a trained logistic regression model.
[0171] Iterative training, i.e., using the above method of calculating gradient values and updating model parameters, updates the model parameters of each data cube multiple times until the training is stopped when the preset stop condition is detected. The final model parameters obtained are used as the model parameters of the trained logistic regression model. The preset stop condition may be the convergence of the loss function, or the difference between the model parameters in the previous and next rounds of parameter updates is less than a preset threshold, or the number of iterative training is greater than a preset number, or the iterative training time is greater than a preset time.
[0172] It should be noted that after the training is completed, each data party can send the model parameters of the partial logistic regression model they own to other data parties, so that each data party has a complete logistic regression model, and then use the complete logistic regression model alone to complete the classification task. Alternatively, each data party may have a part of the model parameters of the logistic regression model, and each data party and the collaborating party may use the logistic regression model to complete the classification task.
[0173] Furthermore, before step A10, the method further includes:
[0174] Step A60, receiving the homomorphically encrypted encryption key sent by the collaborating party;
[0175] The collaborating party can use the preset homomorphic encryption algorithm to generate encryption keys and decryption keys, and distribute the encryption keys to each data party, retaining the decryption keys. Since the decryption keys are retained by the collaborating party, the data party cannot decrypt the data encrypted with the encryption key, and thus cannot obtain the original data. The data party receives the homomorphic encryption key sent by the collaborating party.
[0176] The step A10 comprises:
[0177] Step A101, using the encryption key to encrypt and exchange intermediate results used to calculate gradient values with other data parties, and calculating encrypted gradient values corresponding to local model parameters;
[0178] The data party uses the encryption key to encrypt and exchange the intermediate results used to calculate the gradient value with other data parties, and calculates the encrypted gradient value corresponding to the local model parameter. Specifically, the data party calculates the intermediate result used to calculate the gradient value, encrypts the intermediate result using the encryption key, exchanges the encrypted intermediate result with other data parties, and uses the encrypted intermediate result to calculate the encrypted gradient value corresponding to the local model parameter.
[0179] The step A30 comprises:
[0180] Step A301, sending the random number encrypted gradient value to the collaborating party, so that the collaborating party can use the decryption key corresponding to the encryption key to decrypt the random number encrypted gradient value sent by each data party, obtain the random number encrypted gradient value and return it to each data party accordingly.
[0181] The data party sends the random number encrypted gradient value to the collaboration party. The collaboration party receives the random number encrypted gradient value sent by each data party, and uses the decryption key corresponding to the encryption key to decrypt the random number encrypted gradient value corresponding to each data party, obtains the random number encrypted gradient value corresponding to each data party, and returns it to each data party accordingly.
[0182] Further, when the data party is a data application party having a data tag, and the other data parties are data providers having only feature data, the intermediate result includes a first encrypted intermediate result for calculating a gradient value and a second encrypted intermediate result obtained by calculation, and the step A101 includes:
[0183] Step A1011, receiving a first encrypted intermediate result for calculating a gradient value sent by other data parties, wherein the other data parties use their own local feature data and the basic model parameters in this round of parameter update to calculate the first intermediate result, and use the encryption key to encrypt the first intermediate result to obtain the first encrypted intermediate result;
[0184] The data application receives the first encrypted intermediate result for calculating the gradient value sent by the other data party. The other data party uses their own local feature data and the basic model parameters in this round of parameter update to calculate the first intermediate result, and uses the encryption key to encrypt the first intermediate result to obtain the first encrypted intermediate result. Specifically, the example in the first embodiment is used for explanation. The Host (other data party) uses the local feature data x h and the basic model parameters w for this round of parameter update h Calculate the first intermediate result u h , and for u h Encryption is performed to obtain the first encrypted intermediate result [[u h ]], change [[u h]]Sent to Guest (data application party).
[0185] Step A1012, using each of the first encrypted intermediate results and the local data tag to calculate and obtain a second encrypted intermediate result;
[0186] The data application side uses the first encrypted intermediate results and the local data tag to calculate the second encrypted intermediate result. Specifically, the example in the first embodiment is used for illustration. The guest uses the local feature data x g and the basic model parameters w for this round of model parameter update g Calculate u g , according to the first encrypted intermediate result [[u h ]],u g and the local data label y g The second encrypted intermediate result [[d]] is calculated.
[0187] Step A1013, returning the second encrypted intermediate result to other data parties, so that other data parties can use the second encrypted intermediate result and their own local feature data to calculate encrypted gradient values corresponding to their own model parameters;
[0188] The data application party returns the second encrypted intermediate result to other data parties. Other data parties use the second encrypted intermediate result and their own local feature data to calculate the encrypted gradient values corresponding to their own model parameters. Specifically, the example in the first embodiment is used for illustration. The Host uses [[d]] and its own x h , calculate the encrypted gradient value of the model parameters of this part of the logistic regression model [[g h ]].
[0189] Step A1014: Use the second encrypted intermediate result and local feature data to calculate the encrypted gradient value corresponding to the local model parameter.
[0190] The data application also uses the second encrypted intermediate result and the local feature data to calculate the encrypted gradient value corresponding to the local model parameter. Specifically, the Guest also calculates the encrypted gradient value corresponding to the local model parameter based on [[d]] and its own x g , calculate the encrypted gradient value of the model parameters of this part of the logistic regression model [[g g ]].
[0191] In this embodiment, the encrypted gradient value corresponding to the local model parameter is calculated by encrypting and exchanging the intermediate result used to calculate the gradient value with other data parties, and the encrypted gradient value is added with a random number to obtain the encrypted gradient value with a random number, and sent to the collaborating party. The collaborating party can only obtain the gradient value with a random number, but cannot obtain the original gradient value, so that it is impossible to jointly deduce the original data of the other party through the original gradient value. The gradient value with a random number sent by the collaborating party is received, and the gradient value is obtained by eliminating the random number from the gradient value with a random number, and the local model parameters are updated according to the gradient value. Iterative training is performed until a trained logistic regression model is obtained. In the scheme of longitudinal federated logistic regression modeling with a third party, the possibility of a third party jointly stealing data with one of the parties is avoided, thereby improving the security of logistic regression modeling.
[0192] In addition, an embodiment of the present invention also proposes a computer-readable storage medium, on which a vertical federated learning program for improving security is stored. When the vertical federated learning program for improving security is executed by a processor, the steps of the vertical federated learning method for improving security as described above are implemented.
[0193] The expanded contents of the specific implementation methods of the vertical federated learning device and computer-readable storage medium for improving security of the present invention are basically the same as the above-mentioned embodiments of the vertical federated learning method for improving security, and will not be elaborated here.
[0194] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0195] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0196] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0197] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A vertical federated learning method for improving security, characterized in that: The longitudinal federated learning method for improving security is applied to a collaborating party participating in longitudinal federated logistic regression modeling, wherein the collaborating party is in communication connection with each data party having training data, each data party having a part of the logistic regression model, and the longitudinal federated learning method for improving security includes: Receiving the random number-added encrypted gradient value sent by each data party, wherein each data party encrypts and exchanges the intermediate results used to calculate the gradient value, calculates and obtains the encrypted gradient value corresponding to each model parameter, and adds the respective first random number to the encrypted gradient value to obtain the random number-added encrypted gradient value; Decrypting the random number encrypted gradient value to obtain a random number encrypted gradient value; Returning the random number added gradient value to each data party accordingly, so that each data party can eliminate the random number from the random number added gradient value to obtain a gradient value, and use the gradient value to update their own model parameters; Iterate the training until the preset stop condition is detected to obtain a trained logistic regression model; After the step of decrypting the random number encrypted gradient value to obtain the random number encrypted gradient value, the method further includes: Adding a second random number to the random number added gradient value to update the random number added gradient value, and encrypting the second random number to obtain an encrypted random number, wherein the second random number is different from the first random number; The step of returning the random number gradient value to each data party accordingly comprises: Returning the updated random number gradient value and the encrypted random number to each data party accordingly, so that each data party can use the encrypted random number to eliminate the random number of the random number gradient value, and use the result of eliminating the random number to update their respective encryption model parameters; The step of iteratively training until a preset stop condition is detected to obtain a trained logistic regression model comprises: Iterate the training until the preset stop condition is met, and receive the encrypted model parameters of the completed training sent by each data party; The trained encrypted model parameters are decrypted to obtain a trained logistic regression model.
2. The vertical federated learning method for improving security as claimed in claim 1, characterized in that: Before the step of receiving the random number encrypted gradient value sent by each data party, the method further includes: Send homomorphically encrypted encryption keys to each data party; The step of receiving the random number encrypted gradient value sent by each data party includes: Receiving the random number-added encrypted gradient value sent by each data party, wherein each data party uses the encryption key to encrypt and exchange the intermediate result for calculating the gradient value, calculates the encrypted gradient value corresponding to each model parameter, and adds the respective first random number to the encrypted gradient value to obtain the random number-added encrypted gradient value; The step of decrypting the random number encrypted gradient value to obtain the random number encrypted gradient value comprises: The random number encrypted gradient value is decrypted using a decryption key corresponding to the encryption key to obtain a random number encrypted gradient value.
3. A vertical federated learning method for improving security, characterized in that: The method for improving security of longitudinal federated learning is applied to data parties participating in longitudinal federated logistic regression modeling, wherein the data parties are in communication connection with the collaborating parties and other data parties, and each data party has a part of the logistic regression model. The method for improving security of longitudinal federated learning includes: Encrypted exchange of intermediate results used to calculate gradient values with other data parties to obtain encrypted gradient values corresponding to local model parameters; Adding a first random number to the encrypted gradient value to obtain a random number-added encrypted gradient value; Sending the random number encrypted gradient value to the collaborating party, so that the collaborating party decrypts the random number encrypted gradient value sent by each data party to obtain the random number gradient value, adding a second random number different from the first random number to the random number gradient value to update the random number gradient value, encrypting the second random number to obtain an encrypted random number, and returning the updated random number gradient value and the encrypted random number to each data party accordingly; Using the encrypted random number to eliminate the random number of the random number-added gradient value received from the collaboration party to obtain a gradient value, and using the gradient value to update the encryption model parameters; The trained encrypted model parameters are sent to the collaborating party, and the collaborating party performs iterative training until a preset stopping condition is met, and stops the training, and decrypts the trained encrypted model parameters to obtain a trained logistic regression model.
4. The method for improving security of vertical federated learning according to claim 3, characterized in that: Before the step of encrypting and exchanging the intermediate results for calculating the gradient values with other data parties to calculate the encrypted gradient values corresponding to the local model parameters, the method further includes: Receive the homomorphically encrypted encryption key sent by the collaborating party; The step of encrypting and exchanging intermediate results for calculating gradient values with other data parties to calculate encrypted gradient values corresponding to local model parameters comprises: The encryption key is used to encrypt and exchange intermediate results used to calculate gradient values with other data parties, and the encrypted gradient values corresponding to the local model parameters are calculated; The step of sending the random number encrypted gradient value to the collaborating party so that the collaborating party can decrypt the random number encrypted gradient value sent by each data party to obtain the random number encrypted gradient value, and return the random number encrypted gradient value to each data party accordingly includes: The random number encrypted gradient value is sent to the collaborating party, so that the collaborating party can use the decryption key corresponding to the encryption key to decrypt the random number encrypted gradient value sent by each data party, obtain the random number encrypted gradient value and return it to each data party accordingly.
5. The method for improving security of vertical federated learning according to claim 4, characterized in that: The data party is a data application party with a data tag, the intermediate result includes a first encrypted intermediate result for calculating a gradient value and a second encrypted intermediate result obtained by calculation, and the step of using the encryption key to encrypt and exchange the intermediate result for calculating the gradient value with other data parties to calculate the encrypted gradient value corresponding to the local model parameter includes: Receiving a first encrypted intermediate result for calculating a gradient value sent by other data parties, wherein the other data parties use their own local feature data and basic model parameters in this round of parameter update to calculate the first intermediate result, and use the encryption key to encrypt the first intermediate result to obtain the first encrypted intermediate result; The second encrypted intermediate result is calculated using the first encrypted intermediate results and the local data tag; Returning the second encrypted intermediate result to other data parties, so that other data parties can use the second encrypted intermediate result and their own local feature data to calculate encrypted gradient values corresponding to their own model parameters; The encrypted gradient value corresponding to the local model parameter is calculated using the second encrypted intermediate result and the local feature data.
6. A vertical federated learning device for improving security, characterized in that: The device for improving security of vertical federated learning comprises a memory, a processor, and a vertical federated learning program for improving security stored in the memory and executable on the processor. When the vertical federated learning program for improving security is executed by the processor, the steps of the method for improving security of vertical federated learning as described in any one of claims 1 to 2 are implemented.
7. A vertical federated learning device for improving security, characterized in that: The device for improving security of vertical federated learning includes a memory, a processor, and a vertical federated learning program for improving security stored in the memory and executable on the processor. When the vertical federated learning program for improving security is executed by the processor, the steps of the method for improving security of vertical federated learning are implemented as described in any one of claims 3 to 5.
8. A vertical federated learning system with improved security, characterized in that: The longitudinal federated learning system for improving security includes a collaborator participating in longitudinal federated logistic regression modeling and at least two data parties, wherein the collaborator is the longitudinal federated learning device for improving security as described in claim 6, and the data party is the longitudinal federated learning device for improving security as described in claim 7.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a vertical federated learning program for improving security, and when the vertical federated learning program for improving security is executed by a processor, the steps of the vertical federated learning method for improving security as described in any one of claims 1 to 5 are implemented.
Citation Information
Cited By
Logistic regression security training method and system for multi-source vertical distribution data
CN113886868A
A logistic regression security training method and system for multi-source vertically distributed data
CN113886868B
