Differential privacy federal learning method, computer equipment, storage medium and program product

By judging the importance of the layer based on the weight distribution histogram in the federated learning model and injecting noise, and using quantile clipping gradients, the problem of privacy and performance consideration in the differential privacy federated learning method is solved, and the stability of the model is improved. robustness.

CN118917443APending Publication Date: 2024-11-08GUANGXI NORMAL UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410887528.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-03
Publication Date
2024-11-08

AI Technical Summary

Technical Problem

The existing differential privacy federated learning method cannot take into account privacy and model performance, and the heterogeneity of model parameter size during the training phase leads to performance degradation.

Method used

By obtaining the weight distribution histogram of the federated learning model in the client, we judge the importance of each layer and inject more noise into the unimportant layer; at the same time, we use quantiles to crop the gradients to adaptively deal with the heterogeneity of the gradients sex.

Benefits of technology

It realizes that the federated learning model with good performance is trained while meeting privacy requirements during the training process, reducing the performance degradation caused by the heterogeneity of training parameters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118917443A_ABST
    Figure CN118917443A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of artificial intelligence, in particular to a differential privacy federated learning method, computer equipment, a storage medium and a program product.The differential privacy federated learning method comprises the steps that a weight distribution histogram of a federated learning model in a client side is obtained, and a layer of the federated learning model is judged according to the distribution histogram; and judging the importance of each layer, obtaining relatively important and unimportant layers in the model, and selecting not to inject noise into the important layers and to inject noise into the unimportant layers containing less gradient information, so that the layers have higher security. Through the method, the federal learning model can meet the privacy requirement in the training process, and meanwhile, a federal learning model with relatively good performance can be trained.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to the field of artificial intelligence design, and in particular to a differential privacy federated learning method, computer equipment, storage medium and program product. [Background technology]

[0002] Federated learning is a distributed machine learning method that aims to solve the problems of data privacy protection and data decentralization. It allows multiple parties (usually devices, terminals or edge nodes, etc.) to jointly train machine learning models without transmitting the original data to a central server. However, federated learning may not always provide privacy and robustness guarantees at the same time. Although private data never leaves its owner, training data can be restored from the exchanged model parameters through attacks such as gradient reversal, reconstruction attacks, membership inference and attribute inference attacks.

[0003] In response to possible attacks on federated learning systems, existing methods can further ensure the security of federated learning systems through differential privacy. In the current federated learning algorithms based on differential privacy, the same noise is injected into each layer of the model for perturbation. However, the size of the trained model parameters is heterogeneous at different training stages. For example, the size of the model gradient will change with the training rounds and eventually tend to a fixed value. Therefore, due to the heterogeneity of the gradient, uniform noise may have a huge impact on the performance of the model. [Summary of the invention]

[0004] In order to solve the problem that the existing differential privacy federated learning method cannot take into account both privacy and model performance, the present invention provides a differential privacy federated learning method. A differential privacy federated learning method includes the following steps:

[0005] Deploy the federated learning model on the client through the server;

[0006] Provide sample data in each client to perform gradient descent iterative training on the deployed federated learning model;

[0007] During the iterative training process, the gradient of the sample data is calculated and the gradient is clipped;

[0008] During the iterative training process, obtain the weight distribution histogram of each layer of the neural network in the federated learning model after the previous iteration;

[0009] Set the layer selection threshold and number judgment value to obtain the number of weights greater than the layer selection threshold in the weight distribution histogram of each layer;

[0010] When the number of weights is less than the number judgment value, noise is added to the gradient information of the layer corresponding to the weight distribution histogram;

[0011] In this round of iteration, the federated learning model is updated according to the gradient information after adding noise;

[0012] After the iteration, the client's local model is obtained; the local model is transmitted to the server, and the server aggregates the local model to obtain the trained federated learning model.

[0013] Preferably, a learning rate is set, and the federated learning model after adding noise is controlled to perform gradient descent according to the learning rate to update the obtained local model.

[0014] Preferably, the server initializes model parameters of the federated learning model and transmits the initialized model parameters to each client;

[0015] The client updates the local model to obtain updated model parameters, and transmits the updated model parameters to the server;

[0016] The server aggregates the updated model parameters and sends them to the client, and the federated learning model is iterated cyclically between the client and the server.

[0017] Preferably, the federated learning models transmitted to the server are weighted and averaged to obtain an aggregated federated learning model.

