Year: 2021

Abstract:
The lack of adversarial robustness has been recognized as an important issue for state-of-the-art machine learning (ML) models, e.g., deep neural networks (DNNs). Thereby, robustifying ML models against adversarial attacks is now a major focus of research. However, nearly all existing defense methods, particularly for robust training, made the white-box assumption that the defender has the access to the details of an ML model (or its surrogate alternatives if available), e.g., its architectures and parameters. Beyond existing works, in this paper we aim to address the problem of black-box defense: How to robustify a black-box model using just input queries and output feedback? Such a problem arises in practical scenarios, where the owner of the predictive model is reluctant to share model information in order to preserve privacy. To this end, we propose a general notion of defensive operation that can be applied to black-box models, and design it through the lens of denoised smoothing (DS), a first-order (FO) certified defense technique. To allow the design of merely using model queries, we further integrate DS with the zeroth-order (gradient-free) optimization. However, a direct implementation of zeroth-order (ZO) optimization suffers a high variance of gradient estimates, and thus leads to ineffective defense. To tackle this problem, we next propose to prepend an autoencoder (AE) to a given (black-box) model so that DS can be trained using variance-reduced ZO optimization. We term the eventual defense as ZOAE-DS. In practice, we empirically show that ZO-AE-DS can achieve improved accuracy, certified robustness, and query complexity over existing baselines. And the effectiveness of our approach is justified under both image classification and image reconstruction tasks.

heading: 1 INTRODUCTION
text: ML models, DNNs in particular, have achieved remarkable success owing to their superior predictive performance. However, they often lack robustness. For example, imperceptible but carefully-crafted input perturbations can fool the decision of a well-trained ML model. These input perturbations refer to adversarial perturbations, and the adversarially perturbed (test-time) examples are known as adversarial examples or adversarial attacks (Goodfellow et al., 2015; Carlini & Wagner, 2017; Papernot et al., 2016). Existing studies have shown that it is not difficult to generate adversarial attacks. Numerous attack generation methods have been designed and successfully applied to (i) different use cases from the digital world to the physical world, e.g., image classification (Brown et al., 2017; Li et al., 2019; Xu et al., 2019; Yuan et al., 2021), object detection/tracking (Eykholt et al., 2017; Xu et al., 2020; Sun et al., 2020), and image reconstruction (Antun et al., 2020; Raj et al., 2020; Vasiljević et al., 2021), and (ii) different types of victim models, e.g., white-box models whose details can be accessed by adversaries (Madry et al., 2018; Carlini & Wagner, 2017; Tramer et al., 2020; Croce & Hein, 2020; Wang et al., 2021), and black-box models whose information is not disclosed to adversaries (Papernot et al., 2017; Tu et al., 2019; Ilyas et al., 2018a; Liang et al., 2021).
Given the prevalence of adversarial attacks, methods to robustify ML models are now a major focus in research. For example, adversarial training (AT) (Madry et al., 2018), which has been poised one of the most effective defense methods (Athalye et al., 2018), employed min-max optimization to minimize the worst-case (maximum) training loss induced by adversarial attacks. Extended from AT, various empirical defense methods were proposed, ranging from supervised learning, semi-supervised learning, to unsupervised learning (Madry et al., 2018; Zhang et al., 2019b; Shafahi et al., 2019; Zhang
et al., 2019a; Carmon et al., 2019; Chen et al., 2020; Zhang et al., 2021). In addition to empirical defense, certified defense is another research focus, which aims to train provably robust ML models and provide certificates of robustness (Wong & Kolter, 2017; Raghunathan et al., 2018; Katz et al., 2017; Salman et al., 2019; 2020; 2021). Although exciting progress has been made in adversarial defense, nearly all existing works ask a defender to perform over white-box ML models (assuming non-confidential model architectures and parameters). However, the white-box assumption may restrict the defense application in practice. For example, a model owner may refuse to share the model details, since disclosing model information could hamper the owner’s privacy, e.g., model inversion attacks lead to training data leakage (Fredrikson et al., 2015). Besides the privacy consideration, the white-box defense built upon the (end-to-end) robust training (e.g., AT) is computationally intensive, and thus is difficult to scale when robustifying multiple models. For example, in the medical domain, there exist massive pre-trained ML models for different diseases using hundreds of neuroimaging datasets (Sisodiya et al., 2020). Thus, robustly retraining all models becomes impractical. Taking the model privacy and the defense efficiency into consideration, we ask:
Is it possible to design an adversarial defense over black-box models using only model queries?
Extending adversarial defense to the black-box regime (that we call ‘blackbox defense’) is highly non-trivial due to the challenge of black-box optimization (i.e., learning over blackbox models). To tackle this problem, the prior work (Salman et al., 2020) leveraged surrogate models as
approximations of the black-box models, over which defense can be conducted following the whitebox setup. Yet, this still requires to have access to the information on the victim model type and its function. In practice, those conditions could be difficult to achieve. For example, if the domain knowledge related to medicine or healthcare is lacking (Qayyum et al., 2020; Finlayson et al., 2019), then it will be difficult to determine a proper surrogate model of a medical ML system. Even if a black-box model estimate can be obtained using the model inversion technique (Kumar & Levine, 2019), a significantly large number of model queries are needed even just for tackling a MNIST-level prediction task (Oh et al., 2019). Different from (Salman et al., 2020). We study an authentic blackbox scenario, in which the interaction between defender and model is only based on input-output function queries (see Fig. 1). To our best knowledge, this is the first work to tackle the problem of query-based black-box defense.
Contributions. We summarize our contributions below.
¬ (Formulation-wise) We formulate the problem of black-box defense and investigate it through the lens of zeroth-order (ZO) optimization. Different from existing work, our paper aims to design the restriction-least black-box defense and our formulation is built upon a query-based black-box setting, which avoids the use of surrogate models.
 (Methodology-wise) We propose a novel black-box defense approach, ZO AutoEncoder-based Denoised Smoothing (ZO-AE-DS), which is able to tackle the challenge of ZO optimization in high dimensions and convert a pre-trained non-robust ML model into a certifiably robust model using only function queries.
