Towards Query-Efficient Black-Box Adversary with Zeroth-Order Natural Gradient Descent

Pu Zhao, Pin-Yu Chen, Siyue Wang, Xue Lin

Introduction

Modern technologies based on machine learning (ML) and specifically deep learning (DL), have achieved significant breakthroughs (?) in various applications. Deep neural network (DNN) serves as a fundamental component in artificial intelligence. However, despite the outstanding performance, many recent studies demonstrate that state-of-the-art DNNs in computer vision (?; ?), speech recognition (?; ?) and deep reinforcement learning (?) are vulnerable to adversarial examples (?), which add carefully designed imperceptible distortions to legitimate inputs aiming to mislead the DNNs at test time. This raises concerns of the DNN robustness in many applications with high reliability and dependability requirements.

With the recent exploration of adversarial attacks in image classification and objection detection, the vulnerability/robustness of DNNs has attracted ever-increasing attentions and efforts in the research field known as adversarial machine learning. A large amount of efforts have been devoted to: 1) designing adversarial perturbations in various ML applications (?; ?; ?; ?; ?); 2) security evaluation methodologies to systematically estimate the DNN robustness (?; ?); and 3) defense mechanisms against adversarial attacks (?; ?; ?; ?; ?; ?; ?). This work mainly investigates the first category to build the groundwork towards developing potential defensive measures in reliable ML.

However, most of preliminary studies on this topic focus on the white-box setting where the target DNN model is completely available to the attacker (?; ?; ?). More specifically, the adversary can compute the gradients of the output with respect to the input to identify the effect of perturbing certain input pixels, with complete knowledge about the DNN model’s internal structure, parameters and configurations. Despite the theoretical interest, it is unrealistic to adopt the white-box adversarial methods to attack practical black-box threat models (?), where the internal model states/configurations are not revealed to the attacker (e.g., Google Cloud Vision API). Instead, the adversary can only query the model by submitting inputs and obtain the corresponding model outputs of prediction probabilities when generating adversarial examples.

In the black-box adversarial setting, it is often the case that the less queries, the more efficient an attack becomes. Large amount of queries may be at the risk of exposing the adversary or high financial cost in the case where the query is charged per query. Notably, to date most of the white-box (?; ?) and black-box attacks (?; ?; ?) are based on first-order gradient descent methods. Different from the widely utilized first-order optimization, the application of second-order optimization (?) is less explored due to the large computation overhead, although it may achieve faster convergence rate. The work (?) adopts natural gradient descent (NGD) to train ResNet-50 on ImageNet in 35 epochs, demonstrating its great potentiality.

In this work, inspired by the superb convergence performance of NGD, we propose zeroth-order natural gradient descent (ZO-NGD), which incorporates the zeroth-order (ZO) method and the second-order NGD, to generate black-box adversarial examples in a query-efficient manner. The contributions of this work are summarized as follows:

+ Design of adversary attacks with NGD: To the best of our knowledge, we are the first to derive the Fisher information matrix (FIM) and adopt the second-order NGD method for adversarial attacks, which is different from other first-order-based white-box and black-box attack methods.

+ Co-optimization of zeroth-order and second-order methods: In the black-box setting, we incorporate the zeroth-order random gradient estimation to estimate the gradients which is not directly available, and leverage the second-order NGD to achieve high query-efficiency.

+ No additional queries to obtain the FIM: During the queries to estimate the gradients of the loss, with our design the Fisher information is a byproduct that are extracted and evaluated without requiring additional query complexity.

+ Scalability to high dimensional datasets: In NGD, it is computationally infeasible to compute and invert the FIM with billions of elements on large scale datasets like ImageNet. To address this problem, we propose a method to avoid the computation and inverse of the FIM and thus the computation complexity is at most the same as the input images, rather than its square (the dimension of the FIM).

Related Work

In adversarial ML, the black-box setting is more practical where the attacker can only query the target model by providing input images and receive the probability density output for the input.

In the black-box setting, as the gradients are not directly available, gradient estimation methods via zeroth-order optimization (?; ?; ?) are proposed to estimate the gradients. The ZOO method (?) performs pixel-level gradient estimation first and then perform white-box C&W attack (?) with the estimated gradients. Despite its high success rate, it suffers from intensive computation and huge queries due to element-wise gradient estimation.

