Longitudinal federal learning privacy protection method

By employing a privacy-preserving method for asynchronous vertical federated learning, the inefficiency caused by the mismatch in training speeds among participants in vertical federated learning is addressed. This approach achieves efficient resource utilization and data privacy protection, thereby improving the overall model training efficiency.

CN118965418APending Publication Date: 2024-11-15BEIJING INST OF TECH
View PDF -1 Cites 3 Cited by

Patent Information

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

Smart Images

  • Figure CN118965418A_ABST
    Figure CN118965418A_ABST
Patent Text Reader

Abstract

The invention relates to a longitudinal federated learning privacy protection method, and belongs to the field of privacy protection. The method comprises the following steps: 1, initializing; 2, the client constructs a user sample set through privacy intersection; 3, the client executes forward propagation of the client on the underlying model; 4, the server iteratively updates the intermediate result in a time slice rotation mode and constructs a mapping relation; 5, the server carries out asynchronous aggregation processing on the intermediate result; 6, the server executes forward propagation of the server on the top layer model to obtain a prediction result of the server; 7, training the top-layer model by the server and executing back propagation of the server by utilizing a prediction result; 8, the client receives the middle gradient G distributed by the server to execute back propagation of the bottom layer model; and 9, repeating the steps 3 to 8 until the expected precision or the number of pre-negotiation times is reached, and completing the longitudinal federal training. According to the invention, asynchronous training of longitudinal federated learning is realized, and the model training efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a vertical federated learning privacy protection method, and belongs to the field of privacy protection. Background Art

[0002] In real-world application scenarios, the local storage resources and computing power owned by each participant in vertical federated learning vary to a certain extent. Specifically, participants with stronger storage resources and computing power take a shorter time to perform local model training; on the contrary, participants with lower storage resources and computing power take a longer time to perform local model training. In the traditional synchronous vertical federated learning method, all participants must complete local model training before aggregation can be achieved, which requires a long time to wait for the lagging participants to complete local training, resulting in low efficiency in global model training.

[0003] In summary, when the local computing resources of the client are unbalanced, the global model training efficiency of the current vertical federated learning is low. Asynchronous vertical federated learning provides ideas for improving the efficiency of model training. However, the current asynchronous vertical federated learning usually assumes that all participants have label information, which is inconsistent with the actual needs of vertical federated learning. Therefore, in order to improve the training efficiency of vertical federated learning, it is urgent to propose a vertical federated learning privacy protection method to meet the current practical application needs of vertical federated learning. Asynchronous vertical federated learning is conducive to achieving efficient collaborative training between clients with heterogeneous resources, improving the training efficiency of the global model and protecting data privacy. It is suitable for a variety of practical scenarios of vertical federated learning and promotes the secure circulation of data elements.

[0004] Therefore, how to improve the training efficiency in existing vertical federated learning due to the mismatch in training speeds among participants has become an urgent problem to be solved. Summary of the invention

[0005] The purpose of the present invention is to solve the technical problem of low training efficiency caused by mismatched training speeds of participants in existing vertical federated learning, and to propose a privacy protection method for vertical federated learning.

[0006] The objective of the present invention is achieved through the following technical solutions:

[0007] A vertical federated learning privacy protection method of the present invention is applied to a server and multiple clients, wherein the multiple clients are composed of multiple single clients. It includes the following steps:

[0008] Step 1: Initialize the longitudinal federated learning model, i.e., initialize the server model, the random descent method of multiple clients, and the hyperparameters, where the hyperparameters include the pre-set learning rate η and the sample adoption rate s.

[0009] Step 2: Multiple clients construct a user-aligned user sample set by means of private intersection.

[0010] Step 3: Multiple clients perform client forward propagation on the underlying model of the local features corresponding to the user sample set described in step 2.

[0011] Step 3.1: Multiple clients sample local features according to the sample adoption rate s described in step 1 to obtain local features to be trained.

[0012] Step 3.2: Multiple clients process the intermediate results of a single client in a computing power priority manner according to the underlying model and the local features to be trained as described in step 3.1.

[0013] Step 4: The server iteratively updates the intermediate results received from the client in step 3.2 in a time slice rotation manner and constructs a single client key in the local cache of the server in an array format. i and the intermediate result value i The mapping relationship of key i Indicates the i-th client, value i Represents the intermediate result of the i-th client.

[0014] Step 5: According to the mapping relationship described in step 4, the server performs asynchronous aggregation processing on the intermediate results mapped in the server cache.

[0015] Step 5.1: When the pre-set minimum threshold is met, the aggregation is normal. Go to step 6.

[0016] Step 5.2: When aggregation is blocked, asynchronous aggregation is performed and go to step 5.

