Certified Robustness to Adversarial Examples with Differential Privacy

Mathias Lecuyer, Vaggelis Atlidakis, Roxana Geambasu, Daniel Hsu, Suman Jana

I Introduction

Deep neural networks (DNNs) perform exceptionally well on many machine learning tasks, including safety- and security-sensitive applications such as self-driving cars , malware classification , face recognition , and critical infrastructure . Robustness against malicious behavior is important in many of these applications, yet in recent years it has become clear that DNNs are vulnerable to a broad range of attacks. Among these attacks – broadly surveyed in – are adversarial examples: the adversary finds small perturbations to correctly classified inputs that cause a DNN to produce an erroneous prediction, possibly of the adversary’s choosing . Adversarial examples pose serious threats to security-critical applications. A classic example is an adversary attaching a small, human-imperceptible sticker onto a stop sign that causes a self-driving car to recognize it as a yield sign. Adversarial examples have also been demonstrated in domains such as reinforcement learning and generative models .

Since the initial demonstration of adversarial examples , numerous attacks and defenses have been proposed, each building on one another. Initially, most defenses used best-effort approaches and were broken soon after introduction. Model distillation, proposed as a robust defense in , was subsequently broken in . Other work claimed that adversarial examples are unlikely to fool machine learning (ML) models in the real-world, due to the rotation and scaling introduced by even the slightest camera movements. However, demonstrated a new attack strategy that is robust to rotation and scaling. While this back-and-forth has advanced the state of the art, recently the community has started to recognize that rigorous, theory-backed, defensive approaches are required to put us off this arms race.

Accordingly, a new set of certified defenses have emerged over the past year, that provide rigorous guarantees of robustness against norm-bounded attacks . These works alter the learning methods to both optimize for robustness against attack at training time and permit provable robustness checks at inference time. At present, these methods tend to be tied to internal network details, such as the type of activation functions and the network architecture. They struggle to generalize across different types of DNNs and have only been evaluated on small networks and datasets.

We propose a new and orthogonal approach to certified robustness against adversarial examples that is broadly applicable, generic, and scalable. We observe for the first time a connection between differential privacy (DP), a cryptography-inspired formalism, and a definition of robustness against norm-bounded adversarial examples in ML. We leverage this connection to develop PixelDP, the first certified defense we are aware of that both scales to large networks and datasets (such as Google’s Inception network trained on ImageNet) and can be adapted broadly to arbitrary DNN architectures. Our approach can even be incorporated with no structural changes in the target network (e.g., through a separate auto-encoder as described in Section III-B). We provide a brief overview of our approach below along with the section references that detail the corresponding parts.

§II establishes the DP-robustness connection formally (our first contribution). To give the intuition, DP is a framework for randomizing computations running on databases such that a small change in the database (removing or altering one row or a small set of rows) is guaranteed to result in a bounded change in the distribution over the algorithm’s outputs. Separately, robustness against adversarial examples can be defined as ensuring that small changes in the input of an ML predictor (such as changing a few pixels in an image in the case of an \l0\l_{0}-norm attack) will not result in drastic changes to its predictions (such as changing its label from a stop to a yield sign). Thus, if we think of a DNN’s inputs (e.g., images) as databases in DP parlance, and individual features (e.g., pixels) as rows in DP, we observe that randomizing the outputs of a DNN’s prediction function to enforce DP on a small number of pixels in an image guarantees robustness of predictions against adversarial examples that can change up to that number of pixels. The connection can be expanded to standard attack norms, including \l1\l_{1}, \l2\l_{2}, and l∞l_{\infty} norms.

§III describes PixelDP, the first certified defense against norm-bounded adversarial examples based on differential privacy (our second contribution). Incorporating DP into the learning procedure to increase robustness to adversarial examples requires is completely different and orthogonal to using DP to preserve the privacy of the training set, the focus of prior DP ML literature (as § VI explains). A PixelDP DNN includes in its architecture a DP noise layer that randomizes the network’s computation, to enforce DP bounds on how much the distribution over its predictions can change with small, norm-bounded changes in the input. At inference time, we leverage these DP bounds to implement a certified robustness check for individual predictions. Passing the check for a given input guarantees that no perturbation exists up to a particular size that causes the network to change its prediction. The robustness certificate can be used to either act exclusively on robust predictions, or to lower-bound the network’s accuracy under attack on a test set.

§IV presents the first experimental evaluation of a certified adversarial-examples defense for the Inception network trained on the ImageNet dataset (our third contribution). We additionally evaluate PixelDP on various network architectures for four other datasets (CIFAR-10, CIFAR-100, SVHN, MNIST), on which previous defenses – both best effort and certified – are usually evaluated. Our results indicate that PixelDP is (1) as effective at defending against attacks as today’s state-of-the-art, best-effort defense and (2) more scalable and broadly applicable than a prior certified defense.

Our experience points to DP as a uniquely generic, broadly applicable, and flexible foundation for certified defense against norm-bounded adversarial examples (§V, §VI). We credit these properties to the post-processing property of DP, which lets us incorporate the certified defense in a network-agnostic way.

II DP-Robustness Connection

Adversarial Examples. Adversarial examples are a class of attack against ML models, studied particularly on deep neural networks for multiclass image classification. The attacker constructs a small change to a given, fixed input, that wildly changes the predicted output. Notationally, if the input is xx, we denote an adversarial version of that input by x+αx+\alpha, where α\alpha is the change or perturbation introduced by the attacker. When xx is a vector of pixels (for images), then xix_{i} is the ii’th pixel in the image and αi\alpha_{i} is the change to the ii’th pixel.

It is natural to constrain the amount of change an attacker is allowed to make to the input, and often this is measured by the pp-norm of the change, denoted by ∥α∥p\|\alpha\|_{p}. For 1≤p<∞1\leq p<\infty, the pp-norm of α\alpha is defined by ∥α∥p=(∑i=1n∣αi∣p)1/p\|\alpha\|_{p}=(\sum_{i=1}^{n}|\alpha_{i}|^{p})^{1/p}; for p=∞p=\infty, it is ∥α∥∞=max⁡i∣αi∣\|\alpha\|_{\infty}=\max_{i}|\alpha_{i}|. Also commonly used is the -norm (which is technically not a norm): ∥α∥0=∣{i:αi≠0}∣\|\alpha\|_{0}=|\{i:\alpha_{i}\neq 0\}|. A small -norm attack is permitted to arbitrarily change a few entries of the input; for example, an attack on the image recognition system for self-driving cars based on putting a sticker in the field of vision is such an attack . Small pp-norm attacks for larger values of pp (including p=∞p=\infty) require the changes to the pixels to be small in an aggregate sense, but the changes may be spread out over many or all features. A change in the lighting condition of an image may correspond to such an attack . The latter attacks are generally considered more powerful, as they can easily remain invisible to human observers. Other attacks that are not amenable to norm bounding exist , but this paper deals exclusively with norm-bounded attacks.

Robustness Definition. Intuitively, a predictive model may be regarded as robust to adversarial examples if its output is insensitive to small changes to any plausible input that may be encountered in deployment. To formalize this notion, we must first establish what qualifies as a plausible input. This is difficult: the adversarial examples literature has not settled on such a definition. Instead, model robustness is typically assessed on inputs from a test set that are not used in model training – similar to how accuracy is assessed on a test set and not a property on all plausible inputs. We adopt this view of robustness.