The more practical threat models are investigated in (?). New attack methods based on Natural Evolutionary Strategies (NES) and Monte Carlo approximation to estimate the gradients are developed to mislead ImageNet classifiers under more restrictive threat models. The work (?) further proposes to use the prior information including the time-dependent priors and data-dependent priors to enhance the query efficiency.

Different from the previous first-order-based methods, the work (?) exploits the second-order optimization to improve query efficiency. In general, they explore Hessian information in the parameter space while our work explores the Hessian information in the distribution space (aka information matrix). Particularly, our method obtains the Fisher information during the first-order information (gradients) estimation for free while the mentioned paper needs additional queries for Hessian-based second-order optimization.

Heuristic black-box attacks

In the transfer attack (?), the attacker first trains a surrogate model with data labeled by the target model. White-box attacks are applied to attack the surrogate model and the generated examples are transferred to attack the target model. However, it may suffer from low attack success rate due to the low similarity between the surrogate model and the target model.

The boundary method (?) utilizes a conceptually simple idea to decrease the distortion through random walks and find successful adversarial perturbations while staying on the misclassification boundary. However, it suffers from high computational complexity and lacks algorithmic convergence guarantees.

Second-order optimization

First-order gradient descent methods have been extensively used in various ML tasks. They are easy to implement and suitable for large-scale DL. But these methods come with well known deficiencies such as relatively-slow convergence and sensitivity to hyper-parameter settings. On the other hand, second-order optimization methods provide a elegant solution by selectively re-scaling the gradient with the curvature information (?). As a kind of second-order method, NGD proves to be Fisher efficient by using the FIM instead of the Hessian matrix (?; ?). But the large overhead to compute, store and invert the FIM may limit its application. To address this, Kronecker Factored Approximate Curvature (K-FAC) is proposed to train DNNs (?).

Problem Formulation

Threat Model: In this paper, we mainly investigate black-box adversarial attacks for image classification with DNNs. Different from the white-box setting which has fully access to the DNN model and its internal structures/parameters, the black-box setting constrains the information available to the adversary. The attacker can only query the model by providing an input image and obtain the DNN output score/probability of the input. The black-box setting is more consistent with the scenario of “machine-learning-deployed-as-a-service” like Google Cloud Vision API.

In the following, we first provide a general problem formulation for adversarial attack which can be adopted to either white-box or black-box settings. Then, an efficient solution is proposed for the black-box setting. We highlight that this method can be easily adopted to the white-box setting by using the exact gradients to achieve higher query efficiency.

Motivated by (?), the loss function f(x,t)f(\bm{x},t) is expressed as

where p(i∣x)p(i|\mathbf{x}) denotes the model’s prediction score or probability of the ii-th class for the input x\bm{x}, and κ\kappa is a confidence parameter usually set to zero. Basically, f(x+δ,t)f(\mathbf{x}+\bm{\delta},t) achieves its minimum value 0 if p(t∣x+δ)p(t|\mathbf{x}+\bm{\delta}) is smaller than max⁡i≠tlog⁡p(i∣x+δ)\max_{i\neq t}\log p(i|\mathbf{x}+\bm{\delta}), indicating there is a label with higher probability than the correct label tt and thus a misclassification is achieved by adding the perturbation δ\bm{\delta} to x\bm{x}. In this paper, we mainly investigate the untargeted attack which does not specify the target misclassified label. The targeted attack can be easily implemented following nearly the same problem formulation and loss function with slight modifications (?; ?). We focus on the general formulation here and omit the targeted attack formulation.

Note that in Eq. (Problem Formulation), we use the log probability log⁡p(i∣x)\log p(i|\mathbf{x}) instead of p(i∣x)p(i|\mathbf{x}) because the output probability distribution tends to have one dominating class. The log operator is used to reduce the effect of the dominating class while it still preserves the probability order of all classes.

As most of the white-box attack methods rely on gradient descent methods, the unavailability of the gradients in black-box settings will limit their application. Gradient estimation methods (known as zeroth-order optimization) are applied to perform the normal projected first-order gradient descent process (?; ?) as follows,

