Model training method based on improved federal learning and related device

By combining local differential privacy protection and knowledge distillation technology in federated learning, the problems of model performance and privacy protection in data imbalance scenarios are solved, the generalization ability and security of the model are improved, and optimization is achieved while protecting user privacy. Performance of federated learning systems.

CN118886480APending Publication Date: 2024-11-01GUANGXI POWER GRID CORP

Patent Information

Application Number
CN202410984260.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-22
Publication Date
2024-11-01

AI Technical Summary

Technical Problem

In the data imbalance scenario, traditional federated learning algorithms are difficult to train models with strong generalization capabilities, and the decline in model performance will lead to data security problems and are easily attacked.

Method used

Using an improved federated learning method, combined with local differential privacy protection and knowledge distillation technology, the loss between the teacher model and student model output is minimized, and gradient calculations are performed and Global parameter updates to improve the generalization ability and security of the model.

Benefits of technology

In the data imbalance scenario, the generalization capability and data security of the model are improved, the communication overhead is reduced, the system performance and robustness is improved, the privacy protection capability is enhanced, and the practical application of federated learning is provided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118886480A_ABST
    Figure CN118886480A_ABST
Patent Text Reader

Abstract

The invention discloses a model training method based on improved federal learning and a related device. The method comprises the following steps: acquiring an initial model and sending the initial model to each participating end; iteratively carrying out the updating step to a preset updating iteration threshold value, taking the current model as a trained model, and sending the trained model to each participating end; wherein the updating step comprises the following steps of: receiving gradient parameters sent by each participating end, and entering a global parameter updating process; wherein the gradient parameter is the gradient of each neural network layer of the local model, which is obtained by the participation end through gradient calculation by combining local differential privacy protection and knowledge distillation according to local training data; the global parameter updating process comprises the following steps: updating global parameters of the model according to gradient parameters sent by each participating end, and sending the updated global parameters to each participating end; wherein the updated global parameter is used for updating the model parameter of the local model of the participating end. The method aims at solving the problem of model performance and privacy protection in a data imbalance scene, the generalization ability of the model is improved, and the security of the data is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of data security, and specifically relates to a model training method based on improved federated learning and related devices. Background Art

[0002] In the field of artificial intelligence (AI), federated learning (FL), as an emerging machine learning method, has shown great potential in distributed data environments. Federated learning allows multiple participants to jointly train a model without sharing the original data, thus solving the data privacy and security issues in traditional machine learning. However, despite these advantages of federated learning, in practical applications, especially in scenarios with imbalanced data, traditional federated learning algorithms often face the challenge of performance degradation.

[0003] The problem of data imbalance is ubiquitous in machine learning. It refers to the large difference in the number of data samples of different categories. In the framework of federated learning, when the data categories of participants are unevenly distributed, it is difficult for traditional federated learning algorithms to train models with strong generalization capabilities. This is because the model is more affected by the data categories with a large number during the training process, while ignoring the categories with a small number, resulting in poor performance of the model on a small number of categories. In addition, data imbalance may also lead to security issues in federated learning algorithms. As the model performance deteriorates, it is easier for attackers to exploit the weaknesses of the model to attack, thereby threatening the security of the data. Therefore, in the scenario of data imbalance, how to improve the performance and security of federated learning algorithms is an urgent problem to be solved. Summary of the invention

[0004] In response to the problems existing in the prior art, the present invention provides a model training method and related devices based on improved federated learning, which aims to solve the model performance and privacy protection problems in data imbalance scenarios, which not only improves the generalization ability of the model, but also enhances the security of the data.

[0005] In order to solve the above technical problems, the present invention is implemented by the following technical solutions:

[0006] According to a first aspect of the present invention, a model training method based on improved federated learning is provided, which is applied to a server of a model training system based on improved federated learning, wherein the model training system based on improved federated learning includes a server and a plurality of participating terminals that are communicatively connected to the server; the model training method based on improved federated learning includes:

[0007] Obtain the initial model and send it to each participating end;

[0008] Iterate the update steps until the preset update iteration threshold is reached, take the current model as the trained model, and send it to each participating terminal;

[0009] Wherein, the updating step comprises:

[0010] Receive the gradient parameters sent by each participating end and enter the global parameter update process; the gradient parameters are the gradients of each neural network layer of the local model obtained by the participating end based on the local training data, combined with local differential privacy protection and knowledge distillation;

[0011] The global parameter updating process includes: updating the global parameters of the model according to the gradient parameters sent by each participating terminal, and sending the updated global parameters to each participating terminal; wherein the updated global parameters are used to update the model parameters of the local model of the participating terminal.

[0012] In a possible implementation manner of the first aspect, the gradients of each neural network layer of the local model obtained by gradient calculation by the participant according to local training data in combination with local differential privacy protection and knowledge distillation include:

[0013] The participating end uses local differential privacy protection to add noise to the local training data, and learns through the student model and the teacher model in the softmax layer of the local model to minimize the loss between the output of the teacher model and the student model.

[0014] In a possible implementation manner of the first aspect, updating the global parameters of the model according to the gradient parameters sent by each participating terminal includes:

[0015] Average the gradient parameters sent by each participating terminal to obtain the average gradient parameter;