Next, given an input, we must establish a definition for insensitivity to small changes to the input. We say a model ff is insensitive, or robust, to attacks of pp-norm LL on a given input xx if f(x)=f(x+α)f(x)=f(x+\alpha) for all α∈Bp(L)\alpha\in B_{p}(L). If ff is a multiclass classification model based on label scores (as in §II-A), this is equivalent to:

where k:=f(x)k:=f(x). A small change in the input does not alter the scores so much as to change the predicted label.

II-B DP Background

DP is concerned with whether the output of a computation over a database can reveal information about individual records in the database. To prevent such information leakage, randomness is introduced into the computation to hide details of individual records.

A randomized algorithm AA that takes as input a database dd and outputs a value in a space OO is said to satisfy (ϵ,δ)(\epsilon,\delta)-DP with respect to a metric ρ\rho over databases if, for any databases dd and d′d^{\prime} with ρ(d,d′)≤1\rho(d,d^{\prime})\leq 1, and for any subset of possible outputs S⊆OS\subseteq O, we have

Here, ϵ>0\epsilon>0 and δ∈\delta\in are parameters that quantify the strength of the privacy guarantee. In the standard DP definition, the metric ρ\rho is the Hamming metric, which simply counts the number of entries that differ in the two databases. For small ϵ\epsilon and δ\delta, the standard (ϵ,δ)(\epsilon,\delta)-DP guarantee implies that changing a single entry in the database cannot change the output distribution very much. DP also applies to general metrics ρ\rho , including pp-norms relevant to norm-based adversarial examples.

Our approach relies on two key properties of DP. First is the well-known post-processing property: any computation applied to the output of an (ϵ,δ)(\epsilon,\delta)-DP algorithm remains (ϵ,δ)(\epsilon,\delta)-DP. Second is the expected output stability property, a rather obvious but not previously enunciated property that we prove in Lemma 1: the expected value of an (ϵ,δ)(\epsilon,\delta)-DP algorithm with bounded output is not sensitive to small changes in the input.

The expectation is taken over the randomness in AA.

Consider any α∈Bp(1)\alpha\in B_{p}(1), and let x′:=x+αx^{\prime}:=x+\alpha. We write the expected output as:

We next apply Equation (2) from the (ϵ,δ)(\epsilon,\delta)-DP property:

Since δ\delta is a constant, ∫0bδdt=bδ\int_{0}^{b}\delta dt=b\delta. ∎

II-C DP-Robustness Connection

The intuition behind using DP to provide robustness to adversarial examples is to create a DP scoring function such that, given an input example, the predictions are DP with regards to the features of the input (e.g. the pixels of an image). In this setting, we can derive stability bounds for the expected output of the DP function using Lemma 1. The bounds, combined with Equation (1), give a rigorous condition (or certification) for robustness to adversarial examples.

Formally, regard the feature values (e.g., pixels) of an input xx as the records in a database, and consider a randomized scoring function AA that, on input xx, outputs scores (y1(x),…,yK(x))(y_{1}(x),\dotsc,y_{K}(x)) (with yk(x)∈y_{k}(x)\in and ∑k=1Kyk(x)=1\sum_{k=1}^{K}y_{k}(x)=1). We say that AA is an (ϵ,δ)\epsilon,\delta)-pixel-level differentially private (or (ϵ,δ\epsilon,\delta)-PixelDP) function if it satisfies (ϵ,δ)(\epsilon,\delta)-DP (for a given metric). This is formally equivalent to the standard definition of DP, but we use this terminology to emphasize the context in which we apply the definition, which is fundamentally different than the context in which DP is traditionally applied in ML (see §VI for distinction).

Lemma 1 directly implies bounds on the expected outcome on an (ϵ,δ)(\epsilon,\delta)-PixelDP scoring function:

Suppose a randomized function AA satisfies (ϵ,δ)(\epsilon,\delta)-PixelDP with respect to a pp-norm metric, and where A(x)=(y1(x),…,yK(x)), yk(x)∈A(x)=(y_{1}(x),\dotsc,y_{K}(x)),\ y_{k}(x)\in:

(Robustness Condition) Suppose AA satisfies (ϵ,δ)(\epsilon,\delta)-PixelDP with respect to a pp-norm metric. For any input xx, if for some k∈Kk\in\mathcal{K},

Consider any α∈Bp(1)\alpha\in B_{p}(1), and let x′:=x+αx^{\prime}:=x+\alpha. From Equation (3), we have:

the very definition of robustness at xx (Equation (1)). ∎

The preceding certification test is exact regardless of the value of the δ\delta parameter of differential privacy: there is no failure probability in this test. The test applies only to attacks of pp-norm size of 11, however all preceding results generalize to attacks of pp-norm size LL, i.e., when ∥α∥p≤L\|\alpha\|_{p}\leq L, by applying group privacy . The next section shows how to apply group privacy (§III-B) and generalize the certification test to make it practical (§III-D).

III PixelDP Certified Defense

PixelDP is a certified defense against pp-norm bounded adversarial example attacks built on the preceding DP-robustness connection. Fig. 1(a) shows an example PixelDP DNN architecture for multi-class image classification. The original architecture is shown in blue; the changes introduced to make it PixelDP are shown in red. Denote QQ the original DNN’s scoring function; it is a deterministic map from images xx to a probability distribution over the KK labels Q(x)=(y1(x),…,yK(x))Q(x)=(y_{1}(x),\dotsc,y_{K}(x)). The vulnerability to adversarial examples stems from the unbounded sensitivity of QQ with respect to pp-norm changes in the input. Making the DNN (ϵ,δ)(\epsilon,\delta)-PixelDP involves adding calibrated noise to turn QQ into an (ϵ,δ)(\epsilon,\delta)-DP randomized function AQA_{Q}; the expected output of that function will have bounded sensitivity to pp-norm changes in the input. We achieve this by introducing a noise layer (shown in red in Fig. 1(a)) that adds zero-mean noise to the output of the layer preceding it (layer1 in Fig. 1(a)). The noise is drawn from a Laplace or Gaussian distribution and its standard deviation is proportional to: (1) LL, the pp-norm attack bound for which we are constructing the network and (2) Δ\Delta, the sensitivity of the pre-noise computation (the grey box in Fig. 1(a)) with respect to pp-norm input changes.

One can use PixelDP’s certification check in two ways: (1) one can decide only to actuate on predictions that are deemed robust to attacks of a particular size; or (2) one can compute, on a test set, a lower bound of a PixelDP network’s accuracy under pp-norm bounded attack, independent of how the attack is implemented. This bound, called certified accuracy, will hold no matter how effective future generations of the attack are.

The remainder of this section details the noise layer, training, and certified prediction procedures. To simplify notation, we will henceforth use AA instead of AQA_{Q}.

III-B DP Noise Layer

