4. Adaptive Differential Privacy Mechanisms For Federated Learning
In this section, we will introduce the building blocks of our method and explain how to implement our algorithm. In
Section 4.1, we introduced adaptive differential privacy design. In
Section 4.2, we introduced security analysis and scheme design. In
Section 4.3, we provided a detailed explanation of the ADP-FL algorithm implementation.
4.1. Design of Adaptive Differential Privacy
Differential privacy technology was first proposed by Dwork in 2006[
20] to prevent differential attacks from obtaining sensitive information about a single record, thereby protecting the confidentiality of data. For example, for a query for average wages, select a set of 100 people, query the average wages of these 100 people, and then query the average wages of any 99 people in the set. The wages of the remaining one person can be analyzed by the results of the first two queries, which is a differential attack. The core idea of differential privacy technology is to process query results in a way that, for a dataset with only one record difference, the query result is likely to remain the same.
According to the composition theorem, when deploying differential privacy multiple times on the same input data, the requirements of differential privacy can still be met. However, it should be noted that there is a correlation between the outputs of each algorithm in serial composition, which leads to an increase in the overall privacy budget and failure probability , thereby reducing the effectiveness of privacy protection. In particular, when different differential privacy methods are applied multiple times on the same dataset, the level of privacy protection may be significantly weakened.
Therefore, allocating privacy budgets of different sizes according to the various stages of federated learning has greater advantages than the traditional method of evenly distributing privacy budgets.
In the early stages of federated learning, the gradient information contains less sensitive information, allowing for a more relaxed privacy budget to be adopted. As training progresses, the privacy information contained in the delayed gradient increases, and the privacy budget must be reduced to protect user information. Based on this idea, this paper employs an optimization algorithm that adjusts the client’s privacy budget in real time according to the model’s training progress and accuracy, ensuring that the overall privacy budget remains unchanged. By dynamically allocating the privacy budget, this paper achieves a more balanced approach between privacy protection and model performance during federated learning. This strategy of allocating privacy budgets of different sizes for various stages of federated learning enables the method proposed in this paper to flexibly address privacy protection requirements while fully utilizing the dataset’s information to enhance the model’s accuracy and performance.
Since our overall method gradually reduces the privacy budget
as training progresses, we use Newton’s cooling law formula to adjust
for each training round. The adaptive adjustment process of the privacy budget
can be formalized as:
Where t is current communication round, E is maximum communication round, is the adjustment coefficient that defaults to 0.1.
Algorithm 1 demonstrates the adaptive differential privacy process. When the client begins participating in federated learning, the cumulative privacy budget is set to 0. As training progresses, if the cumulative privacy budget exceeds the total privacy budget, continuing to participate in federated learning will result in privacy leakage risks, so the client exits federated learning. It is important to note that the decline curve of Newton’s cooling law is very rapid. To prevent the privacy budget from depleting too quickly, which could lead to excessive noise and negatively impact training, this paper introduces a detection callback mechanism. When the client detects that the model’s accuracy has decreased beyond a threshold—i.e., when noise is affecting model convergence—the privacy budget is adjusted accordingly. Through this mechanism, this paper achieves a balance between privacy and efficiency.
|
Algorithm 1 Adaptive Differential Privacy |
-
Input:
privacy budget , accumulated privacy budget , Coefficient , Maximum number of communication rounds E
-
Output:
- 1:
- 2:
while and do
- 3:
if then
- 4:
- 5:
else
- 6:
=
- 7:
end if
- 8:
- 9:
end while
- 10:
return
|
4.2. Design of Weighted Aggregation
In federated learning, due to communication or device issues, some devices may not participate in training for extended periods and are referred to as outdated devices. These outdated devices can lead to a decline in model accuracy, a significant issue in practice. To address this issue, a common approach in the context of federated learning is to adjust the weight of the gradient based on the degree of model obsolescence, thereby reducing the impact of outdated gradient information on the model. This paper adjusts the weights of gradient information based on the number of training rounds the model has not participated in and uses an exponential function to implement this adjustment. Through this approach, this paper can more effectively address the impact of outdated devices that have not participated in training for an extended period, thereby improving the overall accuracy of the model. This dynamic weight adjustment strategy ensures that the contribution of outdated devices in model updates gradually decreases, allowing the updates from devices that participate on time to be more significant. Therefore, this paper can better balance the contributions of different devices, thereby enhancing the effectiveness of federated learning and the model’s performance. The obsolescence degree function we use is as follows:
Where is the current communication round, is the last communication round of the client, and is the adjustment coefficient. is the outdated coefficient. It is initially set to 1 and reset to 1 each time it participated in training.
According to the characteristics of the exponential function, the weights of clients who have not participated in training for multiple rounds will be tiny, effectively reducing the impact of outdated information.
During parameter aggregation, differential privacy noise impacts the model’s convergence. Clients with smaller privacy budgets have a higher probability of their uploaded gradient parameters deviating from the model convergence direction. Therefore, it is necessary to adjust the weights based on the amount of noise added by the client. Regarding how to assess the amount of noise added, the privacy budget and the amount of noise added are negatively correlated. The smaller the privacy budget, the more noise is added and the greater the deviation of gradient information. Naturally, this paper uses the privacy budget as a parameter to assess the degree of noise added and uses as one of the weight parameters for model aggregation.
Combining the weight adjustment algorithm for outdated devices and the weight adjustment algorithm for noise, this paper proposes the following aggregation scheme:
Where is the gradient of client i in round t. is the size of the dataset for client i. In this formula, the more noise, the older the model, and the smaller the weight of the gradient provided by the client. When the client continuously participates in training and adjusts the privacy budget , the weight in the aggregation will increase.
Accordingly, the calculation method for the global model is:
The flowchart of the aggregation scheme is shown in
Figure 2. As shown in the figure, in a training round, the green portion represents the time window during which the server receives gradients from clients. In contrast, the red portion represents the time window during which the server performs aggregation and updates the global model. Clients that upload gradients during the green time window are considered regular clients participating in aggregation. Clients who upload gradients during the red time window or do not upload gradients are marked as lagging clients. For users marked as lagging clients, their aggregation weights will decay exponentially over time, allowing them to participate in normal model aggregation again.
4.3. Adaptive Differential Privacy Federated Learning Algorithm
Based on the previously proposed method, we propose Adaptive Differential Privacy Federated Learning (ADP-FL).
Figure 3 is the overview of ADP-FL. Algorithm 2 shows the whole process of ADP-FL.
is the Adaptive Differential Privacy function. The specific details of the algorithm are as follows:
|
Algorithm 2 ADP-FL |
-
Input:
initial paramenters w, privacy budget , maximum communication round E, accumulated privacy budget , Current communication round t, outdated level .
- 1:
Server does:
- 2:
Send initial parameters w to all clients i
- 3:
while do
- 4:
- 5:
Return to each selected client i
- 6:
Set participating clients’ to 1, other clients’
- 7:
end while
- 8:
Client does:
- 9:
Recieve initial parameters w
- 10:
if client i selected and then
- 11:
receive from server
- 12:
local train
- 13:
- 14:
add noise
- 15:
- 16:
return to server
- 17:
end if
|
(1) Steps 2 to 7 are performed by the server. In Step 2, the server initializes the model w and sends it to all clients. Before reaching the maximum communication round E, the server receives the gradient information sent by the clients, aggregates the gradients of each participating client according to the aggregation scheme proposed in this paper, and updates the global model , then is sent to participating clients to update their local models. After the update is complete, the server resets the obsolescence level of participating clients to 1 based on their participation in this update, and sets the obsolescence level of non-participating clients to , thereby implementing the algorithm.
(2) Steps 8 to 15 are performed by the client. During the preparation phase of federated learning training, the client receives the initial model w. When the client is selected and the privacy budget has not been fully consumed, the client first receives the latest model parameters from the server. Based on the local dataset and the latest global model , local training is performed to obtain the local gradient . The privacy budget for this round of training is calculated as . Based on the privacy budget and the Laplace mechanism or Gaussian mechanism, perturbation noise is generated and added to the gradient information, yielding the perturbed gradient information , while the cumulative consumed privacy budget is updated as .