[0016] According to the average gradient parameters, the back propagation algorithm is used to update the global parameters of the model.

[0017] In a possible implementation manner of the first aspect, the gradient calculation is specifically a stochastic gradient descent method.

[0018] According to a second aspect of the present invention, a model training method based on improved federated learning is provided, which is applied to a participant terminal of a model training system based on improved federated learning, wherein the model training system based on improved federated learning includes a server and a plurality of participant terminals that are communicatively connected to the server; the model training method based on improved federated learning includes:

[0019] Receive the initial model sent by the server as the local model;

[0020] Iterate the gradient calculation steps until the preset gradient calculation iteration threshold is reached, and receive the trained model sent by the server;

[0021] Wherein, the gradient calculation step includes:

[0022] Based on the local training data, the gradient of each neural network layer of the local model is calculated by combining local differential privacy protection and knowledge distillation. After the gradient calculation is completed, the gradient of each neural network layer of the local model is sent to the server as a gradient parameter;

[0023] When receiving the updated global parameters sent by the server, updating the model parameters of the local model according to the updated global parameters;

[0024] The global parameters are the global parameters that the server updates the model based on the gradient parameters sent by each participating terminal.

[0025] In a possible implementation manner of the second aspect, the gradient of each neural network layer of the local model obtained by performing gradient calculation based on local training data in combination with local differential privacy protection and knowledge distillation includes:

[0026] The participating end uses local differential privacy protection to add noise to the local training data, and learns through the student model and the teacher model in the softmax layer of the local model to minimize the loss between the output of the teacher model and the student model.

[0027] In a possible implementation manner of the second aspect, updating the global parameters of the model according to the gradient parameters sent by each participating terminal includes:

[0028] Average the gradient parameters sent by each participating terminal to obtain the average gradient parameter;

[0029] According to the average gradient parameters, the back propagation algorithm is used to update the global parameters of the model.

[0030] In a possible implementation manner of the second aspect, the gradient calculation is specifically a stochastic gradient descent method.

[0031] According to a third aspect of the present invention, a model training device based on improved federated learning is provided, which is applied to a server of a model training system based on improved federated learning, wherein the model training system based on improved federated learning includes a server and a plurality of participating terminals that are communicatively connected to the server; the model training device based on improved federated learning includes:

[0032] The sending module is used to obtain the initial model and send it to each participating end;

[0033] An iterative update module is used to iterate the update steps to a preset update iteration threshold, take the current model as the trained model, and send it to each participating terminal;

[0034] Wherein, the updating step comprises:

[0035] Receive the gradient parameters sent by each participating end and enter the global parameter update process; the gradient parameters are the gradients of each neural network layer of the local model obtained by the participating end based on the local training data, combined with local differential privacy protection and knowledge distillation;

[0036] The global parameter updating process includes: updating the global parameters of the model according to the gradient parameters sent by each participating terminal, and sending the updated global parameters to each participating terminal; wherein the updated global parameters are used to update the model parameters of the local model of the participating terminal.

[0037] According to a fourth aspect of the present invention, a model training device based on improved federated learning is provided, which is applied to a participant terminal of a model training system based on improved federated learning, wherein the model training system based on improved federated learning includes a server and a plurality of participant terminals communicatively connected to the server; the model training device based on improved federated learning includes:

[0038] A receiving module is used to receive the initial model sent by the server as a local model;

[0039] An iterative calculation module, used to iterate the gradient calculation steps to a preset gradient calculation iteration threshold, and receive the trained model sent by the server;

[0040] Wherein, the gradient calculation step includes:

[0041] Based on the local training data, the gradient of each neural network layer of the local model is calculated by combining local differential privacy protection and knowledge distillation. After the gradient calculation is completed, the gradient of each neural network layer of the local model is sent to the server as a gradient parameter;

[0042] When receiving the updated global parameters sent by the server, updating the model parameters of the local model according to the updated global parameters;

[0043] The global parameters are global parameters that the server updates the model based on the gradient parameters sent by each participating terminal.

[0044] Compared with the prior art, the present invention has at least the following beneficial effects:

[0045] The present invention provides a model training method based on improved federated learning, which combines local differential privacy protection and knowledge distillation technology, can protect the privacy security of data while improving model performance, and solves the model performance and privacy protection problems in data imbalance scenarios. Specifically, on the basis of the federated learning algorithm, the present invention innovatively combines local differential privacy protection and knowledge distillation to solve the model performance and privacy protection problems in data imbalance scenarios, which not only improves the generalization ability of the model, but also enhances the security of the data, and provides strong support for the promotion of federated learning in practical applications, and optimizes the performance of the federated learning system while protecting user privacy. It has significant privacy protection capabilities, low communication overhead, high system performance and enhanced robustness, and provides strong support for the wide deployment of federated learning in practical applications.

[0046] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the technical solutions in the specific implementation modes of the present invention, the drawings required for use in the description of the specific implementation modes will be briefly introduced below. Obviously, the drawings described below are some implementation modes of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0048] Figure 1 A flowchart of a model training method based on improved federated learning applied to a server of a model training system based on improved federated learning in an embodiment of the present invention;