The noise layer enforces (ϵ,δ)(\epsilon,\delta)-PixelDP by inserting noise inside the DNN using one of two well-known DP mechanisms: the Laplacian and Gaussian mechanisms. Both rely upon the sensitivity of the pre-noise layers (function gg). The sensitivity of a function gg is defined as the maximum change in output that can be produced by a change in the input, given some distance metrics for the input and output (pp-norm and qq-norm, respectively):

Assuming we can compute the sensitivity of the pre-noise layers (addressed shortly), the noise layer leverages the Laplace and Gaussian mechanisms as follows. On every invocation of the network on an input xx (whether for training or prediction) the noise layer computes g(x)+Zg(x)+Z, where the coordinates Z=(Z1,…,Zm)Z=(Z_{1},\dotsc,Z_{m}) are independent random variables from a noise distribution defined by the function noise(Δ,L,ϵ,δ)noise(\Delta,L,\epsilon,\delta).

Laplacian mechanism: noise(Δ,L,ϵ,δ)noise(\Delta,L,\epsilon,\delta) uses the Laplace distribution with mean zero and standard deviation σ=2Δp,1L/ϵ\sigma=\sqrt{2}\Delta_{p,1}L/\epsilon; it gives (ϵ,0)(\epsilon,0)-DP.

Gaussian mechanism: noise(Δ,L,ϵ,δ)noise(\Delta,L,\epsilon,\delta) uses the Gaussian distribution with mean zero and standard deviation σ=2ln⁡(1.25δ)Δp,2L/ϵ\sigma=\sqrt{2\ln(\frac{1.25}{\delta})}\Delta_{p,2}L/\epsilon; it gives (ϵ,δ)(\epsilon,\delta)-DP for ϵ≤1\epsilon\leq 1.

Here, LL denotes the pp-norm size of the attack against which the PixelDP network provides (ϵ,δ)(\epsilon,\delta)-DP; we call it the construction attack bound. The noise formulas show that for a fixed noise standard deviation σ\sigma, the guarantee degrades gracefully: attacks twice as big halve the ϵ\epsilon in the DP guarantee (L←2L⇒ϵ←2ϵL\leftarrow 2L\Rightarrow\epsilon\leftarrow 2\epsilon). This property is often referred as group privacy in the DP literature .

Computing the sensitivity of the pre-noise function gg depends on where we choose to place the noise layer in the DNN. Because the post-processing property of DP carries the (ϵ,δ)(\epsilon,\delta)-PixelDP guarantee from the noise layer through the end of the network, a DNN designer has great flexibility in placing the noise layer anywhere in the DNN, as long as no skip connection exists from pre-noise to post-noise layers. We discuss here several options for noise layer placement and how to compute sensitivity for each. Our methods are not closely tied to particular network architectures and can therefore be applied on a wide variety of networks.

Option 1: Noise in the Image. The most straightforward placement of the noise layer is right after the input layer, which is equivalent to adding noise to individual pixels of the image. This case makes sensitivity analysis trivial: gg is the identity function, Δ1,1=1\Delta_{1,1}=1, and Δ2,2=1\Delta_{2,2}=1.

Option 2: Noise after First Layer. Another option is to place the noise after the first hidden layer, which is usually simple and standard for many DNNs. For example, in image classification, networks often start with a convolution layer. In other cases, DNNs start with fully connected layer. These linear initial layers can be analyzed and their sensitivity computed as follows.

Option 3: Noise Deeper in the Network. One can consider adding noise later in the network using the fact that when applying two functions in a row f1(f2(x))f_{1}(f_{2}(x)) we have: Δp,q(f1∘f2)≤Δp,r(f2)Δr,q(f1)\Delta^{(f_{1}\circ f_{2})}_{p,q}\leq\Delta^{(f_{2})}_{p,r}\Delta^{(f_{1})}_{r,q}. For instance, ReLU has a sensitivity of 11 for p,q∈{1,2,∞}p,q\in\{1,2,\infty\}, hence a linear layer followed by a ReLU has the same bound on the sensitivity as the linear layer alone. However, we find that this approach for sensitivity analysis is difficult to generalize. Combining bounds in this way leads to looser and looser approximations. Moreover, layers such as batch normalization , which are popular in image classification networks, do not appear amenable to such bounds (indeed, they are assumed away by some previous defenses ). Thus, our general recommendation is to add the DP noise layer early in the network – where bounding the sensitivity is easy – and taking advantage of DP’s post-processing property to carry the sensitivity bound through the end of the network.

Option 4: Noise in Auto-encoder. Pushing this reasoning further, we uncover an interesting placement possibility that underscores the broad applicability and flexibility of our approach: adding noise “before” the DNN in a separately trained auto-encoder. An auto-encoder is a special form of DNN trained to predict its own input, essentially learning the identity function f(x)=xf(x)=x. Auto-encoders are typically used to de-noise inputs , and are thus a good fit for PixelDP. Given an image dataset, we can train a (ϵ,δ)(\epsilon,\delta)-PixelDP auto-encoder using the previous noise layer options. We stack it before the predictive DNN doing the classification and fine-tune the predictive DNN by running a few training steps on the combined auto-encoder and DNN. Thanks to the decidedly useful post-processing property of DP, the stacked DNN and auto-encoder are (ϵ,δ)(\epsilon,\delta)-PixelDP.

This approach has two advantages. First, the auto-encoder can be developed independently of the DNN, separating the concerns of learning a good PixelDP model and a good predictive DNN. Second, PixelDP auto-encoders are much smaller than predictive DNNs, and are thus much faster to train. We leverage this property to train the first certified model for the large ImageNet dataset, using an auto-encoder and the pre-trained Inception-v3 model, a substantial relief in terms of experimental work (§IV-A).

III-C Training Procedure

The soundness of PixelDP’s certifications rely only on enforcing DP at prediction time. Theoretically, one could remove the noise layer during training. However, doing so results in near-zero certified accuracy in our experience. Unfortunately, training with noise anywhere except in the image itself raises a new challenge: left unchecked the training procedure will scale up the sensitivity of the pre-noise layers, voiding the DP guarantees.

To avoid this, we alter the pre-noise computation to keep its sensitivity constant (e.g. Δp,q≤1\Delta_{p,q}\leq 1) during training. The specific technique we use depends on the type of sensitivity we need to bound, i.e. on the values of pp and qq. For Δ1,1\Delta_{1,1}, Δ1,2\Delta_{1,2}, or Δ∞,∞\Delta_{\infty,\infty}, we normalize the columns, or rows, of linear layers and use the regular optimization process with fixed noise variance. For Δ2,2\Delta_{2,2}, we run the projection step described in after each gradient step from the stochastic gradient descent (SGD). This makes the pre-noise layers Parseval tight frames, enforcing Δ2,2=1\Delta_{2,2}=1. For the pre-noise layers, we thus alternate between an SGD step with fixed noise variance and a projection step. Subsequent layers from the original DNN are left unchanged.

III-D Certified Prediction Procedure

The proof is similar to the one for Proposition 1 and is detailed in Appendix A-A. Note that the DP bounds are not probabilistic even for δ>0\delta>0; the failure probability 1−η1-\eta comes from the Monte Carlo estimate and can be made arbitrarily small with more invocations of A(x)A(x).