[0018] Preferably, when noise is added to the gradient information, the noise is Gaussian noise or Laplace noise.

[0019] Preferably, the federated learning model is trained iteratively with gradient descent in each client, the norm of the gradient of the federated learning model after the last iteration is obtained, and the quantile of the norm is set as the clipping threshold;

[0020] In this round of iteration, when the norm of the gradient of the federated learning model is greater than the clipping threshold, the gradient is reduced by dividing the norm by the clipping threshold to obtain the federated learning model after gradient descent.

[0021] Preferably, when selecting data in a handwritten digital dataset in the client to calculate the gradient, the layer selection threshold is set to 0.3, or when selecting data in a federated extended handwritten digital dataset to calculate the gradient, the layer selection threshold is set to 0.1.

[0022] In order to solve the above technical problems, the present invention also provides a computer device, including a storage device, a processor, and a computer program stored on the storage device, and the processor executes the computer program to implement the steps of the above differential privacy federated learning method.

[0023] In order to solve the above technical problems, the present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the above differential privacy federated learning method are implemented.

[0024] In order to solve the above technical problems, the present invention also provides a computer program product including a computer program / instructions, which implement the steps of the above differential privacy federated learning method when executed by a processor.

[0025] Compared with the prior art, the differential privacy federated learning method, computer device, storage medium and program product of the present invention have the following advantages:

[0026] 1. The present invention obtains the weight distribution histogram of the federated learning model in the client, judges the layers of the federated learning model according to the distribution histogram, and judges the importance of each layer. For the federated learning model itself, not every layer needs to be injected with noise for disturbance. There are relatively important and unimportant layers in the model. If noise is injected into the important layers, the performance of the model will be greatly affected. Important layers often contain more gradient information. If noise is added to them, it will have a greater impact on the performance of the model. On the contrary, for layers containing less gradient information, they will not be so important in the local training of the federated learning model, so more noise can be injected into them, so that the layer has higher security. Through the above method, the federated learning model can meet the privacy requirements during the training process, and at the same time, a federated learning model with better performance can be trained.

[0027] 2. The differential privacy federated learning method of the present invention also performs dynamic gradient clipping on the deployed federated learning model in each client, obtains the norm of the gradient of the federated learning model after the previous round of iteration, and sets the quantile of the norm as the clipping threshold; in this round of iteration, when the norm of the gradient of the federated learning model is greater than the clipping threshold, the gradient is reduced according to the norm divided by the clipping threshold value to obtain the federated learning model after gradient descent.

[0028] The model parameter sizes of the federated learning model are heterogeneous at different training stages. For example, the size of the model gradient will change with the change of training rounds and eventually tend to a fixed value. The present invention limits the gradient by using quantiles, thereby reducing the impact of outliers on the gradient. Since the gradient is heterogeneous, adaptive gradient clipping is performed for different numbers of iterations, effectively reducing the problem of model performance degradation caused by the heterogeneity of training parameters.

[0029] 3. The present invention also provides a computer device, which has the same beneficial effects as the above-mentioned differential privacy federated learning method, which will not be elaborated here.

[0030] 4. The present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed, it implements the above-mentioned differential privacy federated learning method and has the same beneficial effects as the above-mentioned differential privacy federated learning method, which will not be repeated here.

[0031] 5. The present invention also provides a computer program product, which has the same beneficial effects as the above-mentioned differential privacy federated learning method, which will not be elaborated here.

Brief Description of the Drawings

[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0033] Figure 1 It is a step flow chart of a differential privacy federated learning method provided by the first embodiment of the present invention.

[0034] Figure 2 This is a comparison chart of accuracy rates of different thresholds on the FEMNIST dataset provided by the first embodiment of the present invention.

[0035] Figure 3 This is a comparison chart of accuracy rates of different thresholds on the MNIST dataset provided by the first embodiment of the present invention.

[0036] Figure 4 This is a comparison chart of the accuracy of different quantile values ​​on the FEMNIST dataset provided by the first embodiment of the present invention.

[0037] Figure 5 This is a comparison chart of the accuracy of different quantile values ​​on the MNIST data set provided by the first embodiment of the present invention.

[0038] Figure 6 This is a comparison chart of the accuracy of the FEMNIST dataset under different privacy budgets provided by the first embodiment of the present invention.

[0039] Figure 7 This is a comparison chart of the accuracy of the MNIST dataset under different privacy budgets provided by the first embodiment of the present invention.

