Title: Adaptive Randomized Smoothing: Certified Adversarial Robustness for Multi-Step Defences
Venue: NeurIPS 2024
Accepted: yes
Keywords: Robustness

Adversarial examples

Adaptive defenses

Certified test-time defenses

Randomized Smoothing
Abstract: We propose Adaptive Randomized Smoothing (ARS) to certify the predictions of our test-time adaptive models against adversarial examples.
ARS extends the analysis of randomized smoothing using $f$-Differential Privacy to certify the adaptive composition of multiple steps.
For the first time, our theory covers the sound adaptive composition of general and high-dimensional functions of noisy inputs.
We instantiate ARS on deep image classification to certify predictions against adversarial examples of bounded $L_{\infty}$ norm.
In the $L_{\infty}$ threat model, ARS enables flexible adaptation through high-dimensional input-dependent masking.
We design adaptivity benchmarks, based on CIFAR-10 and CelebA, and show that ARS improves standard test accuracy by  1 to 15\% points.
On ImageNet, ARS improves certified test accuracy by up to 1.6% points over standard RS without adaptivity. Our code is available at [https://github.com/ubc-systopia/adaptive-randomized-smoothing](https://github.com/ubc-systopia/adaptive-randomized-smoothing).

Adaptive Randomized Smoothing: Certified Adversarial Robustness for Multi-Step Defences

Abstract

We propose Adaptive Randomized Smoothing (ARS) to certify the predictions of our test-time adaptive models against adversarial examples. ARS extends the analysis of randomized smoothing using f -Differential Privacy to certify the adaptive composition of multiple steps. For the first time, our theory covers the sound adaptive composition of general and high-dimensional functions of noisy inputs. We instantiate ARS on deep image classification to certify predictions against adversarial examples of bounded L ∞ norm. In the L ∞ threat model, ARS enables flexible adaptation through high-dimensional inputdependent masking. We design adaptivity benchmarks, based on CIFAR-10 and CelebA, and show that ARS improves standard test accuracy by 1 to 15% points. On ImageNet, ARS improves certified test accuracy by up to 1 . 6% points over standard RS without adaptivity. Our code is available at https: //github.com/ubc-systopia/adaptive-randomized-smoothing .

1 Introduction

Despite impressive accuracy, deep learning models still show a worrying susceptibility to adversarial attacks. Such attacks have been shown for a large number of tasks and models (Costa et al., 2023; Chakraborty et al., 2018), including areas where security and safety are critical such as fraud detection (Pumsirirat and Liu, 2018) or autonomous driving (Cao et al., 2021).

Several rigorous defences have been proposed to certify robustness. Randomized Smoothing (RS) (Lécuyer et al., 2019; Cohen et al., 2019) does so by averaging predictions over noisy versions of the input at test time, and as such can scale to large deep learning models. However, RS has its limitations: it is inflexible and either degrades accuracy or only certifies against small attacks.

To address these shortcomings and improve robustness, there has been a recent push to develop defences that adapt to inputs at test time Croce et al. (2022), including for RS (Alfarra et al., 2022a; Súkeník et al., 2021; Hong et al., 2022). Most such adaptive defences are heuristic, unproven, and subject to improved attacks (Croce et al., 2022; Alfarra et al., 2022a; Hong et al., 2022), running the risk of reverting to a hopeless cat and mouse game with attackers (Athalye et al., 2018; Tramer et al., 2020), or only provide limited adaptivity (Súkeník et al., 2021; Hong et al., 2022) and gain (§5).

We (re)connect RS to Differential Privacy (DP), after its abandonment for a tighter analysis via hypothesis testing (Cohen et al., 2019), and introduce Adaptive Randomized Smoothing (ARS) to provide test-time adaptivity while preserving rigorous bounds. Specifically, we analyze RS through the lens of f -Differential Privacy ( f -DP), and use this connection to leverage a key strength of DP: the end-to-end analysis of multi-step adaptive computation using composition results (§2).

We use ARS to design two-step defence against L ∞ adversaries on image classification (Figure 1), which is a challenging setting for RS Blum et al. (2020). The first step computes an input mask that

Input.X

M1

m1

X+21

Post-Processing ofM1

w(m1)

Addnoise

21 ~N(0,o²1)

MaskModelw

element-wise

Mask

product

+=

Post-Processing of Mi,M2

w（m1)0x

()~

M2

m2

w（m1）0x+z2

Average

xcm+c2m2

Prediction

0.2

0.1

0.6

argmax

→

Label y+

Add noise

Base Classifier

9

0.1

+++

focuses on task-relevant information. This reduces the dimension of the input, which is then passed to the second step for prediction. Thanks to this adaptive dimension reduction, the second step makes its prediction on a less noisy image, improving the performance and certification radius (§3).

We evaluate our adaptive randomized smoothing method in three settings (§4). For image classification, we first design a challenging benchmark based on CIFAR-10, and we show that ARS can improve accuracy by up to 15% . For spatially-localized face attribute classification on the CelebA dataset, we show that ARS improves accuracy by up to 7 . 7% . For large-scale image classification on ImageNet, ARS maintains accuracy and improves certified accuracy by up to 1 . 6% .

2 Theory for Adaptivity via Differential Privacy

After introducing the necessary background and known results on RS and DP (§2.1), we reconnect RS to its DP roots by showing that the tight analysis of Cohen et al. (2019) can be seen as PixelDP (Lécuyer et al., 2019) using f -Differential Privacy (Dong et al., 2019; 2022), a hypothesis testing formulation of DP (§2.2). This connection lets us leverage composition results for f -DP to analyze multi-step approaches for provable robustness to adversarial examples, which we name Adaptive Randomized Smoothing (ARS) (§2.3). We leverage ARS to design and analyze a two-step defence against L ∞ -bounded adversaries (§2.4), which we then instantiate as a deep network (§3).

2.1 Related Work: Adversarial Robustness, Randomized Smoothing, and Differential Privacy

̸

Adversarial Examples (Szegedy et al., 2014): Consider a classifier g : X → Y , and input X . An adversarial example of radius r in the L p threat model, for model g on input X , is an input X + e such that g ( X + e ) = g ( X ) , where e ∈ B p ( r ) , where B p ( r ) ≜ { x ∈ R d : ∥ x ∥ p ≤ r } is the L p ball of radius r . These inputs or attacks are made against classifiers at test time. For more on the active topics of attack and defence, we refer to surveys (Li et al., 2023; Costa et al., 2023; Chakraborty et al., 2018) on current attacks and provable defences. In general, provable defences do not focus on the largest-scale highest-accuracy classifiers, with the notable exception of randomized smoothing.

̸

Randomized Smoothing (RS) (Lécuyer et al., 2019; Cohen et al., 2019) is a scalable approach to certifying model predictions against L 2 -norm adversaries. Specifically, it certifies robustness to any attack ∈ B 2 ( r X ) . The algorithm randomizes a base model g by adding spherical Gaussian noise to its input, and produces a smoothed classifier that returns the class with highest expectation over the noise: y + ≜ arg max y ∈Y P z ∼N (0 ,σ 2 I d ) ( g ( X + z ) = y ) . The tightest analysis from Cohen et al. (2019) uses hypothesis testing theory to show that, with p + , p -∈ [0 , 1] such that P ( g ( X + z ) = y + ) ≥ p + ≥ p -≥ max y -= y + P ( g ( X + z ) = y -) , the certificate size r X for prediction y + is:

where Φ -1 is the inverse standard Gaussian CDF, p + lower-bounds the probability of g ( X + z ) = y + (the most probable class), and p -upper-bounds the probability of other classes.

While sound, RS is static during testing even though attacks may adapt. Recent work aims to make RS adapt at test time (Súkeník et al., 2021; Alfarra et al., 2022a; Hong et al., 2022). While pioneering, these works are restricted in either their soundness or their degree of adaptation and resulting improvement. Súkeník et al. (2021) soundly adapt the variance for RS by the distance between test and train inputs. However, this only provides minimal adaptivity, with only minor improvement to certification. Alfarra et al. (2022a) adapt the variance for RS to each test input, but the analysis is not end-to-end, and hence not sound (Súkeník et al., 2021) (except for their memory-based edition, but this requires storage of all examples). UniCR (Hong et al., 2022) adapts the noise distribution for RS, primarily to the data distribution during training, and optionally to input during testing. The train-time adaptation is sound, but the test-time adaptation is not due to the same issue raised by Súkeník et al. (2021). We propose ARS to advance certified test-time adaptivity: our approach is sound and high-dimensional to flexibly adapt the computation of later steps conditioned on earlier steps by differential privacy theory.

Differential Privacy (DP) is a rigorous notion of privacy. A randomized mechanism M is ( ϵ, δ ) -DP if, for any neighbouring inputs X and X ′ , and any subset of possible outputs Y ⊂ Range ( M ) , P ( M ( X ) ∈ Y ) ≤ e ϵ P ( M ( X ′ ) ∈ Y ) + δ . Following Lécuyer et al. (2019), we define neighbouring based on L p norms: X and X ′ in R d are L p neighbours at radius r if X -X ′ ∈ B p ( r ) .

RS was initially analyzed using ( ϵ, δ ) -Differential Privacy (Lécuyer et al., 2019). Intuitively, the randomized classifier M ( X ) ≜ g ( X + z ) , z ∼ N (0 , σ 2 I d ) acts as a privacy preserving mechanism (the Gaussian mechanism) that provably 'hides' small variations in X . This privacy guarantee yields a robustness certificate for the expected predictions.

f -DP (Dong et al., 2019) is a notion of privacy that extends ( ϵ, δ ) -DP, and defines privacy as a bound on the power of hypothesis tests. Appendix A provides more details on f -DP. The main result we leverage is Theorem 2.7 of Dong et al. (2022) that for a Gaussian mechanism M ( X ) = θ ( X ) + z , z ∼ N (0 , r 2 µ 2 ) , such that for any neighbouring X,X ′ , θ ( X ) -θ ( X ′ ) ∈ B 2 ( r ) (i.e., the L 2 sensitivity of θ is r ), we have that M is G µ -DP with the function G µ defined as:

We leverage two key properties of f -DP. First, f -DP is resilient to post-processing. That is, if mechanism M is f -DP, proc ◦ M is also f -DP. Second, f -DP is closed under adaptive composition. We refer to §3 in Dong et al. (2022) for the precise definition and use their Corollary 3.3: the adaptive composition of two Gaussian mechanisms G µ 1 -DP and G µ 2 -DP is itself G µ -DP with

f -DP is distinct from the f -divergence from information theory. Dvijotham et al. (2020) use f -divergence bounds between the noise distribution centred on the original input and centred on any perturbed input. This improves RS by broadening the noise distributions and norm-bounds on the adversary that RS can support. In contrast we focus on f -DP, which captures enough information to reconstruct any divergence by post-processing (Proposition B.1. in Dong et al. (2019)). Our main objective is different: we leverage f -DP composition properties to enable multi-step deep learning architectures that adapt to the input at test time with robustness guarantees.

2.2 Randomized Smoothing from f -DP

We reconnect RS with DP, using f -DP to yield results as strong as that of Equation (1). We start with a general robustness result on f -DP classifiers, which we later build on for our main result.

̸

Proposition 2.1 ( f -DP Robustness) . Let M : X → Y be f -DP for B p ( r ) neighbourhoods, and let M S : X → arg max y ∈Y P ( M ( X ) = y ) be the associated smoothed classifier. Let y + ≜ M S ( X ) be the prediction on input X , and let p + , p -∈ [0 , 1] be such that P ( M ( X ) = y + ) ≥ p + ≥ p -≥ max y -= y + P ( M ( X ) = y -) . Then:

Let us now instantiate Proposition 2.1 for Gaussian RS (see §2.1):

̸

