Heterogeneous federated learning-oriented adaptive differential privacy protection method
By performing hierarchical differentiation and noise processing on the model in federated learning, combining regularization and momentum mechanisms, the negative impact of traditional differential privacy federated learning methods on model performance is solved, and more flexible privacy protection and higher model performance is achieved.
Patent Information
- Application Number
- CN202411845784.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2044-12-16
AI Technical Summary
The traditional differential privacy federated learning method has often negatively impacted the convergence speed and accuracy of the model due to the introduction of noise. How to balance privacy protection and model performance has become a key challenge.
Adaptive differential privacy federated learning method based on regularization and momentum mechanisms are adopted, and different noise intensities are set according to the importance of the hierarchy to reduce the negative impact of noise on model accuracy. , and improve model performance.
It realizes more flexible privacy protection, reduces the impact of noise on model performance, optimizes the convergence speed and accuracy of the model, and ensures stability and adaptability in different data environments.
Smart Images

Figure CN119293861A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of federated learning, and more specifically, relates to an adaptive differential privacy protection method for heterogeneous federated learning. Background Art
[0002] Federated Learning (FL) is a distributed machine learning framework that enables multiple distributed clients to collaboratively train shared models while maintaining data locality, thereby significantly reducing the risk of privacy leakage caused by data concentration. However, with the widespread application of deep learning models in various tasks (such as signal processing, network modeling, and traffic analysis), studies have shown that even in a federated learning framework, the trained models may still leak users' sensitive information and be exposed to potential privacy threats. Therefore, Differential Privacy (DP) technology has become an important means to protect data privacy in federated learning.
[0003] Chinese patent document CN118674014A discloses a privacy-preserving multi-level heterogeneous longitudinal federated learning method that uses two-level data distribution: For geographically dispersed data and different entities within each region each having different characteristics of a local sample set, the present invention allows effective model training in such an environment. Model heterogeneity processing: For the heterogeneity of data sets caused by different label distributions and model architectures between regions, the present invention performs collaborative training through a specific mechanism. It allows participants with different data characteristics in heterogeneous regions to collaborate in training neural network models without sharing local data, and further uses differential privacy technology to enhance privacy.
[0004] The core idea of differential privacy is to add noise to the model update so that attackers cannot accurately infer the specific content of the original data from the analysis results, thereby effectively protecting user privacy. In the federated learning scenario, differential privacy introduces an appropriate amount of noise into the model parameters uploaded by the client. However, traditional differential privacy federated learning methods usually have a negative impact on the performance of the model due to the introduction of noise, especially reducing the convergence speed and accuracy of the model. Therefore, how to strike a balance between privacy protection and model performance has become a key challenge in differential privacy federated learning. Summary of the invention
[0005] The present invention aims to overcome at least one defect of the above-mentioned prior art and provide an adaptive differential privacy federated learning method based on regularization and momentum mechanism to solve the problem that the traditional differential privacy federated learning method usually has a negative impact on the performance of the model due to the introduction of noise, especially reducing the convergence speed and accuracy of the model. Specifically, adaptive noise is introduced at different levels of the model. There are differences in the contribution of each level of the model to the overall learning effect. In order to minimize the damage to key features while adding noise, this paper differentially adds noise to different parts based on the importance of the model level, that is, less noise is applied to more important levels and more noise is applied to secondary levels. This adaptive noise addition strategy not only enhances the flexibility of privacy protection, but also effectively reduces the negative impact of noise on model accuracy, thereby optimizing model performance.
[0006] The present invention provides a device based on an adaptive differential privacy protection method for heterogeneous federated learning.
[0007] The present invention also provides a computer-readable storage medium for implementing the above method.
[0008] The detailed technical scheme of the present invention is as follows: An adaptive differential privacy protection method for heterogeneous federated learning, the method comprising: S1. Perform layered processing on the deep neural network of the local model, set different loss functions for each layer and update the local model loss function for optimization to better capture the learning objectives at each level; S2: Aggregate the optimized deep neural network to obtain the initial global parameters of the central server, and the central server sends the global parameters; the local model receives the global parameters, and then calculates the sample gradient in the current iteration round based on the local data set; S3, applying the gradient descent algorithm, obtaining the local gradient based on the sample gradient calculation and updating the local model parameters, and calculating the corresponding loss value of the local model; S4. Allocate the privacy budget of each layer according to the calculated loss value, and perform noise processing on the local model parameters; S5. Upload the updated local model parameters, i.e., the model parameters with noise processing, to the central server for parameter aggregation, and send the updated global model parameters to each client, and iterate and update until the iteration threshold is reached.
[0009] Furthermore, the S1 specifically includes: S11. Perform layered processing on the local model’s deep neural network, dividing the local model’s deep neural network into convolutional layers and fully connected layers ,Right now ; S12. Set different loss functions according to the characteristics and requirements of different layers to optimize the model: Add a piecewise regularization term to the convolutional layer , in order to control the change of convolutional layer parameters: (1); In formula (1), the total number of global iterations is set to , the total number of local iterations is , in In the round iteration, ; Representing the client In the tth global iteration, The convolutional layer parameters after local iterations, k≤ ,and represents the convolution layer parameters of the t-1th global iteration. This regularization term effectively reduces the negative impact of high noise on feature extraction capabilities by limiting the update amplitude of the convolution layer parameters. is the clipping threshold; Adding a momentum term to the fully connected layer , to speed up the convergence of the fully connected layer: (2); In formula (2), Representing the client In the tth global iteration, The fully connected layer parameters after the local iteration, and Represents the client In the tth global iteration, The fully connected layer parameters after the local iteration; S13. Update local model loss function : (3); In formula (3), , is the cross entropy loss function; , are the coefficients controlling the regularization mechanism and momentum mechanism respectively, B represents the total number of samples in the local dataset, and bi represents the bth sample in the local dataset of the i-th client.
[0010] Furthermore, the local model receives the global parameters and then calculates the sample gradient in the current iteration round based on the local data set, specifically including: In the local model, for the client , using a local dataset Get the sample gradient in each iteration round and set the total number of iterations to , in In the global iteration, , Client In the The sample gradient in the global iteration is : (4); In formula (4), Represents the client In the Model parameters in round global iteration, Represents the client In the The global iteration starts from its local dataset The sample is sampled from and ,Right now: (5); (6); In formulas (5)~(6), Representative The first iteration The model parameters of the convolutional layer of client i in the local iteration, Representative The model parameters of the global convolutional layer at the iteration, Representative The first iteration The model parameters of the fully connected layer of client i in the local iteration, Representative The first iteration Model parameters of the fully connected layer of client i at the local iteration; The local gradient is calculated using the sample gradient: (7); (8); In formulas (7)~(8): and Respectively represent the client In the The first iteration Local gradients of convolutional and fully connected layers at the local iteration; Represents the client Local dataset The total number of samples in .
[0011] Furthermore, the S3 specifically includes: (9); (10); In formulas (9)~(10): and Respectively represent the updated The client side of the local iteration The convolutional layer and fully connected layer parameters; and Respectively represent the learning rates of the convolutional layer and the fully connected layer during training; Then, through the loss function Calculate the loss value of the convolutional layer and the fully connected layer and .
[0012] Furthermore, the S4 specifically includes: When the privacy budget allocated to the convolutional layer is When , the noise assigned to the fully connected layer is satisfy Differential privacy, where , is a coefficient that controls the allocation of privacy budget; Budget for privacy; The main function of the convolutional layer is to extract features from the input data through convolution operations. It has universal applicability. Therefore, in order to better learn global knowledge in the early stage of iteration, the present invention allocates a smaller privacy budget in the early stage. The ratio of the privacy budget of the convolutional layer to the fully connected layer is 2:1, that is, when hour, If is 1.5, the noise ratio of the convolutional layer to the fully connected layer is: =1:2; when When , the privacy budget of each level is allocated according to the calculated loss value, that is: (11); Then add noise to the local model parameters to be uploaded: , (12); (13); (14); In formulas (12)~(14), and is the model difference parameter of the uploaded convolutional layer and the fully connected layer, and Represents the updated The client's convolutional and fully connected layer parameters for the local iteration. is the clipping threshold, and The expected value is 0 and the variance is and Gaussian noise; and Indicates the updated The client's convolutional and fully connected layer parameters for the local iteration.
[0013] In another aspect of the present invention, there is also provided an apparatus comprising: at least one processor; and A memory having a computer program running on the processor stored thereon; when the computer program is executed by the at least one processor, the at least one processor executes the adaptive differential privacy protection method for heterogeneous federated learning as described above.
[0014] In another aspect of the present invention, a machine-readable storage medium is provided, which stores an executable computer program. When the computer program is executed, the machine executes the adaptive differential privacy protection method for heterogeneous federated learning as described above.
[0015] Compared with the prior art, the present invention has the following beneficial effects: (1) The adaptive differential privacy protection method for heterogeneous federated learning provided by the present invention achieves more flexible privacy protection by dividing the model into different layers and applying noise according to the role of each layer. This method effectively reduces the impact of noise on the overall performance of the model, allowing the model to learn data features more accurately while ensuring user privacy.
[0016] (2) The adaptive differential privacy protection method for heterogeneous federated learning provided by the present invention implements regularization and momentum mechanism (RM) on the divided model hierarchy to accelerate the convergence speed of the model and improve the convergence accuracy. Through theoretical analysis of convergence, there is an optimal coefficient of regularization and momentum mechanism, which can maximize the performance of the model and ensure stability and adaptability under different data environments; this method has significant advantages in convergence speed and final model accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a flow chart of the adaptive differential privacy protection method for heterogeneous federated learning described in the present invention.
[0018] Figure 2 It is a schematic diagram of a comparative experiment in Example 1 of the present invention. DETAILED DESCRIPTION
[0019] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0020] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0021] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0022] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.
[0023] Example 1 Ginseng Figure 1 This embodiment provides an adaptive differential privacy protection method for heterogeneous federated learning, which is an adaptive differential privacy federated learning method based on regularization and momentum mechanism, and is applied to a federated learning system, wherein the federated learning system includes multiple clients and a central server, and each client has a local data set for an image classification and recognition task; the method includes: S1. Perform layered processing on the local model and set different loss functions: The deep neural network of the local model is processed in layers, different loss functions are set for each layer according to the characteristics and requirements of different layers, and the local model loss function is updated for optimization to better capture the learning objectives of each level.
[0024] In the present invention, the processing subject of the local model is a deep neural network, and the local model parameters are deep neural network parameters. Preferably, the deep neural network with a convolutional neural network model CNN as the local model.
[0025] S11. Perform layered processing on the local model’s deep neural network, dividing the deep neural network into convolutional layers and fully connected layers ,Right now .
[0026] The main function of the convolution layer is to extract features from the input data through convolution operations, and generate new feature maps by sliding multiple filters (convolution kernels) on the input feature maps. These feature maps capture the edges, textures, and other low-level features of the image and provide rich information for subsequent layers.
[0027] The main function of the fully connected layer is to integrate the features extracted by the convolutional layer to generate the final output. The fully connected layer can learn higher-level abstract features by linearly combining the features and map these features to specific output categories or regression results.
[0028] S12. Set different loss functions according to the characteristics and requirements of different layers to optimize the model: In CNN, the functions of convolutional layers and fully connected layers are different, and their impact on model performance is also different. Due to its strong universality, the convolutional layer should be as close to the global model as possible during the local iteration process in order to effectively capture features and reduce local deviations.
[0029] The intensity of the noise introduced by differential privacy is related to the sensitivity of the sample data. Usually, when introducing noise, the gradient norm is used to measure the sensitivity of the sample data in the local dataset. Therefore, clipping techniques are usually required to control the sensitivity of the sample data. Considering the impact of the clipping threshold on the update of the convolutional neural network model, a segmented regularization term is added to the convolution layer. , in order to control the change of convolutional layer parameters: (1); In formula (1), the total number of global iterations is set to , the total number of local iterations is , in In the round iteration, ; Representing the client In the tth global iteration, The convolutional layer parameters after local iterations, and represents the convolutional layer parameters of the t-1th global iteration, is the trimming threshold. This regularization term effectively reduces the negative impact of high noise on feature extraction capabilities by limiting the update amplitude of the convolution layer parameters.
[0030] The main function of the fully connected layer is to integrate the features extracted by the convolutional layer to generate the final output. Since the fully connected layer usually carries the learning of personalized knowledge, it is hoped that the learning of local personalized knowledge can be guaranteed as much as possible during the optimization process; Adding a momentum term to the fully connected layer , to speed up the convergence of the fully connected layer: (2); In formula (2), Representing the client In the tth global iteration, The fully connected layer parameters after the local iteration, and It represents the first Parameters of the fully connected layer after local iterations.
[0031] This method ensures that the fully connected layer can effectively utilize previous learning results and accelerate the learning and adaptation of personalized features. By combining the above layered noise addition and dynamic regularization strategies, the coordinated optimization of the convolutional layer and the fully connected layer can be achieved, thereby improving the overall performance and convergence speed of the model. This layered method not only optimizes the learning ability of the local model, but also effectively enhances the robustness of the global model, providing a more effective solution for distributed machine learning.
[0032] S13. Update loss function : (3); In formula (3), , is the cross entropy loss function; , are the coefficients controlling the regularization mechanism and momentum mechanism respectively, B represents the total number of samples in the local dataset, and b represents the bth sample in the local dataset.
[0033] S2. The local model receives the global parameters and calculates the sample gradient in the current iteration round: The optimized deep neural network is aggregated to obtain the initial global parameters of the central server, and the central server sends the global parameters, namely ; The local model receives the global parameters and then calculates the sample gradient in the current iteration based on the local data set; the global parameters include the model parameters of the global convolutional layer and the model parameters of the global fully connected layer In the local model, each client has a local dataset for image classification tasks. In this embodiment, the client is the client, and the local data set Contains samples, which can be obtained from the CIFAR-10 dataset.
[0034] The CIFAR-10 dataset is a standard dataset widely used for image classification tasks. It was created by Alex Krizhevsky, Vinod Nair, and Geoffrey Hinton from the University of Toronto, Canada. The dataset contains 10 different categories of color images, each containing 6,000 images, for a total of 60,000 32x32 pixel color images. The image categories include airplanes, cars, birds, cats, deer, dogs, frogs, horses, ships, and trucks.
[0035] The CIFAR-10 dataset is divided into a training set and a test set, where the training set contains 50,000 images and the test set contains 10,000 images. The pixel value of each image ranges from 0 to 255, representing the color intensity in the RGB color space. Each image has a corresponding label, which is an integer between 0 and 9, used to indicate the category to which it belongs.
[0036] In specific application scenarios, the CIFAR-10 dataset can be used for distributed learning, such as collaborative learning among multiple research institutions or companies to jointly train an image classification model for identifying and classifying images of common objects. Each participant uses its own subset of data for local training and shares model updates through distributed learning without exchanging actual data. In this process, noise can be introduced through differential privacy technology to protect the data privacy of each participant and ensure that data at the individual or company level will not be leaked, thereby improving the overall performance and security of the model. This approach can be used to develop intelligent monitoring systems, object recognition systems in autonomous driving, and real-time image classification functions in augmented reality devices.
[0037] For Clients , using a local dataset Get the sample gradient in each iteration round and set the total number of iterations to , in In round iteration ( ), client In the The sample gradient in the round iteration is : (4); In formula (4), Represents the client In the The model parameters in the round iteration, Represents the client In the Round iteration from its local data set The sample is sampled from and ,Right now: (5); (6); In formulas (5)~(6), Representative The first iteration The model parameters of the convolutional layer of client i in the local iteration, Representative The model parameters of the global convolutional layer at the iteration, Representative The first iteration The model parameters of the fully connected layer of client i in the local iteration, Representative The first iteration Model parameters of the fully connected layer of client i at the local iteration; The local gradient is calculated using the sample gradient: (7); (8); In formulas (7)~(8): and Respectively represent the client In the Round Iteration The local gradients of the convolutional layer and the fully connected layer at the local iteration; Represents the client Local dataset The total number of samples in ; Represents a local dataset The samples.
[0038] S3. Apply the gradient descent algorithm and calculate the loss value: Apply the gradient descent algorithm, update the local model parameters based on the local gradients obtained by sample gradient calculation, and calculate the corresponding loss value of the local model.
[0039] (9); (10); In formulas (9)~(10): and Respectively represent the updated The client side of the local iteration The convolutional and fully connected layer parameters, and Respectively represent the learning rates of the convolutional layer and the fully connected layer during training; Then, through the loss function Calculate the respective loss values and .
[0040] S4. Perform noise processing on the local model parameters based on the loss value: The privacy budget of each layer is allocated according to the calculated loss value, and the local model parameters, i.e. the parameters of the deep neural network, are noised.
[0041] Lemma 1: For the mechanism ,in is the input dataset, is a dimensional function, and its ,noise , is expected to be 0, and has a variance of Gaussian noise, then the mechanism satisfy Differential privacy; If there is a mechanism ,in Also a dimensional function, and for ,in Corresponding to the Gaussian noise added in each dimension, the mechanism Also satisfied Differential privacy, provided that the following conditions are met: ;in, Budget for privacy. For Clients The failure probability, Variance of the Gaussian noise added to each dimension.
[0042] From Lemma 1, we can see that when the privacy budget allocated to the convolutional layer is When , the noise (privacy budget) allocated to the fully connected layer is satisfy Differential privacy, where , is a coefficient that controls the allocation of privacy budget.
[0043] Since the main function of the convolutional layer is to extract features from the input data through convolution operations, it has strong universality. Therefore, in order to better learn global knowledge in the early stage of iteration, the present invention allocates a smaller privacy budget in the early stage. The ratio of the privacy budget of the convolutional layer to the fully connected layer is 2:1, that is, when hour, If is 1.5, the noise ratio of the convolutional layer to the fully connected layer is: =1:2; when When , the privacy budget of each level is allocated according to the calculated loss value, that is: (11); Then add noise to the local model parameters to be uploaded: , (12); (13); (14); In formulas (12)~(14), and They are the uploaded convolutional layer and fully connected layer model difference parameters, is the clipping threshold, and The expected value is 0 and the variance is and Gaussian noise.
[0044] S5, loop iteration until end: The updated local model parameters, i.e. the noise-processed local model parameters, are uploaded to the central server for parameter aggregation, and the aggregated new global model parameters are sent to each client, and the update is iterated to the iteration threshold.
[0045] (15); (16); In formula (15) ~ formula (16), and are the parameters of the convolutional layer and the fully connected layer in the global model, and They are the learning rates of the convolutional layer and the fully connected layer during global update, and the updated global model parameters are sent to each client.
[0046] This embodiment not only has good privacy, but also has a good convergence effect: Privacy: A constant and , so that at a given number of iterations In the case of ,when When each client satisfies -Differential privacy.
[0047] : It is the privacy budget, which reflects the strength of privacy protection. The smaller the value, the stronger the privacy protection.
[0048] : The leakage probability allowed in differential privacy is usually a very small value.
[0049] : Number of iterations of the algorithm.
[0050] : Sample sampling rate.
[0051] Convergence: (17); In formula (17), Represents the gradient deviation caused by clipping, where , , are constants, representing the inherent difference, Lipschitz coefficient, and bounded variance in federated learning; (18); (19); (20); This example was experimented on the CIFAR10 dataset and obtained the following experimental results: First, set , , , , , , , .
[0052] When the clipping deviation is not considered, it can be seen from the second term of the convergence result that when given When there is an optimal Make The convergence upper bound of is the smallest, let , corresponding to the number of local iterations The optimal value of .set up , and set =1, minimize get .
[0053] The experimental results are compared as Figure 2 As shown, the scheme of the present invention improves the accuracy by 9% to 15% compared with the benchmark scheme. The hierarchical scheme refers to a model method that does not use the regularization mechanism and momentum mechanism in this scheme. Benchmark 1 is the FedDPA algorithm, which is based on personalized screening of dynamic Fisher information and combines adaptive constraint technology to alleviate the convergence difficulties caused by non-independent and identically distributed data and differential privacy pruning operations. Benchmark 2 is the DP-FedAvg algorithm, which is a FedAvg algorithm with DP. Benchmark 3 is the PPSGD algorithm, which improves the adaptability of the model through a personalized privacy protection mechanism while ensuring privacy security.
[0054] Example 2 This embodiment provides a device for implementing an adaptive differential privacy protection method for heterogeneous federated learning, the device comprising: at least one processor; and A memory storing a computer program, which, when executed by the at least one processor, enables the at least one processor to perform the adaptive differential privacy protection method for heterogeneous federated learning as described above.
[0055] In this embodiment, electronic devices include but are not limited to: personal computers, server computers, workstations, desktop computers, laptop computers, notebook computers, mobile computing devices, smart phones, tablet computers, cellular phones, personal digital assistants (PDAs), handheld devices, messaging devices, wearable computing devices, consumer electronic devices, etc.
[0056] Example 3 This embodiment also provides a computer-readable storage medium storing an executable computer program, which, when executed, enables the machine to perform the adaptive differential privacy protection method for heterogeneous federated learning as described above.
[0057] Specifically, a system or device equipped with a readable storage medium can be provided, on which software program codes that implement the functions of any of the above-mentioned embodiments are stored, and a computer or processor of the system or device can be enabled to read and execute the computer program stored in the readable storage medium.
[0058] In this case, the program code itself read from the machine-readable medium can realize the function of any one of the above embodiments, and thus the machine-readable code and the machine-readable storage medium storing the machine-readable code constitute part of this specification.
[0059] Examples of readable storage media include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD-RW), magnetic tapes, non-volatile memory cards, and ROMs. Optionally, the program code may be downloaded from a server computer or a cloud via a communication network.
[0060] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0061] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0062] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0063] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0064] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the technical solution of the present invention, and are not intended to limit the specific implementation methods of the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the claims of the present invention shall be included in the protection scope of the claims of the present invention.
Claims
1. An adaptive differential privacy protection method for heterogeneous federated learning, characterized in that: The method comprises: S1. Perform layered processing on the deep neural network, set different loss functions for each layer and update the local model loss function for optimization; S2: Aggregate the optimized deep neural network to obtain the initial global parameters of the central server, and the central server sends the global parameters; the local model receives the global parameters, and then calculates the sample gradient in the current iteration round based on the local data set; S3, applying the gradient descent algorithm, updating the local model parameters based on the local gradient obtained by the sample gradient calculation, and calculating the corresponding loss value of the local model; S4. Allocate the privacy budget of each layer according to the calculated loss value and perform noise processing on the local model parameters; S5. Upload the updated local model parameters, i.e., the noise-processed local model parameters, to the central server for parameter aggregation, and send the updated global model parameters to each client, and iterate and update until the iteration threshold is reached.
2. The adaptive differential privacy protection method for heterogeneous federated learning according to claim 1, characterized in that: The S1 specifically includes: S11. Perform layered processing on the local model’s deep neural network, dividing the deep neural network into convolutional layers and fully connected layers ,Right now ; S12. Set different loss functions according to the characteristics and requirements of different layers to optimize the model: Add a piecewise regularization term to the convolutional layer : (1); In formula (1), the total number of global iterations is set to , the total number of local iterations is , in In the round iteration, ; Representing the client In the tth global iteration, The convolutional layer parameters after local iterations, k≤ ,and represents the convolutional layer parameters of the t-1th global iteration, is the trimming threshold; Adding a momentum term to the fully connected layer : (2); In formula (2), Representing the client In the tth global iteration, The fully connected layer parameters after the local iteration, and Represents the client In the tth global iteration, The fully connected layer parameters after the local iteration; S13. Update local model loss function : (3); In formula (3), , is the cross entropy loss function; , are the coefficients controlling the regularization mechanism and momentum mechanism, B represents the total number of samples in the local dataset, and b i Represents the bth sample in the local dataset of the i-th client.
3. The adaptive differential privacy protection method for heterogeneous federated learning according to claim 2, characterized in that: The local model receives the global parameters and then calculates the sample gradient in the current iteration round based on the local data set, specifically including: In the local model, for client i, the local dataset is used Get the sample gradient in each iteration round and set the total number of iterations to , in In the round iteration, , Client In the The sample gradient in the round iteration is : (4); In formula (4), Represents the client In the Model parameters in round global iteration, Represents the client In the The global iteration starts from its local dataset The sample is sampled from and ,Right now: (5); (6); In formulas (5)~(6), Representative The iteration The model parameters of the convolutional layer of client i in the local iteration, Representative The model parameters of the global convolutional layer at the iteration, Representative The iteration The model parameters of the fully connected layer of client i in the local iteration, Representative The iteration Model parameters of the fully connected layer of client i at the local iteration; The local gradient is calculated using the sample gradient: (7); (8); In formulas (7)~(8), and Respectively represent the client In the In the round iteration Local gradients of convolutional and fully connected layers at the local iteration; Represents the client Local dataset The total number of samples in .
4. The adaptive differential privacy protection method for heterogeneous federated learning according to claim 3, characterized in that: The S3 specifically includes: (9); (10); In formulas (9)~(10), and Respectively represent the updated The client side of the local iteration The convolutional layer and fully connected layer parameters, and Respectively represent the learning rates of the convolutional layer and the fully connected layer during training; Then, through the loss function Calculate the respective loss values and .
5. The adaptive differential privacy protection method for heterogeneous federated learning according to claim 4, characterized in that: The S4 specifically includes: When the privacy budget allocated to the convolutional layer is When , the noise assigned to the fully connected layer is satisfy Differential privacy, where , is a coefficient that controls the allocation of privacy budget; Budget for privacy; The ratio of the privacy budget of the convolutional layer to the fully connected layer is 2:1, that is, when hour, If is 1.5, the noise ratio of the convolutional layer to the fully connected layer is: =1:2; when When , the privacy budget of each level is allocated according to the calculated loss value, that is: (11); Then add noise to the model parameters to be uploaded: , (12); (13); (14); In formulas (12)~(14), and They are the model difference parameters of the uploaded convolutional layer and the fully connected layer, are the cropping thresholds of the convolutional layer and the fully connected layer, and The expectation corresponding to the convolutional layer and the fully connected layer is 0, and the variance is and Gaussian noise, and Indicates the updated The client's convolutional and fully connected layer parameters for the local iteration.
6. A device based on an adaptive differential privacy protection method for heterogeneous federated learning, characterized in that: The device comprises: at least one processor; and a memory having stored thereon a computer program running on the processor; Wherein, when the computer program is executed by the processor, the steps of the adaptive differential privacy protection method for heterogeneous federated learning as described in any one of claims 1 to 5 are implemented.
7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Multi-level heterogeneous longitudinal federated learning method for privacy protection
CN118674014A
An image classification method based on differential privacy and hierarchical correlation propagation
CN109034228A
Face recognition network model construction method combined with gender attribute training
CN111339931A
Federal learning classification model training method based on model disturbance
CN115358418A
Asynchronous aggregation and privacy protection method in resource limited federated edge learning
CN116911382A
Cited By
Federal learning-based noise data processing method and device, and medium
CN119622818A
Regular constraint adaptive adjustment method for privacy-preserving heterogeneous decentralized learning
CN119808896A
Regularization Constraint Adaptive Adjustment Method for Privacy-Preserving Heterogeneous Decentralized Learning
CN119808896B
Non-IID data-oriented cross-client global classifier dynamic fine tuning method
CN120373492A
Multi-modal federated learning privacy protection method based on fine-grained differential privacy
CN121009582A