Thus far, we have described PixelDP certificates as binary with respect to a fixed attack bound, LL: we either meet or do not meet a robustness check for LL. In fact, our formalism allows for a more nuanced certificate, which gives the maximum attack size LmaxL_{max} (measured in pp-norm) against which the prediction on input xx is guaranteed to be robust: no attack within this size from xx will be able to change the highest probability. LmaxL_{max} can differ for different inputs. We compute the robustness size certificate for input xx as follows. Recall from III-B that the DP mechanisms have a noise standard deviation σ\sigma that grows in Δp,qLϵ\frac{\Delta_{p,q}L}{\epsilon}. For a given σ\sigma used at prediction time, we solve for the maximum LL for which the robustness condition in Proposition 2 checks out:

We envision two ways of using robustness size certifications. First, when it makes sense to only take actions on the subset of robust predictions (e.g., a human can intervene for the rest), an application can use PixelDP’s certified robustness on each prediction. Second, when all points must be classified, PixelDP gives a lower bound on the accuracy under attack. Like in regular ML, the testing set is used as a proxy for the accuracy on new examples. We can certify the minimum accuracy under attacks up to a threshold size T, that we call the prediction robustness threshold. T is an inference-time parameter that can differ from the construction attack bound parameter, L, that is used to configure the standard deviation of the DP noise. In this setting the certification is computed only on the testing set, and is not required for each prediction. We only need the highest probability label, which requires fewer noise draws. §IV-E shows that in practice a few hundred draws are sufficient to retain a large fraction of the certified predictions, while a few dozen are needed for simple predictions.

IV Evaluation

We evaluate PixelDP by answering four key questions:

What is PixelDP’s accuracy under attack and how does it compare to that of other best-effort and certified defenses?

What is PixelDP’s computational overhead?

We answer these questions by evaluating PixelDP on five standard image classification datasets and networks – both large and small – and comparing it with one prior certified defense and one best-effort defense . §IV-A describes the datasets, prior defenses, and our evaluation methodology; subsequent sections address each question in turn.

Evaluation highlights: PixelDP provides meaningful certified robustness bounds for reasonable degradation in model accuracy on all datasets and DNNs. To the best of our knowledge, these include the first certified bounds for large, complex datasets/networks such as the Inception network on ImageNet and Residual Networks on CIFAR-10. There, PixelDP gives 6060% certified accuracy for 2-norm attacks up to 0.10.1 at the cost of 8.58.5 and 9.29.2 percentage-point accuracy degradation respectively. Comparing PixelDP to the prior certified defense on smaller datasets, PixelDP models give higher accuracy on clean examples (e.g., 92.992.9% vs. 79.679.6% accuracy SVHN dataset), and higher robustness to 22-norm attacks (e.g., 5555% vs. 1717% accuracy on SVHN for 2-norm attacks of 0.50.5), thanks to the ability to scale to larger models. Comparing PixelDP to the best-effort defense on larger models and datasets, PixelDP matches its accuracy (e.g., 8787% for PixelDP vs. 87.387.3% on CIFAR-10) and robustness to 22-norm bounded attacks.

Datasets. We evaluate PixelDP on image classification tasks from five pubic datasets listed in Table II. The datasets are listed in descending order of size and complexity for classification tasks. MNIST consists of greyscale handwritten digits and is the easiest to classify. SVHN contains small, real-world digit images cropped from Google Street View photos of house numbers. CIFAR-10 and CIFAR-100 consist of small color images that are each centered on one object of one of 10 or 100 classes, respectively. ImageNet is a large, production-scale image dataset with over 1 million images spread across 1,000 classes.

Models: Baselines and PixelDP. We use existing DNN architectures to train a high-performing baseline model for each dataset. Table II shows the accuracy of the baseline models. We then make each of these networks PixelDP with regards to 11-norm and 22-norm bounded attacks. We also did rudimentary evaluation of ∞\infty-norm bounded attacks, shown in Appendix A-D. While the PixelDP formalism can support ∞\infty-norm attacks, our results show that tighter bounds are needed to achieve a practical defense. We leave the development and evaluation of these bounds for future work.

Table II shows the PixelDP configurations we used for the 11-norm and 22-norm defenses. The code is available at https://github.com/columbia/pixeldp. Since most of this section focuses on models with 22-norm attack bounds, we detail only those configurations here.

ImageNet: We use as baseline a pre-trained version of Inception-v3 available in Tensorflow . To make it PixelDP, we use the autoencoder approach from §III-B, which does not require a full retraining of Inception and was instrumental in our support of ImageNet. The encoder has three convolutional layers and tied encoder/decoder weights. The convolution kernels are 10×10×3210\times 10\times 32, 8×8×328\times 8\times 32, and 5×5×645\times 5\times 64, with stride 22. We make the autoencoder PixelDP by adding the DP noise after the first convolution. We then stack the baseline Inception-v3 on the PixelDP autoencoder and fine-tune it for 20k20k steps, keeping the autoencoder weights constant.

CIFAR-10, CIFAR-100, SVHN: We use the same baseline architecture, a state-of-the-art Residual Network (ResNet) . Specifically we use the Tensorflow implementation of a 28-10 wide ResNet , with the default parameters. To make it PixelDP, we slightly alter the architecture to remove the image standardization step. This step makes sensitivity input dependent, which is harder to deal with in PixelDP. Interestingly, removing this step also increases the baseline’s own accuracy for all three datasets. In this section, we therefore report the accuracy of the changed networks as baselines.

MNIST: We train a Convolutional Neural Network (CNN) with two 5×55\times 5 convolutions (stride 22, 3232 and 6464 filters) followed by a 10241024 nodes fully connected layer.

Evaluation Metrics. We use two accuracy metrics to evaluate PixelDP models: conventional accuracy and certified accuracy. Conventional accuracy (or simply accuracy) denotes the fraction of a testing set on which a model is correct; it is the standard accuracy metric used to evaluate any DNN, defended or not. Certified accuracy denotes the fraction of the testing set on which a certified model’s predictions are both correct and certified robust for a given prediction robustness threshold; it has become a standard metric to evaluate models trained with certified defenses . We also use precision on certified examples, which measures the number of correct predictions exclusively on examples that are certified robust for a given prediction robustness threshold. Formally, the metrics are defined as follows:

Conventional accuracy ∑i=1nisCorrect(xi)n\frac{\sum_{i=1}^{n}isCorrect(x_{i})}{n}, where nn is the testing set size and isCorrect(xi)isCorrect(x_{i}) denotes a function returning 1 if the prediction on test sample xix_{i} returns the correct label, and 0 otherwise.

Certified accuracy ∑i=1n(isCorrect(xi)&robustSize(scores,ϵ,δ,L)≥T)n\frac{\sum_{i=1}^{n}(isCorrect(x_{i})\&robustSize(scores,\epsilon,\delta,L)\geq T)}{n}, where robustSize(scores,ϵ,δ,L)robustSize(scores,\epsilon,\delta,L) returns the certified robustness size, which is then compared to the prediction robustness threshold T.

Precision on certified examples ∑i=1n(isCorrect(xi)&robustSize(pi,ϵ,δ,L)≥T))∑i=1nrobustSize(pi,ϵ,δ,L)≥T)\frac{\sum_{i=1}^{n}(isCorrect(x_{i})\&robustSize(p_{i},\epsilon,\delta,L)\geq T))}{\sum_{i=1}^{n}robustSize(p_{i},\epsilon,\delta,L)\geq T)}.