Corollary 2.2 (RS from f -DP) . Let M : X → g ( X + z ) , z ∼ N (0 , σ 2 I d ) , and M S : X → arg max y ∈Y P ( M ( X ) = y ) be the associated smooth model. Let y + ≜ M S ( X ) be the prediction on input X , and let p + , p -∈ [0 , 1] be such that P ( M ( X ) = y + ) ≥ p + ≥ p -≥ max y -= y + P ( M ( X ) = y -) . Then ∀ e ∈ B 2 ( r x ) , M S ( X + e ) = y + , with:

Proof. See Appendix B2. Sketch: M is a Gaussian mechanism, and is G r σ -DP for any r ( B 2 ( r ) neighbourhood). We apply Proposition 2.1 and maximize r such that G r σ (1 -p + ) ≥ 1 -G r σ ( p -) .

2.3 Adaptive Randomized Smoothing

While Proposition 2.1 is new, so far we have only used it to reprove the known result of Corollary 2.2. So why is this connection between f -DP and robustness useful? Our key insight is that we can leverage adaptive composition results at the core of DP algorithms to certify multi-step methods that adapt to their inputs at test time . Such adaptive defences have seen recent empirical interest, but either lack formal guarantees, or provide only limited adaptivity in practice (§5). For the first time we derive a sound and high-dimensional adaptive method for certification.

We formalize adaptive multi-step certification as follows. Consider k randomized Gaussian mechanisms M 1 , . . . , M k (our adaptive steps), such that m i ∼ M i ( X | m <i ) , and for all r ≥ 0 we have that M i is G r/σ i -DP for the B 2 ( r ) neighbouring definition. Note that the computation M i can depend on previous results, as long as it is G r/σ i -DP. Further consider a (potentially randomized) post-processing classifier g ( m 1 , . . . , m k ) = y ∈ Y .

̸

Theorem 2.3 ( Main result: Adaptive RS ) . Using definitions above, let M : X → g ( m 1 , . . . , m k ) ∈ Y , ( m 1 , . . . , m k ) ∼ ( M 1 ( X ) , . . . , M k ( X | m <k )) , and the associated smoothed model be M S : X → arg max m ∈Y P ( M ( X ) = y ) . Let y + ≜ M S ( X ) be the prediction on input X , and let p + , p -∈ [0 , 1] be such that P ( M ( X ) = y + ) ≥ p + ≥ p -≥ max y -= y + P ( M ( X ) = y -) . Then ∀ e ∈ B 2 ( r x ) , M S ( X + e ) = y + , with:

Proof. By adaptive composition of Gaussian DP mechanisms (Equation (3)), M is G µ -DP with µ = √ ∑ k i =1 r 2 σ 2 i = r √ ∑ k i =1 1 σ 2 i . We can then apply Corollary 2.2 with σ = 1 / √ ∑ k i =1 1 σ 2 i .

We focus on Gaussian RS, but a similar argument applies to general f -DP mechanisms for which we can compute f i at any r , and the composition f i ⊗··· ⊗ f k , potentially using numerical techniques such as that of Gopi et al. (2021). For Gaussian noise, Theorem 2.3 leverages strong results from DP to provide a perhaps surprising result: there is no cost to adaptivity, in the sense that k independent measurements of input X with Gaussian noise (without adaptivity) of respective variance σ 2 i can be averaged to one measurement of variance σ 2 = 1 / ∑ k i =1 σ -2 i . To show this, we can use a weighted average to minimize variance (see e.g., Equation 4 in Honaker (2015)), with c j = σ -2 j / ∑ k i =1 σ -2 i yielding σ 2 = ∑ k j =1 c 2 j σ 2 j = ∑ k j =1 σ -2 j / ( ∑ k i =1 σ -2 i ) 2 = 1 / ∑ k i =1 σ -2 i . The ARS r X from Theorem 2.3 is identical to that of one step RS from Corollary 2.2 using this variance: adaptivity over multi-step computation comes with no decrease in certified radius .

2.4 ARS against L ∞ -Bounded Adversaries

How can we leverage the multi-step adaptivity from Theorem 2.3 to increase certified accuracy? We focus on two-step certified defence against L ∞ -bounded attacks to increase accuracy by adaptivity. Previous work already notes that RS applies to L ∞ -bounded attackers (Lécuyer et al., 2019; Cohen

et al., 2019), using the fact that ∀ X ∈ R d , ∥ X ∥ 2 ≤ √ d ∥ X ∥ ∞ , and hence that X -X ′ ∈ B ∞ ( r ∞ ) ⇒ X -X ′ ∈ B 2 ( √ d · r ∞ ) . Using Corollary 2.2, this yields:

While L ∞ -specific RS theory exists (Yang et al., 2020), further work by Blum et al. (2020) has found that Gaussian RS performs advantageously in practice. However, Blum et al. (2020); Kumar et al. (2020); Wu et al. (2021) show that the √ d dependency cannot be avoided for a large family of distributions, leading the authors to speculate that RS might be inherently limited for L ∞ certification of predictions on high dimensional images. To side-step this issue, we use two-steps adaptivity to first select subsets of the image important to the classification task (thereby reducing dimension), and then make the prediction based on the selected subset. Formally:

Proposition 2.4 (Adaptive RS for L ∞ ) . Define the following pair of (adaptive) mechanisms:

Then, with any function w : R d → [0 , 1] d (interpreted as a mask):

where ⊙ is the element-wise product; and the final prediction function g : m 1 , m 2 →Y .

̸

Consider the mechanism M that samples m 1 ∼ M 1 , then m 2 ∼ M 2 , and finally outputs g ( m 1 , m 2 ) ; and the associated smoothed classifier M S : X → arg max y ∈Y P ( M ( X ) = y ) . Let y + ≜ M S ( X ) be the prediction on input X , and let p + , p -∈ [0 , 1] be such that P ( M ( X ) = y + ) ≥ p + ≥ p -≥ max y -= y + P ( M ( X ) = y -) . Then ∀ e ∈ B ∞ ( r ∞ X ) , M S ( X + e ) = y + , with:

Proof. Consider any X,X ′ s.t. X -X ′ ∈ B ∞ ( r ∞ ) . We analyze M 1 and M 2 in turn. ∥ X -X ′ ∥ 2 ≤ √ d ∥ X -X ′ ∥ ∞ , so X -X ′ ∈ B 2 ( √ dr ∞ ) , and M 1 is G µ 1 -DP with µ 1 = r ∞ √ d σ 1 .

Important remarks. 1. w ( . ) is a masking function, adaptively reducing (if w i ( m 1 ) ≪ 1 ) the value of X i and thereby the attack surface of an L ∞ attacker. This reduces the effective dimension of the input to M 2 . 2. Reducing the dimension enables a reduction in the noise variance in M 2 , at fixed privacy guarantee G µ 2 . The variance reduction is enabled for all dimensions in the input , even those that are not masked ( w i ( m 1 ) ≈ 1 ). As a result, the variance of the noise in M 2 scales as ∥ w ( m 1 ) ∥ 2 2 ≤ d . The more masking, the lower the variance. It may help to consider the change of variables σ ← σ/ √ d in Equation (4), and σ 1 , 2 ← σ 1 , 2 / √ d in Proposition 2.4, to remove d from r ∞ X and scale the noise variance with d . For RS (Equation (4)), the noise variance scales as d . For ARS, only Equation (5) (the first step) suffers from variance scaled by d , while the second step's variance (Equation (6)) scales as || w ( m 1 ) || 2 2 , which can be much smaller than d when a large part of the image is masked. Reduced variance translates into higher accuracy, as well as p + and p -being further apart, for a larger r ∞ X . 3. The variance reduction due to masking applies in the translation from the B ∞ ( r ∞ ) bound on the attack to the B 2 ( r ) sensitivity used in ARS. This variance reduction would not apply to an L 2 -bounded adversary (an attack that only changes pixels with mask values of one yields no sensitivity improvement). Hence, our two-steps ARS architecture for L ∞ -bounded adversaries does not reduce to bounding L ∞ with L 2 as the traditional RS application does, and our gains come explicitly from variance reduction enabled by adaptive masking against an L ∞ attack.

3 Two-Step ARS for L ∞ Certification of Image Classification

Figure 1 shows our deep learning architecture based on Proposition 2.4. The first step, M 1 , adds noise to input X and post-processes the result into a mask w ( m 1 ) . The second step, M 2 , takes masked input w ( m 1 ) ⊙ X and adds noise. Finally, the base classifier g post-processes a weighted average of m 1 , m 2 to output a label. The whole model is trained end-to-end on the classification task. In RS, only the path going through M 2 is present. This is equivalent to setting σ 2 = σ and w ( . ) = 1 , with no M 1 . In both cases, the final predictions are averaged over the noise to create the smoothed classifier. The ARS architecture introduces several new components, which we next describe.

Budget Splitting: the noise budget σ (Figure 1; red) is split to assign noise levels to the two steps M 1 and M 2 . We parameterize ARS with the same σ as standard RS then split it by the f -DP composition formula from Equation (3). In practice, we assign σ 1 ≥ σ to M 1 , and then σ 2 = 1 / √ 1 σ 2 -1 σ 2 1 . We set σ 1 by either fixing it to a constant or learning it end-to-end.

Masking: the mask model w ( · ) takes the noisy image from M 1 and predicts a weighting (one value in [0 , 1] per input pixel) that is multiplied with the input element-wise (denoted ⊙ in Proposition 2.4). The model is a U-Net architecture, which makes pixel-wise predictions, and acts as a post-processing of M 1 in the f -DP analysis. Our masking enables test-time adaptivity to reduce the noise variance for M 2 , via the mask's dependence on the input through m 1 .

Mechanism output averaging: to fully leverage both steps' information, we take a weighted average of the outputs m 1 and m 2 before passing the result to the base classifier g . For a particular input pixel i , denote X i the value of pixel, w i ∈ [0 , 1] its mask weight (we omit the explicit dependency on m 1 in w for compactness), and m 1 ,i , m 2 ,i the respective values output by M 1 and M 2 . Then, the final value of pixel i in the averaged input will be ˆ X i ≜ c 1 ,i m 1 ,i + c 2 ,i m 2 ,i .

We set c 1 ,i , c 2 ,i such that ˆ X i is the unbiased estimate of X i with smallest variance. First, we set c 1 ,i + w i c 2 ,i = 1 , such that E [ ˆ X i ] = c 1 ,i X i + c 2 ,i w i X i = X i . Second, we minimize the variance. Notice that V [ ˆ X i ] = c 2 1 ,i σ 2 1 + c 2 2 ,i ∥ w ∥ 2 2 σ 2 2 = (1 -w i c 2 ,i ) 2 σ 2 1 + c 2 2 ,i ∥ w ∥ 2 2 σ 2 2 : this is a convex function in c 2 ,i minimized when its gradient in c 2 ,i is zero. Plugging back into the constraint to get c 1 ,i , we obtain the following weights: c 1 ,i = ∥ w ∥ 2 2 σ 2 2 σ 2 1 w 2 i + ∥ w ∥ 2 2 σ 2 2 , and c 2 ,i = σ 2 1 w i σ 2 1 w 2 i + ∥ w ∥ 2 2 σ 2 2 .

The averaged noisy input ˆ X is finally fed to the base classifier g for prediction. The smoothed classifier M S averages predictions (over noise draws) over the entire pipeline. The parameters of w and g (and σ 1 if not fixed) are learned during training and are fixed at inference/certification time.

4 Experiments

We evaluate on standard and L ∞ -certified test accuracy. Certified accuracy at radius r ∞ is the percentage of test samples that are correctly classified and have an L ∞ certificate radius r ∞ X ≥ r ∞ . Standard accuracy is obtained for r ∞ = 0 .