® (Experiment-wise) We verify the efficacy of our method through an extensive experimental study. In the task of image classification, the proposed ZO-AE-DS significantly outperforms the ZO baseline built upon (Salman et al., 2020). For instance, we can improve the certified robust accuracy of ResNet110 on CIFAR-10 from 19.16% (using baseline) to 54.87% (using ZO-AE-DS) under adversarial perturbations with `2 norm less than 64/255. We also empirically show that our proposal stays effective even in the task of image reconstruction.

heading: 2 RELATED WORK
text: Empirical defense. An immense number of defense methods have been proposed, aiming to improve model robustness against adversarial attacks. Examples include detecting adversarial
attacks (Guo et al., 2017; Meng & Chen, 2017; Gong et al., 2017; Grosse et al., 2017; Metzen et al., 2017) and training robust ML models (Madry et al., 2018; Zhang et al., 2019b; Shafahi et al., 2019; Wong et al., 2020; Zhang et al., 2019a; Athalye et al., 2018; Cheng et al., 2017; Wong & Kolter, 2017; Salman et al., 2019; Raghunathan et al., 2018; Katz et al., 2017). In this paper, we focus on advancing the algorithm foundation of robust training over black-box models. Robust training can be broadly divided into two categories: empirical defense and certified defense. In the former category, the most representative method is AT (adversarial training) that formulates adversarial defense as a two-player game (between attacker and defender) (Madry et al., 2018). Spurred by AT, empirical defense has developed rapidly. For example, in (Zhang et al., 2019b), TRADES was proposed to seek the optimal trade-off between accuracy and robustness. In (Stanforth et al., 2019; Carmon et al., 2019), unlabeled data and self-training were shown effective to improve adversarial defense in both robustness and generalization. In (Shafahi et al., 2019; Wong et al., 2020; Zhang et al., 2019a; Andriushchenko & Flammarion, 2020), to improve the scalability of adversarial defense, computationally-light alternatives of AT were developed. Despite the effectiveness of empirical defense against adversarial attacks (Athalye et al., 2018), it lacks theoretical guarantee (known as ‘certificate’) for the achieved robustness. Thus, the problem of certified defense arises.
Certified defense. Certified defense seeks to provide a provably guarantee of ML models. One line of research focuses on post-hoc formal verification of a pre-trained ML model. The certified robustness is then given by a ‘safe’ input perturbation region, within which any perturbed input will not fool the given model (Katz et al., 2017; Ehlers, 2017; Bunel et al., 2018; Dutta et al., 2017). Since the exact verification is computationally intensive, a series of work (Raghunathan et al., 2018; Dvijotham et al., 2018; Wong & Kolter, 2017; Weng et al., 2018a;b; Wong et al., 2018) proposed ‘incomplete’ verification, which utilizes convex relaxation to over-approximate the output space of a predictive model when facing input perturbations. Such a relaxation leads to fast computation in the verification process but only proves a lower bound of the exact robustness guarantee. Besides the post-hoc model verification with respect to each input example, another line of research focuses on in-processing certification-aware training and prediction. For example, randomized smoothing (RS) transforms an empirical classifier into a provably robust one by convolving the former with an isotropic Gaussian distribution. It was shown in (Cohen et al., 2019) that RS can provide formal guarantees for adversarial robustness. Different types of RS-oriented provable defenses have been develped, such as adversarial smoothing (Salman et al., 2019), denoised smoothing (Salman et al., 2020), smoothed ViT (Salman et al., 2021), and feature smoothing (Addepalli et al., 2021).
Zeroth-order (ZO) optimization for adversarial ML. ZO optimization methods are gradientfree counterparts of first-order (FO) optimization methods (Liu et al., 2020b). They approximate the FO gradients through function value based gradient estimates. Thus, ZO optimization is quite useful to solve black-box problems when explicit expressions of their gradients are difficult to compute or infeasible to obtain. In the area of adversarial ML, ZO optimization has become a principled approach to generate adversarial examples from black-box victim ML models (Chen et al., 2017; Ilyas et al., 2018a;b; Tu et al., 2019; Liu et al., 2019; 2020a; Huang & Zhang, 2020; Cai et al., 2021). Such ZO optimization-based attack generation methods can be as effective as state-of-the-art white-box attacks, despite only having access to the inputs and outputs of the targeted model. For example, the work (Tu et al., 2019) leveraged the white-box decoder to map the generated low-dimension perturbations back to the original input dimension. Inspired by (Tu et al., 2019), we leverage the autoencoder architecture to tackle the high-dimension challenge of ZO optimization in black-box defense. Despite the widespread application of ZO optimization to black-box attack generation, few work studies the problem of black-box defense.

heading: 3 PROBLEM FORMULATION: BLACK-BOX DEFENSE
text: In this section, we formulate the problem of black-box defense, i.e., robustifying black-box ML models without having any model information such as architectures and parameters.
Problem statement. Let fθbb(x) denote a pre-defined black-box (bb) predictive model, which can map an input example x to a prediction. In our work, fθbb can be either an image classifier or an image reconstructor. For simplicity of notation, we will drop the model parameters θbb when referring to a black-box model. The threat model of our interest is given by norm-ball constrained adversarial
attacks (Goodfellow et al., 2015). To defend against these attacks, existing approaches commonly require the white-box assumption of f (Madry et al., 2018) or have access to white-box surrogate models of f (Salman et al., 2020). Different from the prior works, we study the problem of black-box defense when the owner of f is not able to share the model details. Accordingly, the only mode of interaction with the black-box system is via submitting inputs and receiving the corresponding predicted outputs. The formal statement of black-box defense is given below:
(Black-box defense) Given a black-box base model f , can we develop a defensive operation R using just input-output function queries so as to produce the robustified model R(f) against adversarial attacks?
Defensive operation. We next provide a concrete formulation of the defensive operationR. In the literature, two principled defensive operations were used: (R1) end-to-end AT (Madry et al., 2018; Zhang et al., 2019b; Cohen et al., 2019), and (R2) prepending a defensive component to a base model (Meng & Chen, 2017; Salman et al., 2020; Aldahdooh et al., 2021). The former (R1) has achieved the state-of-the-art robustness performance (Athalye et al., 2018; Croce & Hein, 2020) but is not applicable to black-box defense. By contrast, the latter (R2) is more compatible with black-box models. For example, denonised smoothing (DS), a recently-developedR2-type approach (Salman et al., 2020), gives a certified defense by prepending a custom-trained denoiser to the targeted model. In this work, we choose DS as the backbone of our defensive operation (Fig. 2).
In DS, a denoiser is integrated with a base model f so that the augmented system becomes resilient to Gaussian noise and thus plays a role similar to the RS-based certified defense (Cohen et al., 2019). That is, DS yields
R(f(x)) := f(Dθ(x)), (1)
where Dθ denotes the learnable denoiser (with parameters θ) prepended to the (black-box) predictor f . Once Dθ is learned, then the DS-based smooth classifier, argmaxc Pδ∈N (0,σ2I)[R(f(x+ δ)) = c], can achieve certified robustness, where c is a class label, δ ∈ N (0, σ2I) denotes the standard Gaussian noise with variance σ2, and argmaxc Pδ∈N (0,σ2I)[f(x+ δ) = c] signifies a smooth version of f .
Based on (1), the goal of black-box defense becomes to find the optimal denoiser Dθ so as to achieve satisfactory accuracy as well as adversarial robustness. In the FO learning paradigm, Salman et al. (2020) proposed a stability regularized denoising loss to train Dθ:
minimize θ Eδ∈N (0,σ2I),x∈U ‖Dθ(x+ δ)− x‖22︸ ︷︷ ︸ := `Denoise(θ) +γEδ,x `CE(R(f(x+ δ)), f(x))︸ ︷︷ ︸ := `Stab(θ) , (2)
where U denotes the training dataset, the first objective term `Denoise(θ) corresponds to the mean squared error (MSE) of image denoising, the second objective term `Stab(θ) measures the prediction stability through the cross-entropy (CE) between the denoised input and the original input, and γ > 0 is a regularization parameter that strikes a balance between `Denoise and `Stab.
We remark that problem (2) can be solved using the FO gradient descent method if the base model f is fully disclosed to the defender. However, the black-box nature of f makes the gradients of the stability loss `Stab(θ) infeasible to obtain. Thus, we will develop a gradient-free DS-oriented defense.

heading: 4 METHOD: A SCALABLE ZEROTH-ORDER OPTIMIZATION SOLUTION
text: In this section, we begin by presenting a brief background on ZO optimization, and elaborate on the challenge of black-box defense in high dimensions. Next, we propose a novel ZO optimization-based DS method that can not only improve model query complexity but also lead to certified robustness.
ZO optimization. In ZO optimization, the FO gradient of a black-box function `(w) (with a d-dimension variable w) is approximated by the difference of two function values along a set of
random direction vectors. This leads to the randomized gradient estimate (RGE) (Liu et al., 2020b):
∇̂w`(w) = 1
q q∑ i=1 [ d µ (`(w + µui)− `(w))ui ] , (3)
where {ui}qi=1 are q random vectors drawn independently and uniformly from the sphere of a unit ball, and µ > 0 is a given small step size, known as the smoothing parameter. The rationale behind (3) is that it provides an unbiased estimate of the FO gradient of the Gaussian smoothing version of ` (Gao et al., 2018), with variance in the order of O(dq ) (Liu et al., 2020b). Thus, a large-scale problem (with large d) yields a large variance of RGE (3). To reduce the variance, a large number of querying directions (i.e., q) is then needed, with the worst-case query complexity in the order of O(d). If q = d, then the least estimation variance can be achieved by the coordinatewise gradient estimate (CGE) (Lian et al., 2016; Liu et al., 2018):
∇̂w`(w) = d∑ i=1 [ `(w + µei)− `(w) µ ei ] , (4)
where ei ∈ Rd denotes the ith elementary basis vector, with 1 at the ith coordinate and 0s elsewhere. For any off-the-shelf FO optimizers, e.g., stochastic gradient descent (SGD), if we replace the FO gradient estimate with the ZO gradient estimate, then we obtain the ZO counterpart of a FO solver, e.g., ZO-SGD (Ghadimi & Lan, 2013).
Warm-up: A direct application of ZO optimization. A straightforward method to achieve the DS-based black-box defense is to solve problem (2) using ZO optimization directly. However, it will give rise to the difficulty of ZO optimization in high dimensions. Specifically, DS requires to calculate the gradient of the defensive operation (1). With the aid of ZO gradient estimation, we obtain
∇θR(f(x)) = dDθ(x)
dθ
df(z)
dz |z=Dθ(x) ≈
dDθ(x)
dθ ∇̂zf(z) |z=Dθ(x) , (5)
where with an abuse of notation, let d denote the dimension of x (yielding Dθ(x) ∈ Rd and z ∈ Rd) and dθ denote the dimension of θ, dDθ(x) dθ ∈ R
dθ×d is the Jacobian matrix of the vector-valued function Dθ(x), and ∇̂zf(z) denotes the ZO gradient estimate of f , following (3) or (4). Since the dimension of an input is typically large for image classification (e.g., d = 3072 for a CIFAR-10
image), it imposes two challenges: (a) The variance of RGE (3) will be ultra-large if the query complexity stays low, i.e., a small query number q is used; And (b) the variance-least CGE (4) becomes impracticable due to the need of ultra-high querying cost (i.e., q = d). Indeed, Table 1 shows that the direct application of (5) into the existing FO-DS solver (Salman et al., 2020), which we call ZO-DS, yields over 25% degradation in
both standard accuracy and certified robustness evaluated at input perturbations with `2 norm less than 128/255, where pixels of an input image are normalized to [0,1]. We refer readers to Sec. 5 for more details.
E n co d er
D eco d er
ZO autoencoder-based DS (ZO-AEDS): A scalable solution to black-box defense. The difficulty of ZO optimization in high dimensions prevents us from developing an effective DS-oriented provable defense for black-box ML models. To tackle such problem, we introduce an Autoencoder (AE) to connect the front-end denoiser Dθ with the back-end black-box
predictive model f so that ZO optimization can be conducted in a (low-dimension) feature embedding space. To be concrete, let ψθDec ◦ φθEnc denote AE consisting of the encoder (Enc) ψθEnc and the decoder (Dec) φθDec , where ◦ denotes the function composition operation. Plugging φθAE between
5
the denoiser Dθ and the black-box predictor f , we then extend the defensive operation (1) to the following (see Fig. 3 for illustration):
Rnew(f(x)) := f (φθDec (z))︸ ︷︷ ︸ new black box , z = ψθEnc (Dθ(x))︸ ︷︷ ︸ new white box , (6)
where z ∈ Rdz denotes the low-dimension feature embedding with dz < d. In (6), we integrate the decoder ψθDec with the black-box predictor f to construct a new black-box model f
′(z) := f(ψθDec(z)), which enables us to derive a ZO gradient estimate of reduced dimension:
∇θRnew(f(x)) ≈ dφθEnc(Dθ(x))
dθ ∇̂zf ′(z) |z=φθEnc (Dθ(x)) . (7)
Assisted by AE, RGE of ∇̂zf ′ has a reduced variance from O(dq ) to O( dz q ). Meanwhile, the least-variance CGE (4) also becomes feasible by setting the query number as q = dz .
Note that the eventual ZO estimate (7) is a function of the dθ×dz Jacobian matrix∇θ[φθEnc(Dθ(x))]. For ease of storing and computing the Jacobian matrix, we derive the following computationally-light alternative of (7) (see derivation in Appendix A):
∇θ`Stab(θ) ≈ ∇θ[a>φθEnc(Dθ(x+ δ))], a = ∇̂z`CE(f ′(z), f(x)) |z=φθEnc (Dθ(x+δ)) , (8)
where recall that f ′(z) = f(ψθDec(z)), and ∇̂ denotes the ZO gradient estimate given by (3) or (4). The computation advantage of (8) is that the derivative operation∇θ can be applied to a scalar-valued inner product built upon a pre-calculated ZO gradient estimate a.
Training ZO-AE-DS. Recall from Fig. 3 that the proposed defensive system involves three components: denoiser Dθ , AE ψθDec ◦ φθEnc , and pre-defined black-box predictor f . Thus, the parameters to be optimized include θ, θDec and θEnc. To train ZO-AE-DS, we adopt a two-stage training protocol. ¬ White-box pre-training on AE: At the first stage, we pre-train the AE model by calling a standard FO optimizer (e.g., Adam) to minimize the reconstruction loss Ex‖φθDec(ψθEnc(x))− x‖22. The resulting AE will be used as the initialization of the second-stage training. We remark that the denoising modelDθ can also be pre-trained. However, such a pre-training could hamper optimization, i.e., making the second-stage training over θ easily trapped at a poor local optima.  End-to-end training: At the second stage, we keep the pre-trained decoder φθDec intact and merge it into the black-box system as shown in Fig. 3. We then optimize θ and θEnc by minimizing the DS-based training loss (2), where the denoiser Dθ and the defensive operationR are replaced by ψθEnc ◦Dθ andRnew (6), respectively. In (2), minimization over the stability loss `Stab(θ) calls the ZO estimate of∇θ`Stab(θ), given by (7). In Appendix C.2, different training schemes are discussed.