For T=0T=0 all predictions are robust, so certified accuracy is equivalent to conventional accuracy. Each time we report LL or TT, we use a $$ pixel range.

Attack Methodology. Certified accuracy – as provided by PixelDP and other certified defense – constitutes a guaranteed lower-bound on accuracy under any norm-bounded attack. However, the accuracy obtained in practice when faced with a specific attack can be much better. How much better depends on the attack, which we evaluate in two steps. We first perform an attack on 1,000 randomly picked samples (as is customary in defense evaluation ) from the testing set. We then measure conventional accuracy on the attacked test examples.

For our evaluation, we use the state-of-the art attack from Carlini and Wagner , that we run for 99 iterations of binary search, 100100 gradient steps without early stopping (which we empirically validated to be sufficient), and learning rate 0.010.01. We also adapt the attack to our specific defense following : since PixelDP adds noise to the DNN, attacks based on optimization may fail due to the high variance of gradients, which would not be a sign of the absence of adversarial examples, but merely of them being harder to find. We address this concern by averaging the gradients over 2020 noise draws at each gradient step. Appendix §A-C contains more details about the attack, including sanity checks and another attack we ran similar to the one used in .

Prior Defenses for Comparison. We use two state-of-art defenses as comparisons. First, we use the empirical defense model provided by the Madry Lab for CIFAR-10 . This model is developed in the context of ∞\infty-norm attacks. It uses an adversarial training strategy to approximately minimize the worst case error under malicious samples . While inspired by robust optmization theory, this methodology is best effort (see §VI) and supports no formal notion of robustness for individual predictions, as we do in PixelDP. However, the Madry model performs better under the latest attacks than other best-effort defenses (it is in fact the only one not yet broken) , and represents a good comparison point.

Second, we compare with another approach for certified robustness against ∞\infty-norm attacks , based on robust optimization. This method does not yet scale to the largest datasets (e.g. ImageNet), or the more complex DNNs (e.g. ResNet, Inception) both for computational reasons and because not all necessary layers are yet supported (e.g. BatchNorm). We thus use their largest released model/dataset, namely a CNN with two convolutions and a 100100 nodes fully connected layer for the SVHN dataset, and compare their robustness guarantees with our own networks’ robustness guarantees. We call this SVHN CNN model RobustOpt.

IV-B Impact of Noise (Q1)

Q1: How does DP noise affect the conventional accuracy of our models? To answer, for each dataset we train up to four (1.0,0.05)(1.0,0.05)-PixelDP DNN, for construction attack bound L∈{0.03,0.1,0.3,1}L\in\{0.03,0.1,0.3,1\}. Higher values of LL correspond to robustness against larger attacks and larger noise standard deviation σ\sigma.

Table III shows the conventional accuracy of these networks and highlights two parts of an answer to Q1. First, at fairly low but meaningful construction attack bound (e.g., L=0.1L=0.1), all of our DNNs exhibit reasonable accuracy loss – even on ImageNet, a dataset on which no guarantees have been made to date! ImageNet: The Inception-v3 model stacked on the PixelDP auto-encoder has an accuracy of 68.3% for L=0.1L=0.1, which is reasonable degradation compared to the baseline of 77.5% for the unprotected network. CIFAR-10: Accuracy goes from 95.5% without defense to 87% with the L=0.1L=0.1 defense. For comparison, the Madry model has an accuracy of 87.3% on CIFAR-10. SVHN: our L=0.1L=0.1 PixelDP network achieves 93.1% conventional accuracy, down from 96.3% for the unprotected network. For comparison, the L=0.1L=0.1 RobustOpt network has an accuracy of 79.6%, although they use a smaller DNN due to the computationally intensive method.

Second, as expected, constructing the network for larger attacks (higher LL) progressively degrades accuracy. ImageNet: Increasing LL to 0.30.3 and then 1.01.0 drops the accuracy to 57.7% and 37.7%, respectively. CIFAR-10: The ResNet with the least noise (L=0.03L=0.03) reaches 93.3%93.3\% accuracy, close to the baseline of 95.5%95.5\%; increasing noise levels (L=(0.1,0.3,1.0)L=(0.1,0.3,1.0)) yields 87%87\%, 70.9%70.9\%, and 37.7%37.7\%, respectively. Yet, as shown in §IV-D, PixelDP networks trained with fairly low LL values (such as L=0.1L=0.1) already provide meaningful empirical protection against larger attacks.

IV-C Certified Accuracy (Q2)

Q2: What accuracy can PixelDP certify on a test set? Fig. 2 shows the certified robust accuracy bounds for ImageNet and CIFAR-10 models, trained with various values of the construction attack bound LL. The certified accuracy is shown as a function of the prediction robustness threshold, TT. We make two observations. First, PixelDP yields meaningful robust accuracy bounds even on large networks for ImageNet (see Fig. 2(a)), attesting the scalability of our approach. The L=0.1L=0.1 network has a certified accuracy of 59% for attacks smaller than 0.090.09 in 22-norm. The L=0.3L=0.3 network has a certified accuracy of 40% to attacks up to size 0.20.2. To our knowledge, PixelDP is the first defense to yield DNNs with certified bounds on accuracy under 22-norm attacks on datasets of ImageNet’s size and for large networks like Inception.

Second, PixelDP networks constructed for larger attacks (higher LL, hence higher noise) tend to yield higher certified accuracy for high thresholds TT. For example, the ResNet on CIFAR-10 (see Fig. 2(b)) constructed with L=0.03L=0.03 has the highest robust accuracy up to T=0.03T=0.03, but the ResNet constructed with L=0.1L=0.1 becomes better past that threshold. Similarly, the L=0.3L=0.3 ResNet has higher robust accuracy than the L=0.1L=0.1 ResNet above the 0.140.14 22-norm prediction robustness threshold.

We ran the same experiments on SVHN, CIFAR-100 and MNIST models but omit the graphs for space reasons. Our main conclusion – that adding more noise (higher LL) hurts both conventional and low TT certified accuracy, but enhances the quality of its high TT predictions – holds in all cases. Appendix A-B discusses the impact of some design choices on robust accuracy, and Appendix A-D discusses PixelDP guarantees as compared with previous certified defenses for ∞\infty-norm attacks. While PixelDP does not yet yield strong ∞\infty-norm bounds, it provides meaningful certified accuracy bounds for 22-norm attacks, including on much larger and more complex datasets and networks than those supported by previous approaches.

IV-D Accuracy Under Attack (Q3)

A standard method to evaluate the strength of a defense is to measure the conventional accuracy of a defended model on malicious samples obtained by running a state-of-the-art attack against samples in a held-out testing set . We apply this method to answer three aspects of question Q3: (1) Can PixelDP help defend complex models on large datasets in practice? (2) How does PixelDP’s accuracy under attack compare to state-of-the-art defenses? (3) How does the accuracy under attack change for certified predictions?