[0040] Figure 8 It is a schematic diagram of the structure of a computer device provided by the second embodiment of the present invention.

[0041] Description of the accompanying drawings:

[0042] 20. Computer equipment;

[0043] 201. Memory; 202. Processor; 203. Computer program. [Specific implementation method]

[0044] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and implementation examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0045] The federated learning algorithm is a privacy-preserving machine learning method that aims to train a global model while keeping the original data of the participating parties (such as mobile devices or distributed servers) confidential. Unlike traditional centralized learning methods, federated learning distributes the model training process across multiple local devices or servers and cooperates only by exchanging model parameters through communication. The core idea of ​​federated learning is to use decentralized data for model training while keeping the data private on local devices. The differential privacy federated learning method combines the concepts of federated learning and differential privacy, aiming to protect the privacy of individuals while still enabling effective model training.

[0046] Differential Privacy is a privacy protection mechanism that aims to protect the privacy of individuals when analyzing personal data or publishing statistical results, and to prevent malicious users from obtaining sensitive information through analysis results. Differential privacy introduces certain noise or disturbances in statistical calculations, making it impossible to accurately infer the specific information of individuals. The core principle of differential privacy is to ensure that the participation of personal data elements does not have an excessive impact on the final statistical results. Specifically, differential privacy masks the contribution of personal data by adding randomized noise, so that attackers cannot learn the specific contribution or sensitive information of individuals from the results. The addition of this randomized noise is independent of the individual's input data and the implementation of the algorithm, so it can protect privacy.

[0047] In the current federated learning algorithm based on differential privacy, the same noise is injected into each layer of the model for perturbation. To solve the problem that the existing differential privacy federated learning method cannot balance privacy and model performance, please refer to Figure 1 The first embodiment of the present invention provides a differential privacy federated learning method. A differential privacy federated learning method includes the following steps:

[0048] S1: Deploy the federated learning model on the client through the server;

[0049] S2: Provide sample data in each client to perform gradient descent iterative training on the deployed federated learning model;

[0050] During the iterative training process, the gradient of the sample data is calculated and the gradient is clipped;

[0051] S3: During the iterative training process, obtain the weight distribution histogram of each layer of the neural network in the federated learning model after the previous iteration;

[0052] Set the layer selection threshold and number judgment value to obtain the number of weights greater than the layer selection threshold in the weight distribution histogram of each layer;

[0053] When the number of weights is less than the number judgment value, noise is added to the gradient information of the layer corresponding to the weight distribution histogram;

[0054] S4: In this round of iteration, the federated learning model is updated according to the gradient information after adding noise;

[0055] After the iteration, the client's local model is obtained; the local model is transmitted to the server, and the server aggregates the local model to obtain the trained federated learning model.

[0056] The present invention obtains the weight distribution histogram of the federated learning model in the client, judges the layers of the federated learning model according to the distribution histogram, and judges the importance of each layer. For the federated learning model itself, not every layer needs to be injected with noise for disturbance. There are relatively important and unimportant layers in the model. If noise is injected into the important layers, the performance of the model will be greatly affected. Important layers often contain more gradient information. If noise is added to them, the performance of the model will be greatly affected. On the contrary, for layers containing less gradient information, they will not be so important in the local training of the federated learning model. Therefore, more noise can be injected into them, so that the layer has higher security. Through the above method, the federated learning model can meet the privacy requirements during the training process, and at the same time, a federated learning model with better performance can be trained.

[0057] It should be noted that the federated learning model is a neural network model. In standard federated learning, the gradient is the derivative of the model parameters calculated based on local data and is used to guide the update of the model parameters. When calculating the gradient of the neural network model trained on each client, the introduction of the differential privacy mechanism can protect the user's privacy by adding noise to the gradient. After the gradient is added with noise, the gradient of each client becomes incompletely certain, thereby reducing the risk of sensitive information leakage.

[0058] It should be noted that the weight distribution histogram refers to the use of a histogram to represent the distribution of weights in the model. After the weights are obtained in this method, the weight distribution can also be represented by other means, such as heat maps, network diagrams, scatter plots, and waveform diagrams. In machine learning and deep learning tasks, the weights of the model are continuously updated during the training process through optimization algorithms (such as gradient descent). Histograms can help us observe and understand the value range and distribution of weights.

[0059] Specifically, step S2 includes step S21:

