Deep Learning with Data Privacy via Residual Perturbation
Abstract
Protecting data privacy in deep learning (DL) is of crucial importance. Several celebrated privacy notions have been established and used for privacy-preserving DL. However, many existing mechanisms achieve privacy at the cost of significant utility degradation and computational overhead. In this paper, we propose a stochastic differential equation-based residual perturbation for privacy-preserving DL, which injects Gaussian noise into each residual mapping of ResNets. Theoretically, we prove that residual perturbation guarantees differential privacy (DP) and reduces the generalization gap of DL. Empirically, we show that residual perturbation is computationally efficient and outperforms the state-of-the-art differentially private stochastic gradient descent (DPSGD) in utility maintenance without sacrificing membership privacy.
Index Terms:
deep learning, data privacy, stochastic differential equationsI Introduction
Many high-capacity deep neural networks (DNNs) are trained with private data, including medical images and financial transaction data [1, 2, 3]. DNNs usually overfit and can memorize the private training data, making training DNNs exposed to privacy leakage [4, 5, 6, 7, 8]. Given a pre-trained DNN, the membership inference attack can determine if an instance is in the training set based on DNN’s response [9, 5, 6]; the model extraction attack can learn a surrogate model that matches the target model, given the adversary only black-box access to the target model [10, 11]; the model inversion attack can infer certain features of a given input from the output of a target model [12, 13]; the attribute inference attack can deanonymize the anonymized data [14, 15].
Machine learning (ML) with data privacy is crucial in many applications [16, 17, 18, 19]. Several algorithms have been developed to reduce privacy leakage, including differential privacy (DP) [20] and federated learning (FL) [21, 22], and -anonymity [23, 24]. Objective, output, and gradient perturbations are popular approaches for ML with DP guarantee [25, 26, 27, 28, 29]. FL trains centralized ML models, through gradient exchange, with the training data being distributed on the edge devices. However, the gradient exchange can still leak privacy [30, 31]. Most of the existing privacy is achieved at a tremendous sacrifice of utility. Moreover, training ML models using the state-of-the-art DP stochastic gradient descent (DPSGD) leads to tremendous computational cost due to the requirement of computing and clipping the per-sample gradient [32]. It remains a great interest to develop new privacy-preserving ML algorithms without the excessive computational overhead or degrade the ML models’ utility.
I-A Our Contribution
We propose residual perturbation for privacy-preserving deep learning (DL). At the core of residual perturbation is injecting Gaussian noise to each residual mapping [33], and the residual perturbation is theoretically motivated by the stochastic differential equation (SDE) theory. The major advantages of residual perturbation are summarized below:
-
•
It guarantees DP and can protect the membership privacy of the training data almost perfectly without sacrificing ResNets’ utility, even improving the classification accuracy.
-
•
It has fewer hyperparameters to tune than DPSGD. Moreover, it is computationally much more efficient than DPSGD; the latter is computationally prohibitive due to the requirement of computing the per-sample gradient.
I-B Related Work
Improving the utility of ML models with DP guarantees is an important task. PATE [34, 35] uses semi-supervised learning accompanied by model transfer between the “student” and “teacher” models to enhance utility. Several variants of the DP notions have also been proposed to improve the theoretical privacy budget and sometimes can also improve the resulting model’s utility [28, 36, 37, 38]. Some post-processing techniques have also been developed to improve the utility of ML models with negligible computational overhead [39, 40].
The tradeoff between privacy and utility of ML models has been studied in several different contexts. In [41], the authors identify the factors that impact the optimal tradeoff of accuracy and privacy of differentially private DL models by empirically evaluating the commonly used privacy-preserving ML libraries, including PyTorch Opacus and Tensorflow privacy. The authors of [42] investigate whether DPSGD offers better privacy in practice than what is guaranteed by its state-of-the-art theoretical privacy analysis — by taking a quantitative, empirical approach to auditing the privacy afforded by specific implementations of differentially private algorithms. In particular, they estimate an empirical DP lower bound under the data poisoning and membership inference attacks. They further compare this empirical lower bound with the DP budget obtained by the state-of-the-art analytic tools [28, 38, 43, 44]. The approach presented in [42] can demonstrate if a given algorithm with a given DP budget is sufficiently private and provides empirical evidence to guide the development of theoretical DP analysis. The privacy-utility tradeoff for different privacy measures in both global and local privacy has been studied in [45], aiming to determine the minimal privacy loss at a fixed utility expense. The paper [46] investigates a DP ensemble classifier approach that seeks to preserve data privacy while maintaining an acceptable level of utility. For the linear regression model, the privacy-utility tradeoff has been studied by enforcing the privacy of the input data via random projection and additive noise [47].
Gaussian noise injection in residual learning has been used to improve the robustness of ResNets [48, 49, 50]. In this paper, we inject Gaussian noise into each residual mapping to achieve data privacy with even improved generalization instead of adversarial robustness. Several related studies focus on disentangling adversarial robustness and generalization in the literature. Some initial hypotheses state that there exists an inherent tradeoff between robustness and accuracy, i.e., an ML model cannot be both more robust and more accurate than others [51, 52] based on the comparisons of different models with different architectures or training strategies and theoretical arguments on a toy dataset, respectively. In [53], the authors disentangle adversarial robustness and generalization, leveraging the low-dimensional manifold assumption of the data. In particular, through a detailed analysis of the regular and on-manifold [54, 55] adversarial examples of the same type as the given class — the adversarial examples that leave and stay in the manifold of the given class of data, the authors of [53] conclude that both robust and accurate ML models are possible. In particular, on-manifold robustness is essentially the generalization of the ML model, which can be improved via on-manifold adversarial training. In [56], the authors precisely characterize the effects of data augmentation on the standard error (corresponding to the natural accuracy of the model) in linear regression when the optimal linear predictor has zero standard and robust error (corresponding to the model’s robust accuracy). Moreover, it is shown in [56] that robust self-training [57, 58, 59] can improve the linear regression model’s robustness without sacrificing its standard error by leveraging extra unlabelled data. Our approach of the ensemble of noise-injected neural networks provides another feasible avenue to develop ML models that are both robust and accurate.
I-C Organization
We organize this paper as follows: In Sec. II, we introduce the residual perturbation for privacy-preserving DL. In Sec. III, we present the generalization and DP guarantees for residual perturbation. In Sec. IV, we numerically verify the efficiency of the residual perturbation in protecting data privacy without degrading the underlying models’ utility. Technical proofs and some more experimental details and results are provided in Secs. V and VI. We end up with concluding remarks.
I-D Notations
We denote scalars by lower or upper case letters; vectors and matrices by lower and upper case bold face letters, respectively. For a vector , we use to denote its norm. For a matrix , we use to denote its induced norm by the vector norm. We denote the standard Gaussian in as with being the identity matrix. The set of (positive) real numbers is denoted as () . We use to denote the ball centered at with radius .
II Algorithms
II-A Deep Residual Learning and Its Continuous Analogue
Given the training set , with being a data-label pair. For a given the forward propagation of a ResNet with residual mappings can be written as
(1) | ||||
where is the nonlinear mapping of the -th residual mapping parameterized by ; is the output activation, and is the prediction. The heuristic continuous limit of (1) is the following ordinary differential equation (ODE)
(2) |
where is the time variable. ODE (2) can be revertible, and thus the ResNet counterpart might be exposed to data privacy leakage. For instance, we use an image downloaded from the Internet (Fig. 1(a)) as the initial data in (2). Then we simulate the forward propagation of ResNet by solving (2) from to using the forward Euler solver with a time step size and a given velocity field (see Sec. VII for the details of ), which maps the original image to its features (Fig. 1(b)). To recover the original image, we start from the feature and use the backward Euler iteration, i.e., to evolve from to with being the features obtained in the forward propagation. We plot the recovered image from features in Fig. 1(c), and the original image can be almost perfectly recovered.
![]() |
![]() |
![]() |
![]() |
![]() |
(a) (Original) | (b) (ODE) | (c) (ODE) | (d) (SDE) | (e) (SDE) |
II-B Residual Perturbation and its SDE Analogue
In this part, we propose two SDE models to reduce the reversibility of (2), and the corresponding residual perturbations analogue can protect the data privacy in DL.
Strategy I
Consider the following SDE model:
(3) |
where is the standard Brownian motion. We simulate the forward propagation and reverse-engineering the input from the output by solving the SDE model (3) with using the same and initial data . We use the following forward (4) and backward (5) Euler-Maruyama discretizations [60] of (3) for the forward and backward propagation, respectively.
(4) |
(5) | ||||
Fig. 1(d) and (e) show the results of the forward and backward propagation by SDE, respectively. These results show that it is much harder to reverse the features obtained from the SDE evolution. The SDE model informs us to inject Gaussian noise, in both training and test phases, to each residual mapping of ResNet to protect data privacy, which results in
(6) |
Strategy II
For the second strategy, we consider using the multiplicative noise instead of the additive noise that used in (3) and (6), and the corresponding SDE can be written as
(7) |
where denotes the Hadamard product. Similarly, we can use the forward and backward Euler-Maruyama discretizations of (7) to propagate the image in Fig. 1(a), and we provide these results in Sec. VI-A. The corresponding residual perturbation is
(8) |
Again, the noise is injected to each residual mapping in both training and test stages.
II-C Utility Enhancement via Model Ensemble
III Main Theory
III-A Differential Privacy Guarantee for Strategy I
We consider the following function class for ResNets with residual perturbation:
(9) |
where is the noisy input with being a hyperparameter and being a normal random vector. is the weight matrix in the -th residual mapping and is the weights of the last layer. and is also a hyperparameter. with being the batch normalization and being a -Lipschitz and monotonically increasing activation function, e.g., ReLU.
We first recap on the definition of differential privacy.
Definition 1 (-DP).
[20] A randomized mechanism satisfies -DP if for any two datasets that differ by one element, and any output subset , it holds that and
Theorem 1.
Assume the input to ResNet lies in and the expectation of the output of every residual mapping is normally distributed and bounded by a constant , in norm. Given the total number of iterations used for training ResNet. For any and , the parameters and in the ResNet with residual perturbation satisfies -DP and -DP, respectively, provided that and , where , and are the number of residual mappings, training data, and batch size, respectively. In particular, in the above setting the whole model obtained by injecting noise according to strategy I satisfies -DP.
III-B Theoretical Guarantees for Strategy II
Privacy
To analyze the residual perturbation scheme in (8), we consider the following function class:
where is a normal random vector for , with being a constant. We denote the entry of that has the largest absolute value as , and . Due to batch normalization, we assume the norm of can be bounded by a positive constant . The other notations are defined similar to that in (9). Consider training by using two datasets and , and we denote the resulting models as:
(10) | ||||
and
(11) | ||||
Then we have the following privacy guarantee.
Theorem 2.
We prove Theorem 2 in Sec. V-B. Theorem 2 guarantees the privacy of the training data given only black-box access to the model, i.e., the model will output the prediction for any input without granting adversaries access to the model itself. In particular, we cannot infer whether the model is trained on or no matter how we query the model in a black-box fashion. This kind of privacy-preserving prediction has also been studied in [34, 35, 61, 62]. We leave theoretical DP-guarantee for for Strategy II for future work.
Generalization gap
Many works have shown that overfitting in training ML models leads to privacy leakage [6], and reducing overfitting can mitigate data privacy leakage [5, 7, 8, 6, 63]. In this part, we show that the residual perturbation (8) can reduce overfitting via computing the Rademacher complexity. For simplicity, we consider binary classification problems. Suppose is drawn from with and being the input data and label spaces, respectively. Assume is the underlying distribution of , which is unknown. Let be the hypothesis class of the ML model. We first recap on the definition of Rademacher complexity.
Definition 2.
[64] Let be the space of real-valued functions on the space . For a given sample of size , the empirical Rademacher complexity of is defined as
where are i.i.d. Rademacher random variables with .
Rademacher complexity is a tool to bound the generalization gap [64]. The smaller the generalization gap is, the less overfitting the model is. For and constant , we consider the following two function classes ( and ):
where . And
where , and with , takes the value such that is well defined on , is a hyperparameter and is a circulant matrix that corresponding to the convolution layer in DNs, and is the standard 1D Brownian motion. The function class represents the continuous analogue of ResNet without inner nonlinear activation functions, and denotes with the residual perturbation (8).
Theorem 3.
Given the training set . We have .
We provide the proof of Theorem 3 in Sec. V-C, where we will also provide quantitative lower and upper bounds of the above Rademacher complexities. Theorem 3 shows that residual perturbation (8) can reduce the generalization error. We will numerically verify this generalization error reduction for ResNet with residual perturbation in Sec. IV.
IV Experiments
In this section, we will verify that 1) Residual perturbation can protect data privacy, particularly membership privacy. 2) The ensemble of ResNets with residual perturbation improves the classification accuracy. 3) The skip connection is crucial in residual perturbation for DL with data privacy. 4) Residual perturbation can improve the utility of the resulting ML models over DPSGD with a compromise in privacy protection. We focus on Strategy I in this section, and we provide the results of Strategy II in Sec. VI.
IV-A Preliminaries
Datasets
We consider MNIST, CIFAR10/CIFAR100 [65], and the Invasive Ductal Carcinoma [66] datasets. MNIST consists of 70K gray-scale images with 60K and 10K of them used for training and test, respectively. Both CIFAR10 and CIFAR100 contain 60K color images with 50K and 10K of them used for training and test, respectively. The IDC dataset is a breast cancer-related benchmark dataset, which contains 277,524 patches of the size with 198,738 labeled negative (0) and 78,786 labeled positive (1). Fig. 2 depicts a few patches from the IDC dataset. For the IDC dataset, we follow [67] and split the whole dataset into training, validation, and test set. The training set consists of 10,788 positive patches and 29,164 negative patches, and the test set contains 11,595 positive patches and 31,825 negative patches. The remaining patches are used as the validation set. For each dataset, we split its training set into and with the same size. Furthermore, we split into two halves with the same size and denote them as and , and split by half into and . The purpose of this splitting of the training set is for the membership inference attack, which will be discussed below.
Negative | Positive | Negative | Positive |
Membership inference attack
To verify the efficiency of residual perturbation for privacy protection, we consider the membership inference attack [6] in all the experiments below. The membership attack proceeds as follows: 1) train the shadow model by using ; 2) apply the trained shadow model to predict all data points in and obtain the corresponding classification probabilities of belonging to each class. Then we take the top three classification probabilities (or two for binary classification) to form the feature vector for each data point. A feature vector is tagged as if the corresponding data point is in , and otherwise. Then we train the attack model by leveraging all the labeled feature vectors; 3) train the target model by using and obtain feature vector for each point in . Finally, we leverage the attack model to decide whether a data point is in .
Experimental settings
We consider En5ResNet8 (ensemble of 5 ResNet8 with residual perturbation) and the standard ResNet8 as the target and shadow models, respectively. We use a multilayer perceptron with a hidden layer of nodes, followed by a softmax function as the attack model, which is adapted from [6]. We apply the same settings in [33] to train the target and shadow models on MNIST, CIFAR10, and CIFAR100. For training models on the IDC dataset, we run 100 epochs of SGD with the same setting as before except that we decay the learning rate by 4 at the 20th, 40th, 60th, and 80th epoch, respectively. Moreover, we run epochs of Adam [68] with a learning rate of 0.1 to train the attack model. For both IDC, MNIST, and CIFAR datasets, we set as half of in Strategy I, which simplifies hyperparameters calibration, and based on our experiment it gives a good tradeoff between privacy and accuracy.
Performance evaluations
We consider both classification accuracy and capability for protecting membership privacy. The attack model is a binary classifier, which is used to decide if a data point is in the training set of the target model. For any , we apply the attack model to predict its probability () of belonging to the training set of the target model. Given any fixed threshold if , we classify as a member of the training set (positive sample), and if , we conclude that is not in the training set (negative sample); so we can obtain different attack results with different thresholds. Furthermore, we can plot the ROC curve(see details in Sec. IV-E) of the attack model and use the area under the ROC curve (AUC) as an evaluation of the membership inference attack. The target model protects perfect membership privacy if the AUC is 0.5 (the attack model performs a random guess), and the more AUC deviates from 0.5, the less private the target model is. Moreover, we use the precision (the fraction of records inferred as members are indeed members of the training set) and recall (the fraction of training set that is correctly inferred as members of the training set by the attack model) to measure ResNets’ capability for protecting membership privacy.
IV-B Experiments on the IDC Dataset
In this subsection, we numerically verify that residual perturbation protects data privacy while retaining the classification accuracy of the IDC dataset. We select the En5ResNet8 as a benchmark architecture, which has ResNet8 as its baseline architecture. As shown in Fig. 3, we set four different thresholds to obtain different attack results with three different noise coefficients (), and means the standard ResNet8 without residual perturbation. We also depict the ROC curve for this experiment in Fig. 7(c). En5ResNet8 is remarkably better in protecting the membership privacy, and as increases the model becomes more resistant to the membership attack. Also, as the noise coefficient increases, the gap between training and test accuracies becomes smaller, which resonates with Theorem 3. For instance, when the AUC for the attack model is and , respectively, for En5ResNet8 and ResNet8; the classification accuracy of En5ResNet8 and ResNet8 are 0.867 and 0.847, respectively.
Residual perturbation vs. DPSGD
In this part, we compare the residual perturbation with the benchmark Tensorflow DPSGD module [69], and we calibrate the hyperparameters, including the initial learning rate (0.1) which decays by a factor of 4 after every 20 epochs, noise multiplier (1.1), clipping threshold (1.0), micro-batches (128), and epochs (100) 222https://github.com/tensorflow/privacy/tree/master/tutorials such that the resulting model gives the optimal tradeoff between membership privacy and classification accuracy. DPSGD is significantly more expensive due to the requirement of computing and clipping the per-sample gradient. We compare the standard ResNet8 trained by DPSGD with the baseline non-private ResNet8, and En5ResNet8 with residual perturbation (). Table I lists the AUC of the attack model and training and test accuracies of the target model; we see that DPSGD and residual perturbation can protect membership privacy, and residual perturbation can improve accuracy without sacrificing membership privacy protection.
Model | AUC | Training Acc | Test Acc |
---|---|---|---|
ResNet8(non-private) | 0.563 | 1.000 | 0.847 |
ResNet8 (DPSGD) | 0.503 | 0.831 | 0.828 |
En1ResNet8() | 0.499 | 0.882 | 0.865 |
IV-C Experiments on the MNIST/CIFAR10/CIFAR100 Datasets
We further test the effectiveness of residual perturbation for ResNet8 and En5ResNet8 on the MNIST/CIFAR10/CIFAR100 dataset. Also, we will contrast residual perturbation with DPSGD in privacy protection and utility maintenance. Fig. 4 plots the performance of En5ResNet8 on CIFAR10 under the above four different measures, namely, precision, recall, training and test accuracy, and AUC. Again, the ensemble of ResNets with residual perturbation is remarkably less vulnerable to membership inference attack; e.g., the AUC of the attack model for ResNet8 (non-private) and En5ResNet8 () is and , respectively. Also, the classification accuracy of En5ResNet8 (%) is higher than that of the non-private ResNet8 (%) for CIFAR10 classification. Fig. 5 depicts the results of En5ResNet8 for CIFAR100 classification. These results confirm again that residual perturbation can protect membership privacy and improve classification accuracy.
Residual perturbation vs. DPSGD
We contrast residual perturbation with DPSGD on MNIST, CIFAR10, and CIFAR100 classification; the results are shown in Tables II, III, and IV, respectively. These results unanimously show that 1) both DPSGD and residual perturbation can effectively protect membership privacy, and 2) residual perturbation is better than DPSGD in maintaining the model’s utility without sacrificing membership privacy protection.
Model | AUC | Training Acc | Test Acc |
---|---|---|---|
ResNet8(non-private) | 0.514 | 1.000 | 0.988 |
ResNet8 (DPSGD) | 0.507 | 0.977 | 0.975 |
En1ResNet8() | 0.506 | 0.989 | 0.978 |
Model | AUC | Training Acc | Test Acc |
---|---|---|---|
ResNet8(non-private) | 0.757 | 1.000 | 0.669 |
ResNet8 (DPSGD) | 0.512 | 0.718 | 0.625 |
En1ResNet8() | 0.511 | 0.760 | 0.695 |
Model | AUC | Training Acc | Test Acc |
---|---|---|---|
ResNet8(non-private) | 0.903 | 0.999 | 0.305 |
ResNet8 (DPSGD) | 0.516 | 0.400 | 0.288 |
En1ResNet8() | 0.515 | 0.485 | 0.383 |
Effects of the number of models in the ensemble
In this part, we consider the effects of the number of residual perturbed ResNets in the ensemble. Fig. 6 illustrates the performance of EnResNet8 for CIFAR10 classification measured in the AUC, and training and test accuracy. These results show that tuning the noise coefficient and the number of models in the ensemble is crucial to optimize the tradeoff between accuracy and privacy.
IV-D On the Importance of Skip Connections
Residual perturbations relies on the irreversibility of the SDEs (3) and (7), and this ansatz lies in the skip connections in the ResNet. We test both standard ResNet and the modified ResNet without skip connections. For CIFAR10 classification, under the same noise coefficient (), the test accuracy is for the En5ResNet8 (with skip connection); while the test accuracy is for the En5ResNet8 (without skip connection). Skip connections makes EnResNet more resistant to noise injection which is crucial for the success of residual perturbation for privacy protection.
IV-E ROC Curves for Experiments on Different Datasets
The receiver operating characteristic (ROC) curve can be used to illustrate the classification ability of a binary classifier. ROC curve is obtained by plotting the true positive rate against the false positive rate at different thresholds. The true positive rate, also known as recall, is the fraction of the positive set (all the positive samples) that is correctly inferred as a positive sample by the binary classifier. The false positive rate can be calculated by 1-specificity, where specificity is the fraction of the negative set (all the negative samples) that is correctly inferred as a negative sample by the binary classifier. In our case, the attack model is a binary classifier. Data points in the training set of the target model are tagged as positive samples, and data points out of the training set of the target model are tagged as negative samples. Then we plot ROC curves for different datasets (as shown in Fig. 7). These ROC curves show that if is sufficiently large, the attack model’s prediction will be nearly a random guess.
(a) CIFAR10 | (b) CIFAR100 | (c) IDC |
(En5ResNet8) | (En5ResNet8) | (En5ResNet8) |
IV-F Remark on the Privacy Budget
In the experiments above, we set the constants and to for Strategy I. For classifying IDC with ResNet8, the theoretical DP budget, based on Theorem 1, for Strategy I is and the DP-budget for DPSGD is . For classifying CIFAR10 with ResNet8, the DP budget, based on Theorem 1, for Strategy I is and the DP-budget for DPSGD is . Using the algorithm provided in [42], we estimate the empirical lower bound of the given for both Strategy I and DPSGD. The obtained empirical lower bound can guide the improvement of analytical tools to bound the DP budget — the larger gap between theoretical and empirical DP budget indicates more theoretical budget to improve. For IDC classification, the lower bound of for Strategy I and DPSGD are 3.604e-3 and 6.608e-3, respectively. And the lower bound of for Strategy I and DPSGD for CIFAR10 classification are 1.055e-1 and 1.558e-1, respectively. These empirical DP budget estimates show that Theorem 1 offers a quite loose DP budget compared to DPSGD. There are several challenges we need to overcome to get a tighter DP bound for Strategy I. Compared to DPSGD, it is significantly harder. In particular, 1) the loss function of the noise injected ResNets is highly nonlinear and very complex with respect to the weights, also the noise term appears in the loss function due to the noise injected in each residual mapping. 2) In our proof, we leverage the framework of subsampled Rényi-DP [37] to find a feasible range of noise variance parameter, and then convert to DP to get the value of for a given DP budget. This procedure will significantly reduce the accuracy of the estimated . We leave the tight DP guarantee as future work. In particular, how to reduce the accuracy of estimating due to the conversion between Rényi-DP and DP.
V Technical Proofs
V-A Proof of Theorem 1
V-A1 Rényi Differential Privacy (RDP)
We use the notion of RDP to prove the DP guarantees for residual perturbations.
Definition 3.
[36] (Rényi divergence) For any two probability distributions and defined over the distribution , the Rényi divergence of order is
Definition 4.
[36] (-RDP) A randomized mechanism is -Rényi DP of order or -RDP, if for any adjacent that differ by one entry, we have
Lemma 1.
[36] Let be -RDP and be -RDP, then the mechanism with and , satisfies -RDP.
Lemma 2.
[36] (From RDP to -DP) If is an -RDP mechanism, then it also satisfies -differential privacy for any .
Lemma 3.
[36] (Post-processing lemma) Let be a randomized algorithm that is -RDP, and let be an arbitrary randomized mapping. Then is -RDP.
V-A2 Proof of Theorem 1
In this subsection, we will give a proof of Theorem 1, i.e., DP-guarantee for the Strategy I.
Proof.
We prove Theorem 1 by mathematical induction. Consider two adjacent datasets that differ by one entry. For the first residual mapping, it is easy to check that when with being the standard deviation of the Gaussian noise injected into the input data, we have . For the remaining residual mappings, we denote the response of the -th residual mapping, for any two input data and , as , respectively. Based on our assumpution, we have
(12) | ||||
where the mean and are both bounded by the constant . If , according the post-processing lemma (Lemma 3), we have
(13) | ||||
so when the standard deviation of the injected Gaussian noise satisfies , (13) implies that
(14) | ||||
implying that . Moreover, note that
(15) | ||||
By the post-processing lemma (Lemma 3) again, we get
Let be the index set with , and we update as
(16) | ||||
where is the weights updated after the -th training iterations. When , it’s obviously that ; when , the equations which we use to update can be rewritten as
(17) | ||||
By Lemma 3, we have . Because there are only steps where we use the information of and . Replacing by and use composition theorem we can get after steps the output satisfies -RDP and satisfies -RDP. By Lemma 2, we can easily establish the DP-guarantee for Strategy I, as stated in Theorem 1. ∎
V-B Proof of Theorem 2
In this section, we will provide a proof for Theorem 2.
Proof.
Let , where BN is the batch normalization operation and is an activation function. Due to the property of batch normalization, we assume the norm of can be bounded by a positive constant . To show that the model (9) guarantees training data privacy given only black-box access to the model. Consider training the model (9) with two different datasets and , and we denote the resulting model as and , respectively. Next, we show that using appropriate and , for any input .
First, we consider the convolution layers, and let be the -th entry of the vectorized . Then we have . For any two different training datasets, we denote
and
where is a diagonal matrix with the -th diagonal entry being the square of the -th element of the vector .
Therefore, if , we have
Furthermore, guarantees -RDP for every convolution layer. For the last fully connected layer, if , we have
i.e., guarantees that the fully connected layer to be -RDP. According to Lemma 1, we have -RDP guarantee for the ResNet of residual mappings if and . Let , for any given pair, if and , then we have get the -DP guarantee for the ResNet with residual mapping using the residual perturbation Strategy II. ∎
V-C Proof of Theorem 3
In this section, we will proof that the residual perturbation (8) can reduce the generalization error via computing the Rademacher complexity. Let us first recap on some related lemmas on SDE and Rademacher complexity.
V-C1 Some Lemmas
Let be the loss function. Here we assume is bounded and is a positive constant. In addition, we denote the function class . The goal of the learning problem is to find such that the population risk is minimized. The gap between population risk and empirical risk is known as the generalization error. We have the following lemma and theorem to connect the population and empirical risks via Rademacher complexity.
Lemma 4.
(Ledoux-Talagrand inequality) [70]Let be a bounded real valued function space and let be a Lipschitz with constant L and . Then we have
Lemma 5.
[64]Let be samples chosen i.i.d. according to the distribution . If the loss function is bounded by . Then for any , with probability at least , the following holds for all ,
In addition, according to the Ledoux-Talagrand inequality and assume loss function is -lipschitz, we have
So the population risk can be bounded by the empirical risk and Rademacher complexity of the function class . Because we can’t minimize the population risk directly, we can minimize it indirectly by minimizing the empirical risk and Rademacher complexity of the function class . Next, we will further discuss Rademacher complexity of the function class . We first introduce several lemmas below.
Lemma 6.
[71] For any given matrix , the solution to the equation
has the following expression
Also, we can write the solution to the following equation
as
Obviously, we have .
Lemma 7.
For any circulant matrix with the first row being , we have the following eigen-decomposition where
and s are the roots of unity and .
V-C2 The proof of Theorem 3
Proof.
By the definition of Rademacher complexity (Def. 2), we have
Let and denote the -th element of as . Then by lemma 7, we have
Note that and according to Lemma 6, similar to proof for the function class we have
Therefore, we have completed the proof for the fact that the ensemble of Gaussian noise injected ResNets can reduce generalization error compared to the standard ResNet. ∎
VI Experiments on Strategy II
VI-A Forward and Backward Propagation Using (7)
Fig. 8 plots the forward and backward propagation of the image using the SDE model (7). Again, we cannot simply use the backward Euler-Maruyama discretization to reverse the features generated by propagating through the forward Euler-Maruyama discretization.
![]() |
![]() |
(a) (SDE) | (b) (SDE) |
VI-A1 Experiments on the IDC Dataset
In this subsection, we consider the performance of residual perturbation (Strategy II) in protecting membership privacy while retaining the classification accuracy on the IDC dataset. We use the same ResNet models as that used for the first residual perturbation. We list the results in Fig. 9, these results confirm that the residual perturbation (8) can effectively protect data privacy and maintain or even improve the classification accuracy. In addition, we depict the ROC curve for this experiment in Fig. 12(c). We note that, as the noise coefficient increases, the gap between training and testing accuracies narrows, which is consistent with Theorem 3.
Residual perturbation vs. DPSGD
We have shown that the first residual perturbation (6) outperforms the DPSGD in protecting membership privacy and improving classification accuracy. In this part, we further show that the second residual perturbation (8) also outperforms the benchmark DPSGD with the above settings. Table V lists the AUC of the attack model and training & test accuracy of the target model; we see that the second residual perturbation can also improve the classification accuracy and protecting comparable privacy.
Model | AUC | Training Acc | Test Acc |
---|---|---|---|
ResNet8 (DPSGD) | 0.503 | 0.831 | 0.828 |
En1ResNet8 | 0.509 | 0.880 | 0.868 |
En5ResNet8 | 0.500 | 0.895 | 0.872 |
VI-A2 Experiments on the CIFAR10/CIFAR100 Datasets
In this subsection, we will test the second residual perturbation (8) on the CIFAR10/CIFAR100 datasets with the same model using the same settings as before. Fig. 10 plots the performance of En5ResNet8 on the CIFAR10 dataset. These results show that the ensemble of ResNets with residual perturbation (8) is significantly more robust to the membership inference attack. For instance, the AUC of the attack model for ResNet8 and En5ResNet8 () is and , respectively. Also, the classification accuracy of En5ResNet8 () is higher than that of ResNet8, and their accuracy is % and % for CIFAR10 classification. Fig. 11 shows the results of En5ResNet8 for CIFAR100 classification. These results confirm that residual perturbation (8) can protect membership privacy and improve classification accuracy again.
VI-A3 ROC Curves for the Experiments on Different Datasets
Fig. 12 plots the ROC curves for the experiments on different datasets with different models using Strategy II. These ROC curves again show that if is sufficiently large, the attack model’s prediction will be nearly a random guess.
(a) CIFAR10 | (b) CIFAR100 | (c) IDC |
(En5ResNet8) | (En5ResNet8) | (En5ResNet8) |
VII More Experimental Details
We give the detailed construction of the velocity field in (3) and (7) that used to generate Figs. 1 and 8 in Algorithm 1.
VIII Concluding Remarks
We proposed residual perturbations, whose theoretical foundation lies in the theory of stochastic differential equations, to protect data privacy for deep learning. Theoretically, we prove that the residual perturbation can reduce the generalization gap with differential privacy guarantees. Numerically, we have shown that residual perturbations are effective in protecting membership privacy on some benchmark datasets. The proposed residual perturbation provides a feasible avenue for developing machine learning models that are more private and accurate than the baseline approach. Nevertheless, the current theoretical differential privacy budget is far from tight; developing analytical tools for analyzing a tighter privacy budget is an interesting future direction.
References
- [1] Yuen, Man-Ching, King, Irwin, Leung, and Kwong-Sak, “A Survey of Crowdsourcing Systems,” in Proceedings of the IEEE international conference on social computing (Socialcom 2011), 2011.
- [2] W. Feng, Z. Yan, H. Zhang, K. Zeng, Y. Xiao, and Y. Hou, “A Survey on Security, Privacy and Trust in Mobile Crowdsourcing,” IEEE Internet of Things Journal, 2017.
- [3] Y. Liu, K. Gadepalli, M. Norouzi, G. E. Dahl, and M. C. Stumpe, “Detecting Cancer Metastases on Gigapixel Pathology Images,” arXiv:1703.02442, 2017.
- [4] M. Fredrikson, S. Jha, and T. Ristenpart, “Model Inversion Attacks that Exploit Confidence Information and Basic Countermeasures,” in 22nd ACM SIGSAC Conference on Computer and Communications Security (CCS 2015), 2015.
- [5] R. Shokri, M. Stronati, C. Song, and V. Shmatikov, “Membership inference attacks against machine learning models,” in 2017 IEEE Symposium on Security and Privacy (SP), pp. 3–18, IEEE, 2017.
- [6] A. Salem, Y. Zhang, M. Humbert, P. Berrang, M. Fritz, and M. Backes, “Ml-leaks: Model and data independent membership inference attacks and defenses on machine learning models,” arXiv preprint arXiv:1806.01246, 2018.
- [7] S. Yeom, I. Giacomelli, M. Fredrikson, and S. Jha, “Privacy risk in machine learning: Analyzing the connection to overfitting,” in 2018 IEEE 31st Computer Security Foundations Symposium (CSF), pp. 268–282, IEEE, 2018.
- [8] A. Sablayrolles, M. Douze, C. Schmid, and H. Jégou, “D’eja vu: an empirical evaluation of the memorization properties of convnets,” arXiv preprint arXiv:1809.06396, 2018.
- [9] M. Fredrikson, E. Lantz, S. Jha, S. Lin, D. Page, and T. Ristenpart, “Privacy in pharmacogenetics: An end-to-end case study of personalized warfarin dosing,” in 23rd USENIX Security Symposium (USENIX Security 14), pp. 17–32, 2014.
- [10] F. Tramèr, F. Zhang, A. Juels, M. K. Reiter, and T. Ristenpart, “Stealing machine learning models via prediction apis,” in 25th USENIX Security Symposium (USENIX Security 16), pp. 601–618, 2016.
- [11] N. Z. Gong and B. Liu, “Attribute inference attacks in online social networks,” ACM Transactions on Privacy and Security (TOPS), vol. 21, no. 1, pp. 1–30, 2018.
- [12] M. Fredrikson, S. Jha, and T. Ristenpart, “Model inversion attacks that exploit confidence information and basic countermeasures,” in Proceedings of the 22nd ACM SIGSAC Conference on Computer and Communications Security, pp. 1322–1333, 2015.
- [13] M. Al-Rubaie and J. M. Chang, “Reconstruction attacks against mobile-based continuous authentication systems in the cloud,” IEEE Transactions on Information Forensics and Security, vol. 11, no. 12, pp. 2648–2663, 2016.
- [14] N. Z. Gong and B. Liu, “You are who you know and how you behave: Attribute inference attacks via users’ social friends and behaviors,” in 25th USENIX Security Symposium (USENIX Security 16), pp. 979–995, 2016.
- [15] X. Zheng, Z. Cai, and Y. Li, “Data linkage in smart internet of things systems: A consideration from a privacy perspective,” IEEE Communications Magazine, vol. 56, no. 9, pp. 55–61, 2018.
- [16] Y. Lindell and B. Pinkas, “Privacy preserving data mining,” in Annual International Cryptology Conference, pp. 36–54, Springer, 2000.
- [17] M. Barreno, B. Nelson, R. Sears, A. D. Joseph, and J. D. Tygar, “Can machine learning be secure?,” in Proceedings of the 2006 ACM Symposium on Information, computer and communications security, pp. 16–25, 2006.
- [18] E. Hesamifard, H. Takabi, M. Ghasemi, and R. N. Wright, “Privacy-preserving machine learning as a service,” Proceedings on Privacy Enhancing Technologies, vol. 2018, no. 3, pp. 123–142, 2018.
- [19] H. Bae, D. Jung, and S. Yoon, “Anomigan: Generative adversarial networks for anonymizing private medical data,” arXiv preprint arXiv:1901.11313, 2019.
- [20] C. Dwork, F. McSherry, K. Nissim, and A. Smith, “Calibrating noise to sensitivity in private data analysis,” in Theory of cryptography conference, pp. 265–284, Springer, 2006.
- [21] H. B. McMahan, E. Moore, D. Ramage, S. Hampson, et al., “Communication-efficient learning of deep networks from decentralized data,” arXiv preprint arXiv:1602.05629, 2016.
- [22] J. Konečnỳ, H. B. McMahan, F. X. Yu, P. Richtárik, A. T. Suresh, and D. Bacon, “Federated learning: Strategies for improving communication efficiency,” arXiv preprint arXiv:1610.05492, 2016.
- [23] L. Sweeney, “k-anonymity: A model for protecting privacy,” International Journal of Uncertainty, Fuzziness and Knowledge-Based Systems, vol. 10, no. 05, pp. 557–570, 2002.
- [24] K. El Emam and F. K. Dankar, “Protecting privacy using k-anonymity,” Journal of the American Medical Informatics Association, vol. 15, no. 5, pp. 627–637, 2008.
- [25] K. Chaudhuri, C. Monteleoni, and A. D. Sarwate, “Differentially private empirical risk minimization,” Journal of Machine Learning Research, vol. 12, no. Mar, pp. 1069–1109, 2011.
- [26] R. Bassily, A. Smith, and A. Thakurta, “Private empirical risk minimization: Efficient algorithms and tight error bounds,” in 2014 IEEE 55th Annual Symposium on Foundations of Computer Science, pp. 464–473, IEEE, 2014.
- [27] R. Shokri and V. Shmatikov, “Privacy-Preserving Deep Learning,” in 22nd ACM SIGSAC Conference on Computer and Communications Security (CCS 2015), 2015.
- [28] M. Abadi, A. Chu, I. Goodfellow, H. B. McMahan, I. Mironov, K. Talwar, and L. Zhang, “Deep learning with differential privacy,” in Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security, pp. 308–318, 2016.
- [29] E. Bagdasaryan, O. Poursaeed, and V. Shmatikov, “Differential privacy has disparate impact on model accuracy,” in Advances in Neural Information Processing Systems, pp. 15453–15462, 2019.
- [30] L. Zhu, Z. Liu, and S. Han, “Deep leakage from gradients,” in Advances in Neural Information Processing Systems, pp. 14747–14756, 2019.
- [31] Z. Wang, M. Song, Z. Zhang, Y. Song, Q. Wang, and H. Qi, “Beyond inferring class representatives: User-level privacy leakage from federated learning,” in IEEE INFOCOM 2019-IEEE Conference on Computer Communications, pp. 2512–2520, IEEE, 2019.
- [32] M. Abadi, A. Chu, I. Goodfellow, H. McMahan, I. Mironov, K. Talwar, and L. Zhang, “Deep Learning with Differential Privacy,” in 23rd ACM Conference on Computer and Communications Security (CCS 2016), 2016.
- [33] K. He, X. Zhang, S. Ren, and J. Sun, “Deep residual learning for image recognition,” in Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778, 2016.
- [34] N. Papernot, M. Abadi, L. Erlingsson, I. Goodfellow, and K. Talwar, “Semisupervised Knowledge Transfer for Deep Learning from Private Training Data,” in 5th International Conference on Learning Representation (ICLR 2017), 2017.
- [35] N. Papernot, S. Song, I. Mironov, A. Raghunathan, and L. Erlingsson, “Scalable Private Learning with PATE,” in International Conference on Learning Representations (ICLR 2018), 2018.
- [36] I. Mironov, “Rényi differential privacy,” in 2017 IEEE 30th Computer Security Foundations Symposium (CSF), pp. 263–275, IEEE, 2017.
- [37] Y. X. Wang, B. Balle, and S. Kasiviswanathan, “Subsampled R’enyi Differential Privacy and Analytical Moments Accountant,” arXiv preprint arXiv:1808.00087, 2018.
- [38] J. Dong, A. Roth, and W. J. Su, “Gaussian differential privacy,” arXiv preprint arXiv:1905.02383, 2019.
- [39] B. Wang, Q. Gu, M. Boedihardjo, F. Barekat, and S. J. Osher, “Dp-lssgd: A stochastic optimization method to lift the utility in privacy-preserving erm,” arXiv preprint arXiv:1906.12056, 2019.
- [40] Z. Liang, B. Wang, Q. Gu, S. Osher, and Y. Yao, “Exploring private federated learning with laplacian smoothing,” arXiv preprint arXiv:2005.00218, 2020.
- [41] O. Kotevska, F. Alamudun, and C. Stanley, “Optimal balance of privacy and utility with differential privacy deep learning frameworks,” in 2021 International Conference on Computational Science and Computational Intelligence (CSCI), pp. 425–430, 2021.
- [42] M. Jagielski, J. Ullman, and A. Oprea, “Auditing differentially private machine learning: How private is private sgd?,” Advances in Neural Information Processing Systems, vol. 33, pp. 22205–22216, 2020.
- [43] I. Mironov, K. Talwar, and L. Zhang, “R’enyi differential privacy of the sampled gaussian mechanism,” arXiv preprint arXiv:1908.10530, 2019.
- [44] L. Yu, L. Liu, C. Pu, M. E. Gursoy, and S. Truex, “Differentially private model publishing for deep learning,” in 2019 IEEE symposium on security and privacy (SP), pp. 332–349, IEEE, 2019.
- [45] H. Zhong and K. Bu, “Privacy-utility trade-off,” arXiv preprint arXiv:2204.12057, 2022.
- [46] K. Mivule, C. Turner, and S.-Y. Ji, “Towards a differential privacy and utility preserving machine learning classifier,” Procedia Computer Science, vol. 12, pp. 176–181, 2012.
- [47] M. Showkatbakhsh, C. Karakus, and S. Diggavi, “Privacy-utility trade-off of linear regression under random projections and additive noise,” in 2018 IEEE International Symposium on Information Theory (ISIT), pp. 186–190, IEEE, 2018.
- [48] A. S. Rakin, Z. He, and D. Fan, “Parametric noise injection: Trainable randomness to improve deep neural network robustness against adversarial attack,” arXiv preprint arXiv:1811.09310, 2018.
- [49] B. Wang, Z. Shi, and S. Osher, “Resnets ensemble via the feynman-kac formalism to improve natural and robust accuracies,” in Advances in Neural Information Processing Systems, pp. 1655–1665, 2019.
- [50] X. Liu, T. Xiao, SiSi, Q. Cao, S. Kumar, and C.-J. Hsieh, “Neural sde: Stabilizing neural ode networks with stochastic noise,” arXiv preprint arXiv:1906.02355, 2019.
- [51] D. Su, H. Zhang, H. Chen, J. Yi, P.-Y. Chen, and Y. Gao, “Is robustness the cost of accuracy?–a comprehensive study on the robustness of 18 deep image classification models,” in Proceedings of the European Conference on Computer Vision (ECCV), pp. 631–648, 2018.
- [52] D. Tsipras, S. Santurkar, L. Engstrom, A. Turner, and A. Madry, “Robustness may be at odds with accuracy,” in International Conference on Learning Representations, 2019.
- [53] D. Stutz, M. Hein, and B. Schiele, “Disentangling adversarial robustness and generalization,” in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 6976–6987, 2019.
- [54] J. Gilmer, L. Metz, F. Faghri, S. S. Schoenholz, M. Raghu, M. Wattenberg, and I. Goodfellow, “Adversarial spheres,” arXiv preprint arXiv:1801.02774, 2018.
- [55] Z. Zhao, D. Dua, and S. Singh, “Generating natural adversarial examples,” in International Conference on Learning Representations, 2018.
- [56] A. Raghunathan, S. M. Xie, F. Yang, J. Duchi, and P. Liang, “Understanding and mitigating the tradeoff between robustness and accuracy,” in Proceedings of the 37th International Conference on Machine Learning (H. D. III and A. Singh, eds.), vol. 119 of Proceedings of Machine Learning Research, pp. 7909–7919, PMLR, 13–18 Jul 2020.
- [57] Y. Carmon, A. Raghunathan, L. Schmidt, P. Liang, and J. C. Duchi, “Unlabeled data improves adversarial robustness,” in Proceedings of the 33rd International Conference on Neural Information Processing Systems, pp. 11192–11203, 2019.
- [58] A. Najafi, S.-i. Maeda, M. Koyama, and T. Miyato, “Robustness to adversarial perturbations in learning from incomplete data,” in Proceedings of the 33rd International Conference on Neural Information Processing Systems, pp. 5541–5551, 2019.
- [59] J.-B. Alayrac, J. Uesato, P.-S. Huang, A. Fawzi, R. Stanforth, and P. Kohli, “Are labels required for improving adversarial robustness?,” Advances in Neural Information Processing Systems, vol. 32, 2019.
- [60] D. J. Higham, “An algorithmic introduction to numerical simulation of stochastic differential equations,” SIAM review, vol. 43, no. 3, pp. 525–546, 2001.
- [61] C. Dwork and V. Feldman, “Privacy-preserving prediction,” in Conference On Learning Theory, pp. 1693–1702, PMLR, 2018.
- [62] R. Bassily, O. Thakkar, and A. Thakurta, “Model-agnostic private learning via stability,” arXiv preprint arXiv:1803.05101, 2018.
- [63] B. Wu, S. Zhao, G. Sun, X. Zhang, Z. Su, C. Zeng, and Z. Liu, “P3sgd: Patient privacy preserving sgd for regularizing deep cnns in pathological image classification,” in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2099–2108, 2019.
- [64] P. L. Barlett and S. Mendelson, “Rademacher and gaussian complexities: Risk bounds and structural results.,” Jounal of Machine Learning Research, 2002.
- [65] A. Krizhevsky, G. Hinton, et al., “Learning multiple layers of features from tiny images,” 2009.
- [66] “Invasive ductal carcinoma (idc) histology image dataset,”
- [67] B. Wu, C. Chen, S. Zhao, C. Chen, Y. Yao, G. Sun, L. Wang, X. Zhang, and J. Zhou, “Characterizing membership privacy in stochastic gradient langevin dynamics,” arXiv preprint arXiv:1910.02249, 2019.
- [68] D. P. Kingma and J. Ba, “Adam: A method for stochastic optimization,” arXiv preprint arXiv:1412.6980, 2014.
- [69] H. B. McMahan, G. Andrew, U. Erlingsson, S. Chien, I. Mironov, N. Papernot, and P. Kairouz, “A general approach to adding differential privacy to iterative training procedures,” arXiv preprint arXiv:1812.06210, 2018.
- [70] L. M and Talagrand, Probability in Banach spaces: Isoperimetry and processes. Springer, 2002.
- [71] F. C. Klebaner, Introduction to stochastic calculus with applications. Springer, 2005.
Wenqi Tao is a Ph.D. student in mathematics at Tsinghua University. His research focuses on graph-based machine learning and deep learning. |
Huaming Ling is a Ph.D. student in mathematics at Tsinghua University. His research focuses on deep learning and stochastic optimization algorithms. |
Zuoqiang Shi received Ph.D. in 2008 from Tsinghua University. He is an associate professor of mathematics at Tsinghua University. |
Bao Wang received Ph.D. in 2016 from Michigan State University. He is an assistant professor of mathematics at the University of Utah. He is a recipient of the Chancellor’s award for postdoc research at UCLA. His research interests include scientific computing and deep learning. |