Accuracy under Attack on ImageNet. We first study conventional accuracy under attack for PixelDP models on ImageNet. Fig. 3 shows this metric for 22-norm attacks on the baseline Inception-v3 model, as well as three defended versions, with a stacked PixelDP auto-encoder trained with construction attack bound L∈{0.1,0.3,1.0}L\in\{0.1,0.3,1.0\}. PixelDP makes the model significantly more robust to attacks. For attacks of size Lattack=0.5L_{attack}=0.5, the baseline model’s accuracy drops to 11%, whereas the L=0.1L=0.1 PixelDP model’s accuracy remains above 60%. At Lattack=1.5L_{attack}=1.5, the baseline model has an accuracy of , but the L=0.1L=0.1 PixelDP is still at 30%, while the L=0.3L=0.3 PixelDP model have more that 39% accuracy.

Accuracy under Attack Compared to Madry. Fig. 4(a) compares conventional accuracy of a PixelDP model to that of a Madry model on CIFAR-10, as the empirical attack bound increases for 22-norm attacks. For 22-norm attacks, our model achieves conventional accuracy on par with, or slightly higher than, that of the Madry model. Both models are dramatically more robust under this attack compared to the baseline (undefended) model. For ∞\infty-norm attacks our model does not fare as well, which is expected as the PixelDP model is trained to defend against 22-norm attacks, while the Madry model is optimized for ∞\infty-norm attacks. For Lattack=0.01L_{attack}=0.01, PixelDP’s accuracy is 69%, 8 percentage points lower than Madry’s. The gap increases until PixelDP arrives at accuracy for Lattack=0.06L_{attack}=0.06, with Madry still having 22%. Appendix §A-D details this evaluation.

Accuracy under Attack Compared to RobustOpt. Fig. 4(b) shows a similar comparison with the RobustOpt defense , which provides certified accuracy bounds for ∞\infty-norm attacks. We use the SVHN dataset for the comparison as the RobustOpt defense has not yet been applied to larger datasets. Due to our support of larger DNN (ResNet), PixelDP starts with higher accuracy, which it maintains under 22-norm attacks. For attacks of Lattack=0.5L_{attack}=0.5, RobustOpt is bellow 2020% accuracy, and PixelDP above 5555%. Under ∞\infty-norm attacks, the behavior is different: PixelDP has the advantage up to Lattack=0.015L_{attack}=0.015 (58.8% to 57.1%), and RobustOpt is better thereafter. For instance, at Lattack=0.03L_{attack}=0.03, PixelDP has 22.8% accuracy, to RobustOpt’s 32.7%. Appendix §A-D details the ∞\infty-norm attack evaluation.

Precision on Certified Predictions Under Attack. Another interesting feature of PixelDP is its ability to make certifiably robust predictions. We compute the accuracy of these certified predictions under attack – which we term robust precision – and compare them to predictions of the Madry network that do not provide such a certification. Fig. 5 shows the results of considering only predictions with a certified robustness above 0.050.05 and 0.10.1. It reflects the benefit to be gained by applications that can leverage our theoretical guarantees to filter out non-robust predictions. We observe that PixelDP’s robust predictions are substantially more correct than Madry’s predictions up to an empirical attack bound of 1.11.1. For T=0.05T=0.05 PixelDP’s robust predictions are 93.993.9% accurate, and up to 10 percentage points more correct under attack for Lattack≤1.1L_{attack}\leq 1.1. A robust prediction is given for above 6060% of the data points. The more conservative the robustness test is (higher TT), the more correct PixelDP’s predictions are, although it makes fewer of them (Certified Fraction lines).

Thus, for applications that can afford to not act on a minority of the predictions, PixelDP’s robust predictions under 2-norm attack are substantially more precise than Madry’s. For applications that need to act on every prediction, PixelDP offers on-par accuracy under 2-norm attack to Madry’s. Interestingly, although our defense is trained for 22-norm attacks, the first conclusion still holds for ∞\infty-norm attacks; the second (as we saw) does not.

IV-E Computational Overhead (Q4)

Q4: What is PixelDP’s computational overhead? We evaluate overheads for training and prediction. PixelDP adds little overhead for training, as the only additions are a random noise tensor and sensitivity computations. On our GPU, the CIFAR-10 ResNet baseline takes on average 0.65s0.65s per training step. PixelDP versions take at most 0.66s0.66s per training step (1.5% overhead). This represents a significant benefit over adversarial training (e.g. Madry) that requires finding good adversarial attacks for each image in the mini-batch at each gradient step, and over robust optimization (e.g. RobustOpt) that requires solving a constrained optimization problem at each gradient step. The low training overhead is instrumental to our support of large models and datasets.

PixelDP impacts prediction more substantially, since it uses multiple noise draws to estimate the label scores. Making a prediction for a single image with 11 noise draw takes 0.01s0.01s on average. Making 1010 draws brings it only to 0.02s0.02s, but 100100 requires 0.13s0.13s, and 10001000, 1.23s1.23s. It is possible to use Hoeffding’s inequality to bound the number of draws necessary to distinguish the highest score with probability at least η\eta, given the difference between the top two scores ymax−ysecond−maxy_{max}-y_{second-max}. Empirically, we found that 300300 draws were typically necessary to properly certify a prediction, implying a prediction time of 0.42s0.42s seconds, a 42×42\times overhead. This is parallelizable, but resource consumption is still substantial. To make simple predictions – distinguish the top label when we must make a prediction on all inputs – 25 draws are enough in practice, reducing the overhead to 3×3\times.

V Analysis

Second, Proposition 1 is not a high probability result; it is valid with probability 11 even when AA is (ϵ,δ>0)(\epsilon,\delta>0)-DP. The δ\delta parameter can be thought of as a “failure probability” of an (ϵ,δ)(\epsilon,\delta)-DP mechanism: a chance that a small change in input will cause a big change in the probability of some of its outputs. However, since we know that Ak(x)∈A_{k}(x)\in, the worst-case impact of such failures on the expectation of the output of the (ϵ,δ)(\epsilon,\delta)-DP mechanism is at most δ\delta, as proven in Lemma 1. Proposition 1 explicitly accounts for this worst-case impact (term (1+eϵ)δ(1+e^{\epsilon})\delta in Equation (4)).

Third, PixelDP applies to any task for which we can measure changes to input in a meaningful pp-norm, and bound the sensitivity to such changes at a given layer in the DNN (e.g. sensitivity to a bounded change in a word frequency vector, or a change of class for categorical attributes). PixelDP also applies to multiclass classification where the prediction procedure returns several top-scoring labels. Finally, Lemma 1 can be extended to apply to DP mechanism with (bounded) output that can also be negative, as shown in Appendix A-E. PixelDP thus directly applies to DNNs for regression tasks (i.e. predicting a real value instead of a category) as long as the output is bounded (or unbounded if δ=0)\delta=0). The output can be bounded due to the specific task, or by truncating the results to a large range of values and using a comparatively small δ\delta.

VI Related Work