heading: 5 EXPERIMENTS
text: In this section, we demonstrate the effectiveness of our proposal through extensive experiments. We will show that the proposed ZO-AE-DS outperforms a series of baselines when robustifying black-box neural networks for secure image classification and image reconstruction.

heading: 5.1 EXPERIMENT SETUP
text: Datasets and model architectures. In the task of image classification, we focus on CIFAR-10 and STL-10 datasets. In Appendix C.3, we demonstrate the effectiveness of ZO-AE-DS on the high-dimension ImageNet images. In the task of image reconstruction, we consider the MNIST dataset. To build ZO-AE-DS and its variants and baselines, we specify the prepended denoiser Dθ as DnCNN (Zhang et al., 2017). We then implement task-specific AE for different datasets. Superficially, the dimension of encoded feature embedding, namely, dz in (6), is set as 192, 576 and 192 for CIFAR-10, STL-10 and MNIST, respectively. The architectures of AE are configured following (Mao et al., 2016), and ablation study on the choice of AE is shown in Appendix C.1. To specify the black-box image classification model, we choose ResNet-110 for CIFAR-10 following (Salman et al., 2020), and ResNet-18 for STL-10. It is worth noting that STL-10 contains 500 labeled 96× 96 training images, and the pre-trained ResNet-18 achieves 76.6% test accuracy that matches to state-of-the-art performance. For image reconstruction, we adopt a reconstruction network consisting of convolution, deconvolution and ReLU layers, following (Raj et al., 2020).
Baselines. We will consider two variants of our proposed ZO-AE-DS: i) ZO-AE-DS using RGE (3), ii) ZO-AE-DS using CGE (4). In addition, we will compare ZO-AE-DS with i) FO-AE-DS, i.e., the first-order implementation of ZO-AE-DS, ii) FO-DS, which developed in (Salman et al., 2020), iii) RS-based certified training, proposed in (Cohen et al., 2019), and iv) ZO-DS, i.e., the ZO implementation of FO-DS using RGE. Note that CGE is not applicable to ZO-DS due to the obstacle of high dimensions. To our best knowledge, ZO-DS is the only query-based black-box defense baseline that can be directly compared with ZO-AE-DS.
Training setup. We build the training pipeline of the proposed ZO-AE-DS following ‘Training ZO-AE-DS’ in Sec. 4. To optimize the denoising model Dθ, we will cover two training schemes: training from scratch, and pre-training & fine-tuning. In the scenario of training from scratch, we use Adam optimizer with learning rate 10−3 to train the model for 200 epochs and then use SGD optimizer with learning rate 10−3 drop by a factor of 10 at every 200 epoch, where the total number of epochs is 600. As will be evident later, training from scratch over Dθ leads to better performance of ZO-AE-DS. In the scenario of pre-training & fine-tuning, we use Adam optimizer to pre-train the denoiser Dθ with the MSE loss `Denoise in (2) for 90 epochs and fine-tune the denoiser with `Stab for 200 epochs with learning rate 10−5 drop by a factor of 10 every 40 epochs. When implementing the baseline FO-DS, we use the best training setup provided by (Salman et al., 2020). When implementing ZO-DS, we reduce the initial learning rate to 10−4 for training from scratch and 10−6 for pre-training & fine-tuning to stabilize the convergence of ZO optimization. Furthermore, we set the smoothing parameter µ = 0.005 for RGE and CGE. And to achieve a smooth predictor, we set the Gaussian smoothing noise as δ ∈ N (0, σ2I) with σ2 = 0.25. With the help of matrix operations and the parallel computing power of the GPU, we optimize the training time to an acceptable range. The averaged one-epoch training time on a single Nvidia RTX A6000 GPU is about ∼ 1min and ∼ 29min for FO-DS and our proposed ZO method, ZO-AE-DS (CGE, q = 192), on the CIFAR-10 dataset.
Evaluation metrics. In the task of robust image classification, the performance will be evaluated at standard test accuracy (SA) and certified accuracy (CA). Here CA is a provable robust guarantee of the Gaussian smoothing version of a predictive model. Let us take ZO-AE-DS as an example, the resulting smooth image classifier is given by fsmooth(x) := argmaxc Pδ∈N (0,σ2I)[Rnew(f(x + δ)) = c], where Rnew is given by (6). Further, a certified radius of `2-norm perturbation ball with respect to an input example can be calculated following the RS approach provided in (Cohen et al., 2019). As a result, CA at a given `2-radius r is the percentage of the correctly classified data points whose certified radii are larger than r. Note that if r = 0, then CA reduces to SA.