[0060] Perform gradient descent iterative training on the federated learning model in each client, obtain the norm of the gradient of the federated learning model after the last iteration, and set the quantile of the norm as the clipping threshold;

[0061] In this round of iteration, when the norm of the gradient of the federated learning model is greater than the clipping threshold, the gradient is reduced by dividing the norm by the clipping threshold to obtain the federated learning model after gradient descent.

[0062] The model parameter sizes of the federated learning model are heterogeneous at different training stages. For example, the size of the model gradient will change with the change of training rounds and eventually tend to a fixed value. The present invention can prevent gradient explosion or gradient disappearance by limiting the gradient using quantiles, thereby improving the stability and robustness of the algorithm.

[0063] At the same time, the use of quantiles can also avoid large fluctuations in gradients and the impact of outliers on gradients, thereby accelerating the convergence of the algorithm. Since gradients are heterogeneous, adaptive gradient clipping is performed for different numbers of iterations, effectively reducing the problem of model performance degradation caused by the heterogeneity of training data.

[0064] Furthermore, the quantile selection process is shown in formula (1), and the gradient clipping process is shown in formula (2). In formula (1), Represents the threshold of gradient clipping of client b in the tth round of training, and C0 is the initial value. Represents the L2 norm of the gradient obtained by the client after a round of training. Represents the data sample The gradient value obtained after training clipping. Represents data samples The gradient value obtained after training clipping. Algorithm 1 shows the specific algorithm flow.

[0065]

[0066] The pseudo code of Algorithm 1 is as follows:

[0067] Input: privacy budget (ε, δ), number of iterations T, learning rate η, initial gradient clipping threshold C0, gradient clipping threshold quantile γ c , the number of clients participating in the training B, the initial global model parameter θ0, and the batch size K in each round of training

[0068] Output: Model parameters θ t+1

[0069] 1. Server-side execution:

[0070] 2. Initialize global model parameters θ0

[0071] 3. Broadcast the global model parameter θ0 to B clients participating in the training

[0072] 4.for t=1,2,…,T do

[0073] 5.for b=1,2,…,B do

[0074] 6. Update of local model parameters

[0075] 7. Upload the updated model parameters to the server

[0076] 8.end for

[0077] 9.end for

[0078] 10. The server uses the Fedavg algorithm to aggregate the model parameters trained by each client

[0079] 11.

[0080] 12. The global model parameters θ after aggregation t+1 Broadcast to each client

[0081] 13. Return θ t+1

[0082] 14. Client execution:

[0083] 15. Receive the global model parameters θ sent by the server t

[0084] 16.for t=1,2,…,T

[0085] 17. Calculate the gradient threshold for this training round

[0086]

[0087] 18.for

[0088] 19.for

[0089] 20.

[0090] twenty one.

[0091] twenty two.

[0092] twenty three.

[0093] 24.end for

[0094] 25. end for

[0095] 26.end for

[0096] 27.

[0097] 28.Return

[0098] Specifically, when noise is added to the gradient information, the noise is Gaussian noise or Laplace noise. Preferably, this first embodiment chooses to use Gaussian noise, and the addition of Gaussian noise can help prevent the model from overfitting the training data during the training process to a certain extent. Overfitting refers to the phenomenon that the model performs well on the training data but performs poorly on the unseen test data. By introducing Gaussian noise in the model update, the robustness and generalization ability of the model can be increased, which helps to alleviate the overfitting phenomenon and improve the generalization performance of the model.

[0099] Specifically, step S4 also includes step S41:

[0100] Set the learning rate, control the gradient descent of the federated learning model after adding noise according to the learning rate, and update the local model.

[0101] Gradient descent is an optimization algorithm used in machine learning to update model parameters to minimize the loss function. In differential privacy federated learning, the gradient descent algorithm is used on the client to update the local model. The model parameters on the client are updated using the calculated gradient through the gradient descent algorithm. The basic idea of ​​the gradient descent algorithm is to iteratively adjust the model parameters along the gradient direction to gradually reduce the value of the loss function.

[0102] Furthermore, by using the gradient descent algorithm to update the local model on each client, the model can be trained using local data while protecting user privacy, and the parameters of the trained local model can be aggregated to the server for further model aggregation and parameter update, ultimately obtaining a global model (i.e., the aggregated federated learning model). This distributed training method not only protects user privacy, but also achieves the goal of federated learning.