[0049] Figure 2 A flowchart of a model training method based on improved federated learning applied by the present invention to a participant end of a model training system based on improved federated learning;

[0050] Figure 3 This is the basic framework diagram of the federated learning algorithm.

[0051] Figure 4 This is the framework diagram of the KD algorithm.

[0052] Figure 5 This is the overall framework diagram for data privacy protection.

[0053] Figure 6 This is a framework diagram of different privacy protection measures taken during the production, release and storage of data.

[0054] Figure 7 This is a framework diagram of the privacy protection mechanism based on the LDP-KD-FL algorithm.

[0055] Figure 8 The figure is a functional comparison chart of different algorithms.

[0056] Fig. 9 The communication overhead comparison results of the four algorithms are shown in the figure.

[0057] Fig.10 The following is a comparison of the server running time under different algorithms.

[0058] Fig.11 Results of training accuracy tests for the four algorithms.

[0059] Fig.12 The following is a comparison of the absolute and relative errors of the four algorithms under different privacy budgets.

[0060] Fig.13 The privacy budget loss comparison results of the four algorithms.

[0061] Fig.14 The similarity comparison results of different noisy images of different algorithms under different privacy budgets. DETAILED DESCRIPTION

[0062] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0063] like Figure 1 As shown, the embodiment of the present application provides a model training method based on improved federated learning, which is mainly applied to a server of a model training system based on improved federated learning. The system includes a central server and several participating terminals connected to the server through network communication. The training method is specifically as follows:

[0064] Before training begins, the server first obtains the initial model and sends it to each participating terminal. It should be understood that these participating terminals can be computing devices dispersed in different geographical locations, and each participating terminal holds a certain amount of local training data.

[0065] The server enters an iterative update process, which continues until the preset update iteration threshold is reached. In each iteration, the server performs the following steps:

[0066] a. Receive gradient parameters

[0067] The server receives the gradient parameters sent by each participating end. These gradient parameters are the gradients of each neural network layer of the local model calculated by the participating end through the stochastic gradient descent method based on the local training data, combined with local differential privacy protection and knowledge distillation technology. Specifically, the participating end first uses local differential privacy protection technology to add noise to the local training data to protect the privacy of the data. Then, in the softmax layer of the local model, the participating end learns through the student model and the teacher model to minimize the loss between the output of the teacher model and the student model, thereby obtaining the gradient parameters.

[0068] b. Global parameter update

[0069] The server updates the global parameters based on the gradient parameters received from each participating terminal. The specific steps are as follows:

[0070] (1) Average gradient parameter

[0071] The server averages the gradient parameters sent by each participating end to obtain an average gradient parameter, which represents the common expectations of all participating ends on the changes in model parameters.

[0072] (2) Update global parameters

[0073] The server uses the back propagation algorithm to update the global parameters of the model based on the average gradient parameters. The back propagation algorithm is a commonly used optimization algorithm in neural network training. It can effectively update the model parameters based on the gradient information, so that the performance of the model on the training data is gradually improved.

[0074] c. Send updated global parameters

[0075] The server sends the updated global parameters to each participating end, and the participating end uses these global parameters to update the model parameters of the local model. This process realizes parameter aggregation and model update in federated learning.

[0076] When the number of iterations reaches the preset update iteration threshold, the server takes the current model as the trained model and sends it to each participating end. At this point, the model training process based on improved federated learning ends. The participating end can use the received trained model for prediction and reasoning tasks of local training data. Since the model is trained by multiple participating ends under the premise of protecting data privacy, it has high generalization ability and robustness.

[0077] like Figure 2As shown, the embodiment of the present application provides a model training method based on improved federated learning, which is applied to a participant terminal of a model training system based on improved federated learning. The system includes a central server and multiple participants connected to the central server, and the training method is as follows:

[0078] Before training begins, the participating end receives the initial model from the server and uses it as the local model for subsequent model training.

[0079] The participating end enters the iterative gradient calculation process, which continues until the preset gradient calculation iteration threshold is reached. In each iteration, the participating end performs the following steps:

[0080] a. Gradient calculation

[0081] The participating end performs gradient calculation based on local training data, combined with local differential privacy protection and knowledge distillation technology. First, the participating end uses local differential privacy protection technology to add noise to the local training data to protect the privacy of the data. Then, in the softmax layer of the local model, the participating end learns through the student model and the teacher model to minimize the loss between the output of the teacher model and the student model. The gradient calculation method in this embodiment is the stochastic gradient descent method, which can calculate the gradient information of the model based on each batch of training data.

[0082] After completing the gradient calculation, the participating end sends the gradients of each neural network layer of the local model to the server as gradient parameters. These gradient parameters represent the contribution of the participating end to the change of model parameters.

[0083] b. Receive and update global parameters

[0084] In each iteration, after the participating end completes the gradient calculation and sends the gradient parameters to the server, the participating end will wait for the server's response. When the participating end receives the updated global parameters sent by the server, it will update the model parameters of the local model based on these global parameters. This process realizes parameter aggregation and model update in federated learning.

[0085] Specifically, the server will update the global parameters according to the gradient parameters sent by each participating terminal. First, the server will average the gradient parameters sent by all participating terminals to obtain the average gradient parameters. Then, based on this average gradient parameter, the server uses the back propagation algorithm to update the global parameters of the model. Finally, the server sends the updated global parameters to each participating terminal for each participating terminal to update the model parameters of the local model.