heading: 5.2 EXPERIMENT RESULTS ON IMAGE CLASSIFICATION
text: Performance on CIFAR-10. In Table 2, we present certified accuracies of ZO-AE-DS and its variants/baselines versus different `2-radii in the setup of (CIFAR-10, ResNet-110). Towards a comprehensive comparison, different RGE-based variants of ZO-AE-DS and ZO-DS are demonstrated using the query number q ∈ {20, 100, 192}. First, the comparison between ZO-AE-DS and ZO-DS shows that our proposal significantly outperforms ZO-DS ranging from the low query number q = 20 to the high query number q = 192 when RGE is applied. Second, we observe that the use of CGE yields the best CA and SA (corresponding to r = 0). The application of CGE is benefited from AE, which reduces the dimension from d = 32 × 32 × 3 to dz = 192. In particular, CGE-based ZO-AE-DS improves the case studied in Table 1 from 5.06% to 35.5% at the `2-radius r = 0.5. Third, although FO-AE-DS yields CA improvement over FO-DS in the white-box context, the improvement achieved by ZO-AE-DS (vs. ZO-DS) for black-box defense is much more significant. This implies
that the performance of black-box defense relies on a proper solution (namely, ZO-AE-DS) to tackle the challenge of ZO optimization in high dimensions. Fourth, RS outperforms the ZO methods. This is not surprising since RS is a known white-box certifiably robust training approach. In Appendix B, we demonstrate the consistent effectiveness of ZO-AE-DS under different denoisier and classifiers.
Performance on STL-10. In Table 3, we evaluate the performance of ZO-AE-DS for STL-10 image classification. For comparison, we also represent the performance of FO-DS, FO-AE-DS, and ZO-DS. Similar to Table 2, the improvement brought by our proposal over ZO-DS is evident, with at least 10% SA/CA improvement across different `2-radii.
When comparing ZO-AE-DS with FO-DS, we observe that ours introduces a 7% degradation in SA (at r = 0). This is different from CIFAR-10 classification. There might be two reasons for the degradation of SA in STL-10. First, the size of a STL-10 image is 9× larger than a CIFAR-10 im-
age. Thus, the over-reduced feature dimension could hamper SA. In this example, we set dz = 576, which is only 3× larger than dz = 192 used for CIFAR-10 classification. Second, the variance of ZO gradient estimates has a larger effect on the performance of STL-10 than that of CIFAR-10, since the former only contains 500 labeled images, leading to a challenging training task. Despite the degradation of SA, ZO-AE-DS outperforms FO-DS in CA, especially when facing a large `2-radius. This is consistent with Table 2. The rationale is that AE can be regarded as an extra smoothing operation for the image classifier, and thus improves certified robustness over FO-DS, even if the latter is designed in a white-box setup. If we compare ZO-AE-DS with FO-AE-DS, then the FO approach leads to the best performance due to the high-accuracy of gradient estimates.
Advantage of AE on ZO optimization. Extended from Table 2, Fig. 4 presents the complete CA curve of non-AE-based and AE-based methods vs. the value of `2-radius in the example of (CIFAR10, ResNet-110). As we can see, ZO-AE-DS using RGE with the smallest query number q = 20 has outperformed ZO-DS using RGE with the largested query number q = 192. This shows the vital role of AE on ZO optimization. Meanwhile, consistent with Table 2 and Table 3, the best model achieved by ZO-AE-DS using CGE could be even better than the FO baseline FO-DS since AE could play a similar role on the smoothing operation. Furthermore, as the query number q increases, the improvement of ZO-AE-DS grows, towards the performance of FO-AE-DS.
Effect of training scheme on ZO-AE-DS. In Table 4, we present the impact of training scheme (over the denoiserDθ) on the CA performance of ZO-AE-DS versus different `2-radii. Two training schemes, training from scratch and pre-training + fine-tuning, are considered. As we can see, training from scratch forDθ leads to the better performance of ZO-AE-DS than pre-
training + fine-tuning. This is because the application of pre-training to Dθ could make optimization easily get trapped at a local optima. We list other ablation studies in Appendix C.