Datasets Weevaluate on CIFAR-10 (Krizhevsky, 2009) in §4.1, CelebA (Liu et al., 2015) (specifically the unaligned HD-CelebA-Cropper edition) in §4.2, and ImageNet (Deng et al., 2009) in §4.3. We measure adaptivity on CIFAR-10 and CelebA by designing challenging benchmarks requiring adaptivity, and measure scalability on ImageNet.

Models We choose the standard ResNet (He et al., 2016) models as base classifiers g with ResNet-110 for CIFAR-10 and ResNet-50 for CelebA and ImageNet. For ARS, our mask model w is a simplified U-Net (Ronneberger et al., 2015) (see Appendix C.1 for details). For the noise budget, we find that a fixed budget split performs reliably, and so in all experiments we split by σ 1 = σ 2 = √ 2 σ .

Methods We compare to standard and strong static methods, design a baseline specifically for our masking approach, and evaluate the only sound input-dependent methods prior to ARS. Cohen et al. is the standard approach to RS (Cohen et al., 2019). UniCR (Hong et al., 2022) learns the noise distribution for RS during training but is static during testing (while they propose an input-adaptive variant, it is not sound so we restrict our comparison to the training variant). We tune hyper-parameters, and perform a grid search for β (the parameter of the noise distribution) to maximize certified accuracy. We find that β = 2 (Gaussian), or β = 2 . 25 (close to a Gaussian,

with smaller tails), to perform best in high and low ( k, σ ) values, respectively (see Appendix D) for details. Static Mask is our baseline that learns a fixed mask during training that does not adapt during testing. The mask is directly parameterized as pixel-wise weights that we multiply with the input and optimize jointly with the base classifier. Relative to ARS in Figure 1, this removes M 1 , sets σ 2 = σ , and makes w ( . ) = W static parameters rather than an adaptive prediction. Súkeník et al. (2021) conditions the variance σ for RS on the input and is therefore test-time adaptive. We use code provided by the authors as is. Comparing ARS to the static baselines measures the value of test-time adaptivity, and comparing ARS to the variance adaptivity of Súkeník et al. measures the importance of more high-dimensional and expressive adaptation.

4.1 CIFAR-10 Benchmark: Classification with Distractor Backgrounds

Input dimension is a key challenge in L ∞ certification using RS (see §2.4). We design our 20kBG benchmark to vary this parameter without affecting the task: we superimpose CIFAR-10 images onto a larger distractor background from the 20 k background images dataset Li et al. (2022a). The backgrounds are split into train and test sets, and resized to k × k pixels (where k ≥ 32 ). The CIFAR-10 image (of dimensions 32 × 32 × 3 ) is then placed at random along the edges of the background image to maximize spatial variation. The spurious background increases the dimension ( = k × k × 3 ) of the input when k > 32 , making L ∞ certification with RS more challenging, but is uninformative for the task of CIFAR-10 by construction. Our mask model ( M 1 ) needs to learn to ignore the background to reduce the effective dimension of the input. For computational reasons, we run all certification results on a 200 sample subset of the CIFAR-10 test set. Appendix D shows extended results, details about hyperparameter tuning (C.3), and results on larger test-sets (D.1). We set the failure probability of the certification procedure to 0.05, use 100 samples to select the most probable class, and 50,000 samples for the Monte Carlo estimate of p + .

Table 1 summarizes the standard accuracy ( r = 0 ) of each approach on the different settings. We vary σ in { 0 . 25 , 0 . 5 , 1 . 0 } and k in { 32 , 48 , 64 , 96 } to show the effect of noise levels and dimensionality on the accuracy of different approaches ( k = 32 corresponds to original CIFAR-10 images). Figure 2 shows the certified test accuracy at different radii r ∞ for ARS and all baselines we consider.

We make three observations. First, ARS outperforms all the baselines under distractor backgrounds ( k > 32 ). Static mask is slightly better at k = 32 , probably because CIFAR-10 images lack enough "irrelevant" information for ARS to discard. This is precisely why we introduce this benchmark, where we explicitly add such irrelevant information to input images. Indeed, at k > 32 , we observe that the standard accuracy of ARS improves, translating to an improved certified accuracy at all certification levels, since more accurate and confident predictions give a larger certified radius r ∞ .

Second, as we grow the input dimension k , the accuracy of ARS remains either stable or increases, whereas that of other baselines goes down, resulting in an increasing gap. For instance, at σ = 1 . 0 , the gap between ARS and the best baseline is 1 . 3 % points for k = 32 , 2 . 5 % points for k = 48 ,

(a)

k

= 32

, σ

= 0

.

5

(b)

k

= 48

, σ

= 0

.

5

(c)

k

= 96

, σ

= 0

.

5

(d)

k

= 64

, σ

= 0

.

25

(e)

k

= 64

, σ

= 0

.

5

(f)

k

= 64

, σ

= 1

.

0

1.0

1.0

1.0

2

ARS (ours)

2

ARS (ours)

2

ARS (ours)

0.8

Cohenetal.

Accurac

0.8

Cohenetal.

Accurac

0.8

Cohenetal.

Accur

0.6

Static Mask

0.6

StaticMask

0.6

StaticMask

Sukenik et al.

Certifie

0.4

UniCR

Certifie

0.4

UniCR

Certifie

0.4

UniCR

0.2

0.2

0.2

C

C

0.0

8.00

0.02

0.04

0.0

8.00

0.02

0.04

0.0

8.00

0.02

0.04

Lradius

Lradius

Lradius

1.0

1.0

1.0

2

ARS (ours)

2

ARS (ours)

2

ARS (ours)

Accura

0.8

Cohenetal.

Accurac

0.8

n

0.8

0.6

StaticMask

0.6

StaticMask

ACC

0.6

StaticMask

Sukenik et al.

Sukeniketal.

Certifie

D

0.4

UniCR

ertifi

0.4

UniCR

Certifie

0.4

UniCR

0.2

0.2

0.2

C

0.0

8.00

0.02

0.04

0.0

8.00

0.02

0.04

0.0

8.00

0.02

0.04

Lradius

Lradius

Lradius

k

Input Images

ARS Masks

32

64

96

8 . 2 %points for k = 64 and 15 %points for k = 96 . As k grows, the amount of relevant information (a 32 × 32 × 3 CIFAR-10 image) remains the same, whereas the amount of spurious background information increases. ARS' mask is able to rule out spurious pixels, reducing the noise in the second step (Figure 3). Thanks to this masking, ARS is much less sensitive to increases in dimensionality.

Third, we observe that except k = 32 , ARS improves over all the baselines in low ( σ = 0 . 25 ) to high ( σ = 1 . 0 ) noise regimes. In fact, this trend continues to persist in higher noise regimes (Appendix D). Similar to previous observations, we notice that as we increase σ , other baselines's accuracy drops significantly whereas ARS accuracy drops much less, displaying higher noise tolerance.

ARS training and inference requires additional computation. To certify a single input ( k = 32 ), Cohen et al. (2019) takes ∼ 12 seconds while ARS takes ∼ 26 seconds (as measured on an NVIDIA A100 80Gb GPU). This 2 × overhead does however yield improved certified accuracy.

4.2 CelebA Benchmark: Classification Without Spatial Alignment

To evaluate ARS on a more realistic task with natural spatial variation, we use the CelebA face dataset in its unaligned version. We focus on the 'mouth slightly open' (label 21) binary classification task because mouth location and shape vary. The input part relevant to this task is likely well-localized, which affords an opportunity for the mask model to reduce the effective input dimension. The dataset

(a)

σ

= 0

.

25

(b)

σ

= 0

.

5

(c)

σ

= 1

.

0

1.0

1.0

1.0

2

0.8

0.8

0.8

0.6

ARS (ours)

0.6

0.6

0.4

staticmask

0.4

0.4

ertifie

0.2

0.2

0.2

C

0.0

00

00

0.000

0.005

0.010

0.000

0.005

0.010

0.015

0.000

0.005

0.010

0.015

Lradius

Lradius

Lradius

consists of images with varied resolution, and meta-data about the position of different features, including the mouth. To create a challenging benchmark, we randomly crop all images to 160 × 160 pixels, which creates spatial variation in the mouth's position. The only crop constraint is that the mouth is ≥ 10 pixels from the edge to ensure sufficient input to solve the task. Figure 5 shows example images from the test set, their respective masks from ARS, and the baseline static mask.

Figure 4 shows the certified accuracy for ARS, Cohen et al. (2019), and static mask, for three levels of the noise σ . First, both baselines perform very similarly. We can see from Figure 5 that the static mask is approximately identity (notice the ≥ 0 . 99 scale), with only very slight dimming on the edges. This is because the mouth is not centred in our benchmark, so there is no one-size-fits-all mask. Second, ARS is able to predict a sparse mask that focuses on

StaticMask

ARS Masks

1.00

0.99

areas likely to have the mouth. The mask adapts to each input at test time, which is what enables the sparsity without performance degradation. Third, this sparse mask leads to a large noise reduction, enabling ARS to drastically improve both standard and certified accuracy. For instance, with σ = 0 . 5 , ARS improves the standard accuracy from 91 . 0% to 94 . 3% (a 3 . 3 point improvement), while the certified accuracy at r ∞ = 0 . 004 jumps from 45 . 0% to 79 . 3% (a more than 30 point improvement!). At lower noise ( σ = 0 . 25 ) there is still an increase in standard accuracy from 94 . 3% to 97 . 0% , and an increase in certified accuracy from 68 . 3% to 84 . 7% at r ∞ = 0 . 002 ). At larger noise ( σ = 1 . 0 ), ARS sees significant increases ( 7 . 7% points in standard accuracy, and from 21 . 3% to 49 . 3% in certified accuracy at r ∞ = 0 . 008 ).

4.3 ImageNet Benchmark: Classification on the Standard Large-Scale Dataset

To evaluate the scalability of ARS we experiment on ImageNet (without any modification) with σ = 0 . 25 , 0 . 5 , 1 . 0 . For each noise level, we compare with Cohen et al. (2019), which we reproduce for this large-scale setting. We evaluate two versions of ARS: our regular setting (End-To-End); and a version that fixes the base classifier to the model trained as in Cohen et al. (2019), and only trains our mask model for 10 epochs (Pretrain). The certified accuracy is plotted in Figure 6 and the standard accuracy is reported in Table 3.

When only training the mask model, certified accuracy remains close to that of Cohen et al. (2019) at all radii and noise levels. ARS trained end-to-end improves both standard and certified accuracy.

The standard accuracy (at r = 0 ) increases from 57 . 2% to 57 . 4% and from 43 . 6% to 44 . 5% when σ = 0 . 5 and σ = 1 , respectively. For σ = 0 . 25 , standard accuracy for ARS is close but slightly lower than Cohen et al. (2019), while the pretrained ARS outperforms Cohen et al. (2019) from 66 . 5% to 67 . 4% . Appendix F discusses other ARS improvements without certification.

Certified accuracy increases at larger σ . For instance at σ = 0 . 5 , ARS improves certified accuracy at r ∞ = 0 . 001 from 48 . 9% to 50 . 5% . At larger noise σ = 1 . 0 , ARS improves certified accuracy at r ∞ = 0 . 005 from 21 . 7% to 23 . 1% . This shows that ARS' adaptivity generalizes outside of the specialized benchmarks we designed, and can scale to large datasets and complex classification tasks.

(a)

σ

= 0

.

25

(b)

σ

= 0

.

5

(c)

σ

= 1

.

0

1.0

1.0

1.0

ARS (end2end)

ARS (end2end)

ARS (end2end)

0.8

ARS (pretrain)

0.8

ARS (pretrain)

0.8

ARS (pretrain)

0.6

0.6

0.6

Certifie

ied

0.4

Certifie

ied

0.4

Certifie

D

0.4

0.2

0.2

0.2

00

0.0

00

0.000

0.005

0.010

0.000

0.005

0.010

0.000

0.005

0.010

Lradius

Lradius

Lradius

5 Discussion