Our work relates to a significant body of work in adversarial examples and beyond. Our main contribution to this space is to introduce a new and very different direction for building certified defenses. Previous attempts have built on robust optimization theory. In PixelDP we propose a new approach built on differential privacy theory which exhibits a level of flexibility, broad applicability, and scalability that exceeds what robust optimization-based certified defenses have demonstrated. While the most promising way to defend against adversarial examples is still an open question, we observe undebatable benefits unique to our DP based approach, such as the post-processing guarantee of our defense. In particular, the ability to prepend a defense to unmodified networks via a PixelDP auto-encoder, as we did to defend Inception with no structural changes, is unique among certified (and best-effort) defenses.

Best-effort Defenses. Defenders have used multiple heuristics to empirically increase DNNs’ robustness. These defenses include model distillation , automated detection of adversarial examples , application of various input transformations , randomization , and generative models . Most of these defenses have been broken, sometimes months after their publication .

The main empirical defense that still holds is Madry et al. , based on adversarial training . Madry et al. motivate their approach with robust optimization, a rigorous theory. However not all the assumptions are met, as this approach runs a best-effort attack on each image in the minibatch at each gradient step, when the theory requires finding the best possible adversarial attack. And indeed, finding this worst case adversarial example for ReLU DNNs, used in , was proven to be NP-hard in . Therefore, while this defense works well in practice, it gives no theoretical guarantees for individual predictions or for the model’s accuracy under attack. PixelDP leverages DP theory to provide guarantees of robustness to arbitrary, norm-based attacks for individual predictions.

Randomization-based defenses are closest in method to our work . For example, Liu et al. randomizes the entire DNN and predicts using an ensemble of multiple copies of the DNN, essentially using draws to roughly estimate the expected arg⁡max⁡\arg\max prediction. They observe empirically that randomization smoothens the prediction function, improving robustness to adversarial examples. However, randomization-based prior work provides limited formalism that is insufficient to answer important defense design questions: where to add noise, in what quantities, and what formal guarantees can be obtained from randomization? The lack of formalism has caused some works to add insufficient amounts of noise (e.g., noise not calibrated to pre-noise sensitivity), which makes them vulnerable to attack . On the contrary, inserts randomness into every layer of the DNN: our work shows that adding the right amount of calibrated noise at a single layer is sufficient to leverage DP’s post-processing guarantee and carry the bounds through the end of the network. Our paper formalizes randomization-based defenses using DP theory, and in doing so helps answer many of these design questions. Our formalism also lets us reason about the guarantees obtained through randomization and enables us to elevate randomization-based approaches from the class of best-effort defenses to that of certified defenses.

Certified Defenses and Robustness Evaluations. PixelDP offers two functions: (1) a strategy for learning robust models and (2) a method for evaluating the robustness of these models against adversarial examples. Both of these approaches have been explored in the literature. First, several certified defenses modify the neural network training process to minimize the number of robustness violations . These approaches, though promising, do not yet scale to larger networks like Google Inception . In fact, all published certified defenses have been evaluated on small models and datasets , and at least in one case, the authors directly acknowledge that some components of their defense would be “completely infeasible” on ImageNet . A recent paper presents a certified defense evaluated on the CIFAR-10 dataset for multi-layer DNNs (but smaller than ResNets). Their approach is completely different from ours and, based on the current results we see no evidence that it can readily scale to large datasets like ImageNet.

Another approach combines robust optimization and adversarial training in a way that gives formal guarantees and has lower computational complexity than previous robust optimization work, hence it has the potential to scale better. This approach requires smooth DNNs (e.g., no ReLU or max pooling) and robustness guarantees are over the expected loss (e.g., log loss), whereas PixelDP can certify each specific prediction, and also provides intuitive metrics like robust accuracy, which is not supported by . Finally, unlike PixelDP, which we evaluated on five datasets of increasing size and complexity, this technique was evaluated only on MNIST, a small dataset that is notoriously amenable to robust optimization (due to being almost black and white). Since the effectiveness of all defenses depends on the model and dataset, it is hard to conclude anything about how well it will work on more complex datasets.

Second, several works seek to formally verify or lower bound the robustness of pre-trained ML models against adversarial attacks. Some of these works scale to large networks , but they are insufficient from a defense perspective as they provide no scalable way to train robust models.

Differentially Private ML. Significant work focuses on making ML algorithms DP to preserve the privacy of training sets . PixelDP is orthogonal to these works, differing in goals, semantic, and algorithms. The only thing we share with DP ML (and most other applied DP literature) are DP theory and mechanisms. The goal of DP ML is to learn the parameters of a model while ensuring DP with respect to the training data. Public release of model parameters trained using a DP learning algorithm (such as DP empirical risk minimization or ERM) is guaranteed to not reveal much information about individual training examples. PixelDP’s goal is to create a robust predictive model where a small change to any input example does not drastically change the model’s prediction on that example. We achieve this by ensuring that the model’s scoring function is a DP function with respect to the features of an input example (eg, pixels). DP ML algorithms (e.g., DP ERM) do not necessarily produce models that satisfy PixelDP’s semantic, and our training algorithm for producing PixelDP models does not ensure DP of training data.

Previous DP-Robustness Connections. Previous work studies generalization properties of DP . It is shown that learning algorithms that satisfy DP with respect to the training data have statistical benefits in terms of out-of-sample performance; or that DP has a deep connection to robustness at the dataset level . Our work is rather different. Our learning algorithm is not DP; rather, the predictor we learn satisfies DP with respect to the atomic units (e.g., pixels) of a given test point.

VII Conclusion

We demonstrated a connection between robustness against adversarial examples and differential privacy theory. We showed how the connection can be leveraged to develop a certified defense against such attacks that is (1) as effective at defending against 22-norm attacks as today’s state-of-the-art best-effort defense and (2) more scalable and broadly applicable to large networks compared to any prior certified defense. Finally, we presented the first evaluation of a certified 22-norm defense on the large-scale ImageNet dataset. In addition to offering encouraging results, the evaluation highlighted the substantial flexibility of our approach by leveraging a convenient autoencoder-based architecture to make the experiments possible with limited resources.

VIII Acknowledgments

We thank our shepherd, Abhi Shelat, and the anonymous reviewers, whose comments helped us improve the paper significantly. This work was funded through NSF CNS-1351089, CNS-1514437, and CCF-1740833, ONR N00014-17-1-2010, two Sloan Fellowships, a Google Faculty Fellowship, and a Microsoft Faculty Fellowship.

References

Appendix A Appendix

We briefly re-state the Proposition and detail the proof.

Suppose AA is (ϵ,δ)(\epsilon,\delta)-PixelDP for size LL in pp-norm metric. For any input xx, if for some k∈Kk\in\mathcal{K},

Consider any α∈Bp(L)\alpha\in B_{p}(L), and let x′:=x+αx^{\prime}:=x+\alpha. From Equation (2), we have with p>ηp>\eta that

Starting from the first inequality, and using the hypothesis, followed by the second inequality, we get

which is the robustness condition from Equation (1). ∎

A-B Design Choice