[0017] Step 6: The server aggregates the intermediate results and performs the server's forward propagation on the top model to obtain the server's prediction results.

[0018] Step 7: Using the server's prediction results obtained in step 6, the server trains the top model and performs server backpropagation.

[0019] Step 7.1: The server and client use private intersection to form sample-aligned labels.

[0020] Step 7.2: Use the prediction results described in step 6.3 and the labels in step 7.1 to train the top-level model, and then obtain the loss value L as shown in formula (1).

[0021]

[0022] Where N is the number of training samples, M is the number of categories, and y icis the label (0 or 1) of the i-th sample category c, p ic is the probability of the i-th sample category c. Specifically, formula (1) represents the cross entropy loss function calculation process using the predicted results and the true label.

[0023] Step 7.3: Use the loss value obtained in step 7.2 to perform back propagation, calculate the gradient value of each node in the server, and use the gradient descent method to update the weight parameters. Thus, the intermediate gradient G of the aggregated input is obtained, as shown in formula (2).

[0024]

[0025] Formula (2) represents the gradient of the process loss function L relative to the intermediate variable H using the chain rule to calculate the intermediate gradient value. L represents the global loss value, H represents the intermediate result of the client, and y represents the output value of the network or the output value of a certain intermediate layer.

[0026] Step 7.4: The server distributes the intermediate gradient G obtained in step 7.3 to the clients respectively.

[0027] Step 8: The client receives the intermediate gradient G distributed by the server and performs backpropagation of the underlying model to update the client's local model parameters.

[0028] Step 8.1: Using the intermediate gradient G obtained in step 7.4, calculate the gradient value of the client.

[0029] Step 8.2: The client's gradient value obtained in step 7.1 is used to update the client's local model weight parameters using the gradient descent method, as shown in formula (3).

[0030] θ t+1 =θ t -ηG (3)

[0031] Formula (3) indicates that the local model of the client uses the gradient descent method to update the model, where η represents the learning rate of model training, θ t+1 represents the updated local model parameters of the t+1th round, θ t represents the local model parameters of the tth round, and G represents the gradient value of the client local model.

[0032] Step 9: Repeat steps 3 to 8 until the expected accuracy or the pre-negotiated number of times is reached, completing the vertical federated learning training.

[0033] In the multi-round training process of vertical federated learning, steps 3 and 4 implement an asynchronous training process. Specifically, in step 3, after any participant completes the forward propagation of the local model to obtain the intermediate parameters, the intermediate parameters can be updated to the cache of step 4. Step 4 can perform server aggregation without waiting for all participants to perform the forward propagation of the local model before aggregation can be performed. Therefore, the method of the present invention realizes asynchronous training of vertical federated learning and improves the efficiency of model training.

[0034] Beneficial effects:

[0035] 1 The present invention effectively improves the model training efficiency. The asynchronous training scheme adopted by the present invention eliminates the need for strict synchronization between participants, and local model training can be performed based on local computing capabilities and resources, which effectively utilizes computing resources and improves training efficiency.

[0036] 2 This discovery effectively reduces storage and communication overhead. Since asynchronous training requires sample alignment, the common practice of existing methods is to directly load the entire data set for training, which will undoubtedly cause huge storage and communication costs. The present invention proposes a sampling mechanism that allows the use of small batches of data for training, reducing storage and communication costs.

[0037] The present invention has good privacy protection capability. The intermediate results generated by the aggregation model of the present invention are not original data, which reduces the risk of original data leakage. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 It is a schematic diagram of the process of the present invention;

[0039] Figure 2 It is a schematic diagram of the architecture of the present invention. DETAILED DESCRIPTION

[0040] In order to better illustrate the purpose and advantages of the present invention, the invention is further described below in conjunction with the accompanying drawings and examples. It should be noted that the implementation of the present invention is not limited to the following embodiments, and any form of modification or change made to the present invention will fall within the protection scope of the present invention.

[0041] Example

[0042] like Figure 1 As shown, a vertical federated learning privacy protection method of the present invention has the following specific implementation steps:

[0043] This embodiment provides an asynchronous longitudinal federated learning technology. The system initializes an image classification task and randomly selects K participants, where the K participants are divided into 1 active party and K-1 passive parties. K parties jointly train a longitudinal federated learning model. Furthermore, the number of participants K is set to 5, including 1 server and 4 clients, where the server has a top-level model and the client has a bottom-level model. Furthermore, the local data set is MNIST, images with known image classification labels. Among them, the image classification labels are 0 to 9.

[0044] Furthermore, all local models in this embodiment are fully connected neural networks.