Limitations: The multi-step adaptivity of ARS improves certification at the cost of increased model size and computation for RS. This impacts both training and testing computation, and is especially costly in the context of RS due to the Monte Carlo estimation of the model's expected predictions (over several forward passes at inference time). While we empirically show improvement by ARS, it would be interesting and important to investigate how it combines with other RS improvements such as adversarial training (Salman et al., 2019), consistency regularization (Jeong and Shin, 2020), higher order certification (Mohapatra et al., 2020), double sampling (Li et al., 2022b), and denoising by diffusion (Carlini et al., 2022). Lastly, our adaptive masking technique provides improved certificates for the L ∞ norm, but does not have the same effect for other norms such as L 2 (see remarks in §2.4). It is plausible that ARS' adaptivity can lead to improvements under alternative norms, by leveraging different DP mechanisms and updates. We leave this exploration for future work.

Implications: Revisiting heuristic adaptive defences (as surveyed in Croce et al. (2022)) through the lens of ARS could help improve the empirical performance of provable defences. ARS may require extensions, but could eventually enable the formal analysis of input purification (e.g., Song and Kim (2018); Nie et al. (2022); Yoon et al. (2021)), or leverage DP-SGD (Abadi et al., 2016) to analyze defences that update by test-time optimization (Alfarra et al., 2022b; Hwang et al., 2022; Mao et al., 2021). Going further, one could leverage the vast DP literature to extend ARS, enabling fully-adaptive variance defences inspired by Alfarra et al. (2022a) by leveraging privacy odometers (Rogers et al., 2016; Lécuyer, 2021; Whitehouse et al., 2023).

To conclude: we introduced Adaptive Randomized Smoothing (ARS) to reconnect RS with DP theory, to propose a new two-step defence for deep image classification, and to rigorously analyze such adaptive defences that condition on inputs at test time. This framework opens promising avenues for designing models that are adaptively and soundly robust with provable guarantees about their updates on natural and adversarial inputs.

Acknowledgments and Disclosure of Funding

We thank Krishnamurthy Dvijotham and Ian Goodfellow for reviewing and providing feedback during the Google DeepMind publication process. We thank Motasem Alfarra for discussing variations on input-dependent variance for randomized smoothing. We are grateful for the support of the Natural Sciences and Engineering Research Council of Canada (NSERC) [reference number RGPIN-202204469], as well as a Google Research Scholar award. This research was enabled by computational support provided by the Digital Research Alliance of Canada (alliancecan.ca).

References

Martin Abadi, Andy Chu, Ian Goodfellow, H Brendan McMahan, Ilya Mironov, Kunal Talwar, and Li Zhang. Deep learning with differential privacy. In Proceedings of the 2016 ACM SIGSAC conference on computer and communications security , 2016.

Motasem Alfarra, Adel Bibi, Philip HS Torr, and Bernard Ghanem. Data dependent randomized smoothing. In Uncertainty in Artificial Intelligence , pages 64-74. PMLR, 2022a.

Motasem Alfarra, Juan C. Perez, Ali Thabet, Adel Bibi, Philip H.S. Torr, and Bernard Ghanem. Combating adversaries with anti-adversaries. Proceedings of the AAAI Conference on Artificial Intelligence , 2022b.

Anish Athalye, Nicholas Carlini, and David Wagner. Obfuscated gradients give a false sense of security: Circumventing defenses to adversarial examples. In International conference on machine learning , 2018.

Avrim Blum, Travis Dick, Naren Manoj, and Hongyang Zhang. Random smoothing might be unable to certify ℓ ∞ robustness for high-dimensional images. The Journal of Machine Learning Research , 2020.

Yulong Cao, Ningfei Wang, Chaowei Xiao, Dawei Yang, Jin Fang, Ruigang Yang, Qi Alfred Chen, Mingyan Liu, and Bo Li. Invisible for both camera and lidar: Security of multi-sensor fusion based perception in autonomous driving under physical-world attacks. In 2021 IEEE Symposium on Security and Privacy (SP) , 2021.

Nicholas Carlini, Florian Tramer, Krishnamurthy Dj Dvijotham, Leslie Rice, Mingjie Sun, and J Zico Kolter. (certified!!) adversarial robustness for free! In The Eleventh International Conference on Learning Representations , 2022.

Anirban Chakraborty, Manaar Alam, Vishal Dey, Anupam Chattopadhyay, and Debdeep Mukhopadhyay. Adversarial attacks and defences: A survey. arXiv preprint arXiv:1810.00069 , 2018.

Jeremy Cohen, Elan Rosenfeld, and Zico Kolter. Certified adversarial robustness via randomized smoothing. In international conference on machine learning , pages 1310-1320. PMLR, 2019.

Joana C Costa, Tiago Roxo, Hugo Proença, and Pedro RM Inácio. How deep learning sees the world: A survey on adversarial attacks & defenses. arXiv preprint arXiv:2305.10862 , 2023.

Francesco Croce, Sven Gowal, Thomas Brunner, Evan Shelhamer, Matthias Hein, and Taylan Cemgil. Evaluating the adversarial robustness of adaptive test-time defenses. In International Conference on Machine Learning , pages 4421-4435. PMLR, 2022.

Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition . Ieee, 2009.

Jinshuo Dong, Aaron Roth, and Weijie J Su. Gaussian differential privacy. arXiv preprint arXiv:1905.02383 , 2019.

Jinshuo Dong, Aaron Roth, and Weijie J Su. Gaussian differential privacy. Journal of the Royal Statistical Society Series B: Statistical Methodology , 2022.

Krishnamurthy (Dj) Dvijotham, Jamie Hayes, Borja Balle, Zico Kolter, Chongli Qin, Andras Gyorgy, Kai Xiao, Sven Gowal, and Pushmeet Kohli. A framework for robustness certification of smoothed classifiers using f-divergences. In International Conference on Learning Representations , 2020. URL https://openreview.net/forum?id=SJlKrkSFPH .

Sivakanth Gopi, Yin Tat Lee, and Lukas Wutschitz. Numerical composition of differential privacy. Advances in Neural Information Processing Systems , 2021.

Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition , 2016.

James Honaker. Efficient use of differentially private binary trees. Theory and Practice of Differential Privacy (TPDP 2015), London, UK , 2015.

Hanbin Hong, Binghui Wang, and Yuan Hong. Unicr: Universally approximated certified robustness via randomized smoothing. In European Conference on Computer Vision . Springer, 2022.

Duhun Hwang, Eunjung Lee, and Wonjong Rhee. Aid-purifier: A light auxiliary network for boosting adversarial defense. In 2022 26th International Conference on Pattern Recognition (ICPR) , 2022.

Jongheon Jeong and Jinwoo Shin. Consistency regularization for certified robustness of smoothed classifiers. Advances in Neural Information Processing Systems , 2020.

Alex Krizhevsky. Learning multiple layers of features from tiny images, 2009. URL https: //api.semanticscholar.org/CorpusID:18268744 .

Aounon Kumar, Alexander Levine, Tom Goldstein, and Soheil Feizi. Curse of dimensionality on randomized smoothing for certifiable robustness. In International Conference on Machine Learning . PMLR, 2020.

Mathias Lécuyer. Practical privacy filters and odometers with rényi differential privacy and applications to differentially private deep learning. arXiv preprint arXiv:2103.01379 , 2021.

Mathias Lécuyer, Vaggelis Atlidakis, Roxana Geambasu, Daniel Hsu, and Suman Jana. Certified robustness to adversarial examples with differential privacy. In 2019 IEEE symposium on security and privacy (SP) , pages 656-672. IEEE, 2019.

Jizhizi Li, Jing Zhang, Stephen J Maybank, and Dacheng Tao. Bridging composite and real: towards end-to-end deep image matting. International Journal of Computer Vision , 2022a.

Linyi Li, Jiawei Zhang, Tao Xie, and Bo Li. Double sampling randomized smoothing. In International Conference on Machine Learning . PMLR, 2022b.

Linyi Li, Tao Xie, and Bo Li. Sok: Certified robustness for deep neural networks. In 2023 IEEE symposium on security and privacy (SP) , 2023.

Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. In Proceedings of International Conference on Computer Vision (ICCV) , December 2015.

Mao, M. Chiquier, H. Wang, J. Yang, and C. Vondrick. Adversarial attacks are reversible with natural supervision. In 2021 IEEE/CVF International Conference on Computer Vision (ICCV) , 2021.

Jeet Mohapatra, Ching-Yun Ko, Tsui-Wei Weng, Pin-Yu Chen, Sijia Liu, and Luca Daniel. Higherorder certification for randomized smoothing. Advances in Neural Information Processing Systems , 2020.

Weili Nie, Brandon Guo, Yujia Huang, Chaowei Xiao, Arash Vahdat, and Animashree Anandkumar. Diffusion models for adversarial purification. In International Conference on Machine Learning , 2022.

Apapan Pumsirirat and Yan Liu. Credit card fraud detection using deep learning based on autoencoder and restricted boltzmann machine. International Journal of advanced computer science and applications , 2018.

Ryan M Rogers, Aaron Roth, Jonathan Ullman, and Salil Vadhan. Privacy odometers and filters: Pay-as-you-go composition. Advances in Neural Information Processing Systems , 2016.

Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In Medical image computing and computer-assisted intervention-MICCAI 2015: 18th international conference, Munich, Germany, October 5-9, 2015, proceedings, part III 18 . Springer, 2015.

Hadi Salman, Jerry Li, Ilya Razenshteyn, Pengchuan Zhang, Huan Zhang, Sebastien Bubeck, and Greg Yang. Provably robust deep learning via adversarially trained smoothed classifiers. Advances in neural information processing systems , 2019.

Yang Song and Taesup Kim. Sebastian nowozin stefano ermon nate kushman. pixeldefend: Leveraging generative models to understand and defend against adversarial examples. In International Conference on Learning Representations , 2018.

Peter Súkeník, Aleksei Kuvshinov, and Stephan Günnemann. Intriguing properties of input-dependent randomized smoothing. arXiv preprint arXiv:2110.05365 , 2021.

Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. In International Conference on Learning Representations , 2014. URL http://arxiv.org/abs/1312.6199 .

Florian Tramer, Nicholas Carlini, Wieland Brendel, and Aleksander Madry. On adaptive attacks to adversarial example defenses. Advances in neural information processing systems , 33:1633-1645, 2020.

Justin Whitehouse, Aaditya Ramdas, Ryan Rogers, and Steven Wu. Fully-adaptive composition in differential privacy. In International Conference on Machine Learning , 2023.

Yihan Wu, Aleksandar Bojchevski, Aleksei Kuvshinov, and Stephan Günnemann. Completing the picture: Randomized smoothing suffers from the curse of dimensionality for a large family of distributions. In Proceedings of The 24th International Conference on Artificial Intelligence and Statistics , Proceedings of Machine Learning Research. PMLR, 2021. URL https://proceedings.mlr.press/v130/wu21d.html .

Greg Yang, Tony Duan, J Edward Hu, Hadi Salman, Ilya Razenshteyn, and Jerry Li. Randomized smoothing of all shapes and sizes. In International Conference on Machine Learning . PMLR, 2020.

Jongmin Yoon, Sung Ju Hwang, and Juho Lee. Adversarial purification with score-based generative models. In Proceedings of the 38th International Conference on Machine Learning , 2021.

A f -DP Background

For this background we use the DP mechanism terminology. A mechanism M ( . ) is a randomized computation taking an input and returning one sample from the distribution of outputs for this input: m ∼ M ( x ) with input x and output m . In ARS, each model step corresponds to an f -DP mechanism.