heading: 5.3 EXPERIMENT RESULTS ON IMAGE RECONSTRUCTION.
text: In what follows, we apply the proposed ZO-AE-DS to robustifying a black-box image reconstruction network. The goal of image reconstruction is to recover the original image from a noisy measurement.
Following (Antun et al., 2020; Raj et al., 2020), we generate the noisy measurement following a linear observation model y = A>x, where A is a sub-sampling matrix (e.g., Gaussian sampling), and x is an original image. A pre-trained image reconstruction network (Raj et al., 2020) then takes A>y as the input to recover x. To evaluate the reconstruction performance, we adopt two metrics (Antun et al., 2020), the root mean squared error (RMSE) and structural similarity (SSIM). SSIM is a supplementary metric to RMSE, since it gives an accuracy indicator when evaluating the similarity between the true image and its estimate at fine-level regions. The vulnerability of image reconstruction networks to adversarial attacks, e.g., PGD attacks (Madry et al., 2018), has been shown in (Antun et al., 2020; Raj et al., 2020; Wolf, 2019).
When the image reconstructor is given as a black-box model, spurred by above, Table 5 presents the performance of image reconstruction using various training methods against adversarial attacks with different perturbation strengths. As we can see, compared to the normally trained image reconstructor (i.e., ‘Standard’ in Table 5), all robustification methods lead to degraded standard image reconstruction performance in the non-adversarial context (i.e., ‖δ‖2 = 0). But the worst performance is provided by ZO-DS. When the perturbation strength increases, the model achieved by standard training becomes over-sensitive to adversarial perturbations, yielding the highest RMSE and the lowest SSIM. Furthermore, we observe that the proposed black-box defense ZO-AE-DS yields very competitive and even better performance with respect to FO defenses. In Fig. 5, we provide visualizations of the reconstructed images using different approaches at the presence of reconstruction-evasion PGD attacks. For example, the comparison between Fig. 5-(f) and (b)/(d) clearly shows the robustness gained by ZO-AE-DS.