[0103] After the server weights and averages the updated model parameters, it sends the aggregated values ​​to the client. The federated learning model is iterated between the client and the server.

[0104] Through multiple rounds of iteration, the global model can gradually converge and improve performance. The role of the loop iteration between the client and the server is to jointly learn the scattered data to obtain a global model without uploading the original data set to the server. This can better protect data privacy and solve problems in the data set. In addition, the loop iteration can also reduce communication overhead, reduce data transmission volume, and improve efficiency.

[0105] Specifically, when the data in the handwritten digit dataset is selected in the client to calculate the gradient, the layer selection threshold is set to 0.3, or when the data in the federated extended handwritten digit dataset is selected to calculate the gradient, the layer selection threshold is set to 0.1.

[0106] It should be noted that the handwritten digit dataset (MNIST dataset) is a standard dataset of handwritten digit images. It is one of the most commonly used datasets in the field of machine learning and computer vision. The MNIST dataset contains a set of grayscale images consisting of handwritten digits from 0 to 9. Each image is a 28x28 pixel, single-channel grayscale image, representing grayscale values ​​between 0 and 255. Each image in the dataset has been preprocessed and normalized so that the digits are centered in the image and have a consistent size.

[0107] The Federated Extended Handwritten Digits Dataset (FEMNIST dataset) is an image dataset for federated learning research. It is an extension and refinement of the traditional MNIST dataset. The FEMNIST dataset contains images of handwritten characters (including numbers and letters) and is divided according to different users (writers) to simulate the situation in which different clients have different data distributions in a federated learning environment.

[0108] This first embodiment also verifies the differential privacy federated learning method through experiments. In the first experiment, the number of layers of injected noise and the performance of the model under different layer selection thresholds were tested, and the optimal layer selection threshold was also determined. Table 1 shows the number of layers of the model that need to be injected with noise under different layer selection thresholds. It can be seen from the table that as the layer selection threshold increases, the number of layers of injected noise is also increasing. Table 1 is shown below:

[0109]

[0110] Table 1 The number of noise adding layers corresponding to different layer selection thresholds

[0111] See also Figure 2 and Figure 3 , this embodiment also tests the performance of the model corresponding to different layer selection thresholds under the same privacy budget ε=30. 02 is the experimental result on the FEMNIST dataset, and 03 is the experimental result tested on the MNIST dataset. It can be seen from the figure that as the layer selection threshold continues to decrease, the accuracy of the model is also decreasing. This is because as the threshold continues to decrease, the number of layers that inject noise into the model becomes smaller and smaller, so the model is less affected by noise. Although the model has the highest accuracy when C=0, it cannot play a privacy protection effect. From this experiment, it can be concluded that for different data sets, the thresholds that make the model perform best are different. On the FEMNIST dataset, the layer selection threshold C=0.1 is the best threshold, and on the MNIST dataset, the layer selection threshold C=0.3 is the best threshold. The optimal layer selection threshold can not only protect the privacy security of the model parameters, but also enable the model to achieve a better performance.

[0112] See also Figure 4 and Figure 5 In the second experiment, this embodiment uses the thresholds C=0.1 and C=0.3 as the layer selection thresholds to explore the impact of different quantiles on the model. From 04 and 05, it can be concluded that as the quantile value becomes smaller and smaller, the accuracy of the model decreases. This is because under a large amount of training data, a larger quantile value will introduce more gradient information, so that the model can adapt to the changes in the training data and increase the accuracy of the model. At the same time, the optimal quantile was determined to be η=0.9 in this experiment.

[0113] See also Figure 6 and Figure 7In the third experiment, the injection of adaptive noise is compared with the injection of fixed noise and no noise injection under the optimal layer selection threshold and quantile. The comparison results are shown in 6 and 07. 06 and 07 show the accuracy that the model can achieve when the number of iterations is 140. ε is the privacy budget, the yellow column represents the accuracy under fixed noise, and the green and purple columns represent the accuracy of adaptive noise and no noise injection, respectively. The injection of noise has a great impact on the model after perturbation, but after the adjustment of adaptive noise, the impact of noise on the model will be reduced. In terms of model performance, the accuracy of dynamic noise is better than that of fixed noise. It has been theoretically proven that dynamic noise can also ensure the security of the model.