Definitions. Dong et al. (2019; 2022) formalize privacy as a bound on the power of hypothesis tests. Consider any two neighbouring inputs: in the most common DP applications, X,X ′ are two databases differing in one element; in the case of ARS against an L p adversary, X,X ′ ∈ R d are any two inputs such that X -X ′ ∈ B p ( r ) . Intuitively a randomized mechanism M is private if, for any such neighbouring inputs, the distributions M ( X ) and M ( X ′ ) are hard to distinguish. That is, by looking at a sample output from mechanism M , it is hard to guess whether M ran on X or on X ′ .

In f -DP (Dong et al., 2019; 2022) 'hard to distinguish' is defined by a hypothesis testing problem:

The output m ∼ M serves as input to a rejection rule ϕ ( . ) ∈ [0 , 1] (note: to preserve typical notations, lower-case ϕ is the rejection rule, and upper-case Φ is the standard normal CDF). The rejection rule rejects H 0 with probability ϕ ( m ) , so ϕ ( m ) = 0 predicts that X was the input, and ϕ ( m ) = 1 that X ′ was.

Given a rejection rule ϕ , we define its Type I error α ϕ and type II error (or one minus the power of the rule) β ϕ as:

Intuitively, α ϕ is the expected amount of rejection of H 0 when the hypothesis is correct ( X was in input, but we think X ′ was), also called the level of the rejection rule. On the flip side, β ϕ is the expected amount of non-rejection under H 1 ( X ′ was in input, but we think X was). 1 -β ϕ is called the power of the rejection rule.

For any two distributions M ( X ) and M ( X ′ ) , we define the trade-off function T ( M ( X ) , M ( X ′ ) ) : [0 , 1] → [0 , 1] that quantifies the minimum amount of type II error achievable at each value of type I error by any (measurable) rule; or equivalently the maximum power of any rule at each level:

Now we define f -DP: for any trade-off function f , a mechanism M is f -DP if, for any neighbouring inputs X,X ′ ,

These definitions are the main technical tools we need to prove Proposition 2.1. Corollary 2.2 only adds the formula for f for the Gaussian mechanism, given in Section 2.1.

Composition. All other results rely on the above plus the adaptive composition of f -DP mechanisms. Such composition is key to all DP theory and algorithm design. Consider a sequence of N mechanisms M i , such that each mechanism is f i -DP with regards to X,X ′ , and depends on the neighbouring input as well as the output of all previous mechanisms. More formally, under H 0 we have m i ∼ M i ( X,m <i ) , and under H 1 we have m i ∼ M i ( X,m <i ) , where m <i ≜ ( m 1 , . . . , m i -1 ) . Concretely, each M i is f i -DP with regards to X,X ′ for f i known in advance, but the actual computation made by M i can depend on m <i (as long as it is f i -DP). We leverage this adaptivity to lower the noise variance in our method's second step while keeping f 2 fixed (see §3).

We need two more results to define the composition of a sequence of mechanisms. First, Proposition 2.2 in Dong et al. (2019; 2022) shows that for any trade-off function f , there exist two distributions P f , Q f such that T ( P f , Q f ) = f . Call any such pair of distributions a representative pair of f . Second, we define the composition operator ⊗ by f ⊗ g = T ( P f × P g , Q f × Q g ) . That is, the composition operator between two trade-off functions is the trade-off function between the product distributions on their representative pair. Then Theorem 3.2 in Dong et al. (2019; 2022) shows that:

Concretely, the mechanism that returns the sequence of results for all compute adaptive M N is f 1 ⊗ . . . ⊗ f N -DP. The previous definitions, as well as this composition result, is what we use to prove Theorem 2.3 and Proposition 2.4.

B Proofs

̸

Proposition 2.1 ( f -DP Robustness). Let M : X → Y be f -DP for B p ( r ) neighbourhoods, and let M S : X → arg max y ∈Y P ( M ( X ) = y ) be the associated smooth classifier. Let y + ≜ M S ( X ) be the prediction on input X , and let p + , p -∈ [0 , 1] be such that P ( M ( X ) = y + ) ≥ p + ≥ p -≥ max y -= y + P ( M ( X ) = y -) . Then:

Proof. Let us first consider any runner-up class y -. Calling M the random variable for M 's prediction, consider the rejection rule ϕ = 1 { M = y -} , where 1 is the indicator function. Denoting α ≜ E M ( X ) ( ϕ ) , and using the fact that M is f -DP for B p ( r ) neighbourhoods, we have that ∀ e ∈ B p ( r ) :

where the last inequality is because α = E M ( X ) ( ϕ ) = P ( M ( X ) = y -) ≤ p -, and f is nonincreasing so f ( α ) ≥ f ( p -) and hence 1 -f ( α ) ≤ 1 -f ( p -) .

̸

Let us now consider the predicted class y + . Keeping the same notations, and defining the rule ϕ ′ = 1 { M = y + } = 1 -1 { M = y + } . Then α ′ = E M ( X ) ( ϕ ′ ) = 1 -P ( M ( X ) = y + ) ≤ 1 -p + , and E M ( X + e ) ( ϕ ′ ) ≤ 1 -f ( α ′ ) ≤ 1 -f (1 -p + ) , yielding:

Putting Equations (8) and (9) together, we have that P ( M ( X + e ) = y + ) ≥ f (1 -p + ) ≥ 1 -f ( p -) ≥ P ( M ( X + e ) = y -) and thus m S ( X + e ) = y + .

Note that we do not have to chose a rule ϕ ∈ { 0 , 1 } , but could instead return any number in [0 , 1] , such as the logits of the base classification model, yielding the following definition for the smoothed classifier M S : X → arg max y ∈Y E ( M ( X ) y ) .

̸

Proposition 2.2 (RS from f -DP). Let M : X → g ( X + z ) , z ∼ N (0 , σ 2 I d ) , and M S : X → arg max y ∈Y P ( M ( X ) = y ) be the associated smooth model. Let y + ≜ M S ( X ) be the prediction on input X , and let p + , p -∈ [0 , 1] be such that P ( M ( X ) = y + ) ≥ p + ≥ p -≥ max y -= y + P ( M ( X ) = y -) . Then ∀ e ∈ B 2 ( r x ) , M S ( X + e ) = y + , with:

Proof. X : → X + z, z ∼ N (0 , σ 2 ) is a Gaussian mechanism. By Equation (2), for the B r ( r ) neighbouring definition, it is G r σ -DP. By post-processing M is also G r σ -DP.

Applying Proposition 2.1, we have that G r σ (1 -p + ) ≥ 1 -G r σ ( p -) ⇒∀ e ∈ B 2 ( r ) , m S ( X + e ) = y + . Let us find r X = sup { r : G r σ (1 -p + ) ≥ 1 -G r σ ( p -) } . Since G r σ ( . ) as a function of r is monotonously decreasing this will happen at G r X σ (1 -p + ) = 1 -G r X σ ( p -) , that is:

where the first implication holds because by symmetry of the standard normal 1 -Φ( x ) = Φ( -x ) , and because Φ is strictly monotonous ; the second because similarly, Φ -1 (1 -p ) = -Φ -1 ( p ) .

C Experiment Details

C.1 Mask Architecture

Figure 7 shows the architecture of our Mask model w ( M 1 ). We adapt a UNet architecture to preserve dimensions, and use a Sigmoid layer at the end of the model to output values between 0 and 1 for mask weights. We set up our UNet hyperparameters as : in_channels =3, out_channels =1 (to out put a mask), base_channel =32, channel_mult ={1,2,4,8}.

C.2 Hyperparameter tuning for CelebA

Table 4 provides the details of our ARS models' hyper-parameters. On the CelebA dataset, we tune the hyper-parameters in the ARS, Cohen et al. (2019), and static mask settings at σ = 0 . 75 . In all settings, we settle on SGD with learning rate 0.05 and a step learning rate scheduler (step size of 3 and γ = 0 . 8 ) for the base classifier. In the static mask setting, we use SGD with learning rate 0.01.

C.3 Hyperparameter tuning for CIFAR-10 BG20k

For the base classifier g in Cohen et al. (2019), Static Mask and ARS experiments, we tune the optimizer and its hyperparameters using k = 64 , σ = 1 . 5 as the testbed. Based on these tuning experiments, we chose AdamW as the optimizer with an initial learning rate of 0.01 and weight decay to 0.0001. We scale the learning rate by 0.1 every 30 th epoch, with a batch size of 256. For the mask model w in ARS experiments, we again used the AdamW optimizer with an initial learning rate of 0.001, weight decay of 0.0001, whilst scaling the learning rate by 0.5 every 40 th epoch. We used the same hyperparameters for all k 's and σ 's for these setups.

For Súkeník et al. (2021), for k = 32 , 48 , 64 , we tune the hyperparameters using k = 64 as the testbed. We kept the optimizer same as used in the author's code (SGD), setting the initial learning rate to 0.01, momentum to 0.9 and weight decay to 0. We scaled the learning rate by 0.1 every 30 th epoch. We tune k = 96 's parameters separately. We start with an initial learning rate 0.1, keeping

the rest of hyperparameters same as for k = 32 , 48 , 64 . Note that for k = 96 , we could not get the standard accuracy to improve upon random baseline for σ = { 0 . 5 , 0 . 75 , 1 . 0 , 1 . 5 } , despite extensively tuning the learning rate.

For UniCR, we tune β (the parameter of the generalized normal distribution for the noise) using σ = 0 . 75 and k = 48 as the testbed. We perform grid search on β and find that β = 2 . 0 or β = 2 . 25 (Gaussian and close to a Gaussian, but with a wider more and shorted tails) perform best. For each k, σ setting, we train 3 models with β = 2 . 25 and 2 . 0 and choose the β giving highest mean standard accuracy. The chosen β for each setting is given in Table 5. For each setting we also tune optimizer hyper-parameters. At k = 32 , we use SGD optimizer. We use a learning rate of 0.01, momentum of 0.9 and weight decay of 0.0005 with a step learning rate scheduler (30 step and γ = 0 . 1 ). At k = 48 , 64 , 96 we use training batch size 256, 100 epochs, and AdamW optimizer. We use a learning rate of 0.001 with step learning rate scheduler (30 step size and γ = 0 . 5 ).

(a)

σ

= 0

.

12

(b)

σ

= 0

.

25

(c)

σ

= 0

.

5

(d)

σ

= 0

.

75

(e)

σ

= 1

.

0

(f)

σ

= 1

.

5

1.0

1.0

1.0

2

ARS (ours)

2

ARS (ours)

2

ARS (ours)

Accurac

0.8

Accurac

0.8

Accurac

0.8

0.6

StaticMask

0.6

StaticMask

0.6

StaticMask

Sukenik et al.

Sukenik et al.

Certifie

0.4

UniCR

Certifie

0.4

UniCR

Certifie

0.4

UniCR

0.2

0.2

0.2

C

C

C

0.0

0.0

0.0

0.00

0.02

0.04

8.00

0.02

0.04

8.00

0.02

0.04

Lradius

Lradius

Lradius

1.0

1.0

1.0

2

n

0.8

ARS (ours)

2

n

0.8

ARS (ours)

Cohenetal.

2

ura

0.8

ARS (ours)

AcC

0.6

StaticMask

Ac

0.6

StaticMask

Ac

0.6

StaticMask

Sukenik et al.

Sukenik et al.

Sukeniketal.

ertifi

0.4

UniCR

ertifie

0.4

UniCR

ertifie

D

0.4

UniCR

0.2

0.2

0.2

C

C

0.0

0.0

0.0

8.00

0.02

0.04

8.00

0.02

0.04

0.00

0.02

0.04

Lradius

Lradius

Lradius

D Additional Results on CIFAR10 BG20k Benchmark

We show here full sweep of results for CIFAR-10 Bg20k benchmark for k = 32 , 48 , 64 , 96 and σ = 0 . 12 , 0 . 25 , 0 . 5 , 0 . 75 , 1 . 0 , 1 . 5 for all our baselines and ARS. Similar to results presented in Table 1, we report the mean accuracy and standard deviation over three seeds.