[0045] Step 1: Initialize the longitudinal federated learning model, i.e., initialize the server model, the random descent method of multiple clients, and the hyperparameters, where the hyperparameters include the pre-set learning rate η and the sample adoption rate s.

[0046] Step 2: Multiple clients construct a user-aligned user sample set by means of private intersection.

[0047] Step 3: Multiple clients perform client forward propagation on the underlying model of the local features corresponding to the user sample set described in step 2.

[0048] Step 3.1: Multiple clients sample local features according to the sample adoption rate s described in step 1 to obtain local features to be trained.

[0049] Step 3.2: Multiple clients process the intermediate results of a single client in a computing power priority manner according to the underlying model and the local features to be trained as described in step 3.1.

[0050] In the embodiment, client i uses local features Xi and local model to calculate the intermediate training result of the rth round Model ci Represents the fully connected neural network model of client i.

[0051] Step 4: The server iteratively updates the intermediate results received from the client in step 3.2 in a time slice rotation manner and constructs a single client key in the local cache of the server in an array format. i and the intermediate result value i The mapping relationship of key i Indicates the i-th client, value i Represents the intermediate result of the i-th client.

[0052] Step 5: According to the mapping relationship described in step 4, the server performs asynchronous aggregation processing on the intermediate results mapped in the server cache.

[0053] Step 5.1: When the pre-set minimum threshold is met, the aggregation is normal. Go to step 6.

[0054] Step 5.2: When aggregation is blocked, asynchronous aggregation is performed and go to step 5.

[0055] In the embodiment, the server uses cache C to aggregate the local output results (h1, h2, h3, h4) of all clients according to a pre-set minimum participant threshold or maximum waiting time, and obtains a local aggregation result H = (h1||h2||h3||h4), where h1, h2, h3, h4 respectively represent the local intermediate results of clients 1, 2, 3, 4 of the current round stored in the cache.

[0056] Step 6: The server aggregates the intermediate results and performs the server's forward propagation on the top model to obtain the server's prediction results.

[0057] In the embodiment, the server receives the intermediate result sent by the client After that, the update is stored in the local cache C. The update strategy is: use the newly received intermediate results Replace the old intermediate results stored in cache C in the previous round: Where r represents the current training round; r-1 represents the previous round; Indicates the local intermediate result obtained by client i in round r-1; Represents the local intermediate result obtained by client i in round r.

[0058] Step 7: Using the server's prediction results obtained in step 6, the server trains the top model and performs server backpropagation.

[0059] Step 7.1: The server and client use private intersection to form sample-aligned labels.

[0060] Step 7.2: Use the prediction results described in step 6.3 and the labels in step 7.1 to train the top-level model, and then obtain the loss value L as shown in formula (1).

[0061]

[0062] Where N is the number of training samples, M is the number of categories, and y ic is the label (0 or 1) of the i-th sample category c, p ic is the probability of the i-th sample category c. Specifically, formula (1) represents the cross entropy loss function calculation process using the predicted results and the true label.

[0063] Step 7.3: Use the loss value obtained in step 7.2 to perform back propagation, calculate the gradient value of each node in the server, and use the gradient descent method to update the weight parameters. Thus, the intermediate gradient G of the aggregated input is obtained, as shown in formula (2).

[0064]

[0065] Formula (2) represents the gradient of the process loss function L relative to the intermediate variable H using the chain rule to calculate the intermediate gradient value. L represents the global loss value, H represents the intermediate result of the client, and y represents the output value of the network or the output value of a certain intermediate layer.

[0066] Step 7.4: The server distributes the intermediate gradient G obtained in step 7.3 to the clients respectively.

[0067] Step 8: The client receives the intermediate gradient G distributed by the server and performs backpropagation of the underlying model to update the client's local model parameters.

[0068] Step 8.1: Using the intermediate gradient G obtained in step 7.4, calculate the gradient value of the client.

[0069] Step 8.2: The client's gradient value obtained in step 7.1 is used to update the client's local model weight parameters using the gradient descent method, as shown in formula (3).

[0070] θ t+1 =θ t -ηG (3)

[0071] Formula (3) indicates that the local model of the client uses the gradient descent method to update the model, where η represents the learning rate of model training, θ t+1 represents the updated local model parameters of the t+1th round, θ t represents the local model parameters of the tth round, and G represents the gradient value of the client local model.

[0072] Step 9: Repeat steps 3 to 8 until the expected accuracy or the pre-negotiated number of times is reached, completing the vertical federated learning training.

[0073] In order to further demonstrate the superiority of the present invention, the present invention conducts the following training experiment for illustration.

[0074] This experiment regards the change in loss value between two rounds of training as a linear function of time, and observes how much longer the synchronous solution takes than the asynchronous solution when a certain loss value is reached. The training result data taken 5 minutes before the asynchronous training is shown in Table 1.