[0086] When the number of iterations reaches the preset gradient calculation iteration threshold, the participating end will receive the trained model sent by the server. After obtaining the trained model, the participating end can use this model locally for data prediction and reasoning tasks. Since the model is trained by multiple participating ends and uses differential privacy protection and knowledge distillation technology to protect data privacy and improve model performance, the model has high generalization ability and robustness.

[0087] In one embodiment, a model training method based on improved federated learning specifically includes the following steps:

[0088] Step 1. Reference Figure 3 , complete the learning of target task knowledge based on local training data, and input the model into the server through each participating end of the training data, and then integrate and update the gradient parameters to realize the sharing of global parameters. The global parameters are gradually aggregated and optimized by the gradient parameters corresponding to the local models of each participating end.

[0089]

[0090] The expression of the global loss function in the federated learning algorithm is:

[0091]

[0092] The parameter calculation formula of the optimal joint model is:

[0093]

[0094] In the formula, p i The weighted coefficient calculated based on the amount of data contributed by the i-th participant; is the parameter vector of the i-th participant in the t-th round of training; I i The amount of data contributed by the i-th participant; F i is the loss function of the i-th participant in the local training model.

[0095] Step 2: Reference Figure 4 , a higher temperature coefficient is used in the softmax layer to enhance the information of negative labels, and the KL divergence of logits under high temperature softmax of the student model and the teacher model is used as the loss. The formula is then used to generate class probabilities, and the problem is further optimized in the knowledge distillation algorithm.

[0096] The calculation formula for generating class probability is:

[0097]

[0098] The calculation formula obtained by further optimizing the problem of generating class probability in the knowledge distillation algorithm is:

[0099]

[0100] Among them, z i Logits generated for the new model, v i are the logits generated by the original model; T is the temperature coefficient.

[0101] Step 3: Improve the traditional KD-FL framework, randomly divide the unlabeled local training data, aggregate them and use them as the validation data set in the central model. Then use other local training data to train the local model. The final central model can be calculated by a third-party server, and the network structure of the central model is consistent with the local model. Then use the trained local training data set to predict the validation data set, and then use the third-party server to fuse the data set to obtain a global consensus.

[0102] The model updating steps of the improved KD-FL algorithm are:

[0103] Input: local private dataset Dk, local initialization model fx, k = 1, ..., m, model parameter set w = {W1, ..., Wm}, public dataset Xp.

[0104] Output: Model fx after this round of training update.

[0105] for t∈[T]epochs do

[0106] for j∈[1....,m]do

[0107] Local training 1: Each participating end takes We as the starting point, trains the model on the local training dataset Dk for fxn epochs, and updates w.

[0108] Prediction information transmission: Yk = Predict (Xp, Wx); Y = {Y1...Ym}.

[0109] Y1=Ym, Yk=Yk-1, k=2,...,m.

[0110] end for

[0111] end for

[0112] Step 4: Reference Figure 5 ,In the data privacy protection section, LDP calculates the distributed matrix held by the client to form a polynomial code.

[0113] The polynomial encoding formula of the A matrix is:

[0114]

[0115] The polynomial encoding formula of the B matrix is:

[0116]

[0117] The polynomial order expression formula of matrix AB is:

[0118] h c (x) = f A (x)g B (x)

[0119] The comparison table definition formula for polynomial order is:

[0120]

[0121] Among them, γ is the number of nodes; R is an independent and identically distributed matrix randomly selected to resist collusion attacks on distributed computing nodes.

[0122] Step 5: In the privacy protection section of the federated learning algorithm, the local differential privacy algorithm analyzes the disturbance range of the data by considering the value range of the data.

[0123] Step 6: Use CNN convolutional neural network to implement data training, and divide the CNN structure into convolutional modules, randomized modules, and fully connected modules. Then, in order to enhance the privacy protection of local differential privacy for federated learning, this embodiment proposes a stochastic gradient descent method, the core idea of ​​which is to perform random perturbations and binary conversions on highly sensitive data at the user end, and then decode and correct the converted data at the user end at the data collection end. In this step, the collected gradients need to be weighted averaged at the data collection end (server);

[0124] The specific steps for weighted averaging the collected gradients on the server are:

[0125] Step 6.1, first set the initial value of the bit to 0 and convert the gradient parameter into binary;

[0126] Step 6.2: Then, the random response technique is used to interfere with the bits to obtain the probability of the random response binary string.

[0127] Step 7: Reference Figure 6 ,For the different privacy protection measures taken in the production, release and storage processes of federated learning data, corresponding protection mechanisms are proposed.

[0128] Exemplarily, data producers include data medicine, e-commerce industry, mobile terminals, the Internet of Things, positioning systems, and financial platforms.

[0129] The shared generation formula for defining matrix products is:

[0130]

[0131] Step 8: To further improve the efficiency of random matrix generation, Vandermonde matrix is ​​used to perform random linear combination on random matrix. The expression formula of random linear combination on random matrix using Vandermonde matrix is:

[0132]

[0133] Where M is the Vandermonde matrix; S N is an N-order random matrix;