(a)

σ

= 0

.

12

(b)

σ

= 0

.

25

(c)

σ

= 0

.

5

(d)

σ

= 0

.

75

(e)

σ

= 1

.

0

(f)

σ

= 1

.

5

1.0

1.0

1.0

2

ARS (ours)

2

ARS (ours)

2

ARS (ours)

0.8

Accurac

0.8

0.8

ccur

cur

A

0.6

Sukenik et al.

Static Mask

0.6

StaticMask

AC

0.6

StaticMask

Sukenik et al.

ertifi

0.4

UniCR

Certifie

0.4

UniCR

Certifie

0.4

UniCR

0.2

0.2

0.2

C

C

C

0.0

0.0

0.0

0.00

0.02

0.04

8.00

0.02

0.04

0.00

0.02

0.04

Lradius

Lradius

Lradius

1.0

1.0

1.0

2

ARS (ours)

2

ARS (ours)

2

ARS (ours)

n

0.8

0.8

un

0.8

AcC

0.6

Sukenik et al.

StaticMask

AC

0.6

StaticMask

Sukenik et al.

A

0.6

Sukenik et al.

StaticMask

ertifi

0.4

UniCR

ertifie

0.4

UniCR

ertifie

D

0.4

UniCR

0.2

0.2

0.2

C

C

0.0

8.00

0.02

0.04

0.0

8.00

0.02

0.04

0.0

8.00

0.02

0.04

Lradius

Lradius

Lradius

(a)

σ

= 0

.

12

(b)

σ

= 0

.

25

(c)

σ

= 0

.

5

(d)

σ

= 0

.

75

(e)

σ

= 1

.

0

(f)

σ

= 1

.

5

1.0

1.0

1.0

Accura

2

0.8

ARS (ours)

0.8

ARS (ours)

Cohenet al.

0.8

ARS (ours)

0.6

StaticMask

0.6

StaticMask

0.6

StaticMask

Sukeniketal.

Sukeniketal.

Sukeniketal.

ertifi

0.4

UniCR

Certifie

0.4

UniCR

Certifie

ied

0.4

UniCR

0.2

0.2

0.2

C

0.0

0.0

0.0

8.00

0.02

0.04

8.00

0.02

0.04

8.00

0.02

0.04

Lradius

Lradius

Lradius

1.0

1.0

1.0

2

ARS (ours)

2

ARS (ours)

2

ARS (ours)

0.8

Cohenet al.

0.8

0.8

A

0.6

Static Mask

Sukenik et al.

A

0.6

StaticMask

Sukenik et al.

A

0.6

StaticMask

Sukenik et al.

ertifie

0.4

UniCR

ertifie

0.4

UniCR

Certifie

0.4

UniCR

0.2

0.2

0.2

C

C

0.0

8.00

0.02

0.04

0.0

8.00

0.02

0.04

0.0

8.00

0.02

0.04

Lradius

Lradius

Lradius

D.1 Impact of Certification Test-set Size

The baseline results in Table 6 are lower than those reported by Cohen et al. (2019) (Figure 6). This is a result of our certifying over a smaller subset of the test set (the released code from Cohen et al. (2019) 1 uses a subset of size 500, while the paper says the certification was on the full test set). In Table 7 we report the standard accuracy ( r = 0 ) on the same 500 samples subset of the CIFAR-10 test set as used in the code released by Cohen et al. (2019). We show results for k = 32 , which is the plain CIFAR-10 task, using both the hyper-parameters from Cohen et al. (2019), our own optimized hyper-parameters (the most notable change is that we use AdamW), and ARS. We make three observations. First, as it turns out, our 200 samples subset used for results in Table 6

(a)

σ

= 0

.

12

(b)

σ

= 0

.

25

(c)

σ

= 0

.

5

(d)

σ

= 0

.

75

(e)

σ

= 1

.

0

(f)

σ

= 1

.

5

1.0

1.0

1.0

2

ARS (ours)

2

ARS (ours)

2

ARS (ours)

0.8

Accurac

0.8

Accurac

0.8

Cohenetal.

ccur

AC

0.6

StaticMask

0.6

StaticMask

0.6

StaticMask

Sukenik et al.

Sukenik et al.

ertifie

0.4

UniCR

Certifie

0.4

UniCR

Certifie

0.4

UniCR

0.2

0.2

0.2

C

C

C

0.0

0.0

0.0

0.00

0.02

0.04

8.00

0.02

0.04

0.00

0.02

0.04

Lradius

Lradius

Lradius

1.0

1.0

1.0

2

ARS (ours)

2

ARS (ours)

ARS (ours)

cura

0.8

n

0.8

cura

0.8

AcC

0.6

StaticMask

Ac

0.6

StaticMask

Ac

0.6

StaticMask

Sukenik et al.

Sukenik et al.

Sukenik et al.

ertifi

0.4

UniCR

Certifie

D

0.4

UniCR

Certifie

D

0.4

UniCR

0.2

0.2

0.2

C

0.0

8.00

0.02

0.04

0.0

8.00

0.02

0.04

0.0

8.00

0.02

0.04

Lradius

Lradius

Lradius

is more challenging, and accuracy values are systematically lower (by about 2 % points) than over 500 samples and the full test set (10k samples). Using the same 500 samples subset yields accuracy values very close to those reported by Cohen et al. (2019) on their hyper-parameters. Second, over all samples sizes 200, 500, and 10k, our hyper-parameters significantly improve the accuracy of RS (by about 3% points consistently), confirming that we are making a fair comparison between the best RS models we could find and ARS. Third, at k = 32 ARS provides modest improvements over tuned RS, as CIFAR-10 images are well cropped and low-dimensional, providing less opportunity for dimension reduction through masking, and hence lower ARS improvements.

D.2 CIFAR-10 BG20k figures

Figure 12, Figure 13, Figure 14 and Figure 15 shows figures of different stages in our ARS architecture (Figure 1). In all of these figures, 1 st row corresponds to input images X , 2 nd row corresponds to images right after M 1 , 3 rd row corresponds to ARS masks, 4 th row corresponds to element-wise

(a)

σ

= 0

.

25

(b)

σ

= 1

.

0

(a)

σ

= 0

.

25

(b)

σ

= 1

.

0

中

product of input X and ARS masks, 5 th row corresponds to images right after M 2 and 6 th row corresponds to images right after averaging M 1 , M 2 .

(a)

σ

= 0

.

25

(b)

σ

= 1

.

0

(a)

σ

= 0

.

25

(b)

σ

= 1

.

0

E Additional Results on CelebA

Inputimages

Firstquerynoisedimages

ARSMasks

Second query noised images after averaging

Figure 16 shows how adaptive masking reduces the noise around areas that are important to classification. The images follow our architecture visualized Figure 1. The mask model is provided the first query noised images as input. The learned masks, presented in the bottom left, are sparse and highly concentrated around the area of interest-the mouth area. The second query noised images (after weighted average) use the mask to clearly reduce the noise around the mouth. This large noise reduction enables ARS to outperform static masking and Cohen et al. (2019), as shown on Figure 4.

We show here a full set of results for the CelebA benchmark over all σ = 0 . 12 , 0 . 25 , 0 . 5 , 0 . 75 , 1 . 0 , 1 . 5 for Cohen et al. (2019), static masking, and ARS. Similarly to the results in Table 2, we report the mean standard accuracy and standard deviation over three seeds in Table 8. The certified accuracies are plotted in Figure 17. We see that at all σ , ARS has the highest standard accuracy.

(a)

σ

= 0

.

12

(b)

σ

= 0

.

25

(c)

σ

= 0

.

5

(d)

σ

= 0

.

75

(e)

σ

= 1

.

0

(f)

σ

= 1

.

5

1.0

1.0

1.0

ARS (ours)

0.8

0.8

0.8-

static mask

0.6

0.6

0.6

Certified

0.4

0.4

0.4

0.2

0.2

0.2

0.0

0.0

0.0

0.000

0.005

0.010

0.015

0.005

0.010

0.015

0.005

0.010

0.015

Lo radius

Lo radius

Lo radius

1.0

1.0

1.0

Certified Accuracy

ARS (ours)

0.8

0.8

0.8

0.6

static mask

0.6

0.6

0.4

0.4

0.4

0.2

0.2

0.2

.00

00

00

0.005

0.010

0.015

0.005

0.010

0.015

0.005

0.010

0.015

Lo radius

Lo radius

La radius

F Additional Results on ImageNet

Figures 18 to 20 show how adaptive masking reduces the noise around areas that are important to classification for ImageNet. The images follow our architecture visualized Figure 1. The mask model is provided the first query noised images as input. The learned masks, presented in the bottom left, are sparse and concentrated around the area of interest (the bird, or any labelled object). The second query noised images after weighted average use the mask to clearly reduce the noise around the bird.

An interesting observation is that on ImageNet, ARS yields larger improvements to the test accuracy without certification. We follow the certification procedure of Cohen et al. (2019), which first determines the predicted class, and then certifies it if and only if the probability of this predicted class is such that p + ≥ 0 . 5 (that is, it groups all other classes into one non-predicted class). If this is not the case, the prediction will count as not certified at r = 0 , even if the predicted class is still correct. We keep this procedure for consistency with prior work, but on a task with a large number of classes like in ImageNet, the accuracy at r = 0 can be much lower as the non-certified accuracy.

We noticed that ARS significantly improves this non certified accuracy, while not improving the accuracy at r = 0 as much (see Section 4.3). In effect ARS leads to more correct predictions, but

this (correct) predicted class has p + < 0 . 5 , so the accuracy at r = 0 does not increase. Table 9 shows this effect by comparing the test accuracy (no certification at all) across all methods. Under ARS, the test accuracy increases from 68 . 5% to 70 . 1% when σ = 0 . 25 , from 60 . 7% to 64 . 2% when σ = 0 . 5 , and from 47 . 9% to 53 . 8% for σ = 1 . 0 . In summary, ARS achieves best test accuracy (without certification) for all the noise levels. This suggests that ARS helps more than shown by the default certification approach, and that a finer analysis that accounts for the probability of all classes could yield further improvements in certified accuracy.

NeurIPS Paper Checklist

1. Claims

Question: Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope?

Answer: [Yes]

Justification: The abstract and introduction identify the purpose of our paper and our theoretical, technical, and empirical contributions. We provide theoretical results in Section 2 with detailed proofs, and comprehensive experimental results in Section 4 to support our technical claims and contributions for test-time adaptive certification for robustness. Our choice of theoretical framework, task scope, and evaluation datasets are all present in the abstract.

Guidelines:

The answer NA means that the abstract and introduction do not include the claims made in the paper.

The abstract and/or introduction should clearly state the claims made, including the contributions made in the paper and important assumptions and limitations. A No or NA answer to this question will not be perceived well by the reviewers.

The claims made should match theoretical and experimental results, and reflect how much the results can be expected to generalize to other settings.

It is fine to include aspirational goals as motivation as long as it is clear that these goals are not attained by the paper.

2. Limitations

Question: Does the paper discuss the limitations of the work performed by the authors?

Answer: [Yes]

Justification: We identify limitations in Section 5 and in particular call out computational overhead and the need to assess the combination of ARS with other improvements to RS (which are compatible in principle, but require experiment to measure and verify).

Guidelines:

The answer NA means that the paper has no limitation while the answer No means that the paper has limitations, but those are not discussed in the paper.

The authors are encouraged to create a separate "Limitations" section in their paper.

The paper should point out any strong assumptions and how robust the results are to violations of these assumptions (e.g., independence assumptions, noiseless settings, model well-specification, asymptotic approximations only holding locally). The authors should reflect on how these assumptions might be violated in practice and what the implications would be.

The authors should reflect on the scope of the claims made, e.g., if the approach was only tested on a few datasets or with a few runs. In general, empirical results often depend on implicit assumptions, which should be articulated.