In the black-box setting, it is often the case that the query number is limited or high query efficiency is required by the adversary. The zeroth-order method tries to extract gradient information of the objective function and the first-order method is applied to minimize the loss due to its wide application in ML. However, the second-order information of the queries is not fully exploited. In this paper, we aim to take advantages of the model’s second-order information and propose a novel method named ZO-NGD optimization.

Zeroth-order Nature Gradient Descent

The proposed method is based on NGD (?) and ZO optimization (?). In the applications of optimizing probabilistic models, NGD uses the natural gradient by multiplying the gradient with the FIM to update the parameters. NGD seems to be a potentially attractive alternative method as it requires fewer total iterations than gradient descent (?; ?; ?).

Motivated from the perspective of information geometry, NGD defines the steepest descent/direction in the realizable distribution space instead of the parameter space. The distance in the distribution space is measured with a special “Riemannian metric” (?), which is different from the standard Euclidean distance metric in the parameter space. This Riemannian metric does not rely on the parameters like the Euclidean metric, but depends on the distributions themselves. Thus it is invariant to any smooth or invertible reparameterization of the model. More details are discussed in the Geometric Interpretation Section.

Next we will introduce the FIM and the implementation details to perform NGD. Basically, the proposed framework first queries the model to estimate the gradients and Fisher information. Then after the damping and inverting processes, natural gradient is obtained to update the perturbation. Algorithm 1 shows the pseudo code of the ZO-NGD.

We introduce and derive the FIM in this section. In general, finding an adversarial example can be formulated as a training problem. In the idealized setting, input vectors x\bm{x} are drawn independently from a distribution QxQ_{\bm{x}} with density function q(x)q(\bm{x}), and the corresponding output tt is drawn from a conditional target distribution Qt∣x{Q_{t\left|{\bf{x}}\right.}} with density function q(t∣x)q(t\left|{\bm{x}}\right.). The target joint distribution is Qt,x{Q_{t,{\bf{x}}}} with the density of q(t,x)=q(t∣x)q(x)q(t,\bm{x})=q(t|\bm{x})q(\bm{x}). By finding an adversarial perturbation δ\bm{\delta}, we obtain the learned distribution Pt,x(δ){P_{t,{\bf{x}}}(\bm{\delta})}, whose density is p(t,x∣δ)=p(t∣x+δ)q(x):=p(t∣x,δ)q(x)p(t,\bm{x}|\bm{\delta})=p(t|\bm{x}+\bm{\delta})q(\bm{x}):=p(t|\bm{x},\bm{\delta})q(\bm{x}).

In statistics, the score function (?) indicates how sensitive a likelihood function p(t,x∣δ)p(t,\bm{x}|\bm{\delta}) is to its parameters δ\bm{\delta}. Explicitly, the score function for δ\bm{\delta} is the gradient of the log-likelihood with respect to δ\bm{\delta} asbelow,

The expected value of the score function with respect to δ\bm{\delta} is zero.

The proof is shown in the appendix. We can define an uncertainty measure around the expected value (i.e., the covariance of the score function) as follows,

The covariance of the score function above is the definition of the Fisher information. It is in the form of a matrix and the FIM can be written as

The exact expectation with TT categories is expressed as,

The usual definition of the natural gradient is

and the NGD minimizes the loss function through

Outer Product and Monte Carlo Approximation

Thus a rank-one matrix can be obtained directly.

Monte Carlo Approximation

For higher query efficiency, we adopt the outer product approximation as it does not require additional queries .

Gaussian Smoothing and Gradient Estimation

To compute the FIM and perform NGD, we need to obtain the gradients of the loss function ∇f(δ)\nabla f(\bm{\delta}) and the gradients of the log-likelihood ∇p(t∣x,δ)\nabla p{(t|\bm{x},\bm{\delta})}, which are not directly available in the black-box setting.

To address this difficulty, we first introduce the Gaussian approximation of f(x)f(\bm{x}) (?),

where ∥⋅∥{\lVert\cdot\rVert} is the Frobenius norm, μ>0\mu>0 is a smoothing parameter and u\bm{u} is a random vector distributed uniformly over the surface of a unit sphere, i.e., u∼N(0,Id)\bm{u}\sim N\left(\text{0,}\mathbf{I}_{d}\right). Its gradient can be written as

where EuE_{\bm{u}} is the Gaussian smoothing function. Thus, based on Eq. (Gaussian Smoothing and Gradient Estimation), we apply the zeroth-order random gradient estimation to estimate the gradients by