[0134] Step 9: Reference Figure 7 By defining the range of the designed parameters, a stochastic gradient descent trend with different mini-batches is generated. Then, a number of participants with a proportion of ρ are selected to calculate the gradient and loss function. Finally, a privacy protection mechanism is constructed based on the LDP-KD-FL algorithm.

[0135] Example

[0136] refer to Figure 8 In order to verify the superiority of the LDP-KD-FL algorithm proposed in the study, the client efficiency of different improved algorithms is analyzed first, and the Federated Averaging Algorithm (FedAvg), Centralized Learning Algorithm (CentLearn), Distributed Learning Algorithm (DistLearn) and LDP-KD-FL algorithm are selected for functional comparison. The comparison results are as follows: Figure 8 shown. Figure 8 The algorithm with the smallest communication overhead is the LDP-KD-FL algorithm, with a total communication volume of 1.5a for each client, followed by the DistLearn algorithm and the FedAvg algorithm. DistLearn does not consider data privacy and user disconnection, and CentLearn and DistLearn do not achieve verifiability. Except for the LDP-KD-FL algorithm, the other three algorithms can forge customer information and return verification information to reliable clients.

[0137] refer to Fig. 9 ,The present invention then compares the communication overhead of the four algorithms. Fig. 9The figure shows the comparison of the total client communication volume of the FedAvg algorithm, CentLearn algorithm, DistLearn algorithm, and LDP-KD-FL algorithm under different gradient parameters. It can be seen that in the FedAvg algorithm, as the gradient parameter increases, the total client communication volume shows an unstable upward trend. When the gradient parameter is 4500, the total communication volume exceeds 40KB. The total communication volume of the CentLearn algorithm and the LDP-KD-FL algorithm shows a gentle upward trend. When the gradient parameter of the DistLearn algorithm is greater than 3000, the total communication volume exceeds 20KB. Compared with the other three algorithms, the total communication volume of each client under different gradient parameters of the LDP-KD-FL algorithm is always lower than that of the other three algorithms. When the gradient parameter is 5000, the communication volume is still less than 40KB.

[0138] refer to Fig.10 ,The present invention then compares the running time of the server under different algorithms. Fig.10 In the figure, (a), (b), (c), and (d) are the comparisons of server running time under different gradient parameters in the FedAvg algorithm, CentLearn algorithm, DistLearn algorithm, and LDP-KD-FL algorithm, respectively. The server running time under the four algorithms shows an upward trend with the increase of the gradient parameter. However, through comparison, it can be seen that the server running time under different gradient algorithms in the LDP-KD-FL algorithm is always lower than that of the other three algorithms. Among them, when the gradient parameter is 2000, the server running time of the LDP-KD-FL algorithm is 152.8ms, which saves 87.7ms, 88.5ms, and 147.8ms respectively compared with the server running time of the FedAvg algorithm, CentLearn algorithm, and DistLearn algorithm under the same gradient parameters.

[0139] refer to Fig.11 In order to analyze the training accuracy of the four algorithms, the present invention selects the MNIST data set and the CIFAR-10 data set to test the four algorithms. The test results are as follows: Fig.11 shown. Fig.11 In the figure, (a) is a comparison of the training accuracy of the four algorithms under the MNIST dataset. When the number of communications is 18, the training accuracy of the LDP-KD-FL algorithm exceeds 80%, which is 30.6%, 45.6%, and 48.6% higher than the accuracy of the FedAvg algorithm, CentLearn algorithm, and DistLearn algorithm, respectively. Fig.11In (b), the training accuracy of the four algorithms under the CIFAR-10 dataset is compared. When the number of communications is 16, the training accuracy of the LDP-KD-FL algorithm exceeds 80%. Under different communication numbers, the training accuracy of the LDP-KD-FL algorithm is always the highest. When the number of communications is 50, the accuracy of the LDP-KD-FL algorithm is 13.4%, 20.3%, and 23.1% higher than that of the FedAvg algorithm, CentLearn algorithm, and DistLearn algorithm, respectively. In summary, the LDP-KD-FL algorithm has smaller communication loss and higher communication efficiency.

[0140] refer to Fig.12 In order to verify the superiority of the improved federated learning algorithm in privacy budget consumption, the absolute and relative errors of the four algorithms in different privacy budgets are compared and analyzed. The results are as follows Fig.12 shown. Fig.12 In the figure, (a), (b), (c), and (d) are the absolute and relative error comparisons of the four algorithms when the privacy budget is 0.5, 1, 2, and 5. The results show that no matter what the privacy budget is, the absolute error and relative error of the LDP-KD-FL algorithm are always the lowest. When the privacy budget is 0.5, the absolute error of the LDP-KD-FL algorithm is 0.12, which is 0.32%, 0.23%, and 0.29% lower than the absolute errors of the FedAvg algorithm, CentLearn algorithm, and DistLearn algorithm, respectively.