[0114] Finally, the proposed method is compared with DP-FedAvg, AE-DPFL, PPSGD, DDGauss and BLUR+LUS algorithms. The comparison results are shown in Table 0. It can be seen from the table that the performance of the proposed method is better than other methods. Compared with other methods, the proposed method can improve the accuracy by about 1%. Except for the proposed method, the number of iterations of the other methods is 1000 rounds. The proposed algorithm can outperform the other methods by about 1% when the number of iterations is half that of the other methods. Table 2 is shown below:

[0115]

[0116] Table 2 Comparison results of the proposed algorithm with other methods

[0117] The first embodiment of the present invention provides a differential privacy federated learning method, which obtains the importance of each layer in the federated learning model in the client. During the training process, noise is not injected into important layers. On the contrary, for unimportant layers containing less gradient information, more noise is injected into them, so that the layer has higher security. Through the above method, the federated learning model can meet the privacy requirements during the training process, and at the same time, a federated learning model with better performance can be trained. Since the model parameter size of the federated learning model is heterogeneous at different training stages, the present invention can prevent gradient explosion or gradient disappearance by limiting the gradient using quantiles, thereby improving the stability and robustness of the algorithm, and effectively reducing the problem of model performance degradation caused by the heterogeneity of training data.

[0118] See also Figure 8 In order to solve the above technical problems, the second embodiment of the present invention also provides a computer device 20, including a storage device 201, a processor 202 and a computer program 203 stored in the storage device 201, and the processor 202 executes the computer program 203 to implement the steps of the above differential privacy federated learning method.

[0119] The computer device 20 provided by the present invention has the same beneficial effects as the above-mentioned differential privacy federated learning method, which will not be described in detail here.

[0120] In order to solve the above technical problems, the third embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above differential privacy federated learning method are implemented.

[0121] The computer-readable storage medium provided by the present invention has the same beneficial effects as the above-mentioned differential privacy federated learning method, which will not be elaborated here.

[0122] In order to solve the above technical problems, the fourth embodiment of the present invention also provides a computer program product including a computer program / instructions, which implement the steps of the above differential privacy federated learning method when executed by a processor.

[0123] The computer program product provided by the present invention has the same beneficial effects as the above-mentioned differential privacy federated learning method, which will not be described in detail here.

[0124] It is understandable that, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part, and / or installed from a removable medium. When the computer program is executed by the central processing unit (CPU), the above functions defined in the method of the present application are executed. It should be noted that the computer-readable medium described in the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. Computer-readable storage media, for example, include but are not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection with one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, an apparatus or a device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, an apparatus or a device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0125] The computer program code for performing the operation of the present application can be written in one or more programming languages ​​or a combination thereof, and the programming language includes object-oriented programming languages ​​such as Java, Smalltalk, C++, and also includes conventional procedural programming languages ​​such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on the remote computer, or completely on the remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).

[0126] In the embodiments provided by the present invention, it should be understood that "B corresponding to A" means that B is associated with A, and B can be determined according to A. However, it should also be understood that determining B according to A does not mean determining B only according to A, and B can also be determined according to A and / or other information.

[0127] It should be understood that the "one embodiment" or "an embodiment" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present invention. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. Those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present invention.

[0128] In various embodiments of the present invention, it should be understood that the size of the serial numbers of the above-mentioned processes does not mean the necessary order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0129] The flow chart and block diagram in the accompanying drawings of the present invention illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which is determined based on the functions involved. It should be particularly noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented by a dedicated hardware-based system that performs a specified function or operation, or can be implemented by a combination of dedicated hardware and computer instructions.

[0130] Compared with the prior art, the differential privacy federated learning method, computer device, storage medium and program product of the present invention have the following advantages:

[0131] 1. The present invention obtains the weight distribution histogram of the federated learning model in the client, judges the layers of the federated learning model according to the distribution histogram, and judges the importance of each layer. For the federated learning model itself, not every layer needs to be injected with noise for disturbance. There are relatively important and unimportant layers in the model. If noise is injected into the important layers, the performance of the model will be greatly affected. Important layers often contain more gradient information. If noise is added to them, it will have a greater impact on the performance of the model. On the contrary, for layers containing less gradient information, they will not be so important in the local training of the federated learning model, so more noise can be injected into them, so that the layer has higher security. Through the above method, the federated learning model can meet the privacy requirements during the training process, and at the same time, a federated learning model with better performance can be trained.