[0075] Table 1 Comparison of the efficiency of asynchronous and synchronous solutions in scenarios with uneven computing power

[0076]

[0077] The results show that the loss value of the asynchronous training scheme is 0.008 at the end of the 5th minute, while the synchronous training scheme takes 7 minutes and 12 seconds to reach this loss value. Calculation shows that the vertical federated learning privacy protection method proposed in the present invention improves the model performance by 46% compared with the synchronous scheme.

Claims

1. A vertical federated learning privacy protection method, applied to a server and multiple clients, wherein: The multiple clients are composed of multiple single clients; characterized in that: the following steps are included: Step 1: Initialize the vertical federated learning model, i.e., initialize the server model, the random descent method of multiple clients, and the hyperparameters, where the hyperparameters include the pre-set learning rate η and the sample adoption rate s; Step 2: Multiple clients construct a user sample set aligned with each other by means of privacy intersection; Step 3: multiple clients perform client forward propagation on the underlying model of the local features corresponding to the user sample set described in step 2; Step 4: The server iteratively updates the intermediate results received from the client in step 3.2 in a time slice rotation manner and constructs a single client key in the local cache of the server in an array format. i and the intermediate result value i The mapping relationship of key i Indicates the i-th client, value i Represents the intermediate result of the i-th client; Step 5: According to the mapping relationship described in step 4, the server performs asynchronous aggregation processing on the intermediate results mapped in the server cache; Step 6: The server aggregates the intermediate results and performs the server forward propagation on the top model to obtain the server prediction result; Step 7: Using the server's prediction results obtained in step 6, the server trains the top-level model and performs server backpropagation; Step 8: The client receives the intermediate gradient G distributed by the server and performs back propagation of the underlying model, thereby updating the client's local model parameters; Step 9: Repeat steps 3 to 8 until the expected accuracy or the pre-negotiated number of times is reached, completing the vertical federated learning training.

2. A vertical federated learning privacy protection method as claimed in claim 1, characterized in that: Step 3 is implemented as follows: Step 3.1: Multiple clients sample local features according to the sample adoption rate s described in step 1 to obtain local features to be trained; Step 3.2: Multiple clients process the intermediate results of a single client in a computing power priority manner according to the underlying model and the local features to be trained as described in step 3.

1.

3. A vertical federated learning privacy protection method as claimed in claim 1, characterized in that: Step 5 is implemented as follows: Step 5.1: When the pre-set minimum threshold is met, the aggregation is normal; go to step 6; Step 5.2: When aggregation is blocked, asynchronous aggregation is performed and go to step 5.

4. A vertical federated learning privacy protection method as claimed in claim 1, characterized in that: Step 7 is implemented as follows: Step 7.1: The server and the client use private intersection to form sample alignment labels; Step 7.2: Use the prediction results described in step 6.3 and the labels in step 7.1 to train the top model, and then obtain the loss value L as shown in formula (1); Where N is the number of training samples, M is the number of categories, and y ic is the label (0 or 1) of the i-th sample category c, p ic is the probability of the i-th sample category c; specifically, formula (1) represents the cross entropy loss function calculation process using the predicted results and the true label; Step 7.3: Use the loss value obtained in step 7.2 to perform back propagation, calculate the gradient value of each node in the server and use the gradient descent method to update the weight parameters; thus, the intermediate gradient G of the aggregated input is obtained, as shown in formula (2); Formula (2) represents the gradient of the process loss function L relative to the intermediate variable H in calculating the intermediate gradient value using the chain rule; where L represents the global loss value, H represents the intermediate result of the client, and y represents the output value of the network or the output value of a certain intermediate layer; Step 7.4: The server distributes the intermediate gradient G obtained in step 7.3 to the clients respectively.

5. A vertical federated learning privacy protection method as claimed in claim 1, characterized in that: Step 8 is implemented as follows: Step 8.1: Use the intermediate gradient G obtained in step 7.4 to calculate the gradient value of the client; Step 8.2: The client's gradient value obtained in step 7.1 is used to update the client's local model weight parameters using the gradient descent method; as shown in formula (3); i t+1 =θ t -ηG (3) Formula (3) indicates that the local model of the client uses the gradient descent method to update the model, where η represents the learning rate of model training, θ t+1 represents the updated local model parameters of the t+1th round, θ t represents the local model parameters of the tth round, and G represents the gradient value of the client local model.

Citation Information

Cited By

  • Privacy protection longitudinal federated learning method and system based on function encryption

    CN119830334A

  • Decentralized heterogeneous neural network federated learning method and system

    CN120124714A

  • A decentralized heterogeneous neural network federated learning method and system

    CN120124714B