heading: 6 CONCLUSION
text: In this paper, we study the problem of black-box defense, aiming to secure black-box models against adversarial attacks using only input-output model queries. The proposed black-box learning paradigm is new to adversarial defense, but is also challenging to tackle because of the black-box optimization nature. To solve this problem, we integrate denoised smoothing (DS) with ZO (zerothorder) optimization to build a feasible black-box defense framework. However, we find that the direct application of ZO optimization makes the defense ineffective and difficult to scale. We then propose ZO-AE-DS, which leverages autoencoder (AE) to bridge the gap between FO and ZO optimization. We show that ZO-AE-DS reduces the variance of ZO gradient estimates and improves the defense and optimization performance in a significant manner. Lastly, we evaluate the superiority of our proposal to a series of baselines in both image classification and image reconstruction tasks.

heading: A DERIVATION OF (8)
text: First, based on (2) and (6), the stability loss corresponding to ZO-AE-DS is given by
`Stab(θ) = `CE (f ′(z), f(x)) := g(z), where f ′(z) = f (φθDec (z)) , z = ψθEnc (Dθ(x+ δ)) .
(9)
We then take the derivative of `Stab(θ) w.r.t. θ. This yields
∇θ`Stab(θ) = dz
dθ
dg(z)
dz |z=ψθEnc (Dθ(x+δ)) , (10)
where dzdθ ∈ R dθ×d and dg(z)dz ∈ R d.
Since g(z) involves the black-box function f , we first compute its ZO gradient estimate following (3) or (4) and obtain
dg(z)
dz |z=ψθEnc (Dθ(x+δ)) ≈ ∇̂zg(z) |z=ψθEnc (Dθ(x+δ)) := a. (11)
Substituting the above into (10), we obtain
∇θ`Stab(θ) = dz
dθ a =  da>z dθ1 da>z dθ2 ...
da>z dθdθ
 = da >z dθ = ∇θ[a>φθEnc(Dθ(x+ δ))], (12)
where the last equality holds based on (9). This completes the derivation.

heading: B COMBINATION OF DIFFERENT DENOISERS AND CLASSIFIERS
text: Table A1 presents the certified accuracies of our proposal using different denoiser models (WideDnCnn vs. DnCnn) and image classifier (Vgg-16).
DnCnn & VGG-16 Wide-DnCnn & VGG-16
`2-radius r FO-DS FO-AE-DS ZO-AE-DS (CGE, q = dz = 192) FO-DS FO-AE-DS ZO-AE-DS(CGE, q = dz = 192) 0.00 (SA) 71.37 73.75 71.92 66.57 75.14 72.97 0.25 51.37 54.74 54.33 50.1 57.45 54.92 0.50 30.21 34.6 34.39 31.52 37.59 34.2 0.75 11.72 15.45 15.36 13.94 17.64 15.7
Table A1: CA (certified accuracy, %) vs. different `2-radii for different combinations of denoisers and classifier.

heading: C ADDITIONAL EXPERIMENTS AND ABLATION STUDIES
text: In what follows, we will show the ablation study on the choice of AE architectures in Appendix C.1. Afterwards, we will show the performance of FO-AE-DS versus different training schemes in Appendix C.2. Finally, we will show the performance of our proposal on the high-dimension ImageNet images in Appendix C.3.
C.1 THE PERFORMANCE OF FO-AE-DS WITH DIFFERENT AUTOENCODERS.
Table. A2 presents the certified accuracy performance of FO-AE-DS with different autoencoders (AE). As we can see, if AE-96 is used (namely, the encoded dimension is half of AE-192 used in the paper), then we observe a slight performance drop. This is a promising result as we can further reduce the query complexity by choosing a different autoencoder since the use of CGE has to be matched with the encoded dimension.
`2-radius r AE-96 AE-192 0.00 (SA) 75.57 75.97
0.25 58.07 59.12 0.50 37.09 38.50 0.75 17.05 18.18
Table A2: CA (certified accuracy, %) vs. different `2-radii for FO-AE-DS with different AutoEncoders.
C.2 THE PERFORMANCE OF FO-AE-DS WITH DIFFERENT TRAINING SCHEMES.
Table. A3 presents the certified accuracy of FO-AE-DS (first-order implementation of ZO-AE-DS) with different training schemes. Training both denoiser and encoder is the default setting. As we can see, only training the denoiser would bring performance degradation, and training both denoiser and AE does boost the performance. It is worth noting that FO-AE-DS with "train the denoiser and AE" training scheme can be regarded as the FO-DS treating the combination of the original denoiser and the same AE used in FO-AE-DS as a new denoiser, which cannot be implemented for ZO-AE-DS since the decoder of ZO-AE-DS is merged into the black-box classifier and its parameters cannot be updated. Furthermore, the key of the introduced AE is to reduce the variable dimension for Zeroth-Order (ZO) gradient estimation.
`2-radius r FO-DS FO-AE-DS (only train
the denoiser)
FO-AE-DS (train the denoiser
and encoder)
FO-AE-DS (train the denoiser
and the AE) 0.00 (SA) 71.80 73.34 75.97 75.76
0.25 51.74 55.61 59.12 58.14 0.50 30.22 35.68 38.50 38.88 0.75 11.87 15.92 18.18 18.48
Table A3: CA (certified accuracy, %) vs. different `2-radii for FO-AE-DS with different training schemes.
C.3 THE PERFORMANCE OF ZO-AE-DS ON IMAGENET IMAGES.
To evaluate the performance of ZO-AE-DS on the Restricted ImageNet (R-ImageNet) dataset, a 10-class subset of ImageNet with 38472 images for training and 1500 images for testing, similar to (Tsipras et al., 2019). Due to our limited computing resources, we are not able to scale up our experiment to the full ImageNet dataset, but the purpose of evaluating on high-dimension images remains the same. In the implementation of ZO-AE-DS, we choose an AE with an aggressive compression (130:1), which is to compress the original 3× 224× 224 images into the 1152× 1× 1 feature dimension. We compare the certified accuracy (CA) performance of our proposed ZO-AE-DS (using CGE) with the black-box baseline ZO-DS, and the white-box baselines FO-DS and FO-AE-DS. Results are summarized in the following table.
As we can see, (1) when considering the black-box classifier, the proposed ZO-AE-DS still significantly outperforms the direct ZO implementation of DS. This shows the importance of variance reduction of query-based gradient estimates. (2) Since ZO-AE-DS and FO-AE-DS used an aggressive AE structure, the performance drops compared to FO-DS. (3) the use of high-resolution images would make the black-box defense much more challenging. However, ZO-AE-DS is still a principled black-box defense method that can achieve reasonable performance.
`2-radius r FO-DS FO-AE-DS ZO-AE-DS
(RGE, q =1152 and encoder)
ZO-AE-DS (CGE, q=1152)
0.00 (SA) 89.33 71.07 26.93 63.60 0.25 81.67 63.40 18.40 52.80 0.50 68.87 53.60 11.67 43.13 0.75 49.80 42.87 5.53 32.73
Table A4: CA (certified accuracy, %) vs. different `2-radii for FO-AE-DS on ImageNet Images.

Review summaries:
The authors formulate the problem of black-box defense and propose a novel black-box defense approach called the Zero Order AutoEncoder-based Denoised Smoothing (ZO-AE-DS). Black-box defense corresponds to situations in which the defense model information cannot be obtained due to privacy protection in real scenarios. ZO-AE-DS introduces zero-order optimization on the structure of denoised smoothing (DS) to estimate the gradient and uses an Autoencoder (AE) to connect the denoiser with the model so that zero-order optimization can be conducted in a (low-dimension) feature embedding space.

This work provides an algorithm to ensure robust training of an ML model with just black-box knowledge of it i.e., input and output access. The algorithm relies on using Denoised Smoothing with zeroth-order optimization where the gradients are estimated using random perturbations (finite-differencing). They avoid the computational burden and high variance of these estimates by first training an auto-encoder to reduce the inputs to a low-dimensional subspace. They show over different architectures and multiple datasets (Cifar10, STL10, image reconstruction over MNIST) that the proposed algorithm performs better than the baseline which is the Denoised Smoothing algorithm by Salman et al.