[0141] refer to Fig.13 To further analyze the privacy utility of the LDP-KD-FL algorithm, we then compare the privacy budget losses of the four algorithms. The results are as follows: Fig.13 shown. Fig.13 The loss comparison of different privacy budgets under different algorithms shows that as the privacy budget increases, the data volume of the LDP-KD-FL algorithm is always below 2100 bits. The average loss of the FedAvg algorithm is 3100 bits, the average loss of the CentLearn algorithm is 4023 bits, and the average loss of the DistLearn algorithm is 5067 bits. In summary, the loss of the LDP-KD-FL algorithm in different privacy budgets is less than that of other algorithms.

[0142] refer to Fig.14 ,The present paper then analyzes the similarity of different noisy images under different privacy budgets by different algorithms, and selects the image quality evaluation SSIM and MS-SSIM. The results are shown in the following. Fig.14 shown. Fig.14In (a), the SSIM index of different algorithms is compared. The SSIM index value of the LDP-KD-FL algorithm is always the highest, indicating that the quality of the graph processed by the LDP-KD-FL algorithm is the best. When the privacy budget is 0.8, the index value of the LDP-KD-FL algorithm is 0.57, which is 0.21, 0.23, and 0.22 higher than the SSIM index of the FedAvg algorithm, CentLearn algorithm, and DistLearn algorithm, respectively. Fig.14 In (b), the MS-SSIM index of the noisy image under different algorithms is compared. It can be seen that as the privacy budget increases, the quality of the noisy image increases. Among them, the MS-SSIM value of the LDP-KD-FL algorithm is better than that of other algorithms. When the privacy budget exceeds 1.3, the MS-SSIM index value of the LDP-KD-FL algorithm shows a steady increase trend, while the other three algorithms are unstable. In summary, the communication loss and privacy budget loss of the LDP-KD-FL algorithm are better than those of other LDP-KD-FL algorithms.

[0143] It should be noted that the KD algorithm, i.e., the knowledge distillation algorithm, is a model compression and transfer learning technology. In this embodiment, the KD algorithm is used to extract knowledge from the original model and pass it to a smaller target model. In this way, the complexity and computational cost of the model can be reduced while maintaining the performance of the model.

[0144] Local differential privacy is a privacy protection technology that protects user privacy by adding noise to local training data. In this application, the local differential privacy protection mechanism is applied to the gradient update process of federated learning to ensure that the user's privacy is not leaked during data transmission and aggregation.

[0145] The LDP-KD-FL algorithm combines the KD algorithm and the local differential privacy protection mechanism. First, the knowledge is extracted from the original model through the KD algorithm and passed to the target model. Then, during the gradient update process of the target model, the local differential privacy protection mechanism is applied to add noise to the gradient to protect the user's privacy. Finally, the noisy gradient is aggregated to update the parameters of the target model.

[0146] Through comparative experiments, it is found that the LDP-KD-FL algorithm shows significant superiority in terms of communication overhead, server running time and privacy budget consumption. Specifically, the total communication volume under the LDP-KD-FL algorithm is always lower than that of other algorithms, the server running time is also lower, and low absolute error and relative error can be maintained under different privacy budgets. In view of the fact that the traditional federated learning algorithm has certain security risks when processing highly sensitive and class-imbalanced data, which may lead to problems such as model performance degradation or data privacy leakage, this embodiment optimizes the performance of the federated learning algorithm by introducing knowledge distillation and local differential privacy privacy protection mechanism, and finally constructs a privacy protection mechanism based on the LDP-KD-FL algorithm. According to experimental analysis, in the comparison of communication volume, the gradient parameters of different algorithms will show an upward trend with the increase of communication volume, but compared with the FedAvg algorithm, CentLearn algorithm and DistLearn algorithm, the total communication volume of the LDP-KD-FL algorithm proposed in the study increases more slowly. When the gradient parameter is 5000, the communication volume is still less than 40KB. In the server running time comparison, when the gradient parameter is 2000, the server running time of the LDP-KD-FL algorithm is 152.8ms. After comparing the training accuracy, the data shows that when the number of communications is 16, the training accuracy of the LDP-KD-FL algorithm exceeds 80%. In the privacy budget error comparison, when the privacy budget is 0.5, the absolute error of the LDP-KD-FL algorithm is 0.12, which is 0.32%, 0.23%, and 0.29% lower than the absolute errors of the FedAvg algorithm, CentLearn algorithm, and DistLearn algorithm, respectively. In summary, the LDP-KD-FL algorithm has low communication utility and responds faster in the server.

[0147] The LDP-KD-FL algorithm proposed in this embodiment integrates the knowledge distillation (KD) algorithm and the local differential privacy protection mechanism in federated learning, and has significant beneficial technical effects. Specifically, it is manifested in the following aspects:

[0148] By applying the local differential privacy protection mechanism and adding noise to the gradient update process of federated learning, the user's privacy information is effectively protected. In the privacy budget analysis, the LDP-KD-FL algorithm showed the lowest absolute error and relative error. When the privacy budget was 0.5, its absolute error was only 0.12, which further proved the effectiveness of the algorithm in privacy protection.

[0149] In the comparison of communication overhead, the total communication volume under the LDP-KD-FL algorithm is always lower than that of other algorithms. For example, when the gradient parameter is 5000, its communication volume is less than 40KB, which significantly reduces the communication cost in the federated learning system.

