Personalized federal learning optimization method and system under differential privacy protection
By selectively fusion of parameter weights and updating global model parameters in personalized federated learning, combined with cross entropy loss and L2 norm regularization, the problems of large noise interference and unstable model performance in personalized federated learning are solved, and the balance of efficient personalization and generalization performance under privacy protection is achieved, and the robustness and accuracy of the model are improved.
Patent Information
- Application Number
- CN202510507697.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-22
- Publication Date
- 2025-08-01
AI Technical Summary
In personalized federated learning, existing methods still have problems such as large noise interference and unstable model performance when dealing with scenarios where data distribution is not independent and distributed. Especially under the requirements of privacy protection, traditional methods are difficult to effectively balance personalized and generalized performance.
Using the personalized federated learning optimization method under differential privacy protection, by training a personalized model on the client, selectively fusion and update global model parameters using parameter weights, combining cross entropy loss and L2 norm regularization, dynamically refer to the global model, cropping and adding noise to alleviate noise interference.
The balance between personalized and generalized performance is achieved, the robustness of the model and the stability under noise are enhanced, the negative impact of noise on model performance is reduced, and the accuracy and convergence speed of the model are improved under privacy protection.
Smart Images

Figure CN120409624A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology applications, and particularly to a personalized federated learning optimization method and system under differential privacy protection. Background Art
[0002] Currently, for some sensitive image data, such as pictures with a high degree of privacy, like traffic road sign pictures, when training a model for classifying them, it is necessary to prevent the leakage of users' privacy information. For this purpose, federated learning, which can provide effective privacy protection with the cooperation of a large number of participants and iteratively train a specific machine learning model in a distributed computing manner, is used to implement the training of the classification model for such image data. Personalized federated learning is an extension of traditional federated learning, aiming to solve the performance problems arising from training on diverse data. Although traditional federated learning methods are trained through a global model, for devices with significant differences (such as different user data distributions, device capabilities, etc.), a unified global model may not be suitable for all devices. Therefore, the goal of personalized federated learning is to customize a personalized model for each device to perform better on local data. Currently, for personalized federated learning, the following methods are mainly used to improve model performance: (1) By adding adaptive noise and gradually reducing the noise according to the convergence of the gradient to improve the model accuracy. (2) By restricting the norm of local updates and using local update sparsity techniques to reduce the adverse effects of clipping and adding random noise. (3) Using the SAM optimizer to enhance the robustness of model parameters to noise and improving model performance by identifying more stable convergence points. Although these methods alleviate the negative impact of noise to a certain extent, there is still a large room for improvement in data scenarios where the data distribution is not independent and identically distributed. Summary of the Invention
[0003] In view of the above technical problems, the technical solution adopted by the present invention is as follows:
[0004] According to a first aspect of the present invention, there is provided a personalized federated learning optimization method under differential privacy protection. The method is executed on a client side and includes the following steps:
[0005] Obtain the initialized global model parameter values from a server and load the initialized global model parameter values into a pre-built local model to obtain an initialized local model with loaded parameters.
[0006] In response to receiving the current global model parameter value sent by the server, based on the weights of the current local model parameter values, select the current local model parameter values that need to be fused with the received current global model parameter value, and obtain the local model parameters fused with the current global model parameter value as the current fusion parameter value; the current global model parameter value is obtained by aggregating the current intermediate global model parameter values currently received by the server.
[0007] Use the local data and the current local model parameter values to train the current local model to update the current local model parameter values and obtain the updated local model parameter values; wherein, the update of the local model parameter values is determined based on a preset loss, and the preset loss includes cross-entropy loss and a loss determined based on the current local model parameter values and the current fusion parameter values; the current local model is the initialized local model.
[0008] Use the local data and the current global model parameter values to train the current local model to update the current global model parameter values and obtain the updated global model parameter values.
[0009] Based on the weights of the current local model parameter values, select the parameter values for updating the updated global model parameter values, and update the updated global model parameter values based on the selected parameter values to obtain the corresponding parameter update result as the current parameter update result.
[0010] Clip and add noise to the current parameter update result as the current intermediate global model parameter value and send it to the server.
[0011] According to the second aspect of the present invention, there is provided a personalized federated learning optimization system under differential privacy protection. The system is deployed on the client side and includes:
[0012] A data acquisition module for acquiring the initialized global model parameter values from the server and loading the initialized global model parameter values into a pre-built local model to obtain the initialized local model with loaded parameters.
[0013] A parameter fusion module for, in response to receiving the current global model parameter value sent by the server, based on the weights of the current local model parameter values, selecting the current local model parameter values that need to be fused with the received current global model parameter value, and obtaining the local model parameters fused with the current global model parameter value as the current fusion parameter value; the current global model parameter value is obtained by aggregating the current intermediate global model parameter values currently received by the server.
[0014] The local model parameter update module is used to train the current local model by using local data and the current local model parameter values, so as to update the current local model parameter values and obtain the updated local model parameter values; wherein, the update of the local model parameter values is determined based on a preset loss, and the preset loss includes cross-entropy loss and a loss determined based on the current local model parameter values and the current fusion parameter values; the current local model is the initialized local model.
[0015] The first global model parameter update module is used to train the current local model by using local data and the current global model parameter values, so as to update the current global model parameter values and obtain the updated global model parameter values.
[0016] The second global model parameter update module is used to select the parameter values for updating the updated global model parameter values based on the weights of the current local model parameter values, and update the updated global model parameter values based on the selected parameter values to obtain the corresponding parameter update results as the current parameter update results; and clip and add noise to the current parameter update results as the current intermediate global model parameter values and send them to the server.
[0017] The present invention has at least the following beneficial effects:
[0018] A personalized federated learning optimization method under differential privacy protection provided by an embodiment of the present invention can achieve a balance between personalization and generalization performance by training a personalized model to adapt to the local data distribution on the client side and updating the local model parameters based on the loss determined based on the current local model parameter values and the current fusion parameter values. In addition, using the parameter weights as a parameter importance metric to selectively fuse with the global model parameter values and update the global model parameter values can prevent sensitive parameters from being interfered by the global parameters with noise, thereby further reducing the negative impact of noise on the model performance and improving the robustness of the model under noise.
[0019] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present invention, nor is it used to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. Description of the Drawings
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0021] Figure 1The flowchart of the personalized federated learning optimization method under differential privacy protection provided by the embodiments of the present invention. Detailed implementation manners
[0022] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative efforts shall fall within the protection scope of the present invention.
[0023] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which the present invention belongs. The terms used in the description of the present invention in this specification are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.
[0024] It should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the steps as sequential processes, many of the steps can be implemented in parallel, concurrently, or simultaneously. In addition, the order of the steps can be rearranged. The process can be terminated when its operation is completed, but there can also be additional steps not included in the drawings. The process can correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.
[0025] The embodiments of the present invention provide a personalized federated learning optimization method under differential privacy protection. As Figure 1 shown, the method is executed on the client side, and the method may include the following steps:
[0026] S100, obtain the initial global model parameter values from the server, and load the initial global model parameter values into the pre-built local model to obtain an initialized local model with loaded parameters.
[0027] In the embodiments of the present invention, the server is communicatively connected to multiple clients. The server defines the structure of the global model and randomly initializes the parameter values of the global model, and then sends them to each client. Each client will load the received initial global model parameter values into its own local model to obtain the corresponding initialized local model. The local model has the same structure as the global model.
[0028] In an embodiment of the present invention, the local model can be an image classification model for classifying target objects in an image. In a schematic embodiment, the local model can be a convolutional neural network, and the local model can include m network layers, where m > 1. In a preferred embodiment, the local model can include 4 network layers, namely a first convolutional layer, a second convolutional layer, a first fully connected layer, and a second fully connected layer connected in sequence.
[0029] S200, in response to receiving the current global model parameter value sent by the server, based on the weight of the current local model parameter value, select the current local model parameter value that needs to be fused with the received current global model parameter value to obtain the local model parameter fused with the current global model parameter value as the current fusion parameter value; the current global model parameter value is obtained by aggregating the current intermediate global model parameter values currently received by the server.
[0030] In an embodiment of the present invention, when the global model training round does not reach the preset round threshold, the server will randomly select a set number of clients from multiple clients according to a proportion to participate in the training of this round during each round of training, and send the current global model parameter value to the clients currently participating in the training of this round.
[0031] In an embodiment of the present invention, the weight of the current local model parameter value can be obtained based on the gradient of each parameter value. Specifically, for the j-th parameter value p ij in the i-th network layer of the current local model, the weight W ij satisfies the following conditions:
[0032] W ij =(W0 ij -min(W i )) / (max(W i )-min(W i ))), where W0 ij is the initial weight of the j-th parameter value in the i-th network layer, W0 ij =(▽p ij )) 2 , where ▽p ij is the gradient of p ij , the value of i ranges from 1 to m, the value of j ranges from 1 to z(i), and z(i) is the number of parameters in the i-th network layer; W i is the parameter weight set corresponding to the i-th network layer, W i ={W0 ij} j=1……z(i) , max() represents taking the maximum value, and min() represents taking the minimum value.
[0033] In an embodiment of the present invention, p ijThe gradient can be obtained through the following steps:
[0034] Obtain p ij The corresponding partial derivative expression
[0035] where f(θ, D) is the cross-entropy loss function expression of the local model, D is the local data, θ is the local model parameter vector, θ = {θ h} h=1……n , θ h is the h-th parameter in θ, h ranges from 1 to n, n is the number of parameters in θ, and θ ij is the j-th parameter in the i-th network layer. Those skilled in the art know that the dependent variable of the cross-entropy loss function expression is the class prediction probability of the target object, and the independent variable can be the local model parameter vector, and the specific expression can be an existing expression.
[0036] Substitute p ij into the partial derivative expression to obtain the gradient of p ij .
[0037] Furthermore, the r-th parameter value g r c in the current fusion parameter value satisfies the following conditions:
[0038] If W r ≥ θ, set g r c = p r , if W r < θ, set g r c = h r , where W r is the weight of the r-th parameter value in the current fusion parameter value, θ is a hyperparameter, and its value range is 0 - 1, p r is the r-th parameter value in the current local model parameter value, and h r is the r-th parameter value in the current global model parameter value, and r ranges from 1 to n, where n is the number of parameters in the local model parameters.
[0039] In the embodiments of the present invention, if W r ≥ θ, it indicates that the corresponding parameter value is more sensitive to the loss function, that is, it contributes more, and it belongs to the parameter sensitive to noise. Therefore, the global model parameter value is not used to update this parameter value to reduce the negative impact of noise on the model performance. If W r<θ indicates that the contribution of the corresponding parameter value to the loss function is small, and it belongs to a parameter that is insensitive to noise. The global model parameter value can be used to update this parameter value. In this way, the client can obtain an adaptive global model parameter, providing a personalized global reference for the client's personalized model update, and thus minimizing noise interference to the greatest extent.
[0040] Further, the current global model parameter value satisfies the following conditions:
[0041] b r =(1 / Q)∑ n r=1 u r ;
[0042] where b r is the r-th parameter value in the current global model parameter value.
[0043] S300, use the local data and the current local model parameter value to train the current local model to update the current local model parameter value, and obtain the updated local model parameter value; wherein, the update of the local model parameter value is determined based on a preset loss, and the preset loss includes cross-entropy loss and a loss determined based on the current local model parameter value and the current fusion parameter value; the current local model is the initialized local model.
[0044] In the embodiment of the present invention, the local data can be an image data set specified for the corresponding client.
[0045] Those skilled in the art know that any method for a client to train the current local model using local data and the current local model parameter value falls within the protection scope of the present invention.
[0046] In the embodiment of the present invention, the preset loss satisfies the following condition: L = L1 + L2, where L is the preset loss, L1 is the cross-entropy loss, L2 is the loss determined based on the current local model parameter value and the current fusion parameter value, and L2 = λ / 2(∑ n r=1 (p r -g r c ) 2 ), p r is the r-th parameter value in the current local model parameter value, r ranges from 1 to n, n is the number of parameters in the local model parameter, and g r c is the r-th parameter value in the current fusion parameter value, and λ is a hyperparameter.
[0047] Those skilled in the art know that the cross-entropy loss can be calculated based on an existing cross-entropy loss calculation function.
[0048] In the embodiments of the present invention, since the loss of the local model incorporates the adaptive global parameters generated by fusing the global model parameter values and the local model parameter values, it can effectively reduce the negative impact of noise on the model performance, and is more suitable for scenarios where the data is non-independent and identically distributed and privacy is protected.
[0049] S400. Use the local data and the current global model parameter values to train the current local model to update the current global model parameter values, and obtain the updated global model parameter values.
[0050] Those skilled in the art know that any method for a client to train the current local model using local data and the current global model parameter values falls within the protection scope of the present invention.
[0051] S500. Based on the weights of the current local model parameter values, select the parameter values for updating the updated global model parameter values, and update the updated global model parameter values based on the selected parameter values to obtain the corresponding parameter update result as the current parameter update result.
[0052] Further, the step of based on the weights of the current local model parameter values, selecting the parameter values for updating the updated global model parameter values, and updating the updated global model parameter values based on the selected parameter values to obtain the corresponding parameter update result specifically includes:
[0053] Sort the weights of the parameter values corresponding to the i-th network layer of the local model in descending order to obtain the sorted weights corresponding to this network layer.
[0054] Take the parameter values corresponding to the first g(i) weights in the sorted weights corresponding to the i-th network layer as the parameter values for updating the updated global model parameter values, where g(i) = k × z(i), and k is a set coefficient, which can be an empirical value.
[0055] Based on the parameter values for updating the updated global model parameter values in the i-th network layer, obtain the binary mask vector corresponding to the parameters of this network layer. Among them, if a certain parameter value corresponding to the i-th network layer is a parameter value for updating the updated global model parameter values, the value at the corresponding position in the binary mask vector is 1, otherwise, it is 0. For example, the parameters of the i-th network layer include a1, a2, a3, and a4. Among them, the parameter values corresponding to a1 and a4 are the parameter values for updating the updated global model parameter values, then the binary mask vector corresponding to the parameters of the i-th network layer is (1, 0, 0, 1).
[0056] Multiply the binary mask vector corresponding to the parameters of the i-th network layer by the updated global model parameter value corresponding to this network layer, that is, perform element-wise multiplication, to obtain the parameter update result corresponding to the i-th network layer.
[0057] In the embodiments of the present invention, for each network layer, select the parameter values with the top weights to update the global model parameter values, which can reduce the communication overhead and reduce the impact of differential privacy noise on the local model, so as to improve the performance of the model while ensuring privacy protection.
[0058] S600, clip and add noise to the current parameter update result as the current intermediate global model parameter value, and send it to the server.
[0059] In the embodiments of the present invention, the current intermediate global model parameter value satisfies the following conditions:
[0060] u r = u r c / max(1, (∑ n r=1 (u r c ) 2 ) 1 / 2 ) / C) + ε;
[0061] Wherein, u r is the r-th parameter value in the current intermediate global model parameter value, u r c is the r-th parameter value in the current parameter update result, C is the clipping threshold, which is an empirical value. ε is the added noise, and ε is the noise sampled from a Gaussian distribution with a mean of 0 and a variance of βC 2 / |Q|, β is a hyperparameter, which can be an empirical value and is specifically determined based on the type and quantity of local data. Q is the number of clients currently participating in the global model training, and || represents taking the absolute value.
[0062] In the embodiments of the present invention, two benchmark datasets, CIFAR-10 and MNIST, are selected to evaluate the personalized federated learning optimization method under differential privacy protection provided by the embodiments of the present invention. A simple convolutional neural network including two convolutional layers and two fully connected layers is used to train the dataset.
[0063] Comparison method: The method provided in the embodiments of the present invention is compared with the methods used in Document 1, Document 2, and Document 3 in terms of performance under different privacy budgets, performance under different degrees of heterogeneity, and the influence of different local update rounds. The method provided in Document 1 is a classical DP-FL method, which achieves differential privacy protection by adding noise during local updates; the method provided in Document 2 is a method that alleviates the influence of differential privacy noise through local regularization and sparsification, and the method provided in Document 3 generates a robust local flatness model through the SAM optimizer, effectively alleviating the performance loss caused by differential privacy.
[0064] Document 1: R.C. Geyer, T. Klein, and M. Nabi, “Differentially private federated learning: A client level perspective,” arXiv preprint arXiv:1712.07557, 2017;
[0065] Document 2: Cheng A, Wang P, Zhang X S, et al. Differentially private federated learning with local regularization and sparsification[C] / / Proceedings of the IEEE / CVF conference on computer vision and pattern recognition. 2022:10122 - 10131;
[0066] Document 3: SHI Y, LIU Y, et al. Make landscape flatter in differentially private federated learning[C] / / Proceedings of the IEEE / CVF Conference on Computer Vision and Pattern Recognition. 2023:24552 - 24562.
[0067] Reference 4: Yang X, Huang W, Ye M. Dynamic personalized federated learning with adaptive differential privacy[J]. Advances in Neural Information Processing Systems, 2023, 36: 72181-72192.
[0068] In the embodiments of the present invention, the learning rate is set to 0.001. For CIFAR-10 and MNIST, the batch sizes are set to 50 and 32 respectively, the local training epochs are set to 5 and 2, and the total number of global training epochs is 100. The number of clients participating in global training each time is fixed at 20, and the clipping threshold is 0.2. For the hyperparameters θ and λ, the best values are selected from {0.1, 0.3, 0.5, 0.7, 0.9} and {0.05, 0.1, 0.5, 1, 2} respectively through grid search. The present invention divides the dataset into 20 subsets based on the Dirichlet distribution and assigns them to different clients, and uses a fixed noise multiplier to ensure differential privacy. The experimental hardware environment is an NVIDIA 3090 GPU, and the algorithm implementation is completed based on the PyTorch framework.
[0069] Among them, the comparison results of the performance under different privacy budgets are shown in Table 1 below, the comparison results of the performance under different degrees of heterogeneity are shown in Table 2 below, and the comparison results of the influence of different local update epochs are shown in Table 3 below. Among them, δ in Table 1 represents the privacy budget, α in Table 2 represents the degree of heterogeneity of local data, IID represents independent and identically distributed data, and R in Table 3 represents the update epoch.
[0070] Table 1
[0071]
[0072] Table 2
[0073] Method α=0.5 α=1 α=2 IID Document 1 48.83 52.35 54.93 56.25 Document 2 51.65 55.17 56.35 57.09 Document 3 51.04 54.19 55.52 56.11 Document 4 49.68 53.52 56.19 56.83 The present invention 53.46 56.29 57.71 58.23
[0074] Table 3
[0075]
[0076]
[0077] As can be seen from Table 1, the personalized federated learning optimization method under differential privacy protection provided by the embodiments of the present invention performs excellently under different privacy budgets. Especially in the case of low privacy budgets, it shows significant advantages. In addition, it is significantly superior to other methods in terms of convergence speed and final accuracy, indicating the good applicability of the method provided by the embodiments of the present invention in distributed learning scenarios with high privacy protection requirements. As can be seen from Table 2, the personalized federated learning optimization method under differential privacy protection provided by the embodiments of the present invention can accelerate model convergence and significantly improve model accuracy. In addition, from the curve fluctuations during the training process, it can be seen that the method of the present invention shows stronger stability, and its training curve is always relatively smooth even under high heterogeneity conditions. This means that the method of the present invention remains robust in highly heterogeneous scenarios with noise interference. As can be seen from Table 3, the personalized federated learning optimization method under differential privacy protection provided by the embodiments of the present invention shows strong robustness in different communication delay scenarios. As R increases, the overall performance of all algorithms improves. However, when R becomes large enough, the performance of the method provided in Document 1 significantly decreases. The reason for this decrease is that more local update rounds will increase the gap between the local model and the global model, weaken the effectiveness of global aggregation, and thus affect the overall model performance. In contrast, the method provided by the present invention uses regularization techniques to constrain the deviation between the local model and the global model, thereby alleviating the problem of performance degradation. This method helps to reduce the negative impact of over-updating, enables the model to maintain more stable performance in all rounds, and achieves higher accuracy.
[0078] In summary, a personalized federated learning optimization method under differential privacy protection provided by the embodiments of the present invention has at least the following technical effects:
[0079] (1) Train a personalized model at the client to adapt to the local data distribution. Introduce an L2 norm regularization term into the loss function of the personalized model to make it dynamically refer to the global model, thereby reducing the impact of data with non-independent and identically distributed data while ensuring that the model has good generalization performance.
[0080] (2) Use the weights determined based on the parameter gradients for parameter personalization. By calculating the weights of the local model, i.e., the parameters of the personalized model, identify sensitive and important parameters to prevent these parameters from being interfered by noise, thereby enhancing the robustness of the personalized model to noise.
[0081] (3) Perform hierarchical sparsification based on the calculated weights, which can remove parameters that have less impact on the model performance, thereby further reducing the impact of noise on the model performance and reducing the communication cost.
[0082] (4) Experiments were conducted on the CIFAR-10 and MNIST datasets, verifying the superior balancing ability of the proposed method between privacy protection and model performance.
[0083] Another embodiment of the present invention provides a personalized federated learning optimization system under differential privacy protection. The system is deployed on the client side and includes:
[0084] A data acquisition module, configured to obtain the initial global model parameter values from the server and load the initial global model parameter values into a pre-built local model to obtain an initialized local model with loaded parameters.
[0085] A parameter fusion module, configured to, in response to receiving the current global model parameter values sent by the server, select the current local model parameter values that need to be fused with the received current global model parameter values based on the weights of the current local model parameter values, and obtain local model parameter values that have fused the current global model parameter values as the current fusion parameter values; the current global model parameter values are obtained by aggregating the current intermediate global model parameter values currently received by the server.
[0086] A local model parameter update module, configured to use local data and the current local model parameter values to train the current local model to update the current local model parameter values and obtain updated local model parameter values; wherein, the update of the local model parameter values is determined based on a preset loss, and the preset loss includes cross-entropy loss and a loss determined based on the current local model parameter values and the current fusion parameter values; the current local model is the initialized local model.
[0087] A first global model parameter update module, configured to use local data and the current global model parameter values to train the current local model to update the current global model parameter values and obtain updated global model parameter values.
[0088] A second global model parameter update module, configured to select parameter values for updating the updated global model parameter values based on the weights of the current local model parameter values, and update the updated global model parameter values based on the selected parameter values to obtain corresponding parameter update results as the current parameter update results; and clip and add noise to the current parameter update results as the current intermediate global model parameter values and send them to the server.
[0089] This system can be used to execute Figure 1 the method shown in the embodiments shown, and therefore, for the functions that can be realized by each functional module of the device, reference can be made to Figure 1 the description of the embodiments shown, which will not be elaborated here.
[0090] An embodiment of the present invention further provides an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are configured to execute the method according to the embodiment of the present invention.
[0091] An embodiment of the present invention further provides a computer-readable storage medium storing computer-executable instructions for executing the method according to the embodiment of the present invention.
[0092] It should be understood that the various forms of the processes shown above can be used, steps can be reordered, added or deleted. For example, the steps described in the present invention can be executed in parallel, sequentially or in a different order, as long as the desired results of the technical solutions disclosed in the present invention can be achieved, and this is not limited herein.
[0093] The above specific embodiments do not constitute a limitation on the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A personalized federated learning optimization method under differential privacy protection, characterized in that, The method is executed on the client side, and the method includes the following steps: Obtain the initialized global model parameter values from the server, and load the initialized global model parameter values into a pre-built local model to obtain an initialized local model with loaded parameters; In response to receiving the current global model parameter values sent by the server, based on the weights of the current local model parameter values, select the current local model parameter values that need to be fused with the received current global model parameter values to obtain local model parameter values fused with the current global model parameter values as the current fusion parameter values; The current global model parameter values are obtained by aggregating the current intermediate global model parameter values currently received by the server; Use local data and the current local model parameter values to train the current local model to update the current local model parameter values to obtain updated local model parameter values; wherein, the update of the local model parameter values is determined based on a preset loss, and the preset loss includes cross-entropy loss and a loss determined based on the current local model parameter values and the current fusion parameter values; the current local model is the initialized local model; Use local data and the current global model parameter values to train the current local model to update the current global model parameter values to obtain updated global model parameter values; Based on the weights of the current local model parameter values, select the parameter values used to update the updated global model parameter values, and update the updated global model parameter values based on the selected parameter values to obtain the corresponding parameter update result as the current parameter update result; Clip and add noise to the current parameter update result as the current intermediate global model parameter values and send them to the server.
2. The method according to claim 1, characterized in that, The local model includes m network layers; m>1; where the jth parameter value p in the i-th network layer in the current local model is ij The weight W ij The following conditions are met: W ij = (W0 ij - min(W i )) / (max(W i ) - min(W i )),W0 ij is the initial weight of the j-th parameter value in the i-th network layer, W0 ij = (▽p ij )) 2 , where ▽p ij is the gradient of p ij , the value range of i is from 1 to m, the value range of j is from 1 to z(i), and z(i) is the number of parameters in the i-th network layer; W i is the parameter weight set corresponding to the i-th network layer, W i = {W0 ij} j=1……z(i) , max() represents taking the maximum value, and min() represents taking the minimum value.
3. The method according to claim 2, wherein The r-th parameter value g among the current fusion parameter values r c satisfies the following conditions: If W r ≥ θ, set g r c = p r , if W r < θ, set g r c = h r , where W r is the weight of the r-th parameter value in the current fusion parameter values, θ is a hyperparameter, p r is the r-th parameter value in the current local model parameter values, h r is the r-th parameter value in the current global model parameter values, and r takes values from 1 to n, where n is the number of parameters in the local model parameters.
4. The method according to claim 1, characterized in that, The preset loss satisfies the following condition: L = L1 + L2, where L is the preset loss, L1 is the cross-entropy loss, and L2 is the loss determined based on the current local model parameter values and the current fusion parameter values. L2 = λ / 2(∑ n r=1 (p r -g r c ) 2 ), p r is the r-th parameter value in the current local model parameter values, r ranges from 1 to n, and n is the number of parameters in the local model parameters. g r c is the r-th parameter value in the current fusion parameter values, and λ is a hyperparameter.
5. The method according to claim 2, wherein The step of, based on the weights of the current local model parameter values, selecting the parameter values used to update the updated global model parameter values, and updating the updated global model parameter values based on the selected parameter values to obtain the corresponding parameter update result specifically includes: Sort the weights of the parameter values corresponding to the i-th network layer of the local model in descending order to obtain the sorted weights corresponding to this network layer; Use the parameter values corresponding to the first g(i) weights in the sorted weights corresponding to the i-th network layer as the parameter values used to update the updated global model parameter values, where g(i)=k×z(i), and k is a set coefficient; Based on the parameter values used to update the updated global model parameter values in the i-th network layer, obtain the binary mask vector corresponding to the parameters of this network layer, where if a certain parameter value corresponding to the i-th network layer is the parameter value used to update the updated global model parameter values, the value at the corresponding position in the binary mask vector is 1, otherwise, it is 0; Multiply the binary mask vector corresponding to the parameters of the i-th network layer by the updated global model parameter values corresponding to this network layer to obtain the parameter update result corresponding to the i-th network layer.
6. The method according to claim 4, characterized in that The current intermediate global model parameter values satisfy the following conditions: u r = u r c / max(1, (∑ n r=1 (u r c ) 2 ) 1 / 2 ) / C) + ε; Among them, u r is the r-th parameter value in the current intermediate global model parameter values, u r c is the r-th parameter value in the current parameter update result, C is the clipping threshold, ε is the added noise, and ε is the noise sampled from a Gaussian distribution with a mean of 0 and a variance of βC 2 / |Q|, where β is a hyperparameter, Q is the number of clients currently participating in the global model training, and || represents taking the absolute value.
7. The method according to claim 1, wherein The local model is a convolutional neural network.
8. The method according to claim 6, wherein The current global model parameter values satisfy the following conditions: b r = (1 / Q) ∑ n r=1 u r ; Among them, b r is the r-th parameter value in the current global model parameter values.
9. A personalized federated learning optimization system under differential privacy protection, characterized in that, The system is deployed on the client side, and the system includes: A data acquisition module, configured to acquire the initial global model parameter values from the server and load the initial global model parameter values into a pre-built local model to obtain an initialized local model with loaded parameters; A parameter fusion module, configured to, in response to receiving the current global model parameter values sent by the server, select the current local model parameter values that need to be fused with the received current global model parameter values based on the weights of the current local model parameter values, to obtain local model parameter values that have fused the current global model parameter values as the current fusion parameter values; the current global model parameter values are obtained by aggregating the current intermediate global model parameter values currently received by the server; A local model parameter update module, configured to train the current local model by using local data and the current local model parameter values to update the current local model parameter values to obtain updated local model parameter values; wherein, the update of the local model parameter values is determined based on a preset loss, and the preset loss includes cross-entropy loss and a loss determined based on the current local model parameter values and the current fusion parameter values; the current local model is the initialized local model; A first global model parameter update module, configured to train the current local model by using local data and the current global model parameter values to update the current global model parameter values to obtain updated global model parameter values; A second global model parameter update module, configured to select the parameter values for updating the updated global model parameter values based on the weights of the current local model parameter values, and update the updated global model parameter values based on the selected parameter values to obtain corresponding parameter update results as the current parameter update results; and clip and add noise to the current parameter update results as the current intermediate global model parameter values and send them to the server.