where RR is the number of random direction vectors and {uj}\{\mathbf{u}_{j}\} denote independent and identically distributed (i.i.d.) random direction vectors following Gaussian distribution.

We note that in each gradient estimation step, by querying the model R+1R+1 times, we can simultaneously obtain both the ∇^f(δ)\hat{\nabla}f(\bm{\delta}) and ∇^log⁡p(t∣x,δ)\hat{\nabla}\log p(t\left|{{\bf{x}},{\bm{\delta}}}\right.) as demonstrated in Algorithm 1. Different from the zeroth-order gradient descent which only estimates the gradients of the loss function ∇^f(δ)\hat{\nabla}f(\bm{\delta}) (such as ? and ?), ZO-NGD obtains ∇^log⁡p(t∣x,δ)\hat{\nabla}\log p(t\left|{{\bf{x}},{\bm{\delta}}}\right.) and computes the FIM from the same query outputs without incurring additional query complexity. This is one major difference between ZO-NGD and other zeroth-order methods. Thus, higher query-efficiency can be achieved by leveraging the FIM and second-order optimization.

Damping for Fisher Information Matrix

The inverse of the FIM is required for natural gradient. However, the eigenvalue distribution of the FIM is known to have an extremely long tail (?), where most of the eigenvalues are close to zero. This in turn causes the eigenvalues of the inverse FIM to be extremely large, leading to the unstable training. To mitigate this problem, damping technique is used to add a positive value to the diagonal of the FIM to stabilize the training as shown below,

where γ\gamma is a constant. As the damping limits the maximum eigenvalue of the inverse FIM, we can restrict the norm of the gradients. This prevents ZO-NGD from moving too far in flat directions.

With the obtained FIM, the perturbation update is

ZO-NGD tries to extract the Fisher information to perform second-order optimization for faster convergence rate and better query efficiency.

Scalability to High Dimensional Datasets

where c=∥s^(δ)∥c=\lVert\hat{s}(\bm{\delta})\rVert. The inverse matrix F^−1\mathbf{\hat{F}}^{-1} can be represented as,

This can be verified simply by checking their multiplication and we omit the proof here. Then the gradient update Δδ=λF^−1∇f(δ)\varDelta\bm{\delta}=\lambda\mathbf{\hat{F}}^{-1}\nabla f(\bm{\delta}) in Eq. (19) is

During the computation of Δδ=λF^−1∇f(δ)\varDelta\bm{\delta}=\lambda\mathbf{\hat{F}}^{-1}\nabla f(\bm{\delta}), we compute s^(δ)T∇^f(δ)\hat{s}\left(\bm{\delta}\right)^{T}\hat{\nabla}f\left(\bm{\delta}\right) first in Eq. (22) and obtain a scalar, then Δδ\varDelta\bm{\delta} is simply the sum of two vectors. Although F^\mathbf{\hat{F}} and its inverse might have billions of elements, we avoid directly computing them and the dimension of the internal computation is at most the same level as the dimension dd of the images, rather than its square d2d^{2}. Thus, the ZO-NGD method can be applied on datasets with high dimensional images.

Geometric Interpretation

We provide a geometric interpretation for the natural gradient here. The negative gradient −∇f(δ)-\nabla f(\bm{\delta}) can be interpreted as the steepest descent direction in the sense that it yields the most reduction in ff per unit of change of δ\bm{\delta}, where the change is measured by the standard Euclidean norm ∥⋅∥\left\|\cdot\right\| (?), as shown below,

By following the −∇f(δ)-\nabla f(\bm{\delta}) direction, we can obtain the change of δ\bm{\delta} within a certain ϵ\epsilon-neighbourhood to minimize the loss function.

The negative natural gradient is the steepest descent direction in the distribution space.

We provide the proof of Lemma 2 in the appendix1. In the parameter space, the negative gradient is the steepest descent direction to minimize the loss function. By contrast, in the distribution space where the distance is measured by KL divergence, the steepest descent direction is the negative natural gradient. Thus, the direction in distribution space defined by the natural gradient will be invariant to the choice of parameterization (?), i.e., it will not be affected by how the model is parametrized, but only depends on the distribution induced by the parameters.

Experimental Results