Our theoretical results allow the DP DNN to output any bounded score over labels Ak(x)A_{k}(x). In the evaluation we used the softmax output of the DNN, the typical “probabilities” that DNNs traditionally output. We also experimented with using arg⁡max⁡\arg\max scores, transforming the probabilities in a zero vector with a single 11 for the highest score label. As each dimension of this vector is in $,ourtheoryappliesasis.Weobservedthat, our theory applies as is. We observed that\arg\maxscoreswereabitlessrobustempirically(loweraccuracyunderattack).However,asshownonFig.6scores were a bit less robust empirically (lower accuracy under attack). However, as shown on Fig. 6\arg\maxscoresyieldahighercertifiedaccuracy.ThisisbothbecausewecanusetighterboundsformeasurementerrorusingaClopper−Pearsoninterval,andbecausethescores yield a higher certified accuracy. This is both because we can use tighter bounds for measurement error using a Clopper-Pearson interval, and because the\arg\max$ pushes the expected scores further apart, thus satisfying Proposition 1 more often.

We also study the impact of the DP mechanism used on certified accuracy for 11-norm attacks. Both the Laplace and Gaussian mechanisms can be used after the first convolution, by respectively controlling the Δ1,1\Delta_{1,1} or Δ1,2\Delta_{1,2} sensitivity. Fig. 7 shows that for our ResNet, the Laplace mechanism is better suited to low levels of noise: for L=0.1L=0.1, it yields a slightly higher accuracy (90.5%90.5\% against 88.9%88.9\%), as well as better certified accuracy with a maximum robustness size of 11-norm 0.220.22 instead of 0.190.19, and a robust accuracy of 73%73\% against 65.4%65.4\% at the 0.190.19 threshold. On the other hand, when adding more noise (e.g. L=0.3L=0.3), the Gaussian mechanism performs better, consistently yielding a robust accuracy 1.51.5 percentage point higher.

A-C Attack Details

All evaluation results (§IV) are based on the attack from Carlini and Wagner , specialized to better attack PixelDP (see parameters and adaptation in §IV-A). We also implemented variants of the iterative Projected Gradient Descent (PGD) attack described in , modified to average gradients over 1515 noise draws per step, and performing each attack 1515 times with a small random initialization. We implemented two version of this PGD attack.

2-norm Attack: The gradients are normalized before applying the step size, to ensure progress even when gradients are close to flat. We perform k=100k=100 gradient steps and select a step size of 2.5Lk\frac{2.5L}{k}. This heuristic ensures that all feasible points within the 2-norm ball can be reached after kk steps. After each step, if the attack is larger than LL, we project it on the 2-norm ball by normalizing it. Under this attack, results were qualitatively identical for all experiments. The raw accuracy numbers were a few percentage points higher (i.e. the attack was slightly less efficient), so we kept the results for the Carlini and Wagner attack.

∞\infty-norm Attack: We perform max(L+8,1.5L)max(L+8,1.5L) gradient steps and maintain a constant step of size of 0.0030.003 (which corresponds to the minimum pixel increment in a discrete $pixelrange).Attheendofeachgradientstepweclipthesizeoftheperturbationtoenforceaperturbationwithinthepixel range). At the end of each gradient step we clip the size of the perturbation to enforce a perturbation within the\infty$-norm ball of the given attack size. We used this attack to compare PixelDP with models from Madry and RobustOpt (see results in Appendix A-D).

Finally, we performed sanity checks suggested in . The authors observe that several heuristic defenses do not ensure the absence of adversarial examples, but merely make them harder to find by obfuscating gradients. This phenomenon, also referred to as gradient masking , makes the defense susceptible to new attacks crafted to circumvent that obfuscation . Although PixelDP provides certified accuracy bounds that are guaranteed to hold regardless of the attack used, we followed guidelines from , to to rule out obfuscated gradients in our empirical results. We verified three properties that can be symptomatic of problematic attack behavior. First, when growing TT, the accuracy drops to on all models and datasets. Second, our attack significantly outperforms random sampling. Third, our iterative attack is more powerful than the respective single-step attack.

A-D ∞\infty-norm Attacks

As far as ∞\infty-norm attacks are concerned, we acknowledge that the size of the attacks against which our current PixelDP defense can certify accuracy is substantially lower than that of previous certified defenses. Although previous defenses have been demonstrated on MNIST and SVHN only, and for smaller DNNs, they achieve ∞\infty-norm defenses of T∞=0.1T_{\infty}=0.1 with robust accuracy 91.6%91.6\% and 65%65\% on MNIST. On SVHN, uses T∞=0.01T_{\infty}=0.01, achieving 59.3% of certified accuracy. Using the crude bounds we have between pp-norms makes a comparison difficult in both directions. Mapping ∞\infty-norm bounds in 22-norm gives T2≥T∞T_{2}\geq T_{\infty}, also yielding very small bounds. On the other hand, translating 22-norm guarantees into ∞\infty-norm ones (using that ∥x∥2≤n∥x∥∞\|x\|_{2}\leq\sqrt{n}\|x\|_{\infty} with nn the size of the image) would require a 22-norm defense of size T2=2.8T_{2}=2.8 to match the T∞=0.1T_{\infty}=0.1 bound from MNIST, an order of magnitude higher than what we can achieve. As comparison points, our L=0.3L=0.3 CNN has a robust accuracy of 91.6%91.6\% at T=0.19T=0.19 and 65%65\% at T=0.39T=0.39. We make the same observation on SVHN, where we would need a bound at T2=0.56T_{2}=0.56 to match the T∞=0.01T_{\infty}=0.01 bound, but our ResNet with L=0.1L=0.1 reaches a similar robust accuracy as RobustOpt for T2=0.1T_{2}=0.1. This calls for the design ∞\infty-norm specific PixelDP mechanisms that could also scale to larger DNNs and datasets.

On Figures 8 and 9, we show PixelDP’s accuracy under ∞\infty-norm attacks, compared to the Madry and RobustOpt models, both trained specifically against this type of attacks. On CIFAR-10, the Madry model outperforms PixelDP: for Lattack=0.01L_{attack}=0.01, PixelDP’s accuracy is 69%, 8 percentage points lower than Madry’s. The gap increases until PixelDP arrives at accuracy for Lattack=0.06L_{attack}=0.06, with Madry still having 22%.

On SVHN, against the RobustOpt model, trained with robust optimization against ∞\infty-norm attacks, PixelDP is better up to L∞=0.015L_{\infty}=0.015, due to its support of larger ResNet models. For attacks of ∞\infty-norm above this value, RobustOpt is more robust.

A-E Extension to regression

A previous version of this paper contained an incorrect claim in the statement of Lemma 1 for outputs that can be negative. Because the paper focused on classification, where DNN scores are in $$, the error had no impact on the claims or experimental results for classification. Lemma 2, below, provides a correct version of Lemma 1 for outputs that can be negative, showing how PixelDP can be extended to support regression problems:

The expectation is taken over the randomness in AA.

Following Lemma 2, supporting regression problems involves three steps. First, if the output is unbounded, one must use (ϵ,0)(\epsilon,0)-DP (e.g. with the Laplace mechanism). If the output is bounded, one may use (ϵ,δ)(\epsilon,\delta)-DP. The output may be bounded either naturally, because the specific task has inherent output bounds, or by truncating the results to a large range of values and using a comparatively small δ\delta.

Second, instead of estimating the expected value of the randomized prediction function, we estimate both A+(x)A_{+}(x) and A−(x)A_{-}(x). We can use Hoeffding’s inequality or Empirical Bernstein bounds to bound the error.