[0132] 2. The differential privacy federated learning method of the present invention also performs dynamic gradient clipping on the deployed federated learning model in each client, obtains the norm of the gradient of the federated learning model after the previous round of iteration, and sets the quantile of the norm as the clipping threshold; in this round of iteration, when the norm of the gradient of the federated learning model is greater than the clipping threshold, the gradient is reduced according to the norm divided by the clipping threshold value to obtain the federated learning model after gradient descent.

[0133] The model parameter sizes of the federated learning model are heterogeneous at different training stages. For example, the size of the model gradient will change with the change of training rounds and eventually tend to a fixed value. The present invention limits the gradient by using quantiles, thereby reducing the impact of outliers on the gradient. Since the gradient is heterogeneous, adaptive gradient clipping is performed for different numbers of iterations, effectively reducing the problem of model performance degradation caused by the heterogeneity of training parameters.

[0134] 3. The present invention also provides a computer device, which has the same beneficial effects as the above-mentioned differential privacy federated learning method, which will not be elaborated here.

[0135] 4. The present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed, it implements the above-mentioned differential privacy federated learning method and has the same beneficial effects as the above-mentioned differential privacy federated learning method, which will not be repeated here.

[0136] 5. The present invention also provides a computer program product, which has the same beneficial effects as the above-mentioned differential privacy federated learning method, which will not be elaborated here.

[0137] The above is a detailed introduction to a differential privacy federated learning method disclosed in an embodiment of the present invention. This article uses specific examples to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention, and any modifications, equivalent substitutions and improvements made within the principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A differential privacy federated learning method, characterized in that: The following steps are involved: Deploy the federated learning model on the client through the server; Providing sample data in each of the clients to perform gradient descent iterative training on the deployed federated learning model; During the iterative training process, the gradient of the sample data is calculated and the gradient is clipped; During the iterative training process, a weight distribution histogram of each layer of the neural network in the federated learning model after the last iteration is obtained; Setting a layer selection threshold and a number judgment value to obtain the number of weights in the weight distribution histogram of each layer that are greater than the layer selection threshold; When the number of the weights is less than the number judgment value, adding noise to the gradient information of the layer corresponding to the weight distribution histogram; In this round of iteration, the federated learning model is updated according to the gradient information after adding noise; After the iteration, the local model of the client is obtained; the local model is transmitted to the server, and the server aggregates the local model to obtain a trained federated learning model.

2. A differential privacy federated learning method according to claim 1, characterized in that: The following steps are involved: The learning rate is set, and the federated learning model after adding noise is controlled to perform gradient descent according to the learning rate to update the obtained local model.

3. A differential privacy federated learning method according to claim 2, characterized in that: The following steps are involved: The server initializes the model parameters of the federated learning model, and transmits the initialized model parameters to each of the clients; The client updates the local model to obtain updated model parameters, and transmits the updated model parameters to the server; The server aggregates the updated model parameters and sends them to the client, and the client and the server cyclically iterate the federated learning model.

4. A differential privacy federated learning method according to claim 3, characterized in that: The following steps are involved: The federated learning models transmitted to the server are weighted and averaged to obtain an aggregated federated learning model.

5. A differential privacy federated learning method according to claim 4, characterized in that: The following steps are involved: When the noise is added to the gradient information, the noise is Gaussian noise or Laplace noise.

6. A differential privacy federated learning method according to claim 5, characterized in that: The following steps are involved: Performing the gradient descent iterative training on the federated learning model in each of the clients, obtaining the norm of the gradient of the federated learning model after the last round of iteration, and setting the quantile of the norm as a clipping threshold; In this round of iteration, when the norm of the gradient of the federated learning model is greater than the clipping threshold, the gradient is reduced by dividing the norm by the clipping threshold to obtain the federated learning model after gradient descent.

7. A differential privacy federated learning method according to claim 6, characterized in that: The following steps are involved: When the gradient is calculated by selecting data in a handwritten digital dataset in the client, the layer selection threshold is set to 0.3, or when the gradient is calculated by selecting data in a federated extended handwritten digital dataset, the layer selection threshold is set to 0.

1.

8. A computer device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of a differential privacy federated learning method as described in any one of claims 1 to 7.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of a differential privacy federated learning method as described in any one of claims 1 to 7 are implemented.

10. A computer program product comprising a computer program / instructions, characterized in that: When the computer program / instruction is executed by a processor, the steps of a differential privacy federated learning method as described in any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Heterogeneous federated learning-oriented adaptive differential privacy protection method

    CN119293861A