In this section, we present the experimental results of the ZO-NGD method. We compare ZO-NGD with various attack methods on three image classification datasets, MNIST (?), CIFAR-10 (?) and ImageNet (?).

We train two networks for MNIST and CIFAR-10 datasets, respectively. The model for MNIST achieves 99.6% accuracy with four convolutional layers, two max pooling layers, two fully connected layers and a softmax layer. For CIFAR-10, we adopt the same model architecture as MNIST, achieving 80% accuracy. For ImageNet, a pre-trained Inception v3 network (?) is utilized instead of training our own model, attaining 96% top-5 accuracy. All experiments are performed on machines with NVIDIA GTX 1080 TI GPUs.

We first check the white-box setting, where we compare the proposed NGD with PGD from adversarial training. PGD is a typical first-order method while NGD utilizes the second-order FIM. The query here is defined as one forward pass and one subsequent backpropagation as we need to obtain the gradients through backpropagation. We report the average number of queries over 500 images for successful adversaries on each dataset. On MNIST, NGD requires 2.12 queries while PGD needs 4.88 queries with ϵ=0.2\epsilon=0.2. On CIFAR-10, NGD requires 2.06 queries while PGD needs 4.21 queries with ϵ=0.1\epsilon=0.1. On ImageNet, NGD requires 2.20 queries while PGD needs 5.62 queries with ϵ=0.05\epsilon=0.05. We can see that NGD achieves higher query efficiency by incorporating FIM.

Evaluation on MNIST and CIFAR-10

In the evaluation on MNIST and CIFAR-10, we select 2000 correctly classified images from MNIST and CIFAR-10 test datasets, respectively, and perform black-box attacks for these images. We compare the ZO-NGD method with the transfer attack (?), ZOO black-box attack (?), and the natural-evolution-strategy-based projected gradient descent method (NES-PGD) (?). For the transfer attack (?), we apply C&W attack (?) to the surrogate model. The implementations of ZOO and NES-PGD are based on the GitHub code released by the authorsThe code and appendix are available at https://github.com/LinLabNEU/ZO˙NGD˙blackbox. . For the attack methods, the pixel values of all images are normalized to the range of $.IntheproposedZO−NGDmethod,thesamplingnumber. In the proposed ZO-NGD method, the sampling numberRintherandomgradientestimationasdefinedinEq.(16)and(GaussianSmoothingandGradientEstimation)issetto40.in the random gradient estimation as defined in Eq. (16) and (Gaussian Smoothing and Gradient Estimation) is set to 40.\epsilonissetto0.4forMNISTand0.2forCIFAR−10orImageNet.InEq.(16)and(GaussianSmoothingandGradientEstimation),wesetis set to 0.4 for MNIST and 0.2 for CIFAR-10 or ImageNet. In Eq. (16) and (Gaussian Smoothing and Gradient Estimation), we set\mu=1forthreedatasets.for three datasets.\gamma$ is set to 0.01.

The experimental results are summarized in Table 1. We show the success rate and the average queries over successful adversarial examples for the black-box attack methods on MNIST and CIFAR-10 datasets. As shown in Table 1, the transfer attack does not achieve high success rate due to the difference between the surrogate model and the original target model. The ZOO attack method can achieve high success rate at the cost of excessive query complexity since it performs gradient estimation for each pixel of the input image. We can observe that the ZO-NGD method requires significantly less queries than the NES-PGD method. NES-PGD uses natural evolutionary strategies for gradient estimation and then perform first-order gradient descent to obtain the adversarial perturbations. Compared with NES-PGD, the proposed ZO-NGD not only estimates the first-order gradients of the loss function, but also tries to obtain the second-order Fisher information from the queries without incurring additional query complexities, leading to higher query-efficiency. From Table 1, we can observe that the ZO-NGD method attains the smallest number of queries to successfully obtain the adversarial examples in the black-box setting. Benchmarking on the ZOO method, the query reduction ratio of ZO-NGD can be as high as 93.7% on MNIST and 98% on CIFAR-10.

Evaluation on ImageNet