[0150] In terms of server running time, the LDP-KD-FL algorithm also shows an advantage. When the gradient parameter is 2000, its server running time is 152.8ms, which is lower than the running time of the other three algorithms, which helps to improve the overall performance of the federated learning system.

[0151] The LDP-KD-FL algorithm takes into account both data privacy and user disconnection, making the algorithm more robust and adaptable in practical applications.

[0152] By combining the KD algorithm, the LDP-KD-FL algorithm can achieve effective compression and optimization of the model while protecting privacy, thereby reducing the computational complexity without sacrificing too much performance.

[0153] Due to the significant advantages of the LDP-KD-FL algorithm in privacy protection, communication overhead, system performance, etc., it has great application potential in practical application scenarios that require processing large-scale data and have strict requirements on privacy protection, such as medical and financial fields.

[0154] The following are device embodiments of the present invention, which can be used to implement the method embodiments of the present invention. For details not disclosed in the device embodiments, please refer to the method embodiments of the present invention.

[0155] In one embodiment, a model training device based on improved federated learning is applied to a server of a model training system based on improved federated learning, wherein the model training system based on improved federated learning includes a server and a plurality of participating terminals that are communicatively connected to the server; the model training device based on improved federated learning includes a sending module and an iterative update module. The sending module and the iterative update module are respectively configured as:

[0156] The sending module is used to obtain the initial model and send it to each participating end.

[0157] An iterative update module is used to iteratively perform update steps to a preset update iteration threshold, use the current model as a trained model, and send it to each participating terminal; wherein the update step includes: receiving gradient parameters sent by each participating terminal, and entering a global parameter update process; wherein the gradient parameters are the gradients of each neural network layer of the local model obtained by the participating terminal according to local training data, combined with local differential privacy protection and knowledge distillation, by performing gradient calculation; the global parameter update process includes: updating the global parameters of the model according to the gradient parameters sent by each participating terminal, and sending the updated global parameters to each participating terminal; wherein the updated global parameters are used to update the model parameters of the local model of the participating terminal.

[0158] In one embodiment, a model training device based on improved federated learning is applied to a participant end of a model training system based on improved federated learning, wherein the model training system based on improved federated learning includes a server and a plurality of participants connected to the server in communication; the model training device based on improved federated learning includes a receiving module and an iterative calculation module, wherein the receiving module and the iterative calculation module are respectively configured as follows:

[0159] The receiving module is used to receive the initial model sent by the server as the local model.

[0160] An iterative calculation module is used to iteratively perform a gradient calculation step to a preset gradient calculation iteration threshold, and receive a trained model sent by a server; wherein the gradient calculation step includes: performing gradient calculation on the local training data in combination with local differential privacy protection and knowledge distillation to obtain the gradients of each neural network layer of the local model, and after completing the gradient calculation, sending the gradients of each neural network layer of the local model as gradient parameters to the server; when receiving an updated global parameter sent by the server, updating the model parameters of the local model according to the updated global parameter; the global parameter is the global parameter of the model updated by the server according to the gradient parameter sent by each participating terminal.

[0161] In one embodiment of the present invention, a computer device is provided, which includes a processor and a memory, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is used to execute the program instructions stored in the computer storage medium. The processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc., which are the computing core and control core of the terminal, which are suitable for implementing one or more instructions, and are specifically suitable for loading and executing one or more instructions to implement the corresponding method flow or corresponding functions; the processor described in the embodiment of the present invention can be used to implement an operation of a model training method based on improved federated learning.

[0162] In one embodiment of the present invention, a model training method based on improved federated learning can be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as an independent product. Based on this understanding, the present invention implements all or part of the process in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. Computer-readable storage media include permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data.

[0163] The computer storage medium can be any available medium or data storage device that can be accessed by a computer, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (such as CD, DVD, BD, HVD, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NANDFLASH), solid-state drive (SSD)), etc.

[0164] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0165] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products of the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0166] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0167] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0168] In the description of the present invention, in addition, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0169] In the present invention, unless otherwise clearly specified and limited, the terms "connected", "connection" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection, an electrical connection, or communication with each other; it can be a direct connection, or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements, unless otherwise clearly defined. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0170] In the present invention, unless otherwise clearly specified and limited, a first feature being "above" or "below" a second feature may mean that the first and second features are in direct contact, or the first and second features are in indirect contact through an intermediate medium. Moreover, a first feature being "above", "above" or "above" a second feature may mean that the first feature is directly above or obliquely above the second feature, or simply means that the first feature is higher in level than the second feature. A first feature being "below", "below" or "below" a second feature may mean that the first feature is directly below or obliquely below the second feature, or simply means that the first feature is lower in level than the second feature.

[0171] In the present invention, the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" etc. mean that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the described specific features, structures, materials or characteristics may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0172] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A model training method based on improved federated learning, characterized in that: A server applied to a model training system based on improved federated learning, wherein the model training system based on improved federated learning includes a server and a plurality of participating terminals connected to the server in communication; The model training method based on improved federated learning includes: Obtain the initial model and send it to each participating end; Iterate the update steps until the preset update iteration threshold is reached, take the current model as the trained model, and send it to each participating terminal; Wherein, the updating step comprises: Receive the gradient parameters sent by each participating end and enter the global parameter update process; the gradient parameters are the gradients of each neural network layer of the local model obtained by the participating end based on the local training data, combined with local differential privacy protection and knowledge distillation; The global parameter updating process includes: updating the global parameters of the model according to the gradient parameters sent by each participating terminal, and sending the updated global parameters to each participating terminal; wherein the updated global parameters are used to update the model parameters of the local model of the participating terminal.