The authors should reflect on the factors that influence the performance of the approach. For example, a facial recognition algorithm may perform poorly when image resolution is low or images are taken in low lighting. Or a speech-to-text system might not be used reliably to provide closed captions for online lectures because it fails to handle technical jargon.

The authors should discuss the computational efficiency of the proposed algorithms and how they scale with dataset size.

If applicable, the authors should discuss possible limitations of their approach to address problems of privacy and fairness.

While the authors might fear that complete honesty about limitations might be used by reviewers as grounds for rejection, a worse outcome might be that reviewers discover limitations that aren't acknowledged in the paper. The authors should use their best judgment and recognize that individual actions in favor of transparency play an important role in developing norms that preserve the integrity of the community. Reviewers will be specifically instructed to not penalize honesty concerning limitations.

3. Theory Assumptions and Proofs

Question: For each theoretical result, does the paper provide the full set of assumptions and a complete (and correct) proof?

Answer: [Yes]

Justification: We present the theoretical results in Section 2, where we cover the main results, and provide Appendix B with further detailed assumptions and proofs.

Guidelines:

The answer NA means that the paper does not include theoretical results.

All the theorems, formulas, and proofs in the paper should be numbered and crossreferenced.

All assumptions should be clearly stated or referenced in the statement of any theorems.

The proofs can either appear in the main paper or the supplemental material, but if they appear in the supplemental material, the authors are encouraged to provide a short proof sketch to provide intuition.

Inversely, any informal proof provided in the core of the paper should be complemented by formal proofs provided in appendix or supplemental material.

Theorems and Lemmas that the proof relies upon should be properly referenced.

4. Experimental Result Reproducibility

Question: Does the paper fully disclose all the information needed to reproduce the main experimental results of the paper to the extent that it affects the main claims and/or conclusions of the paper (regardless of whether the code and data are provided or not)?

Answer: [Yes]

Justification: The method is described in the text, and to ensure sufficient detail, we additionally provide appendices and supplementary material that includes the anonymized code for our method. The experiments identify their settings and hyperparameters, such as noise levels and input image dimensions, and these settings can be verified by inspection of the results for our method and the baselines like Cohen et al. (2019). By relying on standard base models, such as ResNet-50, our work is made more reproducible by following the conventions of existing papers. For modeling specific to our contribution, such as a the mask model, we have taken care to provide more detail in the appendix. Our adaptivity benchmarks, while our own design, are simple to implement (through padding and cropping) and our choices of how to transform the base public datasets are described in the text. In addition, we have incorporated reviewers feedback in the camera ready version.

Guidelines:

The answer NA means that the paper does not include experiments.

If the paper includes experiments, a No answer to this question will not be perceived well by the reviewers: Making the paper reproducible is important, regardless of whether the code and data are provided or not.

If the contribution is a dataset and/or model, the authors should describe the steps taken to make their results reproducible or verifiable.

Depending on the contribution, reproducibility can be accomplished in various ways. For example, if the contribution is a novel architecture, describing the architecture fully might suffice, or if the contribution is a specific model and empirical evaluation, it may be necessary to either make it possible for others to replicate the model with the same dataset, or provide access to the model. In general. releasing code and data is often one good way to accomplish this, but reproducibility can also be provided via detailed instructions for how to replicate the results, access to a hosted model (e.g., in the case of a large language model), releasing of a model checkpoint, or other means that are appropriate to the research performed.

While NeurIPS does not require releasing code, the conference does require all submissions to provide some reasonable avenue for reproducibility, which may depend on the nature of the contribution. For example

(a) If the contribution is primarily a new algorithm, the paper should make it clear how to reproduce that algorithm.

(b) If the contribution is primarily a new model architecture, the paper should describe the architecture clearly and fully.

(c) If the contribution is a new model (e.g., a large language model), then there should either be a way to access this model for reproducing the results or a way to reproduce the model (e.g., with an open-source dataset or instructions for how to construct the dataset).

(d) We recognize that reproducibility may be tricky in some cases, in which case authors are welcome to describe the particular way they provide for reproducibility. In the case of closed-source models, it may be that access to the model is limited in some way (e.g., to registered users), but it should be possible for other researchers to have some path to reproducing or verifying the results.

5. Open access to data and code

Question: Does the paper provide open access to the data and code, with sufficient instructions to faithfully reproduce the main experimental results, as described in supplemental material?

Answer: [Yes]

Justification: We submit our codes and necessary command in a zip file. For the camera ready version, we have open sourced our code at https://github.com/ubc-systopia/ adaptive-randomized-smoothing/tree/main . The hyperparameter settings are listed in Table 4. The datasets we used are cited and has open access to the public. .

Guidelines:

The answer NA means that paper does not include experiments requiring code.