We perform black-box adversarial attacks on ImageNet where 1000 correctly classified images are randomly selected. On ImageNet, we compare the proposed ZO-NGD with the ZOO attack, NES-PGD method and the bandit attack with time and data-dependent priors (named as Bandits[TD]) (?). The transfer attack is not performed since it is not easy to train a surrogate model on ImageNet. The Bandits[TD] method makes use of the prior information for the gradients estimation, including the time-dependent priors which explores the heavily correlated successive gradients, and the data-dependent priors which exploits the spatially local similarity exhibited in images. After gradient estimation with the priors or bandits information, first-order gradient descent method is applied.

We present the performance evaluation on ImageNet in Table 2. The success rate and the average queries over successful attacks for various black-box attack methods are reported. Table 2 shows the ZOO attack method can achieve high success rate with high query complexity due to its element-wise gradient estimation. We can have a similar observation that the ZO-NGD method only requires a much smaller number of queries than the NES-PGD method due to the faster convergence rate of second-order optimization by exploring the Fisher information. We also find that the ZO-NGD method also outperforms the Bandits[TD] method in terms of query efficiency. The Bandits[TD] method enhances the query efficiency of gradient estimations through the incorporation of priors information for the gradients, but its attack methodology is still based on the first-order gradient descent method. As observed from Table 2, the ZO-NGD method achieves the highest query-efficiency for successful adversarial attacks in the black-box setting. It can obtain 96.5% query reduction ratio on ImageNet when compared with the ZOO method. In Figure 1, we show some legitimate images on ImageNet and their corresponding adversarial examples obtained by ZO-NGD. We can observe that the adversarial perturbations are imperceptible. More examples on MNIST and CIFAR-10 are shown in the appendix.

Ablation study

In this ablation study, we perform sensitivity analysis on the proposed ZO-NGD method based variations in model architectures and different parameter settings. Below we summarize the conclusion and findings from this ablation study and report their details in the appendix. (1) Tested on VGG16 and ResNet and varying the parameters μ\mu and ϵ\epsilon in ZO-NGD, the results demonstrate the consistent superior performance of ZO-NGD by leveraging the second-order optimization. (2) We inspect the approximation techniques used in ZO-NGD including damping and outer product method. The results show that there is a wide range of proper γ\gamma values such that damping can work effectively to reduce the loss, and the outer product is a reasonable approximation based on the empirical evidence. We also note that the ASR of ZOO is higher than ZO-NGD. We provide a discussion about the ASR v.s. query number in the appendix.

Figure 2 shows the cumulative distribution (CDF) of the query number for 1000 images on three datasets, validating ZO-NGD’s query efficiency.

Transferability

The transferability of adversarial examples is an interesting and valuable metric to measure the performance. To show the transferability, we use 500 targeted adversarial examples generated by ZO-NGD on ImageNet with ϵ=0.1\epsilon=0.1 on Inception to attack ResNet and VGG16 model. It achieves 94.4% and 95.6% ASR, respectively, demonstrating high transferability of our method. Our transferred ASR is also higher than NES-PGD (92.1% and 92.9% ASR).

Conclusion

In this paper, we propose a novel ZO-NGD to achieve high query-efficiency in black-box adversarial attacks. It incorporates the ZO random gradient estimation and the second-order FIM for NGD. The performance evaluation on three image classification datasets demonstrate the effectiveness of the proposed method in terms of fast convergence and improved query efficiency over state-of-the-art methods.

Acknowledgments

This work is partly supported by the National Science Foundation CNS-1932351, and is also based upon work partially supported by the Department of Energy National Energy Technology Laboratory under Award Number DE-OE0000911.

Disclaimer

This report was prepared as an account of work sponsored by an agency of the United States Government. Neither the United States Government nor any agency thereof, nor any of their employees, makes any warranty, express or implied, or assumes any legal liability or responsibility for the accuracy, completeness, or usefulness of any information, apparatus, product, or process disclosed, or represents that its use would not infringe privately owned rights. Reference herein to any specific commercial product, process or service by trade name, trademark, manufacturer, or otherwise does not necessarily constitute or imply its endorsement, recommendation, or favoring by the United States Government or any agency thereof. The views and opinions of authors expressed herein do not necessarily state or reflect those of the United States Government or any agency thereof.

References

Appendix A Appendix

Appendix B Geometric Interpretation