2. According to claim 1, a model training method based on improved federated learning is characterized in that: The participating end calculates the gradients of each neural network layer of the local model based on the local training data in combination with local differential privacy protection and knowledge distillation, including: The participating end uses local differential privacy protection to add noise to the local training data, and learns through the student model and the teacher model in the softmax layer of the local model to minimize the loss between the output of the teacher model and the student model.

3. The model training method based on improved federated learning according to claim 1, characterized in that: The updating of the global parameters of the model according to the gradient parameters sent by each participating terminal includes: Average the gradient parameters sent by each participating terminal to obtain the average gradient parameter; According to the average gradient parameters, the back propagation algorithm is used to update the global parameters of the model.

4. The model training method based on improved federated learning according to claim 1, characterized in that: The gradient calculation is specifically a stochastic gradient descent method.

5. A model training method based on improved federated learning, characterized in that: Applied to a participant terminal of a model training system based on improved federated learning, wherein the model training system based on improved federated learning includes a server and a plurality of participant terminals connected to the server in communication; The model training method based on improved federated learning includes: Receive the initial model sent by the server as the local model; Iterate the gradient calculation steps until the preset gradient calculation iteration threshold is reached, and receive the trained model sent by the server; Wherein, the gradient calculation step includes: Based on the local training data, the gradient of each neural network layer of the local model is calculated by combining local differential privacy protection and knowledge distillation. After the gradient calculation is completed, the gradient of each neural network layer of the local model is sent to the server as a gradient parameter; When receiving the updated global parameters sent by the server, updating the model parameters of the local model according to the updated global parameters; The global parameters are global parameters that the server updates the model based on the gradient parameters sent by each participating terminal.

6. The model training method based on improved federated learning according to claim 5, characterized in that: The gradients of each neural network layer of the local model obtained by performing gradient calculation based on the local training data in combination with local differential privacy protection and knowledge distillation include: The participating end uses local differential privacy protection to add noise to the local training data, and learns through the student model and the teacher model in the softmax layer of the local model to minimize the loss between the output of the teacher model and the student model.

7. The model training method based on improved federated learning according to claim 5, characterized in that: The updating of the global parameters of the model according to the gradient parameters sent by each participating terminal includes: Average the gradient parameters sent by each participating terminal to obtain the average gradient parameter; According to the average gradient parameters, the back propagation algorithm is used to update the global parameters of the model.

8. The model training method based on improved federated learning according to claim 5, characterized in that: The gradient calculation is specifically a stochastic gradient descent method.

9. A model training device based on improved federated learning, characterized in that: A server applied to a model training system based on improved federated learning, wherein the model training system based on improved federated learning includes a server and a plurality of participating terminals connected to the server in communication; The model training device based on improved federated learning includes: The sending module is used to obtain the initial model and send it to each participating end; An iterative update module is used to iterate the update steps to a preset update iteration threshold, take the current model as the trained model, and send it to each participating terminal; Wherein, the updating step comprises: Receive the gradient parameters sent by each participating end and enter the global parameter update process; the gradient parameters are the gradients of each neural network layer of the local model obtained by the participating end based on the local training data, combined with local differential privacy protection and knowledge distillation; The global parameter updating process includes: updating the global parameters of the model according to the gradient parameters sent by each participating terminal, and sending the updated global parameters to each participating terminal; wherein the updated global parameters are used to update the model parameters of the local model of the participating terminal.

10. A model training device based on improved federated learning, characterized in that: Applied to a participant terminal of a model training system based on improved federated learning, wherein the model training system based on improved federated learning includes a server and a plurality of participant terminals connected to the server in communication; The model training device based on improved federated learning includes: A receiving module is used to receive the initial model sent by the server as a local model; An iterative calculation module, used to iterate the gradient calculation steps to a preset gradient calculation iteration threshold, and receive the trained model sent by the server; Wherein, the gradient calculation step includes: Based on the local training data, the gradient of each neural network layer of the local model is calculated by combining local differential privacy protection and knowledge distillation. After the gradient calculation is completed, the gradient of each neural network layer of the local model is sent to the server as a gradient parameter; When receiving the updated global parameters sent by the server, updating the model parameters of the local model according to the updated global parameters; The global parameters are global parameters that the server updates the model based on the gradient parameters sent by each participating terminal.

Citation Information

Patent Citations

  • Electric power inspection image defect detection method based on federated learning and adaptive difference

    CN114897837A

  • Drug molecule property prediction method based on federal safety cooperation

    CN116580785A

  • Federal learning privacy protection model training method and system based on knowledge distillation

    CN116957064A

  • Hierarchical privacy protection federated learning method based on core data set

    CN118350038A

Cited By

  • Federal learning method and system based on bidirectional feedback knowledge distillation and differential privacy

    CN119990373A

  • Multi-stage federated learning method and device, equipment, storage medium and program product

    CN120893522A