Please see the NeurIPS code and data submission guidelines ( https://nips.cc/ public/guides/CodeSubmissionPolicy ) for more details.

While we encourage the release of code and data, we understand that this might not be possible, so 'No' is an acceptable answer. Papers cannot be rejected simply for not including code, unless this is central to the contribution (e.g., for a new open-source benchmark).

The instructions should contain the exact command and environment needed to run to reproduce the results. See the NeurIPS code and data submission guidelines ( https: //nips.cc/public/guides/CodeSubmissionPolicy ) for more details.

The authors should provide instructions on data access and preparation, including how to access the raw data, preprocessed data, intermediate data, and generated data, etc.

The authors should provide scripts to reproduce all experimental results for the new proposed method and baselines. If only a subset of experiments are reproducible, they should state which ones are omitted from the script and why.

At submission time, to preserve anonymity, the authors should release anonymized versions (if applicable).

Providing as much information as possible in supplemental material (appended to the paper) is recommended, but including URLs to data and code is permitted.

6. Experimental Setting/Details

Question: Does the paper specify all the training and test details (e.g., data splits, hyperparameters, how they were chosen, type of optimizer, etc.) necessary to understand the results?

Answer: [Yes]

Justification: We detail our experimental setting at a high-level in Section 4 and then elaborate in each subsection. We list our experimental setting in Section 4 and the hyperparameters in Table 4. For baselines, we rely on the reference hyperparameter settings from the papers for Cohen et al. (2019), rely on code and hyper-parameters shared by the authors for Súkeník et al. (2021) (the code is not public), and tune hyper-parameters and β for Hong et al. (2022) (details in §C).

Guidelines:

The answer NA means that the paper does not include experiments.

The experimental setting should be presented in the core of the paper to a level of detail that is necessary to appreciate the results and make sense of them.

The full details can be provided either with the code, in appendix, or as supplemental material.

7. Experiment Statistical Significance

Question: Does the paper report error bars suitably and correctly defined or other appropriate information about the statistical significance of the experiments?

Answer: [Yes]

Justification: We ran all experiments end-to-end over three different seeds, and show both mean and standard deviation on plots and tables (except on ImageNet, for resources reasons). The factors of variability are those that are standard and natural to deep learning and robustness by randomized smoothing: initialization of parameters, train-time sampling of the data, train-time sampling of augmentations, and test-time sampling of noise for certification.

Guidelines:

The answer NA means that the paper does not include experiments.

The authors should answer "Yes" if the results are accompanied by error bars, confidence intervals, or statistical significance tests, at least for the experiments that support the main claims of the paper.

The factors of variability that the error bars are capturing should be clearly stated (for example, train/test split, initialization, random drawing of some parameter, or overall run with given experimental conditions).

The method for calculating the error bars should be explained (closed form formula, call to a library function, bootstrap, etc.)

The assumptions made should be given (e.g., Normally distributed errors).

It should be clear whether the error bar is the standard deviation or the standard error of the mean.

It is OK to report 1-sigma error bars, but one should state it. The authors should preferably report a 2-sigma error bar than state that they have a 96% CI, if the hypothesis of Normality of errors is not verified.

For asymmetric distributions, the authors should be careful not to show in tables or figures symmetric error bars that would yield results that are out of range (e.g. negative error rates).

If error bars are reported in tables or plots, The authors should explain in the text how they were calculated and reference the corresponding figures or tables in the text.

8. Experiments Compute Resources

Question: For each experiment, does the paper provide sufficient information on the computer resources (type of compute workers, memory, time of execution) needed to reproduce the experiments?

Answer: [Yes]

Justification: The computing resources are included in Table 4. The resources are single GPUs, which while required are sufficiently standard for this field as to be understandable and accessible.

Guidelines:

The answer NA means that the paper does not include experiments.

The paper should indicate the type of compute workers CPU or GPU, internal cluster, or cloud provider, including relevant memory and storage.

The paper should provide the amount of compute required for each of the individual experimental runs as well as estimate the total compute.

The paper should disclose whether the full research project required more compute than the experiments reported in the paper (e.g., preliminary or failed experiments that didn't make it into the paper).

9. Code Of Ethics

Question: Does the research conducted in the paper conform, in every respect, with the NeurIPS Code of Ethics https://neurips.cc/public/EthicsGuidelines ?

Answer: [Yes]

Justification: We have reviewed the NeurIPS Code of Ethics and can confirm that we conform to them in every respect when we conducted research in the paper.

Guidelines:

The answer NA means that the authors have not reviewed the NeurIPS Code of Ethics.

If the authors answer No, they should explain the special circumstances that require a deviation from the Code of Ethics.

The authors should make sure to preserve anonymity (e.g., if there is a special consideration due to laws or regulations in their jurisdiction).

10. Broader Impacts

Question: Does the paper discuss both potential positive societal impacts and negative societal impacts of the work performed?

Answer: [NA]

Justification: This paper improves the robustness of existing machine learning models to adversarial examples. Adversarial examples have been proposed for a limited number of beneficial use cases, such as censorship or surveillance evasion, but overall more robust and trustworthy ML models can benefit the increasingly broad deployment of machine learning, including in security and safety-critical applications. As a paper with a theoretical emphasis and empirical evaluation on well-established benchmarks, this work does not have additional societal impact beyond the norm.

Guidelines:

The answer NA means that there is no societal impact of the work performed.

If the authors answer NA or No, they should explain why their work has no societal impact or why the paper does not address societal impact.

Examples of negative societal impacts include potential malicious or unintended uses (e.g., disinformation, generating fake profiles, surveillance), fairness considerations (e.g., deployment of technologies that could make decisions that unfairly impact specific groups), privacy considerations, and security considerations.

The conference expects that many papers will be foundational research and not tied to particular applications, let alone deployments. However, if there is a direct path to any negative applications, the authors should point it out. For example, it is legitimate to point out that an improvement in the quality of generative models could be used to generate deepfakes for disinformation. On the other hand, it is not needed to point out that a generic algorithm for optimizing neural networks could enable people to train models that generate Deepfakes faster.

The authors should consider possible harms that could arise when the technology is being used as intended and functioning correctly, harms that could arise when the technology is being used as intended but gives incorrect results, and harms following from (intentional or unintentional) misuse of the technology.

If there are negative societal impacts, the authors could also discuss possible mitigation strategies (e.g., gated release of models, providing defenses in addition to attacks, mechanisms for monitoring misuse, mechanisms to monitor how a system learns from feedback over time, improving the efficiency and accessibility of ML).

11. Safeguards

Question: Does the paper describe safeguards that have been put in place for responsible release of data or models that have a high risk for misuse (e.g., pretrained language models, image generators, or scraped datasets)?

Answer: [NA]

Justification: Our work does not have a high risk for misuse, given its theoretical portion on proofs for robustness, and its empirical portion on the robustness evaluation of standard image classifiers. As such no special safeguards are needed.

Guidelines:

The answer NA means that the paper poses no such risks.

Released models that have a high risk for misuse or dual-use should be released with necessary safeguards to allow for controlled use of the model, for example by requiring that users adhere to usage guidelines or restrictions to access the model or implementing safety filters.

Datasets that have been scraped from the Internet could pose safety risks. The authors should describe how they avoided releasing unsafe images.

We recognize that providing effective safeguards is challenging, and many papers do not require this, but we encourage authors to take this into account and make a best faith effort.

12. Licenses for existing assets

Question: Are the creators or original owners of assets (e.g., code, data, models), used in the paper, properly credited and are the license and terms of use explicitly mentioned and properly respected?

Answer: [Yes]

Justification: All papers, code, and assets, etc. have been properly cited in the paper. We make use of the the reference code provided by the cited papers by their authors. We make use of standard and existing datasets, and therefore do not collect or introduce additional assets.

Guidelines:

The answer NA means that the paper does not use existing assets.

The authors should cite the original paper that produced the code package or dataset.

The authors should state which version of the asset is used and, if possible, include a URL.

The name of the license (e.g., CC-BY 4.0) should be included for each asset.

For scraped data from a particular source (e.g., website), the copyright and terms of service of that source should be provided.

If assets are released, the license, copyright information, and terms of use in the package should be provided. For popular datasets, paperswithcode.com/datasets has curated licenses for some datasets. Their licensing guide can help determine the license of a dataset.

For existing datasets that are re-packaged, both the original license and the license of the derived asset (if it has changed) should be provided.

If this information is not available online, the authors are encouraged to reach out to the asset's creators.

13. New Assets

Question: Are new assets introduced in the paper well documented and is the documentation provided alongside the assets?

Answer: [NA]

Justification: We do not collect or include new assets. To the extent that our own method code is an asset, it is the creation of the authors, and it is included anonymously and confidentially in our supplementary materials. If accepted, the code will be released under an open license such as BSD-2.

Guidelines:

The answer NA means that the paper does not release new assets.

Researchers should communicate the details of the dataset/code/model as part of their submissions via structured templates. This includes details about training, license, limitations, etc.

The paper should discuss whether and how consent was obtained from people whose asset is used.

At submission time, remember to anonymize your assets (if applicable). You can either create an anonymized URL or include an anonymized zip file.

14. Crowdsourcing and Research with Human Subjects

Question: For crowdsourcing experiments and research with human subjects, does the paper include the full text of instructions given to participants and screenshots, if applicable, as well as details about compensation (if any)?

Answer: [NA]

Justification: No crowdsourcing or human subjects.

Guidelines:

The answer NA means that the paper does not involve crowdsourcing nor research with human subjects.

Including this information in the supplemental material is fine, but if the main contribution of the paper involves human subjects, then as much detail as possible should be included in the main paper.

According to the NeurIPS Code of Ethics, workers involved in data collection, curation, or other labor should be paid at least the minimum wage in the country of the data collector.

15. Institutional Review Board (IRB) Approvals or Equivalent for Research with Human Subjects

Question: Does the paper describe potential risks incurred by study participants, whether such risks were disclosed to the subjects, and whether Institutional Review Board (IRB) approvals (or an equivalent approval/review based on the requirements of your country or institution) were obtained?

Answer: [NA]

Justification: No crowdsourcing or human subjects.

Guidelines:

The answer NA means that the paper does not involve crowdsourcing nor research with human subjects.

Depending on the country in which research is conducted, IRB approval (or equivalent) may be required for any human subjects research. If you obtained IRB approval, you should clearly state this in the paper.

We recognize that the procedures for this may vary significantly between institutions and locations, and we expect authors to adhere to the NeurIPS Code of Ethics and the guidelines for their institution.

For initial submissions, do not include any information that would break anonymity (if applicable), such as the institution conducting the review.

Peer reviews:
comments: SUMMARY:
The paper introduces Adaptive Randomized Smoothing (ARS), an innovative theoretical extension of Randomized Smoothing (RS) based on f-Differential Privacy (f-DP) to enhance the robustness certification of machine learning models. Empirical results demonstrate that ARS surpasses both standard RS and its variants in robustness certification metrics.

The authors present a solid theoretical framework and conduct thorough experimental evaluations. Despite ARS inheriting certain inherent constraints of RS, the method represents a significant advancement, offering a fresh approach to augment RS through budget decomposition.

STRENGTHS:
1. The paper is well-written and easy to follow.
2. The theoretical underpinnings are solid: The integration of RS with f-DP and the subsequent decomposition leveraging f-DP properties is a creative and compelling strategy to refine RS.
3. The implementation of a masking mechanism is judiciously chosen to tackle the dimensionality challenges highlighted by the theoretical discourse.

WEAKNESSES:
1. As an enhancement of RS, ARS is subject to the same fundamental limitations, notably the requirement for a substantial sample size to attain satisfactory robustness certification. The authors acknowledge this constraint within the limitations section of the paper.

QUESTIONS:
1. Does the theoretical framework extend to alternative norm types, such as L1 or L2 norms?

LIMITATIONS:
See weaknesses and questions.
TITLE: Official Review
SOUNDNESS_CORRECTNESS: 4
DATE: 2024-06-13

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis work presents the first sound composition of randomized smoothing. Based on the novel theoretical results, this work presents the first sound way to compose a mask generator with the Gaussian sampling required for randomized smoothing, thereby reducing the effective dimension and improves the certification of randomized smoothing. This work opens up the possibility of more complex compositions for randomized smoothing, which is attempted before without soundness and great success. To this end, this work serves a good milestone in the field of randomized smoothing.\n\nSTRENGTHS:\nThis paper presents a great theoretical contribution to randomized smoothing, namely the composition rule. I did not find evident mistakes in the proof, but others might spot issues. If the theorems presented are correct, I recommend immediate acceptance, regardless of the experimental inadequacy that I will elaborate in the weaknesses section.\n\nThe experimental section presents three different benchmarks, characterizing different aspects. The results show the advantage of the proposed method. The $L_\\infty$ robustness of randomized smoothing is improved and depend less on the data dimension.\n\nWEAKNESSES:\nThe main inadequacy I spot is its experimental design, specifically Section 4.3. While Section 4.1 and 4.2 are interesting and validates some of the claims made, Section 4.3 presents the main benchmark in the field of randomized smoothing. However, the authors only present the results on ImageNet with $\\sigma=0.5$, while the main practice in the feild is to report results on \\{cifar-10, ImageNet\\} times \\{$\\sigma=0.25, 0.5, 1.0$\\}. I request the authors to present the full benchmark for comparison.\n\nIn addition, to compare with Cohen et al., the masking trick could also be applied to certiify $L_2$ robustness. It is not clear why the authors only report $L_\\infty$ robustness in the paper.\n\nQUESTIONS:\nSee weaknesses.\n\nLIMITATIONS:\nThe authors adequately addressed the limitations.", "TITLE": "Official Review", "RECOMMENDATION": 6, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 2, "DATE": "2024-06-19"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis paper proposes a framework to derive robustness certificates for smoothed classifiers based on f-differential privacy (f-DP). The framework achieves the same tight certificate for Gaussian smoothed classifiers as Cohen et al. (2019), while enabling analysis of adaptive multi-step smoothing mechanisms using the adaptive composition theorem for f-DP. To demonstrate the framework, the authors design a two-step smoothing mechanism that effectively performs adaptive (input-dependent) dimension reduction to achieve robustness against $\\ell_\\infty$-bounded perturbations. Experiments on three datasets demonstrate substantial improvement over baselines in some cases.\n\nSTRENGTHS:\n**Originality and significance:**\nThis paper reconnects randomized smoothing and differential privacy, showing that f-DP can achieve competitive robustness certificates. By identifying this connection, the paper could seed further innovations in randomized smoothing, where the design of smoothing mechanisms has been limited due to challenges in obtaining tractable robustness certificates. This has been a problem in prior work, where the analysis of smoothing mechanisms using input-dependent additive noise (e.g., Hong et al., 2022) were later shown to be unsound.\n\n**Quality:**\nThe technical foundation is strong, which is important for work that aims to achieve provable robustness. The experiments are solid, covering a range of settings, including those where the adaptive masking approach does not achieve a significant performance advantage (ImageNet). In some cases the improvement in certified accuracy/standard accuracy over baselines is quite significant (of order 10 percentage points).\n\n**Clarity:**\nThe paper was a pleasure to read.\n\nWEAKNESSES:\nThe proposed adaptive masking smoothing mechanism does not achieve significant improvements in certified robustness over baselines in many cases, especially for CIFAR-10 (Fig 2) and ImageNet (Fig 6). There is a more pronounced improvement for CelebA, however I wonder if this is related to the fact that the masking model is trained under supervision or whether the masking smoothing mechanism is simply a better fit for CelebA? This could perhaps be investigated by repeating the experiment without using the mouth location metadata. \n\nGiven the (at times) marginal improvement of the adaptive masking smoothing mechanism, it would be interesting to understand how it compares along other dimensions, like computational efficiency and model size. It’s noted (line 324) that the mechanism is less efficient and uses a larger model, however it would be good to quantify to better understand the trade-offs.\n\nTheorem 2.3 applies for a composition of randomized Gaussian mechanisms, which may be limiting given the range of mechanisms studied in the DP literature. I expect the theorem could be adapted for other mechanisms, but I wonder whether this would result in a tractable radius?\n\nQUESTIONS:\n- To better understand the generality of the approach: can a certified radius be derived for a composition of heterogeneous f-DP mechanisms (not necessarily all Gaussian)?\n\n- Is there an intuitive explanation for the larger gap in certified accuracy between ARS and Cohen et al. for CelebA versus ImageNet? \n\n- Are results available for a non-uniform split of the noise budget (line 223)?\n\nLIMITATIONS:\nYes, limitations are addressed adequately in Section 5.", "TITLE": "Official Review", "RECOMMENDATION": 8, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 4, "DATE": "2024-07-12"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe paper uses tools from differential privacy (f-DP relating privacy to hypothesis testing, and also compositional rule of DP) to design a differentially private  2-step mechanism. The first step is interpreted here as creating a mask, and the second step is the \"standard randomized smoothing\" on the masked input, so it potentially greatly reduces the dimensionality.\n\nSTRENGTHS:\nThe main result is Proposition 2.4, where it is shown that we can use two step randomized smoothing, where in the first step we effectively obtain a mask to mask out some of the input pixels, and by this effectivelly escaping the curse of dimensionality we have in randomized smoothing and the we use the standard smoothing on the masked input. The soundness is guaranteed by tools from differential privacy, framing the adversarial problem in the privacy language and use the standard (i suppose) tools to perform a private compositional test. The neighbouring databases (in the privacy sense) are formulated as $\\ell_\\infty$ distance in the image space, which exactly matches the setting of adversarial robustness (this was considered in the very first RS paper already that also took the DP approach to randomized smoothing).\n\nThe originality comes from bringing standard tools from a different field and demonstrates that they are effective here. Quality is high, the results and ideas are fresh and new in the field and improve on SotA. Clarity is somewhat good but not perfect, the authors seem to come from DP community (I'm from robustness) so It requires some effort and reading other papers for me to follow. Significance is on the higher end of the randomized smoothing papers in the recent years, the results might seem incremental on benchmarks, but the actual techniques are new so it will likely attract attention. The downside is not convincing empirical evaluation (is limited and in the standard settings the improvements are very mild, the main benefits are demonstrated on CELEBA benchmark), overall the empirical evaluation does not convince me that this approach outperforms SotA by a non-trivial margin. This being said, the work (mainly the tools used) is clearly interesting enough to be accepted.\n\n\n\n\nvery minor:\n* f-DP is not really introduced I think, the $f$ appears in prop 2.1 without any explanation, right?\n* unify Dong 2019 and Dong 2022 citations. I think they are the same?\n* \" adaptivity over multi-step computation comes with no increase in certified radius\" - no decrease?\n\nWEAKNESSES:\n^\n\nQUESTIONS:\n-\n\nLIMITATIONS:\n-", "TITLE": "Official Review", "RECOMMENDATION": 7, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2024-07-13"}