We provide a geometric interpretation for the natural gradient in this section. The negative gradient −∇f(δ)-\nabla f(\bm{\delta}) can be interpreted as the steepest descent direction in the sense that it yields the most reduction in ff per unit of change of δ\bm{\delta}, where the change is measured by the standard Euclidean norm ∥⋅∥\left\|\cdot\right\| (?), as shown below,

By following the −∇f(δ)-\nabla f(\bm{\delta}) direction, we can obtain the change of δ\bm{\delta} within a certain ϵ\epsilon-neighbourhood to minimize the loss function.

As the loss function is related to the likelihood, we can explore the steepest direction to minimize the loss in the space of all possible likelihoods (i.e. distribution space). KL divergence (?) is a popular measure of the distance between two distributions. For two distributions p(t∣δ)p\left(t|\bm{\delta}\right) and p(t∣δ′)p\left(t|\bm{\delta}^{\prime}\right), their KL divergence is defined as

The FIM F\bm{F} is the Hessian of KL divergence between two distributions p(t∣δ)p(t|\bm{\delta}) and p(t∣δ+α)p(t|\bm{\delta}+\bm{\alpha}), with respect to α\bm{\alpha}, evaluated at α=0\bm{\alpha}=\bm{0}.

The proof is shown in the appendix. By Lemma 3, the FIM can be regarded as the curvature in the distribution space.

The second order Taylor expansion of the KL divergence can be expressed as

Next we explore the direction to minimize the loss function in the distribution space where the distance is measured by the KL divergence. Although in general, the KL divergence is not symmetric, it is (approximately) symmetric in a local neighborhood. The problem can be formulated as

where mm is a certain constant. The purpose of fixing the KL divergence to a constant is to move along the distribution space with a constant speed, regardless of the curvature.

Thus, we can obtain Lemma 2 and show its proof in the appendix. In the parameter space, the negative gradient is the steepest descent direction to minimize the loss function. By contrast, in the distribution space, the steepest descent direction is the negative natural gradient. Thus, the direction in distribution space defined by the natural gradient will be invariant to the choice of parameterization (?), i.e., it will not be affected by how the model is parametrized, but only depends on the distribution induced by the parameters.

Appendix C Proof of Lemmas

Proof of Lemma 3

Proof of Lemma 3. The gradients of the KL divergence can be expressed as

The Hessian of the KL divergence is defined by

Proof of Lemma 4

Notice that the first term is zero as they are the same distributions. The second term is zero due to Lemma 1.

Proof of Lemma 2

Proof of Lemma 2. The Lagrangian function of the minimization can be formulated as

To solve this minimization, we set its derivative to zero:

We can see that the negative natural gradient defines the steepest direction in the distribution space.

Appendix D Adversarial Examples

Appendix E Ablation study

To check the performance of the proposed method on various model architecture, we performed experiments on three datasets using two new models (VGG16 & ResNet) and summarized the results in Table A1. The proposed ZO-NGD is more query-efficient than NES-PGD.

Parameter Analysis

The sensitivity analysis on the parameters μ\mu and ϵ\epsilon are demonstrated in Table A2. As observed form Table A2, the ZO-NGD performance is robust to different μ\mu values (fixing ϵ=0.2\epsilon=0.2), and larger ϵ\epsilon leads to fewer queries.

In second-order optimization, damping is a common technique to compensate for errors in the quadratic approximation. The parameter γ\gamma plays a key role in damping. To show the influence of γ\gamma, we demonstrate the loss after 2 ADMM iterations for a wide range of γ\gamma values with the same initialization in Figure A2(a). We observe that 0.01 or 0.001 is an appropriate choice for γ\gamma to achieve higher query efficiency.

Drift of Outer Product

Although we adopt outer product (Equ. (12)) to approximate Equ. (9), we use the empirical evidence below to motivate why Equ. (12) dominates in Equ. (9) and the approximation is reasonable. For a well-trained model, the prediction probability of a correctly classified image usually dominates the probability distribution, that is, p(t∣x,δ)p(t|\bm{x},\bm{\delta}) is usually much larger than other probabilities if tt is correct and δ\bm{\delta} is small. We plot the average prediction probability distribution of 1000 correctly classified images on CIFAR-10 and ImageNet for their top-10 labels in Figure A2(b). As observed from Figure A2(b), the correct label usually dominates in the probability distribution, leading to reasonable approximation loss from Equ. (9) to Equ. (12).