betaFeedback

WorksComputer Science

Mitigating Black-Box Score-Based Query Attacks via Gradient Confusion

Abstract

Score-based black-box adversarial attacks pose a serious threat to deployed machine learning systems by exploiting repeated model queries to craft adversarial examples, requiring neither access to model parameters nor architecture. Existing defenses predominantly rely on stochastic output perturbations, which fail to prevent determined attackers from recovering stable gradient estimates by increasing query budgets or averaging over randomness. In this work, we propose the Gradient Confusion Defense (GCD), a retraining-free, deterministic test-time wrapper that actively shapes the probability vector returned to querying adversaries. By solving a constrained optimization problem grounded in the model's Jacobian, GCD aligns the exposed logit-gradient with a target confusion direction that is maximally misaligned with the true adversarial loss gradient—increasing the query complexity of attacks without sacrificing predictive utility or top-1 accuracy. We provide rigorous theoretical analysis demonstrating that GCD provably slows gradient-estimation-based attacks and induces systematic accept/reject errors in random search-based attacks, with the confusion effect amplifying as the fraction of defended queries increases. Extensive experiments on CIFAR-10 and ImageNet across multiple architectures (ResNet-18, ResNet-50, ViT-B/16) and four state-of-the-art attacks confirm these predictions: GCD achieves state-of-the-art robustness, while incurring zero clean accuracy degradation. %Crucially, unlike randomization-based defenses, GCD's deterministic structure provides resilience against adaptive attacks that exploit stochasticity, making it well-suited for security-critical deployment settings.

Introduction

Modern machine learning systems are often deployed via remote interfaces (e.g., cloud APIs and online services), where users interact with models only through query access. In this setting, standard white-box threat assumptions [33, 14, 23, 6, 4, 21] are frequently unrealistic, yet query-based black-box attacks remain highly effective even without access to model parameters, gradients, or training data [18, 2, 3, 11, 15, 19, 28, 7, 8, 29] (Vo et al. 2024). By adaptively probing the model and observing outputs, adversaries can craft adversarial examples under practical query budgets, making black-box robustness a core requirement for secure and trustworthy deployment.

Query-based black-box attacks are commonly divided into decision-based attacks [11, 7, 8, 29], which rely only on predicted labels and search for the decision boundary, and score-based attacks [3, 2, 15, 19] (Vo et al. 2024), which use logits or class probabilities to estimate gradients via finite-difference or search-based strategies. In practice, score-based attacks are typically more query-efficient and achieve higher success rates, posing a serious risk to deployed classifiers that must return confidence scores. As a result, a large body of work (Qin et al., 2021; Xie et al., [38]; He et al., 2019; Chen et al., [10]; Aithal and Li, [1]; Dashtbani et al., [13]; Hung-Quang et al., [17]; Wang et al., [37] have proposed defenses, most of which introduce randomness into model responses (Qin et al., [26]; Aithal and Li, [1]; Dashtbani et al., [13]; Hung-Quang et al., [17]). While such methods can increase variance or slow optimization, they do not explicitly control the gradient signal exposed through outputs, allowing attackers to average over randomness (Athalye et al., [5]) or increase the query budget to recover stable estimates when meaningful scores must be preserved.

In this work, we revisit black-box defense from a different perspective and ask: What gradient signal should a model expose to an adversary? Instead of relying on stochastic perturbations, we propose to actively manipulate the gradient information inferred from model outputs. Our goal is not merely to add noise, but to deliberately bias the gradient estimates or search directions that score-based attacks attempt to recover, steering them away from directions that reduce the classification margin.

We study the problem of defending a fixed, pretrained target classifier against query-based black-box adversaries while preserving correct predictions and usable score outputs. We introduce a deterministic test-time response wrapper that modifies the returned probability vector without altering the classifier itself or its training procedure. The core idea is gradient confusion: we deliberately shape the output scores so that the induced adversarial loss gradient’s direction deviates from the true adversarial loss gradient that score-based attacks seek to estimate. Using the loss gradients and Jacobian of the model’s logits, we derive an analytic target direction that misaligns the attacker’s search direction or estimated gradient, thereby increasing the number of queries required for successful adversarial example generation.

Building on a target confusion direction, we introduce the Gradient Confusion Defense (GCD), which formulates a constrained optimization problem over output probabilities to explicitly control the gradient signal exposed to score-based black-box attackers. GCD enforces three principled constraints at test time: exact preservation of the top-1 prediction to maintain clean accuracy, a bounded ℓ1\ell_1 distortion on the returned probability vector to preserve the utility of confidence scores, and alignment of the exposed logit-gradient with a target confusion direction rather than the true gradient.

The main contributions of this work are threefold.

  • We propose the Gradient Confusion Defense (GCD), a practical, retraining-free test-time defense that explicitly controls the gradient signal exposed through model outputs in the score-based black-box threat model.

  • We theoretically analyze how GCD forces the adversary to issue more queries to generate a successful adversarial example using gradient estimation-based and search-based attacks.

  • Extensive experiments show that GCD substantially reduces attack success rates while preserving clean accuracy, and further validate our theoretical analysis and demonstrate the effectiveness of our defense against several state-of-the-art query-based and adaptive attacks.

Related Works

Score-based query attacks. Query-based black-box adversarial attacks craft adversarial examples using only repeated queries to a deployed model, without access to parameters or gradients. These attacks are typically divided into score-based methods (Andriushchenko et al., [3]; Al-Dujaili and O’Reilly, [2]; Guo et al., [15]; Ilyas et al., [19]; Vo et al., 2024; Reza et al., [28]; Ilyas et al., [18]; Chen et al., [9]), which leverage logits or class probabilities, and decision-based methods (Cheng et al., [11]; Chen and Gu, 2020; Chen et al., [8]; Reza et al., [29]), which use only predicted labels and are often less query-efficient. Early score-based attacks estimated gradients via zero-order optimization and finite-difference style approximations (Chen et al., [9]; Ilyas et al., [18, 19]), while later work emphasized search-based strategies that can be highly query-efficient (Andriushchenko et al., [3]; Al-Dujaili and O’Reilly, [2]). Bandit-TD (Ilyas et al., [19]) frames gradient estimation as a bandit optimization problem and exploits temporal correlation of successive gradients and spatial structure in images. SquareAttack (Andriushchenko et al., [3]) performs randomized search using localized square-shaped perturbations, accepting only loss-decreasing proposals, yielding strong practical query efficiency. BruSLeAttack (Vo et al., 2024) targets sparse (ℓ0\ell_0) perturbations by searching over a reduced set of pixel locations to replace with values from a fixed synthetic image, and uses a Bayesian strategy guided by historical pixel-manipulation outcomes to improve query efficiency.

Black-box defenses. A foundational line of defense is adversarial training (AT) (Tramèr et al., [34]; Salman et al., [31]; Rice et al., [30]), which empirically improves robustness by training on adversarially perturbed samples. Extensions incorporate data augmentation (Rebuffi et al., [27]), denoising (Salman et al., [32]), and ensembling (Liu et al., [20]), but AT often remains costly and can reduce clean accuracy; moreover, many such defenses primarily target white-box threats and can be brittle under obfuscated-gradient effects (Athalye et al., [4]). For query-based threats, defenses commonly aim to disrupt the attacker’s ability to recover stable gradients from outputs, typically via randomization or output/logit manipulation. AAA [10] explicitly optimizes returned logits to confound the attacker by wrapping the original loss with a surrogate that preserves similar degradation behavior while inducing opposite gradient slopes, thereby steering optimization toward incorrect directions. RLS [13] randomizes the effective scale of logits by multiplying them with a random coefficient, which empirically degrades gradient estimation and slows attacks. Boundary defense [1] injects noise into the model’s output to hinder convergence, and RND [26] injects noise at the input level, both aiming to increase the query complexity required for successful attacks.

Preliminaries

Let X⊆[0,1]d\mathcal{X} \subseteq[0,1]^d be the input space, and let [K]={1,…,K}[K] = \{1,\ldots,K\} denote the label set. A classifier M:X→ΔK\mathcal{M}:\mathcal{X}\to\Delta^K outputs a probability vector M(x)=σ(z(x))\mathcal{M}(\mathbf{x})=\sigma(\mathbf{z}(\mathbf{x})), where z(x)\mathbf{z}(\mathbf{x}) denotes the logits and σ\sigma is the softmax function. Here, ΔK={p∈RK∣∑ipi=1}\Delta^K=\{\mathbf{p}\in\mathbb{R}^K\mid\sum_i p_i=1\} denotes the probability simplex. Let k∈[K]k\in[K] denote the true label of input x\mathbf{x}. For simplicity, we denote y^:=M(x)\hat{\mathbf{y}}:=\mathcal{M}(\mathbf{x}).

Attacks and perturbations. An adversarial example xadv\mathbf{x}_{\mathrm{adv}} for a sample x\mathbf{x} with corresponding label kk is generated by adding a perturbation δ\boldsymbol{\delta} to x\mathbf{x}. Typically, the norm of the perturbation δ\boldsymbol{\delta} is bounded so as not to change the ground-truth label of x\mathbf{x}. Formally, an adversarial example is defined as xadv=x+δ\mathbf{x}_{\mathrm{adv}}=\mathbf{x}+\boldsymbol{\delta}, such that ∥xadv−x∥p≤R\lVert\mathbf{x}_{\mathrm{adv}}-\mathbf{x}\rVert_p\le R, where RR is the perturbation budget, and the classifier M\mathcal{M} misclassifies xadv\mathbf{x}_{\mathrm{adv}} (untargeted attack: arg⁡max⁡iM(xadv)i≠k\arg\max_i\mathcal{M}(\mathbf{x}_{\mathrm{adv}})_i\ne k) or predicts a target class tt (targeted attack: arg⁡max⁡iM(xadv)i=t\arg\max_i\mathcal{M}(\mathbf{x}_{\mathrm{adv}})_i=t).

There are two strategies for generating adversarial examples in the black-box setting: transfer-based [25] and query-based [9]. In the query-based setting (our focus), the adversary can adaptively query the model up to a budget QQ that bounds the number of query the adversary can perform. Each query returns either (i) a score or probability vector (score-based setting) or (ii) only the predicted label (decision-based setting). We focus on score-based black-box attacks, as they are generally stronger than decision-based attacks and harder to defend [18]. Query-based black-box attacks typically optimize an adversarial loss using only the model’s outputs.

Adversarial Loss. To attack the black-box target classifier M(x)\mathcal{M}(\mathbf{x}), the following adversarial loss function has been widely used in score-based attacks [9, 18, 26]:

f(x):=M(x)i−M(x)j,(1)f(\mathbf{x}) := \mathcal{M}(\mathbf{x})_i-\mathcal{M}(\mathbf{x})_j, \tag*{(1)}

where ii and jj denote the indices of the largest and second-largest components of the probability vector M(x)\mathcal{M}(\mathbf{x}), respectively. Decreasing f(x)f(\mathbf{x}) encourages the top prediction (typically the correct label) to lose confidence relative to its strongest competitor. There are two common approaches for minimizing f(x)f(\mathbf{x}): gradient estimation (Zero-Order Optimization) and random search.

Gradient estimation (Zero-Order Optimization) The most prominent approach for generating adversarial examples is to update the input in the opposite direction of the gradient of the adversarial loss function with respect to the input, ∇xf(x)\nabla_{\mathbf{x}}f(\mathbf{x}), so as to decrease the adversarial loss. Since the attacker cannot directly access the model’s parameters or the gradient ∇xf(x)\nabla_{\mathbf{x}}f(\mathbf{x}), it instead estimates the gradient using only the model’s outputs. A gradient estimator that is widely used in score-based attacks [18, 24, 26] is given by

∇^xfμ(x):=1m∑i=1mf(x+μui)−f(x)μui,(2)\widehat{\nabla}_{\mathbf{x}}f_\mu(\mathbf{x}) := \frac{1}{m}\sum_{i=1}^{m}\frac{f(\mathbf{x}+\mu\mathbf{u}_i)-f(\mathbf{x})}{\mu}\mathbf{u}_i, \tag*{(2)}

where ui∼N(0,I)\mathbf{u}_i\sim\mathcal{N}(0,\mathbf{I}) and μ>0\mu>0 is a small smoothing parameter. In this setup, the adversary queries the model at points in a neighborhood around the input x\mathbf{x}. As a result, they effectively observe a Gaussian-smoothed version of the loss function, denoted by fμ(x)f_\mu(\mathbf{x}). The attacker then performs Projected Gradient Descent (PGD) steps based on ∇^xfμ(x)\widehat{\nabla}_{\mathbf{x}}f_\mu(\mathbf{x}) while respecting the input perturbation constraint:

xt+1=ΠR(xt−ηt∇^xfμ(xt)),(3)\mathbf{x}_{t+1}=\Pi_R\left(\mathbf{x}_t-\eta_t\widehat{\nabla}_{\mathbf{x}}f_\mu(\mathbf{x}_t)\right), \tag*{(3)}

where ηt\eta_t is step size at iteration t, and ΠR\Pi_R denotes projection onto the ℓp\ell_p-ball of radius RR, i.e., ∥x′−x∥p≤R\lVert\mathbf{x}'-\mathbf{x}\rVert_p\le R. Each step of PGD requires one query to the target model. Increasing the number of steps required for PGD to converge increases the query complexity of the attack.

Random-search. Random search is an iterative method for minimizing the adversarial loss function. Let μ>0\mu> 0 denote the step size (i.e., the perturbation magnitude used by the search rule). At iteration tt, given the current iterate xt\mathbf{x}_t, the attacker samples a search direction ut∼D\mathbf{u}_t \sim\mathcal{D} from a predefined distribution (e.g., Gaussian directions or structured perturbations), and evaluates the candidate xt+μut\mathbf{x}_t + \mu\mathbf{u}_t. If this perturbation decreases the adversarial loss f(⋅)f(\cdot) in (1), the attacker updates xt+1←xt+μut\mathbf{x}_{t+1} \leftarrow\mathbf{x}_t + \mu\mathbf{u}_t; otherwise, xt+1←xt\mathbf{x}_{t+1} \leftarrow\mathbf{x}_t. This type of random-search (hill-climbing) rule is commonly used in query-based black-box attacks [15, 3, 19]. Using the adversarial loss f(x)f(\mathbf{x}), the one-step improvement signal is defined as

ht:=f(xt+μut)−f(xt).(4)h_t := f(\mathbf{x}_t + \mu\mathbf{u}_t) - f(\mathbf{x}_t). \tag*{(4)}

If ht<0h_t < 0, then moving along ut\mathbf{u}_t decreases the loss and is therefore considered a useful attack direction. Accordingly, the accepted update is given by

xt+1=Πξ(xt+I(ht<0)⋅μut),(5)\mathbf{x}_{t+1} = \Pi_{\xi}\left(\mathbf{x}_t + \mathbb{I}(h_t < 0) \cdot\mu\mathbf{u}_t\right), \tag*{(5)}

where I(⋅)\mathbb{I}(\cdot) denotes the indicator function.

Gradient Confusion Defense (GCD)

In score-based black-box attacks, the adversary minimizes the loss f(x)f(\mathbf{x}) in (1) using only the model output y^∈ΔK\hat{\mathbf{y}} \in\Delta^K. Gradient Confusion Defense (GCD) disrupts this process by returning a modified output y~∈ΔK\tilde{\mathbf{y}} \in\Delta^K instead of y^\hat{\mathbf{y}}, increasing the number of queries needed to succeed (potentially exceeding the budget QQ). GCD constructs y~\tilde{\mathbf{y}} from M\mathcal{M} and y^\hat{\mathbf{y}} while preserving utility by keeping ∥y^−y~∥1\lVert\hat{\mathbf{y}} - \tilde{\mathbf{y}}\rVert_1 small and ensuring argmax⁡k(y^k)=argmax⁡k(y~k)\operatorname{argmax}_k(\hat{y}_k) = \operatorname{argmax}_k(\tilde{y}_k). For analysis, we introduce a hypothetical model M~\tilde{\mathcal{M}} with y~=M~(x)=σ(z~(x))\tilde{\mathbf{y}} = \tilde{\mathcal{M}}(\mathbf{x}) = \sigma(\tilde{\mathbf{z}}(\mathbf{x})), and drop the dependence on x\mathbf{x} in notation.

Since the adversary only sees the output of the defended target model by the gradient confusion method, their adversarial loss function transforms to:

f~(x):=M~(x)i−M~(x)j,(6)\tilde{f}(\mathbf{x}) := \tilde{\mathcal{M}}(\mathbf{x})_i - \tilde{\mathcal{M}}(\mathbf{x})_j, \tag*{(6)}

where ii and jj denote the indices of the largest and second-largest components of the probability vector M~(x)\tilde{\mathcal{M}}(\mathbf{x}), respectively. The gradient confusion solves the following minimization problem to compute y~\tilde{\mathbf{y}}:

arg min⁡y~ ⟨∇xf(x),∇xf~(x)⟩,s.t. ∥M(x)−M~(x)∥1≤ξandy~∈ΔK(7)\underset{\tilde{\mathbf{y}}}{\operatorname{arg\,min}}\ \langle\nabla_{\mathbf{x}}f(\mathbf{x}), \nabla_{\mathbf{x}}\tilde{f}(\mathbf{x})\rangle, \qquad\text{s.t.}\ \lVert\mathcal{M}(\mathbf{x})-\tilde{\mathcal{M}}(\mathbf{x})\rVert_1 \le\xi\quad\text{and} \quad\tilde{\mathbf{y}} \in\Delta^K \tag*{(7)}

where ξ\xi is the distortion budget. The GCD minimization problem addresses two objectives. (i) Confusion: Minimizing ⟨∇xf(x),∇xf~(x)⟩\langle\nabla_{\mathbf{x}}f(\mathbf{x}), \nabla_{\mathbf{x}}\tilde{f}(\mathbf{x})\rangle misaligns the adversary’s estimated gradient ∇xf~(x)\nabla_{\mathbf{x}}\tilde{f}(\mathbf{x}) from the true gradient ∇xf(x)\nabla_{\mathbf{x}}f(\mathbf{x}). This increases the query cost of gradient-estimation attacks and can mislead random-search attacks by flipping the sign of hth_t. Theorems 4.3 and 4.4 in § 4.1 provide theoretical support, and Section 5 validates GCD empirically. (ii) Utility: The constraint ∥M(x)−M~(x)∥1≤ξ\lVert\mathcal{M}(\mathbf{x})-\tilde{\mathcal{M}}(\mathbf{x})\rVert_1 \le\xi (equivalently ∥y^−y~∥1≤ξ\lVert\hat{\mathbf{y}}-\tilde{\mathbf{y}}\rVert_1 \le\xi) keeps y~=M~(x)\tilde{\mathbf{y}} = \tilde{\mathcal{M}}(\mathbf{x}) close to y^=M(x)\hat{\mathbf{y}} = \mathcal{M}(\mathbf{x}), preserving predictive performance. Section 4.2 details how we solve (7).

Theoretical Analysis

In this section, we theoretically show that solving the optimization problem in (7) increases the model’s resistance to score-based black-box attacks. To incorporate the crafted loss function f~\tilde{f}, we define a randomized defended objective:

fdef(x):=λf(x)+(1−λ)f~(x),λ∼Bernoulli⁡(p),(8)f_{\mathrm{def}}(\mathbf{x}) := \lambda f(\mathbf{x}) + (1-\lambda)\tilde{f}(\mathbf{x}), \qquad\lambda\sim\operatorname{Bernoulli}(p), \tag*{(8)}

where λ\lambda is drawn independently for each query. This theoretical model allows us to formalize the effect of f~\tilde{f} on the optimization problem faced by the adversary.

Under mild assumptions, we show that using fdeff_{\mathrm{def}} increases the number of steps required by gradient-estimation-based attacks and misleads search-based attacks. Consequently, it confuses the adversary and increases the number of queries required to craft an adversarial input. Moreover, we argue that setting p→0p \to0 maximizes this confusion effect.

Assumption 4.1. The loss functions ff and f~\tilde{f} are Lipschitz continuous with constants L0(f)L_0(f) and L0(f~)L_0(\tilde{f}), respectively.

Assumption 4.2. The loss functions ff and f~\tilde{f} are smooth, meaning their gradients are Lipschitz continuous with constants L1(f)L_1(f) and L1(f~)L_1(\tilde{f}), respectively.

Gradient Estimation-Based Attacks

Gradient estimation-based attacks approximate gradients using function evaluations (e.g., (2)) and update the input via projected gradient descent (e.g., (3)). Thus, the adversary applies (projected) gradient descent to minimize the adversarial loss. The number of queries performed by the adversary is denoted by TT, which corresponds to the number of optimization steps. In theory, the adversary is considered to have succeeded in optimizing the adversarial loss function if the norm of its gradient is sufficiently small at the final iterate. Thus, to analyze the adversary’s optimization procedure, we need to bound the gradient norm. In our framework, using (8), the gradient estimator is driven by fdeff_{\mathrm{def}} rather than ff.

Theorem 4.3. Suppose Assumption 4.1 holds. Consider zero-order optimization using the gradient estimator driven by fdeff_{\mathrm{def}}, with smoothing parameter μ≤μ∗\mu\le\mu^{*}, for TT iterations and constant step size ηt=η∗\eta_t = \eta^{*}. If, for all x∈Rd\mathbf{x} \in\mathbb{R}^{d}, it holds that ∣f(x)−f~(x)∣≤ϵ|f(\mathbf{x})-\tilde{f}(\mathbf{x})| \le\epsilon, where ϵ>0\epsilon> 0 is a small constant, then the following bound holds:

pT∑t=0T−1E[∥∇fμ(xt)∥2]+1−pT∑t=0T−1E[⟨∇fμ(xt),∇f~μ(xt)⟩]≤4d3L0(f)5Rϵ′T(p+(1−p)L0(f~)2L0(f)2+2p(1−p)ϵ2ϵ′2).(9)\frac{p}{T}\sum_{t=0}^{T-1}\mathbb{E}\left[\left\lVert\nabla f_{\mu}(\mathbf{x}_{t})\right\rVert^{2}\right]+\frac{1-p}{T}\sum_{t=0}^{T-1}\mathbb{E}\left[\left\langle\nabla f_{\mu}(\mathbf{x}_{t}),\nabla\tilde{f}_{\mu}(\mathbf{x}_{t})\right\rangle\right] \le\sqrt{\frac{4d^{3}L_{0}(f)^{5}R}{\epsilon'T}\left(p+(1-p)\frac{L_{0}(\tilde{f})^{2}}{L_{0}(f)^{2}}+2p(1-p)\frac{\epsilon^{2}}{\epsilon'^{2}}\right)}. \tag*{(9)}

Here, RR denotes the perturbation budget, ϵ′>0\epsilon' > 0 is a small constant ensuring that fμf_{\mu} is close to ff, and the expectation is taken over the randomness of the optimization process up to iteration tt.

The detailed proof of Theorem 4.3 is provided in Appendix B. This theorem shows that incorporating the function f~\tilde{f} into the optimization process can effectively perturb the optimization landscape and mislead the gradient estimates. In particular, by optimizing the confusion term ⟨∇fμ(xt),∇f~μ(xt)⟩\langle\nabla f_{\mu}(\mathbf{x}_{t}),\nabla\tilde{f}_{\mu}(\mathbf{x}_{t})\rangle, we can increase the overall bound and thereby improve robustness against gradient estimation attacks.

Implications of Theorem 4.3. Let

C(p)=4d3L0(f)5Rϵ′(p+(1−p)L0(f~)2L0(f)2+2p(1−p)ϵ2ϵ′2),C(p)=\sqrt{\frac{4d^{3}L_{0}(f)^{5}R}{\epsilon'}\left(p+(1-p)\frac{L_{0}(\tilde{f})^{2}}{L_{0}(f)^{2}}+2p(1-p)\frac{\epsilon^{2}}{\epsilon'^{2}}\right)},

be a constant depending on pp and C(0)≠0C(0)\ne0. Rearranging the bound in (9) as:

1T∑t=0T−1E[∥∇fμ(xt)∥2]≤C(p)pT−1−pp1T∑t=0T−1E[⟨∇fμ(xt),∇f~μ(xt)⟩].(10)\frac{1}{T}\sum_{t=0}^{T-1}\mathbb{E}\left[\left\lVert\nabla f_{\mu}(\mathbf{x}_{t})\right\rVert^{2}\right]\le\frac{C(p)}{p\sqrt{T}}-\frac{1-p}{p}\frac{1}{T}\sum_{t=0}^{T-1}\mathbb{E}\left[\left\langle\nabla f_{\mu}(\mathbf{x}_{t}),\nabla\tilde{f}_{\mu}(\mathbf{x}_{t})\right\rangle\right]. \tag*{(10)}

For adversary to succeed in optimization, they need to minimize the right hand side of the inequality below a certain threshold by increasing TT which is the number of optimization steps. Thus the defender can increase the second term in the right hand side by optimizing the confusion term ⟨∇fμ(xt),∇f~μ(xt)⟩\langle\nabla f_{\mu}(\mathbf{x}_{t}),\nabla\tilde{f}_{\mu}(\mathbf{x}_{t})\rangle to be negative and large in magnitude. In other words, the defender needs to make the gradients of the two functions to be misaligned. This would force the attacker to use a larger number of optimization steps (queries) TT to achieve the desired threshold, thus increasing the attack cost.

Choosing $p \to 0. We can further increase the bound in (10) by choosing pp close to 0. When p→0p \to0, the factor (1−p)/p(1-p)/p amplifies the contribution of the confusion term. Therefore, if the defender enforces ⟨∇fμ(xt),∇f~μ(xt)⟩\langle\nabla f_{\mu}(\mathbf{x}_{t}),\nabla\tilde{f}_{\mu}(\mathbf{x}_{t})\rangle to be negative and large in magnitude, the right-hand side of (10) can become arbitrarily large, effectively preventing the attacker from driving the average gradient norm below a fixed threshold within a limited number of iterations. This motivates choosing p=0p=0, i.e., relying entirely on f~\tilde{f} in the optimization process.

Search-Based Attacks

Random-search score-based attacks propose a direction ut\mathbf{u}_{t} and accept or reject it based on the sign of the one-step improvement signal (cf. (4) and (5)). Under our switching defense, each query is answered using the randomized objective fdeff_{\mathrm{def}}, which independently returns either ff or f~\tilde{f}; thus the two evaluations used to form the improvement from xt\mathbf{x}_{t} to xt+μut\mathbf{x}_{t}+\mu\mathbf{u}_{t} may come from different objectives. Let hdef,th_{\mathrm{def},t} denote the improvement signal computed from the defender’s returned values. Because hdef,th_{\mathrm{def},t} can mix ff and f~\tilde{f} across the two points, sign⁡(hdef,t)\operatorname{sign}(h_{\mathrm{def},t}) can disagree with sign⁡(ht)\operatorname{sign}(h_t), causing the attacker to accept harmful steps or reject helpful ones. The next result lower bounds the probability of such one-step sign errors via (i) a geometric term depending on the angle between ∇f(x)\nabla f(\mathbf{x}) and ∇f~(x)\nabla\tilde{f}(\mathbf{x}), and (ii) a smoothness correction scaling with μ\mu (vanishing as μ→0\mu\to0 under Assumption 4.2).

Theorem 4.4. Let Assumption 4.2 hold. Let d≥2d \ge2 and u∼N(0,I)\mathbf{u} \sim\mathcal{N}(\mathbf{0},\mathbf{I}). Fix x∈Rd\mathbf{x} \in\mathbb{R}^{d} and μ>0\mu> 0. Define the true and defended one-step signals

h:=f(x+μu)−f(x),hdef:=fdef(x+μu)−fdef(x).h := f(\mathbf{x}+\mu\mathbf{u})-f(\mathbf{x}), \qquad h_{\mathrm{def}} := f_{\mathrm{def}}(\mathbf{x}+\mu\mathbf{u})-f_{\mathrm{def}}(\mathbf{x}).

Then

P(sign⁡(h)≠sign⁡(hdef))≥(1−p)2[1πarccos⁡(⟨∇f(x),∇f~(x)⟩∥∇f(x)∥∥∇f~(x)∥)−μd2π(L1(f)∥∇f(x)∥+L1(f~)∥∇f~(x)∥)](11)\mathbb{P}\left(\operatorname{sign}(h) \ne\operatorname{sign}(h_{\mathrm{def}})\right) \ge (1-p)^2\left[\frac{1}{\pi}\arccos\left(\frac{\langle\nabla f(\mathbf{x}),\nabla\tilde{f}(\mathbf{x})\rangle}{\|\nabla f(\mathbf{x})\|\|\nabla\tilde{f}(\mathbf{x})\|}\right)-\frac{\mu d}{\sqrt{2\pi}}\left(\frac{L_1(f)}{\|\nabla f(\mathbf{x})\|}+\frac{L_1(\tilde{f})}{\|\nabla\tilde{f}(\mathbf{x})\|}\right)\right] \tag*{(11)}

The proof of Theorem 4.4 is deferred to Appendix C. The event sign⁡(h)≠sign⁡(hdef)\operatorname{sign}(h) \ne\operatorname{sign}(h_{\mathrm{def}}) is exactly a one-step decision error: relative to the true objective ff, the attacker either rejects a truly improving direction or accepts a non-improving direction. Theorem 4.4 shows that this error probability is lower bounded by a misalignment term, proportional to the angle between ∇f(x)\nabla f(\mathbf{x}) and ∇f~(x)\nabla\tilde{f}(\mathbf{x}), up to a smoothness correction that decreases with the step size μ\mu. Consequently, designing f~\tilde{f} so that ∇f~(x)\nabla\tilde{f}(\mathbf{x}) is strongly misaligned with ∇f(x)\nabla f(\mathbf{x}) forces random search to waste queries, degrading progress under a fixed budget. A discussion of the Gaussian direction model (and its relationship to isotropic samplers used in practice) is provided in Appendix C.3.

Conclusion. In summary, this subsection provides theoretical support that GCD increases the query cost of score-based black-box attacks. Theorem 4.3 shows that inducing a negative confusion term slows gradient-estimation-based optimization, while Theorem 4.4 shows that gradient misalignment causes accept/reject errors in search-based attacks. Together, these results justify designing f~\tilde{f} to remain close to ff in value while being misaligned in gradient.

Solving the GCD Minimization Problem

GCD is a test-time output wrapper defense. It leaves the underlying target classifier unchanged, but modifies the probability vector returned to users. Concretely, for an input x\mathbf{x}, the target model produces logits z(x)∈RK\mathbf{z}(\mathbf{x}) \in\mathbb{R}^{K} and probability vector y^=σ(z(x))∈ΔK\hat{\mathbf{y}}=\sigma(\mathbf{z}(\mathbf{x})) \in\Delta^{K}. We suppose that GCD returns a perturbed distribution y~=σ(z~(x))∈ΔK\tilde{\mathbf{y}}=\sigma(\tilde{\mathbf{z}}(\mathbf{x})) \in\Delta^{K}. We first focus on minimizing ⟨∇xf(x),∇xf~(x)⟩\langle\nabla_{\mathbf{x}}f(\mathbf{x}),\nabla_{\mathbf{x}}\tilde{f}(\mathbf{x})\rangle, and then incorporate the constraints ∥M(x)−M~(x)∥1≤ξ\|\mathcal{M}(\mathbf{x})-\tilde{\mathcal{M}}(\mathbf{x})\|_{1}\le\xi and y~∈ΔK\tilde{\mathbf{y}}\in\Delta^{K}.

Based on the chain rule, we can write the inner product as follows:

arg⁡min⁡y~ ⟨∇xf(x),∇xf~(x)⟩=arg⁡min⁡y~ ⟨∇xz(x)∇zf(z(x)),∇xz~(x)∇z~f~(z~(x))⟩.(12)\underset{\tilde{\mathbf{y}}}{\arg\min}\ \left\langle\nabla_{\mathbf{x}}f(\mathbf{x}),\nabla_{\mathbf{x}}\tilde{f}(\mathbf{x})\right\rangle = \underset{\tilde{\mathbf{y}}}{\arg\min}\ \left\langle\nabla_{\mathbf{x}}\mathbf{z}(\mathbf{x})\nabla_{\mathbf{z}}f(\mathbf{z}(\mathbf{x})),\nabla_{\mathbf{x}}\tilde{\mathbf{z}}(\mathbf{x})\nabla_{\tilde{\mathbf{z}}}\tilde{f}(\tilde{\mathbf{z}}(\mathbf{x}))\right\rangle. \tag*{(12)}

Solving (12) exactly is difficult because y~=σ(z~(x))\tilde{\mathbf{y}}=\sigma(\tilde{\mathbf{z}}(\mathbf{x})) appears inside the objective through f~\tilde{f} and ∇x~f~\nabla_{\tilde{\mathbf{x}}}\tilde{f}, so the optimal z~\tilde{\mathbf{z}} determines the gradient terms needed to optimize for z~\tilde{\mathbf{z}} (a circular chicken-and-egg dependency). Therefore, due to the constraint ∥M(x)−M~(x)∥1≤ξ\|\mathcal{M}(\mathbf{x})-\tilde{\mathcal{M}}(\mathbf{x})\|_{1}\le\xi, we use a local approximation of z~(x)\tilde{\mathbf{z}}(\mathbf{x}) by z(x)\mathbf{z}(\mathbf{x}) (i.e., z(x)≈z~(x)\mathbf{z}(\mathbf{x})\approx\tilde{\mathbf{z}}(\mathbf{x})), which yields ∇xz(x)≈∇xz~(x)\nabla_{\mathbf{x}}\mathbf{z}(\mathbf{x})\approx\nabla_{\mathbf{x}}\tilde{\mathbf{z}}(\mathbf{x}). Let J(x)=∇xz(x)\mathbf{J}(\mathbf{x})=\nabla_{\mathbf{x}}\mathbf{z}(\mathbf{x}), our objective will approximately become:

arg⁡min⁡y~ ⟨∇xf(x),∇xf~(x)⟩≈arg⁡min⁡y~ ⟨J(x)∇zf(z(x)),J(x)∇z~f~(z~(x))⟩.(13)\underset{\tilde{\mathbf{y}}}{\arg\min}\ \left\langle\nabla_{\mathbf{x}}f(\mathbf{x}),\nabla_{\mathbf{x}}\tilde{f}(\mathbf{x})\right\rangle \approx\underset{\tilde{\mathbf{y}}}{\arg\min}\ \left\langle\mathbf{J}(\mathbf{x})\nabla_{\mathbf{z}}f(\mathbf{z}(\mathbf{x})),\mathbf{J}(\mathbf{x})\nabla_{\tilde{\mathbf{z}}}\tilde{f}(\tilde{\mathbf{z}}(\mathbf{x}))\right\rangle. \tag*{(13)}

Our experiments show this surrogate delivers consistent improvements against query-based black-box attacks. The only derivative that is a function of y~\tilde{\mathbf{y}} is ∇z~f~(z~(x))\nabla_{\tilde{\mathbf{z}}}\tilde{f}(\tilde{\mathbf{z}}(\mathbf{x})). Let z~k(x)\tilde{z}_{k}(\mathbf{x}) denote the kk-th component of the perturbed logits vector z~(x)\tilde{\mathbf{z}}(\mathbf{x}). For the kk-th component of ∇z~f~(z~(x))\nabla_{\tilde{\mathbf{z}}}\tilde{f}(\tilde{\mathbf{z}}(\mathbf{x})), we have

∂f~(z~(x))∂z~k(x)={y~i(1−y~i)−(−y~jy~i),if k=i,−y~iy~j−y~j(1−y~j),if k=j,−y~iy~k−(−y~jy~k),if k≠i,k≠j.(14)\frac{\partial\tilde{f}(\tilde{\mathbf{z}}(\mathbf{x}))}{\partial\tilde{z}_{k}(\mathbf{x})} = \begin{cases} \tilde{y}_{i}(1-\tilde{y}_{i})-(-\tilde{y}_{j}\tilde{y}_{i}), & \text{if } k=i,\\ -\tilde{y}_{i}\tilde{y}_{j}-\tilde{y}_{j}(1-\tilde{y}_{j}), & \text{if } k=j,\\ -\tilde{y}_{i}\tilde{y}_{k}-(-\tilde{y}_{j}\tilde{y}_{k}), & \text{if } k\ne i,k\ne j. \end{cases} \tag*{(14)}

where i=arg⁡max⁡ky~ki = \arg\max_k \tilde{y}_k (index of predicted class after defense), and j=arg⁡max⁡k≠iy~kj = \arg\max_{k\ne i} \tilde{y}_k (index of runner-up class after defense). Since we do not know the index of the predicted class and the runner-up class of y~\tilde{\mathbf{y}} before minimization, we use the index of the predicted class and the runner-up class of y^\hat{\mathbf{y}} to construct ∇zf~(z(x))\nabla_{\mathbf{z}}\tilde{f}(\mathbf{z}(\mathbf{x})). Hence, i=arg⁡max⁡ky^ki = \arg\max_k \hat{y}_k and j=arg⁡max⁡k≠iy^kj = \arg\max_{k\ne i} \hat{y}_k.

The optimal solution for the minimization problem (13) with respect to ∇z∗f~(z(x))\nabla_{\mathbf{z}}^*\tilde{f}(\mathbf{z}(\mathbf{x})) is as follows:

∇z∗f~(z(x))=−αJ(x)⊤J(x)∇zf(z(x)).(15)\nabla_{\mathbf{z}}^*\tilde{f}(\mathbf{z}(\mathbf{x})) = -\alpha J(\mathbf{x})^\top J(\mathbf{x}) \nabla_{\mathbf{z}}f(\mathbf{z}(\mathbf{x})). \tag*{(15)}

where α→∞\alpha\to\infty. In our experiments, we found that the norm of ∇z∗f~(z(x))\nabla_{\mathbf{z}}^*\tilde{f}(\mathbf{z}(\mathbf{x})) is not important for the success of GCD. Thus, we choose α=1\alpha= 1. Since we have J(x)J(\mathbf{x}) and ∇zf(z(x))\nabla_{\mathbf{z}}f(\mathbf{z}(\mathbf{x})), we can compute ∇z∗f~(z(x))\nabla_{\mathbf{z}}^*\tilde{f}(\mathbf{z}(\mathbf{x})). Because the equation ∇zf~(z(x))=∇z∗f~(z(x))\nabla_{\mathbf{z}}\tilde{f}(\mathbf{z}(\mathbf{x})) = \nabla_{\mathbf{z}}^*\tilde{f}(\mathbf{z}(\mathbf{x})) with respect to y~\tilde{\mathbf{y}} is a nonlinear system, we cannot solve it directly to obtain y~=M~(x)\tilde{\mathbf{y}} = \tilde{\mathcal{M}}(\mathbf{x}). Moreover, the constraints ∥M(x)−M~(x)∥1≤ξ\lVert\mathcal{M}(\mathbf{x})-\tilde{\mathcal{M}}(\mathbf{x})\rVert_1 \le\xi and y~∈ΔK\tilde{\mathbf{y}} \in\Delta^K must also be considered.

To find y~\tilde{\mathbf{y}}, GCD employs a solution that (i) returns a valid probability vector y~∈ΔK\tilde{\mathbf{y}} \in\Delta^K, (ii) keeps y~=M~(x)\tilde{\mathbf{y}} = \tilde{\mathcal{M}}(\mathbf{x}) close to y^=M(x)\hat{\mathbf{y}} = \mathcal{M}(\mathbf{x}) to satisfy the utility constraint, and (iii) preserves the predicted label of the target model (arg⁡max⁡ky^k=arg⁡max⁡ky~k\arg\max_k \hat{y}_k = \arg\max_k \tilde{y}_k). GCD solves the following minimization problem to obtain y~\tilde{\mathbf{y}}:

arg⁡min⁡y~−⟨∇zf~(z(x)),∇z∗f~(z(x))⟩s.t.∥M(x)−M~(x)∥1≤ξ.(16)\begin{aligned} \arg\min_{\tilde{\mathbf{y}}}\quad&-\langle\nabla_{\mathbf{z}}\tilde{f}(\mathbf{z}(\mathbf{x})), \nabla_{\mathbf{z}}^*\tilde{f}(\mathbf{z}(\mathbf{x}))\rangle\\ \text{s.t.}\quad&\lVert\mathcal{M}(\mathbf{x})-\tilde{\mathcal{M}}(\mathbf{x})\rVert_1 \le\xi. \tag*{(16)} \end{aligned}

The inner product in (16) encourages ∇zf~(z(x))\nabla_{\mathbf{z}}\tilde{f}(\mathbf{z}(\mathbf{x})) to align with ∇z∗f~(z(x))\nabla_{\mathbf{z}}^*\tilde{f}(\mathbf{z}(\mathbf{x})) as much as possible, subject to the constraint ∥M(x)−M~(x)∥1≤ξ\lVert\mathcal{M}(\mathbf{x})-\tilde{\mathcal{M}}(\mathbf{x})\rVert_1 \le\xi. After solving the minimization problem in (16), the resulting y~\tilde{\mathbf{y}} is normalized by dividing by its sum to ensure that y~∈ΔK\tilde{\mathbf{y}} \in\Delta^K. GCD solves the minimization problem in (16) using a trust-region interior-point method [12], as implemented in the scipy package [35]. In rare cases, the index of the largest component of the resulting y~\tilde{\mathbf{y}} differs from that of y^\hat{\mathbf{y}}, which reduces the accuracy of the target model. To address this issue, GCD manually adjusts y~\tilde{\mathbf{y}}. Let i=arg⁡max⁡ky^ki = \arg\max_k \hat{y}_k and j=arg⁡max⁡ky~kj = \arg\max_k \tilde{y}_k. If i≠ji \ne j, GCD adds y~j−y~i\tilde{y}_j-\tilde{y}_i to y~i\tilde{y}_i and subtracts it from y~j\tilde{y}_j. This guarantees that arg⁡max⁡ky^k=arg⁡max⁡ky~k\arg\max_k \hat{y}_k = \arg\max_k \tilde{y}_k, thereby preserving the accuracy of the target model.

Experiments

Experimental Setup

Datasets and Models. We evaluate our proposed method, Gradient Confusion Defense across two standard benchmark datasets: CIFAR-10 and ImageNet. To ensure comprehensive assessment, we test on multiple model architectures. For CIFAR-10, we utilize pretrained ResNet-18 models. For ImageNet, we employ Torchvision pretrained ResNet-50 and Vision Transformer (ViT-B/16). All evaluations are performed on N=1000N = 1000 randomly sampled test images per dataset, ensuring statistical significance while maintaining computational efficiency.

Baseline Defenses. We compare GCD against five established defense methods implemented in our experimental framework: input Random Noise Defense (iRND) [26] applies Gaussian noise with σ=0.01\sigma= 0.01 to input images. Boundary Defense (oRND) [1] adds Gaussian noise with σ=1.0\sigma= 1.0 to output logits. Randomized Feature Defense (RFD) [17] injects noise into intermediate features. Random Logit Scaling (RLS) [13] multiplies logits by a uniformly sampled scale in [0.5,10][0.5, 10]. For Adaptive Attack on Attackers (AAA), we implement AAA-sine [10] with temperature 1, deviation 0.5, attractor interval 4, calibration weight 5, learning rate 0.1, and 100 inner iterations. We only test AAA-sine, following Chen et al. [10] which showed AAA-linear is vulnerable to adaptive attacks.

All hyperparameters were selected based on established literature or thorough validation to ensure a fair comparison. Our defense replaces the model output with the optimized probability vector obtained from (16), using an output distortion budget of ξ=0.5\xi= 0.5. Since the dimension of y~\tilde{\mathbf{y}} is large for ImageNet and the trust-region interior-point method is a second-order optimizer, minimizing (16) incurs a moderate computational cost. Therefore, for ImageNet we select a subset S\mathcal{S} of 20 indices of y~\tilde{\mathbf{y}} and optimize (16) only over these components, while fixing the remaining components of y~\tilde{\mathbf{y}} to their corresponding values in y^\hat{\mathbf{y}}. To construct S\mathcal{S}, we use ∇z∗f~(z(x))\nabla_{\mathbf{z}}^*\tilde{f}(\mathbf{z}(\mathbf{x})) and select the top-10 and bottom-10 components, which we found to have the largest effect on the objective in (16). As a result, for ImageNet the optimized y~\tilde{\mathbf{y}} differs from y^\hat{\mathbf{y}} in only 20 components (before normalization).

Attacks Configuration. We evaluate defenses against four state-of-the-art score-based black-box attacks in untargeted settings: BanditAttack [19] (ℓ2\ell_2 and ℓ∞\ell_\infty variants), BrusleAttack (Vo et al., 2024) (ℓ0\ell_0 variant),

ModelDefenseAcc. DropBandit-ℓ2\ell_2Bandit-ℓ∞\ell_\inftySquare-ℓ2\ell_2Square-ℓ∞\ell_\inftySign-ℓ∞\ell_\inftyBrusle-ℓ0\ell_0
ResNet-18None-82.68% / 545.6898.03% / 186.1687.76% / 466.2999.38% / 112.4698.97% / 230.0579.78% / 234.82
iRND1%11.63% / 333.9741.47% / 186.4924.92% / 290.2180.52% / 178.9666.49% / 233.4882.9% / 220.76
oRND0.6%12.53% / 354.4347.70% / 158.4320.98% / 188.3164.09% / 113.9238.83% / 170.0568.6% / 201.10
RLS0%04.15% / 345.925.11% / 23.9612.76% / 268.6947.31% / 90.8821.06% / 111.4151.77% / 316.57
AAA0.1%03.33% / 31838.08% / 132.269.77% / 174.9143.41% / 82.0432.09% / 177.1066.78% / 290.17
GCD0%0.94% / 131.6628.12% / 99.374.15% / 20.9530.71% / 11.1014.53% / 72.1438.59% / 269.82

Table 1. Black-box attack results on CIFAR-10. ASR and average number of queries are reported.

ModelDefenseAcc. DropBandit-ℓ2\ell_2Bandit-ℓ∞\ell_\inftySquare-ℓ2\ell_2Square-ℓ∞\ell_\inftySign-ℓ∞\ell_\infty
ResNet-50None-46.73% / 761.2287.05% / 251.7981.45% / 483.6599.47% / 133.9091.33% / 328.71
iRND0.2%11.02% / 440.3045.56% / 141.7926.66% / 214.1783.49% / 126.1060.78% / 229.78
oRND1.7%51.47% / 229.9475.95% / 103.8359.84% / 208.4983.52% / 96.9169.47% / 182.20
RLS0%6.68% / 618.4247.80% / 143.7216.29% / 143.0359.82% / 104.0721.37% / 109.13
AAA0.3%11.80% / 356.9637.94% / 85.1015.69% / 32.0547.06% / 33.5923.6% / 109.37
GCD0%3.34% / 528.635.65% / 103.2913.22% / 64.0547.94% / 32.1720.17% / 90.15
ViT-B/16None-38.17% / 801.4176.46% / 319.7570.64% / 566.6597.90% / 351.1580.05% / 597.98
iRND0.2%7.78% / 471.2425.13% / 169.1921.77% / 287.4861.70% / 252.0238% / 255.65
oRND1.8%46.71% / 266.7369.17% / 191.0758.88% / 291.5697.32% / 84.3981.44% / 313.67
RLS0%4.47% / 589.528.51% / 224.6310.29% / 148.4230.36% / 144.3113.39% / 184.20
AAA0%8.17% / 300.1322.28% / 102.8610.9% / 43.7226.74% / 92.4615.1% / 236.60
GCD0%3.35% / 60921.94% / 140.0312.38% / 455.7433.83% / 257.2121.44% / 315.70

Table 2. Black-box attack results on ImageNet. ASR and average number of queries are reported.

SignAttack [2] (ℓ∞\ell_\infty variant), and SquareAttack [3] (ℓ2\ell_2 and ℓ∞\ell_\infty variants). For CIFAR-10, inputs are scaled to [0, 255] with ℓ∞\ell_\infty budget ϵ=12.75\epsilon= 12.75 (0.05 normalized) and ℓ2\ell_2 budget ϵ=255\epsilon= 255 (1.0 normalized). For ImageNet, inputs are in [0, 1] with ℓ∞\ell_\infty budget ϵ=0.05\epsilon= 0.05, and ℓ2\ell_2 budgets follow the original implementations (Bandit: ϵ=1275\epsilon= 1275, Square: ϵ=5\epsilon= 5). All attacks are constrained by a maximum query budget of Q=1000Q = 1000 queries per sample.

Metrics. We report three metrics for each (dataset, model, defense, attack) configuration: Attack Success Rate, the fraction of samples successfully attacked within the query budget; Average Queries, the mean queries per successful attack; and Clean Accuracy Drop for each defended model. Together, they capture robustness and utility, enabling evaluation of the defense–utility trade-off.

Results and Analysis

Overall Performance. Tables 1 and 2 summarize results on CIFAR-10 (ResNet-18) and ImageNet (ResNet-50, ViT-B/16). Across settings, GCD achieves a strong robustness–utility trade-off, preserving clean accuracy while reducing attack success rates. On CIFAR-10, GCD lowers Square-ℓ2\ell_2 ASR from 87.76% (undefended) to 4.15%, and Sign-ℓ∞\ell_\infty from 98.97% to 14.53%. This effectiveness transfers to ImageNet: for ResNet-50, GCD incurs no clean accuracy drop while maintaining strong robustness. Results on ViT-B/16 further confirm robustness; for example, Square-ℓ∞\ell_\infty ASR decreases from 97.90% to 33.83%.

Comparison with Other Defenses. Tables 1 and 2 also show that on non-transformer models, GCD outperforms nearly all baselines. While randomized defenses (iRND, oRND, RLS) can reduce attack success, they often incur accuracy drops or weaker protection; iRND and oRND trade accuracy for limited robustness. AAA and RLS preserve accuracy and can be competitive, but are more vulnerable to adaptive attacks (Section 5.3). Table 3 reports ℓ1\ell_1 deviations over 1000 ImageNet samples: GCD exhibits a larger shift, consistent with shaping scores to misalign the induced adversarial loss gradient rather than merely injecting noise.

DefenseMin ℓ1\ell_1Avg ℓ1\ell_1Max ℓ1\ell_1
iRND0.000.111.03
oRND0.000.261.77
RLS0.000.331.74
AAA0.000.281.60
GCD0.070.581.25

Table 3. ℓ1\ell_1 distance between the original output of the model y^\hat{y} and defense output y~\tilde{y} for 1000 ImageNet samples.

Gradient Misalignment Evidence. Figure 1 shows θ=∠(∇xf(x),∇xf~(x))\theta= \angle(\nabla_{\mathbf{x}}f(\mathbf{x}), \nabla_{\mathbf{x}}\tilde{f}(\mathbf{x})), the deviation between the true loss gradient ∇xf(x)\nabla_{\mathbf{x}}f(\mathbf{x}) and the gradient ∇xf~(x)\nabla_{\mathbf{x}}\tilde{f}(\mathbf{x}) implied by the defended score responses (i.e., the direction the attacker follows). GCD induces a systematic bias in this recovered direction, increasing the query cost of score-based attacks. In particular, GCD yields large deviations across queries (e.g., 24.5°–84.4°, many near ∼50∘\sim50^\circ), whereas AAA concentrates at θ≈0∘\theta\approx0^\circ (nearly revealing the true direction). RLS shows mixed behavior, including near-zero angles that still provide a reliable descent direction and angles near 90°. We hypothesize this occurs because the RLS transform maps some target-model output probability vectors to one-hot vectors, making ∇xf~(x)≈0\nabla_{\mathbf{x}}\tilde{f}(\mathbf{x}) \approx0. As a result, GCD’s persistent misalignment compounds over iterations, increasing query complexity and reducing attack success, while defenses that often yield θ≈0∘\theta\approx0^\circ preserve a low-query path. These observations support our theoretical analysis.

Figure 1. Polar histograms of gradient direction misalignment. For 10 randomly selected samples from the ImageNet test set, we plot the angular deviation θ=∠(∇xf(x),∇xf~(x))\theta= \angle(\nabla_{\mathbf{x}}f(\mathbf{x}), \nabla_{\mathbf{x}}\tilde{f}(\mathbf{x})) between the direction ∇xf~(x)\nabla_{\mathbf{x}}\tilde{f}(\mathbf{x}) induced by the defended score responses (i.e., the direction the attacker would follow) and the true loss gradient ∇xf(x)\nabla_{\mathbf{x}}f(\mathbf{x}). Each color corresponds to 200 square-ℓ∞\ell_\infty attack iterations (200 queries used to generate adversarial example for a sample). Dashed rays and numeric labels indicate the mean deviation for each sample.

Figure 2 demonstrates trajectory-level analysis for 10 random CIFAR-10 samples over 100 Square Attack iterations: for each query iteration tt along the attack trajectory, we measure the angle θt\theta_t between the direction exposed under the defense and the corresponding undefended direction. This is the operational quantity that matters to an iterative score-based attacker. Based on these results, AAA does exhibit occasional local reversals, but they are not persistent: after a brief transient, its mean angle quickly settles to a small range (about 8°–10° in our trace plot), and many sample traces remain near low angles. In contrast, GCD maintains substantially larger misalignment throughout the trajectory, with the mean staying around 25°–28°, and many samples remaining in the 30°–45° range over tens of queries. So the practical difference is not whether a defense can reverse a local slope at isolated points, but whether it sustains input-space misalignment along the whole optimization path. GCD does; AAA usually does not. This also explains the mechanism. AAA heuristically flips local slopes in output space, but it does not optimize the induced input-space direction after composition with the model Jacobian. GCD is Jacobian-aware: Eqs. (7), (15), and (16) explicitly optimize the exposed direction in input space. That is precisely the quantity that matters for score-based attacks. This interpretation is also consistent with our theory: Theorem 4.4 shows that larger angular misalignment increases the probability of accept/reject errors in search-based attacks, and when that larger angle is maintained across many iterations, those errors compound over the trajectory.

Figure 2. Angular deviation between defense-exposed and undefended gradient directions over 100 Square Attack iterations on 10 CIFAR-10 samples.

Adaptive Attack Evaluation

To assess defense resilience against adaptive adversaries, we evaluate GCD alongside AAA and RLS against two adaptive attacks: Expectation over Transformation (EOT) [5] and PendulumAttack [13]. For sample x\mathbf{x}, EOT counteracts random-based defenses by averaging over kk independently randomized defense outputs (1k∑i=0kM~(i))\left(\frac{1}{k}\sum_{i=0}^{k}\widetilde{\mathcal{M}}^{(i)}\right) to obtain an unbiased estimation of the y^=M(x)\hat{\mathbf{y}} = \mathcal{M}(\mathbf{x}). PendulumAttack employs iterative estimation and exploitation of defense patterns.

Table 4 reveals that GCD maintains performance even under adaptive settings. The primary result is reported in the Max column, which corresponds to a worst-case adaptive threat model in which the attacker uses the more successful of the two evaluated adaptive variants. Under this setting, GCD exhibits stronger robustness than both AAA and RLS.

DefenseEOTPen-SquareMax(EOT,Pen)
AAA21.94% / 85.4440.53% / 306.0840.53%
RLS36.19% / 215.8323.55% / 85.4436.19%
GCD24.04% / 159.6930.12% / 209.3330.12%

Table 4. Adaptive Attacks on GCD, RLS, and AAA. We incorporate two adaptive techniques—Expectation over Transformation (EOT) and Pendulum—into the Square Attack framework. For both adaptive variants, we set k=10k = 10 and evaluate performance on 1000 ImageNet samples using ViT-B/16.

Figure 2 provides a mechanism-level interpretation of this result. GCD introduces a deterministic bias into the exposed objective, whereas randomization-based defenses primarily introduce variance and AAA primarily creates local slope perturbations. Adaptive averaging is designed to reduce variance; it does not remove a deterministic directional bias. For a deterministic defense, the relevant question is therefore whether the exposed direction remains persistently displaced along the attack trajectory. Figure 2 shows that GCD maintains this displacement, while AAA realigns much more quickly.

This evidence helps explain the observed adaptive comparison, although it does not by itself establish causality. Adaptive attacks may smooth local irregularities or exploit predictable patterns, but they still optimize the systematically altered objective exposed by GCD. By contrast, AAA transforms the loss into a structured oscillatory surface. Pendulum-style attacks can exploit such structure by reversing the optimization direction when progress stalls, thereby escaping local minima and maxima. The trajectory plot therefore complements Table 4, it indicates that GCD’s effect is sustained across successive queries rather than being limited to isolated local slope changes.

Discussion and Conclusion

Our comprehensive evaluation across two datasets, multiple model architectures, four attack methods, and two threat models demonstrates that Gradient Confusion represents an effective new paradigm for black-box defense. By explicitly shaping the gradient information revealed to attackers, GCD Consistently lower attack success rates across all evaluated configurations. Besides, we do not degrade the clean accuracy. Also, GCD Maintains protection even against sophisticated adaptive attacks. These results establish GCD as a state-of-the-art defense against score-based black-box attacks, offering a principled alternative to randomization-based approaches. The method’s model-agnostic implementation and deterministic operation make it particularly suitable for deployment in security-critical applications where both robustness and reliable performance are paramount. However, one limitation warrants discussion. GCD requires Jacobian computations, adding computational overhead (approximately 15% inference time increase). Future work could explore alternative optimization methods and workarounds to address this obstacle.

Notations

Here one can find all notations and symbols used in the paper.

SymbolDescription
General Model and Inputs
X\mathcal{X}Input space, X⊆[0,1]d\mathcal{X} \subseteq[0,1]^d
ddDimension of the input space
[K][K]Label set {1,…,K}\{1,\ldots,K\}
M\mathcal{M}Classifier mapping X→ΔK\mathcal{X} \to\Delta^K
z(x)\mathbf{z}(\mathbf{x})Logits vector output by the model for input x\mathbf{x}
σ(⋅)\sigma(\cdot)Softmax function
ΔK\Delta^KProbability simplex {p∈RK∣∑ipi=1}\{\mathbf{p} \in\mathbb{R}^K \mid\sum_i p_i = 1\}
y^,M(x)\hat{\mathbf{y}},\mathcal{M}(\mathbf{x})Original probability vector output by the target model
kkTrue label of input x\mathbf{x}
J(x)J(\mathbf{x})Jacobian of the model’s logits with respect to the input, ∇xz(x)\nabla_{\mathbf{x}}\mathbf{z}(\mathbf{x})
Attacks and Optimization
xadv\mathbf{x}_{adv}Adversarial example (xadv=x+δ\mathbf{x}_{adv} = \mathbf{x} + \boldsymbol{\delta})
RRPerturbation budget (radius of the allowed perturbation ball)
QQMaximum query budget
f(x)f(\mathbf{x})Adversarial loss function based on the original model output
i,ji,jIndices of the largest and second-largest probability components
∇^xfμ(x)\hat{\nabla}_{\mathbf{x}} f_\mu(\mathbf{x})Estimated gradient of the smoothed function
u,ut\mathbf{u},\mathbf{u}_tRandom search direction vector, u∼N(0,I)\mathbf{u} \sim\mathcal{N}(\mathbf{0},\mathbf{I})
μ\muSmoothing parameter (step size for finite differences)
fμ(x)f_\mu(\mathbf{x})Gaussian-smoothed version of the loss function
ηt\eta_tStep size (learning rate) at iteration tt
Πξ\Pi_{\xi}Projection operator onto the lpl_p-ball of radius ξ\xi
hth_tOne-step improvement signal in random search
Gradient Confusion Defense (GCD)
y~,M~(x)\tilde{\mathbf{y}},\widetilde{\mathcal{M}}(\mathbf{x})Modified/Defended probability vector returned to the user
z~(x)\tilde{\mathbf{z}}(\mathbf{x})Perturbed logits corresponding to y~\tilde{\mathbf{y}}
f~(x)\tilde{f}(\mathbf{x})Adversarial loss function based on the modified output y~\tilde{\mathbf{y}}
ξ\xiDistortion budget (constraint on l1l_1 distance between y^\hat{\mathbf{y}} and y~\tilde{\mathbf{y}})
fdef(x)f_{\mathrm{def}}(\mathbf{x})Randomized defended objective function (theoretical model)
λ\lambdaBernoulli random variable used in the theoretical switching defense
ppProbability parameter for the Bernoulli distribution (λ∼Bernoulli⁡(p)\lambda\sim\operatorname{Bernoulli}(p))
Theoretical Analysis
L0(f)L_0(f)Lipschitz continuity constant of function ff
L1(f)L_1(f)Lipschitz constant of the gradient (smoothness constant) of ff
TTTotal number of optimization steps/queries
ϵ\epsilonSmall constants bounding the difference between functions (∣f−f~∣\lvert f-\tilde{f}\rvert)
ϵ′\epsilon'Small constants bounding the difference between functions (∣fμ−f∣\lvert f_\mu-f\rvert)
hdefh_{\mathrm{def}}Improvement signal computed from the defender’s returned values

Table 5. Summary of Notations and Symbols used in the Gradient Confusion Defense (GCD) paper.

Theoretical Analysis of Gradient Confusion for Gradient Estimation-Based Attacks

In this appendix, we provide the theoretical analysis of Theorem 4.3. We show that by incorporating a second function f~\tilde{f}, which is close to the original function ff but has misaligned gradients, we can increase the convergence bound of gradient-estimation-based attacks. This analysis provides insights into how optimizing a confusion term can enhance the robustness of models against such attacks. We first state preliminaries and lemmas used in the proof, and then present the detailed proof of Theorem 4.3.

Preliminaries

Definition B.1 (μ\mu-Gaussian Smoothing). For a function f:Rd→Rf : \mathbb{R}^{d} \to\mathbb{R}, we define its μ\mu-Gaussian smoothed version as:

fμ(x)=Eu∼N(0,Id)[f(x+μu)](17)f_{\mu}(\mathbf{x}) = \mathbb{E}_{\mathbf{u}\sim\mathcal{N}(\mathbf{0},\mathbf{I}_{d})}[f(\mathbf{x}+\mu\mathbf{u})] \tag*{(17)}

Now, we define the gradient estimator as

gμ(x)=f(x+μu)−f(x)μu,(18)g_{\mu}(\mathbf{x}) = \frac{f(\mathbf{x}+\mu\mathbf{u})-f(\mathbf{x})}{\mu}\mathbf{u}, \tag*{(18)}

where u∼N(0,Id)\mathbf{u}\sim\mathcal{N}(\mathbf{0},\mathbf{I}_{d}). Using the change of variables y:=x+μu\mathbf{y}:=\mathbf{x}+\mu\mathbf{u}, we can show that the gradient of the smoothed function can be written as

∇fμ(x)=∇(1(2π)d/2∫f(x+μu)e−12∥u∥2du)=∇(1μd+1(2π)d/2∫f(y)e−12μ2∥y−x∥2dy)(Change of variables)=1μd+1(2π)d/2∫f(y)(−y−xμ2)e−12μ2∥y−x∥2dy=1μd+1(2π)d/2∫f(x+μu)(−μuμ2)e−12∥u∥2μddu(Change of variables)=1(2π)d/2∫f(x+μu)(−uμ)e−12∥u∥2du=Eu∼N(0,Id)[f(x+μu)μu](Eu∼N(0,Id)[f(x)μu]=0)=Eu∼N(0,Id)[f(x+μu)−f(x)μu]=Eu∼N(0,Id)[gμ(x)].(19)\begin{aligned} \nabla f_{\mu}(\mathbf{x}) &= \nabla\left(\frac{1}{(2\pi)^{d/2}}\int f(\mathbf{x}+\mu\mathbf{u})e^{-\frac{1}{2}\lVert\mathbf{u}\rVert^{2}}d\mathbf{u}\right) \\ &= \nabla\left(\frac{1}{\mu^{d+1}(2\pi)^{d/2}}\int f(\mathbf{y})e^{-\frac{1}{2\mu^{2}}\lVert\mathbf{y}-\mathbf{x}\rVert^{2}}d\mathbf{y}\right) \quad\text{(Change of variables)}\\ &= \frac{1}{\mu^{d+1}(2\pi)^{d/2}}\int f(\mathbf{y})\left(-\frac{\mathbf{y}-\mathbf{x}}{\mu^{2}}\right)e^{-\frac{1}{2\mu^{2}}\lVert\mathbf{y}-\mathbf{x}\rVert^{2}}d\mathbf{y}\\ &= \frac{1}{\mu^{d+1}(2\pi)^{d/2}}\int f(\mathbf{x}+\mu\mathbf{u})\left(-\frac{\mu\mathbf{u}}{\mu^{2}}\right)e^{-\frac{1}{2}\lVert\mathbf{u}\rVert^{2}}\mu^{d}d\mathbf{u}\quad\text{(Change of variables)}\\ &= \frac{1}{(2\pi)^{d/2}}\int f(\mathbf{x}+\mu\mathbf{u})\left(-\frac{\mathbf{u}}{\mu}\right)e^{-\frac{1}{2}\lVert\mathbf{u}\rVert^{2}}d\mathbf{u}\\ &= \mathbb{E}_{\mathbf{u}\sim\mathcal{N}(\mathbf{0},\mathbf{I}_{d})}\left[\frac{f(\mathbf{x}+\mu\mathbf{u})}{\mu}\mathbf{u}\right]\quad\left(\mathbb{E}_{\mathbf{u}\sim\mathcal{N}(\mathbf{0},\mathbf{I}_{d})}\left[\frac{f(\mathbf{x})}{\mu}\mathbf{u}\right]=0\right)\\ &= \mathbb{E}_{\mathbf{u}\sim\mathcal{N}(\mathbf{0},\mathbf{I}_{d})}\left[\frac{f(\mathbf{x}+\mu\mathbf{u})-f(\mathbf{x})}{\mu}\mathbf{u}\right]\\ &= \mathbb{E}_{\mathbf{u}\sim\mathcal{N}(\mathbf{0},\mathbf{I}_{d})}[g_{\mu}(\mathbf{x})]. \tag*{(19)} \end{aligned}

Thus, we have the following lemma:

Lemma B.2. The gradient estimator gμ(x)g_{\mu}(\mathbf{x}) is an unbiased estimator of the gradient of the smoothed function fμ(x)f_{\mu}(\mathbf{x}), i.e.,

Eu[gμ(x)]=∇fμ(x).\mathbb{E}_{\mathbf{u}}[g_{\mu}(\mathbf{x})] = \nabla f_{\mu}(\mathbf{x}).

We also use the following lemma on the smoothness of the Gaussian-smoothed function from Nesterov and Spokoiny [24]:

Lemma B.3. If ff is L0(f)L_{0}(f)-Lipschitz continuous, then its smoothed version fμf_{\mu} is differentiable and has a Lipschitz continuous gradient with constant

L1(fμ)=2dμL0(f).L_{1}(f_{\mu}) = \frac{2\sqrt{d}}{\mu}L_{0}(f).

We also use the following lemma on the moments of Gaussian random variables, which follows from standard concentration properties of Gaussian distributions:

Lemma B.4. For u∼N(0,Id)\mathbf{u}\sim\mathcal{N}(\mathbf{0},\mathbf{I}_{d}), we have

E[∥u∥2]≤d,(20)\mathbb{E}[\lVert\mathbf{u}\rVert^{2}] \le d, \tag*{(20)}

and

E[∥u∥4]≤(d+4)2.(21)\mathbb{E}[\lVert\mathbf{u}\rVert^{4}] \le(d+4)^{2}. \tag*{(21)}

Bias and variance of gradient estimator

Let f:Rd→Rf:\mathbb{R}^{d}\to\mathbb{R} and f~:Rd→R\tilde{f}:\mathbb{R}^{d}\to\mathbb{R} be two functions such that, for all x∈Rd\mathbf{x}\in\mathbb{R}^{d}, ∣f(x)−f~(x)∣≤ϵ|f(\mathbf{x})-\tilde{f}(\mathbf{x})|\leq\epsilon. We define a randomized objective hh as

h(x)=λf(x)+(1−λ)f~(x),(22)h(\mathbf{x})=\lambda f(\mathbf{x})+(1-\lambda)\tilde{f}(\mathbf{x}), \tag*{(22)}

where λ∼Bernoulli⁡(p)\lambda\sim\operatorname{Bernoulli}(p). Thus, the corresponding gradient estimator is given by

gμ(x)=(λ1f(x+μu)+(1−λ1)f~(x+μu))−(λ2f(x)+(1−λ2)f~(x))μu=[λ1f(x+μu)−f(x)μ+(1−λ1)f~(x+μu)−f~(x)μ+(λ1−λ2)(f(x)−f~(x))μ]u.(23)\begin{aligned} g_{\mu}(\mathbf{x})=\frac{\left(\lambda_{1}f(\mathbf{x}+\mu\mathbf{u})+(1-\lambda_{1})\tilde{f}(\mathbf{x}+\mu\mathbf{u})\right)-\left(\lambda_{2}f(\mathbf{x})+(1-\lambda_{2})\tilde{f}(\mathbf{x})\right)}{\mu}\mathbf{u} \\ &=\left[\lambda_{1}\frac{f(\mathbf{x}+\mu\mathbf{u})-f(\mathbf{x})}{\mu}+(1-\lambda_{1})\frac{\tilde{f}(\mathbf{x}+\mu\mathbf{u})-\tilde{f}(\mathbf{x})}{\mu}+\frac{(\lambda_{1}-\lambda_{2})(f(\mathbf{x})-\tilde{f}(\mathbf{x}))}{\mu}\right]\mathbf{u}. \tag*{(23)} \end{aligned}

Thus, for the expectation of the gradient estimator, we have:

Eλ1,λ2[gμ(x)]=p(f(x+μu)−f(x)μu)+(1−p)(f~(x+μu)−f~(x)μu)(24)\mathbb{E}_{\lambda_{1},\lambda_{2}}[g_{\mu}(\mathbf{x})]=p\left(\frac{f(\mathbf{x}+\mu\mathbf{u})-f(\mathbf{x})}{\mu}\mathbf{u}\right)+(1-p)\left(\frac{\tilde{f}(\mathbf{x}+\mu\mathbf{u})-\tilde{f}(\mathbf{x})}{\mu}\mathbf{u}\right) \tag*{(24)}

From lemma B.2 we have:

Eu,λ1,λ2[gμ(x)]=p∇fμ(x)+(1−p)∇f~μ(x)(25)\mathbb{E}_{\mathbf{u},\lambda_{1},\lambda_{2}}[g_{\mu}(\mathbf{x})]=p\nabla f_{\mu}(\mathbf{x})+(1-p)\nabla\tilde{f}_{\mu}(\mathbf{x}) \tag*{(25)}

Now we need to compute the variance of the gradient estimator:

∥gμ(x)∥2=[λ1f(x+μu)−f(x)μ+(1−λ1)f~(x+μu)−f~(x)μ+(λ1−λ2)(f(x)−f~(x))μ]2∥u∥2(26)\lVert g_{\mu}(\mathbf{x})\rVert^{2}=\left[\lambda_{1}\frac{f(\mathbf{x}+\mu\mathbf{u})-f(\mathbf{x})}{\mu}+(1-\lambda_{1})\frac{\tilde{f}(\mathbf{x}+\mu\mathbf{u})-\tilde{f}(\mathbf{x})}{\mu}+\frac{(\lambda_{1}-\lambda_{2})(f(\mathbf{x})-\tilde{f}(\mathbf{x}))}{\mu}\right]^{2}\lVert\mathbf{u}\rVert^{2} \tag*{(26)}

Now set α=f(x+μu)−f(x)μ\alpha=\frac{f(\mathbf{x}+\mu\mathbf{u})-f(\mathbf{x})}{\mu}, α~=f~(x+μu)−f~(x)μ\tilde{\alpha}=\frac{\tilde{f}(\mathbf{x}+\mu\mathbf{u})-\tilde{f}(\mathbf{x})}{\mu}, and δ=f(x)−f~(x)μ\delta=\frac{f(\mathbf{x})-\tilde{f}(\mathbf{x})}{\mu}. Thus for AA we have:

A=λ12α2+(1−λ1)2α~2+(λ1−λ2)2δ2+2λ1(1−λ1)αα~+2λ1(λ1−λ2)αδ+2(1−λ1)(λ1−λ2)α~δ⇒Eλ1,λ2[A]=pα2+(1−p)α~2+2p(1−p)(α−α~)δ+2p(1−p)δ2=pα2+(1−p)α~2+2p(1−p)(α−α~+δ)δ\begin{aligned} A={}&\lambda_{1}^{2}\alpha^{2}+(1-\lambda_{1})^{2}\tilde{\alpha}^{2}+(\lambda_{1}-\lambda_{2})^{2}\delta^{2}+2\lambda_{1}(1-\lambda_{1})\alpha\tilde{\alpha}\\ &+2\lambda_{1}(\lambda_{1}-\lambda_{2})\alpha\delta+2(1-\lambda_{1})(\lambda_{1}-\lambda_{2})\tilde{\alpha}\delta\\ \Rightarrow\quad\mathbb{E}_{\lambda_{1},\lambda_{2}}[A]={}&p\alpha^{2}+(1-p)\tilde{\alpha}^{2}+2p(1-p)(\alpha-\tilde{\alpha})\delta+2p(1-p)\delta^{2}\\ ={}&p\alpha^{2}+(1-p)\tilde{\alpha}^{2}+2p(1-p)(\alpha-\tilde{\alpha}+\delta)\delta \end{aligned}
Eλ1,λ2[A]=p(f(x+μu)−f(x)μ)2+(1−p)(f~(x+μu)−f~(x)μ)2+2p(1−p)μ2(f(x+μu)−f~(x+μu))(f(x)−f~(x))(27)\mathbb{E}_{\lambda_{1},\lambda_{2}}[A]=p\left(\frac{f(\mathbf{x}+\mu\mathbf{u})-f(\mathbf{x})}{\mu}\right)^{2}+(1-p)\left(\frac{\tilde{f}(\mathbf{x}+\mu\mathbf{u})-\tilde{f}(\mathbf{x})}{\mu}\right)^{2}+\frac{2p(1-p)}{\mu^{2}}\left(f(\mathbf{x}+\mu\mathbf{u})-\tilde{f}(\mathbf{x}+\mu\mathbf{u})\right)\left(f(\mathbf{x})-\tilde{f}(\mathbf{x})\right) \tag*{(27)}

Now using the bound ∣f(x)−f~(x)∣≤ϵ|f(\mathbf{x})-\tilde{f}(\mathbf{x})|\leq\epsilon, and Lipschitz continuity of ff and f~\tilde{f}, we have:

Eλ1,λ2[A]≤pL02(f)∥u∥2+(1−p)L02(f~)∥u∥2+2p(1−p)ϵ2μ2(28)\mathbb{E}_{\lambda_{1},\lambda_{2}}[A]\leq pL_{0}^{2}(f)\lVert\mathbf{u}\rVert^{2}+(1-p)L_{0}^{2}(\tilde{f})\lVert\mathbf{u}\rVert^{2}+\frac{2p(1-p)\epsilon^{2}}{\mu^{2}} \tag*{(28)}

Putting this into equation 26, we have:

Eλ1,λ2[∥gμ(x)∥2]≤pL02(f)∥u∥4+(1−p)L02(f~)∥u∥4+2p(1−p)ϵ2μ2∥u∥2(29)\mathbb{E}_{\lambda_{1},\lambda_{2}}[\lVert g_{\mu}(\mathbf{x})\rVert^{2}]\leq pL_{0}^{2}(f)\lVert\mathbf{u}\rVert^{4}+(1-p)L_{0}^{2}(\tilde{f})\lVert\mathbf{u}\rVert^{4}+\frac{2p(1-p)\epsilon^{2}}{\mu^{2}}\lVert\mathbf{u}\rVert^{2} \tag*{(29)}

Now taking expectation over u\mathbf{u}, using lemma B.4 we have:

Eu,λ1,λ2[∥gμ(x)∥2]≤pL02(f)(d+4)2+(1−p)L02(f~)(d+4)2+2p(1−p)ϵ2μ2d(30)\mathbb{E}_{\mathbf{u},\lambda_{1},\lambda_{2}}[\lVert g_{\mu}(\mathbf{x})\rVert^{2}]\leq pL_{0}^{2}(f)(d+4)^{2}+(1-p)L_{0}^{2}(\tilde{f})(d+4)^{2}+\frac{2p(1-p)\epsilon^{2}}{\mu^{2}}d \tag*{(30)}

Descent Lemma

We now define the optimization process. Starting from x0\mathbf{x}_{0}, at each iteration tt we sample λ1(t),λ2(t)∼Bernoulli⁡(p)\lambda_{1}^{(t)},\lambda_{2}^{(t)}\sim\operatorname{Bernoulli}(p) and u(t)∼N(0,Id)\mathbf{u}^{(t)}\sim\mathcal{N}(\mathbf{0},I_{d}), and compute the gradient estimator gμ(xt)g_{\mu}(\mathbf{x}_{t}). We then update the iterate as

xt+1=xt−ηtgμ(xt),\mathbf{x}_{t+1}=\mathbf{x}_{t}-\eta_{t}g_{\mu}(\mathbf{x}_{t}),

where ηt\eta_t denotes the step size at iteration tt. Consequently, each iterate xt\mathbf{x}_t is a random variable that depends on all previous samples {λ1(i),λ2(i),u(i)}i<t\{ \lambda_1^{(i)}, \lambda_2^{(i)}, \mathbf{u}^{(i)} \}_{i<t}. We define the history up to iteration tt as

Zt={λ1(i),λ2(i),u(i)}i<t.\mathcal{Z}_t = \left\{ \lambda_1^{(i)}, \lambda_2^{(i)}, \mathbf{u}^{(i)} \right\}_{i<t}.

Our goal is to analyze the convergence of this process in expectation over all sources of randomness. We assume the process is run for TT iterations.

Having access to the variance and bias of the gradient estimator, we can now use the standard descent lemma for zero order optimization.

fμ(xt+1)≤fμ(xt)−ηt⟨∇fμ(xt),gμ(xt)⟩+L1(fμ)2ηt2∥gμ(xt)∥2(31)f_\mu(\mathbf{x}_{t+1}) \leq f_\mu(\mathbf{x}_t) - \eta_t \langle\nabla f_\mu(\mathbf{x}_t), \mathbf{g}_\mu(\mathbf{x}_t) \rangle+ \frac{L_1(f_\mu)}{2}\eta_t^2 \lVert\mathbf{g}_\mu(\mathbf{x}_t) \rVert^2 \tag*{(31)}

Using equations 25 and 30, and taking expectation over λ1(t)\lambda_1^{(t)}, λ2(t)\lambda_2^{(t)} and u(t)\mathbf{u}^{(t)} we have:

Eu(t),λ1(t),λ2(t)[fμ(xt+1)]≤fμ(xt)−ηtp∥∇fμ(xt)∥2−ηt(1−p)⟨∇fμ(xt),∇f~(xt)⟩+L1(fμ)2ηt2(pL02(f)(d+4)2+(1−p)L02(f~)(d+4)2+2p(1−p)ϵ2μ2d)(32)\mathbb{E}_{\mathbf{u}^{(t)},\lambda_1^{(t)},\lambda_2^{(t)}}[f_\mu(\mathbf{x}_{t+1})] \leq f_\mu(\mathbf{x}_t) - \eta_t p \lVert\nabla f_\mu(\mathbf{x}_t) \rVert^2 - \eta_t(1-p)\langle\nabla f_\mu(\mathbf{x}_t), \nabla\widetilde{f}(\mathbf{x}_t) \rangle + \frac{L_1(f_\mu)}{2}\eta_t^2 \left(pL_0^2(f)(d+4)^2 + (1-p)L_0^2(\widetilde{f})(d+4)^2 + \frac{2p(1-p)\epsilon^2}{\mu^2}d\right) \tag*{(32)}

Now taking expectation over the history Zt\mathcal{Z}_t, we have:

EZt,u(t),λ1(t),λ2(t)[fμ(xt+1)]=EZt+1[fμ(xt+1)]≤EZt[fμ(xt)]−ηtpEZt[∥∇fμ(xt)∥2]−ηt(1−p)EZt[⟨∇fμ(xt),∇f~(xt)⟩]+L1(fμ)2ηt2(pL02(f)(d+4)2+(1−p)L02(f~)(d+4)2+2p(1−p)ϵ2μ2d)(33)\mathbb{E}_{\mathcal{Z}_t,\mathbf{u}^{(t)},\lambda_1^{(t)},\lambda_2^{(t)}}[f_\mu(\mathbf{x}_{t+1})] = \mathbb{E}_{\mathcal{Z}_{t+1}}[f_\mu(\mathbf{x}_{t+1})] \leq\mathbb{E}_{\mathcal{Z}_t}[f_\mu(\mathbf{x}_t)] - \eta_t p\mathbb{E}_{\mathcal{Z}_t}[\lVert\nabla f_\mu(\mathbf{x}_t)\rVert^2] - \eta_t(1-p)\mathbb{E}_{\mathcal{Z}_t}[\langle\nabla f_\mu(\mathbf{x}_t), \nabla\widetilde{f}(\mathbf{x}_t)\rangle] + \frac{L_1(f_\mu)}{2}\eta_t^2 \left(pL_0^2(f)(d+4)^2 + (1-p)L_0^2(\widetilde{f})(d+4)^2 + \frac{2p(1-p)\epsilon^2}{\mu^2}d\right) \tag*{(33)}

Let’s define new notations for simplicity:

At=EZt[fμ(xt)]Bt=EZt[∥∇fμ(xt)∥2]Ct=EZt[⟨∇fμ(xt),∇f~(xt)⟩]D=pL02(f)(d+4)2+(1−p)L02(f~)(d+4)2+2p(1−p)ϵ2μ2d(34)\begin{aligned} A_t &= \mathbb{E}_{\mathcal{Z}_t}[f_\mu(\mathbf{x}_t)]\\ B_t &= \mathbb{E}_{\mathcal{Z}_t}[\lVert\nabla f_\mu(\mathbf{x}_t)\rVert^2]\\ C_t &= \mathbb{E}_{\mathcal{Z}_t}[\langle\nabla f_\mu(\mathbf{x}_t), \nabla\widetilde{f}(\mathbf{x}_t)\rangle]\\ D &= pL_0^2(f)(d+4)^2 + (1-p)L_0^2(\widetilde{f})(d+4)^2 + \frac{2p(1-p)\epsilon^2}{\mu^2}d \tag*{(34)} \end{aligned}

Rewrite the inequality with new notations:

At+1≤At−ηtpBt−ηt(1−p)Ct+L1(fμ)2ηt2D(35)A_{t+1} \leq A_t - \eta_t pB_t - \eta_t(1-p)C_t + \frac{L_1(f_\mu)}{2}\eta_t^2D \tag*{(35)}

Rearranging the terms, we have:

At+1−At≤−ηtpBt−ηt(1−p)Ct+L1(fμ)2ηt2D(36)A_{t+1} - A_t \leq-\eta_t pB_t - \eta_t(1-p)C_t + \frac{L_1(f_\mu)}{2}\eta_t^2D \tag*{(36)}

Thus for different iterations t=0,…,T−1t=0,\ldots,T-1, we have:

A1−A0≤−η0pB0−η0(1−p)C0+L1(fμ)2η02DA2−A1≤−η1pB1−η1(1−p)C1+L1(fμ)2η12D⋮AT−AT−1≤−ηT−1pBT−1−ηT−1(1−p)CT−1+L1(fμ)2ηT−12D(37)\begin{aligned} A_1-A_0 &\leq-\eta_0pB_0-\eta_0(1-p)C_0+\frac{L_1(f_\mu)}{2}\eta_0^2D\\ A_2-A_1 &\leq-\eta_1pB_1-\eta_1(1-p)C_1+\frac{L_1(f_\mu)}{2}\eta_1^2D\\ &\vdots\\ A_T-A_{T-1} &\leq-\eta_{T-1}pB_{T-1}-\eta_{T-1}(1-p)C_{T-1}+\frac{L_1(f_\mu)}{2}\eta_{T-1}^2D \tag*{(37)} \end{aligned}

Summing all these inequalities, we have:

AT−A0≤−p∑t=0T−1ηtBt−(1−p)∑t=0T−1ηtCt+L1(fμ)2D∑t=0T−1ηt2(38)A_T-A_0 \leq-p\sum_{t=0}^{T-1}\eta_tB_t-(1-p)\sum_{t=0}^{T-1}\eta_tC_t+\frac{L_1(f_\mu)}{2}D\sum_{t=0}^{T-1}\eta_t^2 \tag*{(38)}

Here A0=fμ(x0)A_0=f_\mu(\mathbf{x}_0) and AT=EZT[fμ(xT)]A_T=\mathbb{E}_{\mathcal{Z}_T}[f_\mu(\mathbf{x}_T)] is the expectation of the function value at the end of the optimization process. Let’s assume we use constant step size ηt=η\eta_t=\eta for all tt. Thus we have:

AT−A0≤−ηp∑t=0T−1Bt−η(1−p)∑t=0T−1Ct+L1(fμ)2η2DT(39)A_T-A_0\leq-\eta p\sum_{t=0}^{T-1}B_t-\eta(1-p)\sum_{t=0}^{T-1}C_t+\frac{L_1(f_\mu)}{2}\eta^2DT \tag*{(39)}

Taking average over TT iterations, we have:

1ηT(AT−A0)≤−p1T∑t=0T−1Bt−(1−p)1T∑t=0T−1Ct+L1(fμ)2ηD(40)\frac{1}{\eta T}(A_T-A_0)\leq-p\frac{1}{T}\sum_{t=0}^{T-1}B_t-(1-p)\frac{1}{T}\sum_{t=0}^{T-1}C_t+\frac{L_1(f_\mu)}{2}\eta D \tag*{(40)}

Rearranging the terms, we have:

p1T∑t=0T−1Bt+(1−p)1T∑t=0T−1Ct≤A0−ATηT+L1(fμ)2ηD(41)p\frac{1}{T}\sum_{t=0}^{T-1}B_t+(1-p)\frac{1}{T}\sum_{t=0}^{T-1}C_t\leq\frac{A_0-A_T}{\eta T}+\frac{L_1(f_\mu)}{2}\eta D \tag*{(41)}

Now minimize the right hand side with respect to η\eta:

η∗=2(A0−AT)L1(fμ)DT(42)\eta^*=\sqrt{\frac{2(A_0-A_T)}{L_1(f_\mu)DT}} \tag*{(42)}

Thus we have:

p1T∑t=0T−1Bt+(1−p)1T∑t=0T−1Ct≤2L1(fμ)D(A0−ATT)(43)p\frac{1}{T}\sum_{t=0}^{T-1}B_t+(1-p)\frac{1}{T}\sum_{t=0}^{T-1}C_t\leq\sqrt{2L_1(f_\mu)D\left(\frac{A_0-A_T}{T}\right)} \tag*{(43)}

From Lipschitz continuity of ff and f~\tilde{f}, we know that fμf_\mu and f~μ\tilde{f}_\mu are also Lipschitz continuous with the same constants. Thus we can bound A0−ATA_0-A_T as:

∣A0−AT∣≤L0(f)∥x0−x∗∥≤L0(f)R(44)\lvert A_0-A_T\rvert\leq L_0(f)\lVert\mathbf{x}_0-\mathbf{x}^*\rVert\leq L_0(f)R \tag*{(44)}

Where RR is the radius of the ball for optimization budget. Thus we have the final convergence bound as:

p1T∑t=0T−1Bt+(1−p)1T∑t=0T−1Ct≤2L1(fμ)D(L0(f)RT)(45)p\frac{1}{T}\sum_{t=0}^{T-1}B_t+(1-p)\frac{1}{T}\sum_{t=0}^{T-1}C_t\leq\sqrt{2L_1(f_\mu)D\left(\frac{L_0(f)R}{T}\right)} \tag*{(45)}

From the definition of fμf_\mu and lemma B.3 we have L1(fμ)=2d1/2μL0(f)L_1(f_\mu)=\frac{2d^{1/2}}{\mu}L_0(f), therefore we have:

p1T∑t=0T−1Bt+(1−p)1T∑t=0T−1Ct≤4d1/2L0(f)2RμTD(46)p\frac{1}{T}\sum_{t=0}^{T-1}B_t+(1-p)\frac{1}{T}\sum_{t=0}^{T-1}C_t\leq\sqrt{\frac{4d^{1/2}L_0(f)^2R}{\mu T}D} \tag*{(46)}

We also need to choose μ\mu small enough to have ∣fμ(x)−f(x)∣≤ϵ′\lvert f_\mu(\mathbf{x})-f(\mathbf{x})\rvert\leq\epsilon'. To have this bound, we choose μ≤ϵ′d1/2L0(f)\mu\leq\frac{\epsilon'}{d^{1/2}L_0(f)} as in Nesterov and Spokoiny [24]. Thus we can still simplify the bound as:

p1T∑t=0T−1Bt+(1−p)1T∑t=0T−1Ct≤4dL0(f)3Rϵ′TD(47)p\frac{1}{T}\sum_{t=0}^{T-1}B_t+(1-p)\frac{1}{T}\sum_{t=0}^{T-1}C_t\leq\sqrt{\frac{4dL_0(f)^3R}{\epsilon'T}D} \tag*{(47)}

Let’s also plug this value in DD and rewrite that:

D=pL02(f)(d+4)2+(1−p)L02(f~)(d+4)2+2p(1−p)ϵ′2d2L0(f)2ϵ′2(48)D=pL_0^2(f)(d+4)^2+(1-p)L_0^2(\tilde{f})(d+4)^2+\frac{2p(1-p)\epsilon'^2d^2L_0(f)^2}{\epsilon'^2} \tag*{(48)}

The input dimension dd usually dominates the constant 4 in (d+4)(d+4), thus we can simplify the final bound as:

D≈pL02(f)d2+(1−p)L02(f~)d2+2p(1−p)ϵ′2d2L0(f)2ϵ′2=pd2L0(f)2(1+(1−p)L02(f~)pL02(f)+2(1−p)ϵ2ϵ′2)(49)\begin{aligned} D\approx pL_0^2(f)d^2+(1-p)L_0^2(\tilde{f})d^2+\frac{2p(1-p)\epsilon'^2d^2L_0(f)^2}{\epsilon'^2} \\ &= pd^2L_0(f)^2\left(1+\frac{(1-p)L_0^2(\tilde{f})}{pL_0^2(f)}+2(1-p)\frac{\epsilon^2}{\epsilon'^2}\right) \tag*{(49)} \end{aligned}

Plugging this into the final bound, we have:

pT∑t=0T−1EZt[∥∇fμ(xt)∥2]+1−pT∑t=0T−1EZt[⟨∇fμ(xt),∇f~μ(xt)⟩]≤4d3L0(f)5Rϵ′T(p+(1−p)L02(f~)L02(f)+2p(1−p)ϵ2ϵ′2)(50)\frac{p}{T}\sum_{t=0}^{T-1}\mathbb{E}_{\mathcal{Z}_t}[\lVert\nabla f_\mu(\mathbf{x}_t)\rVert^2]+\frac{1-p}{T}\sum_{t=0}^{T-1}\mathbb{E}_{\mathcal{Z}_t}[\langle\nabla f_\mu(\mathbf{x}_t),\nabla\tilde{f}_\mu(\mathbf{x}_t)\rangle]\leq\sqrt{\frac{4d^3L_0(f)^5R}{\epsilon'T}\left(p+(1-p)\frac{L_0^2(\tilde{f})}{L_0^2(f)}+2p(1-p)\frac{\epsilon^2}{\epsilon'^2}\right)} \tag*{(50)}

This bound shows that optimizing the confusion term ⟨∇fμ(x),∇f~μ(x)⟩\langle\nabla f_\mu(\mathbf{x}),\nabla\tilde{f}_\mu(\mathbf{x})\rangle increases the bound and, consequently, increases the number of steps required by gradient estimation-based attacks.

Theoretical Analysis of Gradient Confusion for Search-Based Attacks

In this part, we provide the detailed proof of Theorem 4.4, which theoretically shows that GC can be effective against search-based attacks by misleading the acceptance/rejection signal hth_t. As a result, the adversary requires more steps (and thus more queries) to craft an adversarial example. We first present auxiliary lemmas used in the proof, and then provide the detailed proof of the theorem.

Auxiliary Lemmas

Lemma C.1. Let f:Rd→Rf : \mathbb{R}^{d} \to\mathbb{R} be LL-smooth, i.e.,

∥∇f(u)−∇f(v)∥≤L∥u−v∥∀u,v∈Rd.\lVert\nabla f(u) - \nabla f(v) \rVert\le L \lVert u-v \rVert\quad\forall u,v \in\mathbb{R}^{d}.

Then for any x,ϵ∈Rdx,\epsilon\in\mathbb{R}^{d},

f(x+ϵ)=f(x)+⟨∇f(x),ϵ⟩+rf,f(x+\epsilon)=f(x)+\langle\nabla f(x),\epsilon\rangle+r_f,

where the remainder term satisfies

∣rf∣≤L2∥ϵ∥2.\lvert r_f\rvert\le\frac{L}{2}\lVert\epsilon\rVert^{2}.

Equivalently,

∣f(x+ϵ)−f(x)−⟨∇f(x),ϵ⟩∣≤L2∥ϵ∥2.\left\lvert f(x+\epsilon)-f(x)-\langle\nabla f(x),\epsilon\rangle\right\rvert\le\frac{L}{2}\lVert\epsilon\rVert^{2}.

Proof. Define ϕ(t)=f(x+tϵ)\phi(t)=f(x+t\epsilon) for t∈[0,1]t\in[0,1]. By the fundamental theorem of calculus,

f(x+ϵ)−f(x)=∫01⟨∇f(x+tϵ),ϵ⟩ dt.f(x+\epsilon)-f(x)=\int_{0}^{1}\langle\nabla f(x+t\epsilon),\epsilon\rangle\,dt.

Subtracting the first-order term yields

f(x+ϵ)−f(x)=⟨∇f(x),ϵ⟩+∫01⟨∇f(x+tϵ)−∇f(x),ϵ⟩ dt.f(x+\epsilon)-f(x)=\langle\nabla f(x),\epsilon\rangle+\int_{0}^{1}\langle\nabla f(x+t\epsilon)-\nabla f(x),\epsilon\rangle\,dt.

Thus the remainder term is

rf=∫01⟨∇f(x+tϵ)−∇f(x),ϵ⟩ dt.r_f=\int_{0}^{1}\langle\nabla f(x+t\epsilon)-\nabla f(x),\epsilon\rangle\,dt.

Applying Cauchy–Schwarz and LL-smoothness,

∣rf∣≤∫01∥∇f(x+tϵ)−∇f(x)∥∥ϵ∥ dt≤∫01Lt∥ϵ∥2 dt=L2∥ϵ∥2.\lvert r_f\rvert\le\int_{0}^{1}\lVert\nabla f(x+t\epsilon)-\nabla f(x)\rVert\lVert\epsilon\rVert\,dt\le\int_{0}^{1}Lt\lVert\epsilon\rVert^{2}\,dt=\frac{L}{2}\lVert\epsilon\rVert^{2}.

Lemma C.2. Let u∼N(0,Id)u\sim\mathcal{N}(0,I_d) in Rd\mathbb{R}^{d} with d≥2d\ge2, and let g∈Rdg\in\mathbb{R}^{d} be fixed with g≠0g\ne0. Then for any c≥0c\ge0,

P(∣gTu∣<c∥u∥2)≤2πcd∥g∥.\mathbb{P}\left(\lvert g^{\mathsf{T}}u\rvert<c\lVert u\rVert^{2}\right)\le\sqrt{\frac{2}{\pi}}\frac{cd}{\lVert g\rVert}.

Proof. Write u=rsu=rs where r=∥u∥≥0r=\lVert u\rVert\ge0 and s=u/∥u∥∈Sd−1s=u/\lVert u\rVert\in S^{d-1}. By rotational invariance of the standard Gaussian, rr and ss are independent, ss is uniform on the unit sphere, and r2∼χd2r^{2}\sim\chi^{2}_{d}. Let a=∥g∥>0a=\lVert g\rVert>0. Then

gTu=rgTs.g^{\mathsf{T}}u=r g^{\mathsf{T}}s.

By rotation symmetry, gTs=aTg^{\mathsf{T}}s=aT, where TT is the first coordinate of a uniform random point on Sd−1S^{d-1}. Hence

P(∣gTu∣<c∥u∥2∣r)=P(∣arT∣<cr2∣r)=P(∣T∣<car).\mathbb{P}\left(\lvert g^{\mathsf{T}}u\rvert<c\lVert u\rVert^{2}\mid r\right)=\mathbb{P}\left(\lvert arT\rvert<cr^{2}\mid r\right)=\mathbb{P}\left(\lvert T\rvert<\frac{c}{a}r\right).

For d≥2d\ge2, TT has density on [−1,1][-1,1]

fT(t)=Cd(1−t2)d−32,Cd=Γ(d/2)πΓ((d−1)/2).f_T(t)=C_d(1-t^2)^{\frac{d-3}{2}},\qquad C_d=\frac{\Gamma(d/2)}{\sqrt{\pi}\Gamma((d-1)/2)}.

Since sup⁡t∈[−1,1]fT(t)=fT(0)=Cd\sup_{t\in[-1,1]} f_T(t)=f_T(0)=C_d, for any t≥0t\ge0 we have

P(∣T∣<t)=∫−ttfT(x) dx≤2tCd.\mathbb{P}(|T|<t)=\int_{-t}^{t}f_T(x)\,\mathrm{d}x\le2tC_d.

Therefore,

P(∣T∣<car)≤2Cdcar.\mathbb{P}\left(|T|<\frac{c}{a}r\right)\le2C_d\frac{c}{a}r.

Taking expectation over rr gives

P(∣gTu∣<c∥u∥2)≤2CdcaE[r].\mathbb{P}\left(|g^{\mathsf T}u|<c\lVert u\rVert^2\right)\le2C_d\frac{c}{a}\mathbb{E}[r].

By Cauchy–Schwarz, E[r]≤E∥u∥2=d\mathbb{E}[r]\le\sqrt{\mathbb{E}\lVert u\rVert^2}=\sqrt{d}. Finally, using Γ(x+12)/Γ(x)≤x\Gamma\left(x+\frac{1}{2}\right)/\Gamma(x)\le\sqrt{x} for all x≥12x\ge\frac{1}{2} with x=d−12x=\frac{d-1}{2},

Cd=Γ(d/2)πΓ((d−1)/2)=1πΓ(x+12)Γ(x)≤d2π.C_d=\frac{\Gamma(d/2)}{\sqrt{\pi}\Gamma((d-1)/2)}=\frac{1}{\sqrt{\pi}}\frac{\Gamma\left(x+\frac{1}{2}\right)}{\Gamma(x)}\le\sqrt{\frac{d}{2\pi}}.

Combining gives

P(∣gTu∣<c∥u∥2)≤2(d2π)c∥g∥(d)=2πcd∥g∥.\mathbb{P}\left(|g^{\mathsf T}u|<c\lVert u\rVert^2\right)\le2\left(\sqrt{\frac{d}{2\pi}}\right)\frac{c}{\lVert g\rVert}(\sqrt{d})=\sqrt{\frac{2}{\pi}}\frac{cd}{\lVert g\rVert}.

Lemma C.3. Let u∼N(0,Id)u\sim\mathcal{N}(0,I_d) and let g,g~∈Rdg,\widetilde{g}\in\mathbb{R}^d be nonzero vectors. Define θ∈[0,π]\theta\in[0,\pi] to be the angle between gg and g~\widetilde{g}, i.e.

cos⁡θ=⟨g,g~⟩∥g∥∥g~∥.\cos\theta=\frac{\langle g,\widetilde{g}\rangle}{\lVert g\rVert\lVert\widetilde{g}\rVert}.

Then

P(sign⁡(⟨g,u⟩)≠sign⁡(⟨g~,u⟩))=θπ=1πarccos⁡(⟨g,g~⟩∥g∥∥g~∥).\mathbb{P}\left(\operatorname{sign}(\langle g,u\rangle)\ne\operatorname{sign}(\langle\widetilde{g},u\rangle)\right)=\frac{\theta}{\pi}=\frac{1}{\pi}\arccos\left(\frac{\langle g,\widetilde{g}\rangle}{\lVert g\rVert\lVert\widetilde{g}\rVert}\right).

Proof. Set X=⟨g,u⟩X=\langle g,u\rangle and Y=⟨g~,u⟩Y=\langle\widetilde{g},u\rangle. Then (X,Y)(X,Y) is a centered bivariate Gaussian with

Var⁡(X)=∥g∥2,Var⁡(Y)=∥g~∥2,Cov⁡(X,Y)=⟨g,g~⟩,\operatorname{Var}(X)=\lVert g\rVert^2,\qquad\operatorname{Var}(Y)=\lVert\widetilde{g}\rVert^2,\qquad\operatorname{Cov}(X,Y)=\langle g,\widetilde{g}\rangle,

so the correlation is ρ=⟨g,g~⟩/(∥g∥∥g~∥)=cos⁡θ\rho=\langle g,\widetilde{g}\rangle/(\lVert g\rVert\lVert\widetilde{g}\rVert)=\cos\theta. A standard orthant probability identity gives

P(X>0,Y>0)=14+12πarcsin⁡(ρ).\mathbb{P}(X>0,Y>0)=\frac{1}{4}+\frac{1}{2\pi}\arcsin(\rho).

By symmetry,

P(XY<0)=1−2P(X>0,Y>0)=12−1πarcsin⁡(ρ)=1πarccos⁡(ρ)=θπ.\mathbb{P}(XY<0)=1-2\mathbb{P}(X>0,Y>0)=\frac{1}{2}-\frac{1}{\pi}\arcsin(\rho)=\frac{1}{\pi}\arccos(\rho)=\frac{\theta}{\pi}.

Proof of Theorem 4.4

With the above lemmas in place, we now state the theorem and present a detailed proof.

Theorem C.4 (Theorem 4.4 (restated)). Under Assumption 4.2, for d≥2d\ge2, u∼N(0,Id)u\sim\mathcal{N}(0,I_d), fixed x∈Rdx\in\mathbb{R}^d, μ>0\mu>0, and with per-query switching defense fdeff_{\mathrm{def}}, the signals

h:=f(x+μu)−f(x),hdef:=fdef(x+μu)−fdef(x)h:=f(x+\mu u)-f(x),\qquad h_{\mathrm{def}}:=f_{\mathrm{def}}(x+\mu u)-f_{\mathrm{def}}(x)

satisfy the bound in (11).

Proof. Let

Δf:=f(x+μu)−f(x),Δf~:=f~(x+μu)−f~(x).\Delta_f:=f(x+\mu u)-f(x),\qquad\Delta_{\widetilde{f}}:=\widetilde{f}(x+\mu u)-\widetilde{f}(x).

By definition, h=Δfh=\Delta_f. Let λ1,λ2∼i.i.d.Bernoulli⁡(p)\lambda_1,\lambda_2\mathrel{\overset{\mathrm{i.i.d.}}{\sim}}\operatorname{Bernoulli}(p) be independent of uu, and write

fdef(x+μu)=λ1f(x+μu)+(1−λ1)f~(x+μu),fdef(x)=λ2f(x)+(1−λ2)f~(x).f_{\mathrm{def}}(x+\mu u)=\lambda_1f(x+\mu u)+(1-\lambda_1)\widetilde{f}(x+\mu u),\qquad f_{\mathrm{def}}(x)=\lambda_2f(x)+(1-\lambda_2)\widetilde{f}(x).

Define E:={sign⁡(h)≠sign⁡(hdef)}E := \{\operatorname{sign}(h) \ne\operatorname{sign}(h_{\mathrm{def}})\}. Conditioning on (λ1,λ2)(\lambda_1,\lambda_2) and keeping only the case (0,0)(0,0) gives

P(E)≥P(E∩{λ1=0,λ2=0})=P(λ1=0,λ2=0)P(sign⁡(Δf)≠sign⁡(Δf~))=(1−p)2P(sign⁡(Δf)≠sign⁡(Δf~)).\begin{aligned} \mathbb{P}(E) \ge\mathbb{P}\left(E \cap\{\lambda_1=0,\lambda_2=0\}\right) \\ &= \mathbb{P}(\lambda_1=0,\lambda_2=0)\mathbb{P}\left(\operatorname{sign}(\Delta_f) \ne\operatorname{sign}(\Delta_{\tilde{f}})\right) \\ &= (1-p)^2\mathbb{P}\left(\operatorname{sign}(\Delta_f) \ne\operatorname{sign}(\Delta_{\tilde{f}})\right). \end{aligned}

It remains to lower bound P(sign⁡(Δf)≠sign⁡(Δf~))\mathbb{P}\left(\operatorname{sign}(\Delta_f) \ne\operatorname{sign}(\Delta_{\tilde{f}})\right).

Define the linear parts

A:=⟨∇f(x),u⟩,A~:=⟨∇f~(x),u⟩.A := \langle\nabla f(x),u\rangle,\qquad\widetilde{A} := \langle\nabla\tilde{f}(x),u\rangle.

By Lemma C.1 applied to ff with L=L1(f)L=L_1(f) and ϵ=μu\epsilon=\mu u,

Δf=μA+rf,∣rf∣≤L1(f)2μ2∥u∥2.\Delta_f=\mu A+r_f,\qquad|r_f|\le\frac{L_1(f)}{2}\mu^2\lVert u\rVert^2.

Similarly, applying Lemma C.1 to f~\tilde{f} with L=L1(f~)L=L_1(\tilde{f}),

Δf~=μA~+rf~,∣rf~∣≤L1(f~)2μ2∥u∥2.\Delta_{\tilde{f}}=\mu\widetilde{A}+r_{\tilde{f}},\qquad|r_{\tilde{f}}|\le\frac{L_1(\tilde{f})}{2}\mu^2\lVert u\rVert^2.

Step 1: sign-stability events. If ∣δ∣<∣a∣|\delta|<|a|, then sign⁡(a+δ)=sign⁡(a)\operatorname{sign}(a+\delta)=\operatorname{sign}(a). Define

Gf:={L1(f)2μ∥u∥2<∣A∣},Gf~:={L1(f~)2μ∥u∥2<∣A~∣}.G_f:=\left\{\frac{L_1(f)}{2}\mu\lVert u\rVert^2<|A|\right\},\qquad G_{\tilde{f}}:=\left\{\frac{L_1(\tilde{f})}{2}\mu\lVert u\rVert^2<|\widetilde{A}|\right\}.

On GfG_f, we have ∣rf∣<μ∣A∣|r_f|<\mu|A|, hence sign⁡(Δf)=sign⁡(A)\operatorname{sign}(\Delta_f)=\operatorname{sign}(A); similarly on Gf~G_{\tilde{f}}, sign⁡(Δf~)=sign⁡(A~)\operatorname{sign}(\Delta_{\tilde{f}})=\operatorname{sign}(\widetilde{A}). Therefore,

P(sign⁡(Δf)≠sign⁡(Δf~))≥P(sign⁡(A)≠sign⁡(A~))−P(Gfc)−P(Gf~c).\mathbb{P}\left(\operatorname{sign}(\Delta_f)\ne\operatorname{sign}(\Delta_{\tilde{f}})\right) \ge\mathbb{P}\left(\operatorname{sign}(A)\ne\operatorname{sign}(\widetilde{A})\right)-\mathbb{P}(G_f^c)-\mathbb{P}(G_{\tilde{f}}^c).

Step 2: linear sign disagreement. By Lemma C.3 with g=∇f(x)g=\nabla f(x) and g~=∇f~(x)\tilde{g}=\nabla\tilde{f}(x),

P(sign⁡(A)≠sign⁡(A~))=1πarccos⁡(⟨∇f(x),∇f~(x)⟩∥∇f(x)∥∥∇f~(x)∥).\mathbb{P}\left(\operatorname{sign}(A)\ne\operatorname{sign}(\widetilde{A})\right) =\frac{1}{\pi}\arccos\left(\frac{\langle\nabla f(x),\nabla\tilde{f}(x)\rangle}{\lVert\nabla f(x)\rVert\lVert\nabla\tilde{f}(x)\rVert}\right).

Step 3: bound Taylor-failure probabilities. Using Lemma C.2 with g=∇f(x)g=\nabla f(x) and c=L1(f)2μc=\frac{L_1(f)}{2}\mu,

P(Gfc)=P(∣A∣<L1(f)2μ∥u∥2)≤2π(L1(f)2μ)d∥∇f(x)∥=μd2πL1(f)∥∇f(x)∥.\mathbb{P}(G_f^c)=\mathbb{P}\left(|A|<\frac{L_1(f)}{2}\mu\lVert u\rVert^2\right) \le\sqrt{\frac{2}{\pi}}\frac{\left(\frac{L_1(f)}{2}\mu\right)d}{\lVert\nabla f(x)\rVert} =\frac{\mu d}{\sqrt{2\pi}}\frac{L_1(f)}{\lVert\nabla f(x)\rVert}.

Similarly,

P(Gf~c)≤μd2πL1(f~)∥∇f~(x)∥.\mathbb{P}(G_{\tilde{f}}^c)\le\frac{\mu d}{\sqrt{2\pi}}\frac{L_1(\tilde{f})}{\lVert\nabla\tilde{f}(x)\rVert}.

Step 4: combine and multiply by (1−p)2(1-p)^2. Combining Steps 1–3 yields

P(sign⁡(Δf)≠sign⁡(Δf~))≥1πarccos⁡(⟨∇f(x),∇f~(x)⟩∥∇f(x)∥∥∇f~(x)∥)−μd2π(L1(f)∥∇f(x)∥+L1(f~)∥∇f~(x)∥).\mathbb{P}\left(\operatorname{sign}(\Delta_f)\ne\operatorname{sign}(\Delta_{\tilde{f}})\right) \ge\frac{1}{\pi}\arccos\left(\frac{\langle\nabla f(x),\nabla\tilde{f}(x)\rangle}{\lVert\nabla f(x)\rVert\lVert\nabla\tilde{f}(x)\rVert}\right) -\frac{\mu d}{\sqrt{2\pi}}\left(\frac{L_1(f)}{\lVert\nabla f(x)\rVert}+\frac{L_1(\tilde{f})}{\lVert\nabla\tilde{f}(x)\rVert}\right).

Multiplying by (1−p)2(1-p)^2 gives (11). □

Why Gaussian Directions?

We model the search direction as Gaussian because it is rotationally invariant and makes the analysis depend only on geometry. This is also a good approximation for many isotropic samplers used in practice: in high dimensions, one-dimensional projections (i.e., inner products with a random direction) of a broad class of high-dimensional random vectors are close to Gaussian under mild conditions, so Gaussian modeling captures the sign behavior of these projections well [22]. In the proof, the key quantity is the probability that the two linearized one-step signals induced by ∇f(x)\nabla f(x) and ∇f~(x)\nabla\tilde{f}(x) disagree in sign, and rotational invariance implies this probability depends only on their relative orientation. This is exactly where the arccosine term in (11) comes from.

References

  1. [1]Aithal, M.B., Li, X., 2022. Boundary defense against black-box adversarial attacks, in: 26th International Conference on Pattern Recognition, ICPR 2022, Montreal, QC, Canada, August 21-25, 2022, IEEE. pp. 2349–2356.arxiv.org/abs/2201.13444
  2. [2]Al-Dujaili, A., O’Reilly, U., 2020. Sign bits are all you need for black-box attacks, in: 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020, OpenReview.net.
  3. [3]Andriushchenko, M., Croce, F., Flammarion, N., Hein, M., 2020. Square attack: A query-efficient black-box adversarial attack via random search, in: Vedaldi, A., Bischoff, H., Brox, T., Frahm, J. (Eds.), Computer Vision - ECCV 2020 - 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part XXIII, Springer. pp. 484–501.arxiv.org/abs/1912.00049
  4. [4]Athalye, A., Carlini, N., Wagner, D.A., 2018a. Obfuscated gradients give a false sense of security: Circumventing defenses to adversarial examples, in: Dy, J.G., Krause, A. (Eds.), Proceedings of the 35th International Conference on Machine Learning, ICML 2018, Stockholmmässan, Stockholm, Sweden, July 10-15, 2018, PMLR. pp. 274–283.arxiv.org/abs/1802.00420
  5. [5]Athalye, A., Engstrom, L., Ilyas, A., Kwok, K., 2018b. Synthesizing robust adversarial examples, in: Dy, J.G., Krause, A. (Eds.), Proceedings of the 35th International Conference on Machine Learning, ICML 2018, Stockholmmässan, Stockholm, Sweden, July 10-15, 2018, PMLR. pp. 284–293.
  6. [6]Carlini, N., Wagner, D.A., 2017. Towards evaluating the robustness of neural networks, in: 2017 IEEE Symposium on Security and Privacy, SP 2017, San Jose, CA, USA, May 22-26, 2017, IEEE Computer Society. pp. 39–57.arxiv.org/abs/1608.04644
  7. [7]Chen, J., Gu, Q., 2020. Rays: A ray searching method for hard-label adversarial attack, in: Gupta, R., Liu, Y., Tang, J., Prakash, B.A. (Eds.), KDD ’20: The 26th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, Virtual Event, CA, USA, August 23-27, 2020, ACM. pp. 1739–1747.arxiv.org/abs/2006.12792
  8. [8]Chen, J., Jordan, M.I., Wainwright, M.J., 2020. Hopskipjumpattack: A query-efficient decision-based attack, in: 2020 IEEE Symposium on Security and Privacy, SP 2020, San Francisco, CA, USA, May 18-21, 2020, IEEE. pp. 1277–1294.arxiv.org/abs/1904.02144
  9. [9]Chen, P., Zhang, H., Sharma, Y., Yi, J., Hsieh, C., 2017. ZOO: zeroth order optimization based black-box attacks to deep neural networks without training substitute models, in: Thuraisingham, B., Biggio, B., Freeman, D.M., Miller, B., Sinha, A. (Eds.), Proceedings of the 10th ACM Workshop on Artificial Intelligence and Security, AISec@CCS 2017, Dallas, TX, USA, November 3, 2017, ACM. pp. 15–26.DOI
  10. [10]Chen, S., Huang, Z., Tao, Q., Wu, Y., Xie, C., Huang, X., 2022. Adversarial attack on attackers: Post-process to mitigate black-box score-based query attacks, in: Koyejo, S., Mohamed, S., Agarwal, A., Belgrave, D., Cho, K., Oh, A. (Eds.), Advances in Neural Information Processing Systems 35: Annual Conference on Neural Information Processing Systems 2022, NeurIPS 2022, New Orleans, LA, USA, November 28 - December 9, 2022.arxiv.org/abs/2205.12134
  11. [11]Cheng, M., Singh, S., Chen, P.H., Chen, P., Liu, S., Hsieh, C., 2020. Sign-opt: A query-efficient hard-label adversarial attack, in: 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020, OpenReview.net.
  12. [12]Conn, A.R., Gould, N.I.M., Toint, P.L., 2000. Trust Region Methods. MOS-SIAM Series on Optimization, SIAM.DOI
  13. [13]Dashtbani, H., Gandomani, M.D., Sadeghzadeh, A., 2026. Random logit scaling: Defending deep neural networks against black-box score-based adversarial example attacks. Transactions on Machine Learning Research 2026.arxiv.org/abs/2607.14921
  14. [14]Goodfellow, I.J., Shlens, J., Szegedy, C., 2015. Explaining and harnessing adversarial examples, in: Bengio, Y., LeCun, Y. (Eds.), 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings.DOI
  15. [15]Guo, C., Gardner, J.R., You, Y., Wilson, A.G., Weinberger, K.Q., 2019. Simple black-box adversarial attacks, in: Chaudhuri, K., Salakhutdinov, R. (Eds.), Proceedings of the 36th International Conference on Machine Learning, ICML 2019, 9-15 June 2019, Long Beach, California, USA, PMLR. pp. 2484–2493.arxiv.org/abs/1905.07121
  16. [17]Hung-Quang, N., Lao, Y., Pham, T., Wong, K., Doan, K.D., 2024. Understanding the robustness of randomized feature defense against query-based adversarial attacks, in: The Twelfth International Conference on Learning Representations, ICLR 2024, Vienna, Austria, May 7-11, 2024, OpenReview.net.arxiv.org/abs/2310.00567
  17. [18]Ilyas, A., Engstrom, L., Athalye, A., Lin, J., 2018. Black-box adversarial attacks with limited queries and information, in: Dy, J.G., Krause, A. (Eds.), Proceedings of the 35th International Conference on Machine Learning, ICML 2018, Stockholmssmässan, Stockholm, Sweden, July 10-15, 2018, PMLR. pp. 2142–2151.arxiv.org/abs/1804.08598
  18. [19]Ilyas, A., Engstrom, L., Madry, A., 2019. Prior convictions: Black-box adversarial attacks with bandits and priors, in: 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019, OpenReview.net.arxiv.org/abs/1807.07978
  19. [20]Liu, X., Cheng, M., Zhang, H., Hsieh, C., 2018. Towards robust neural networks via random self-ensemble, in: Ferrari, V., Hebert, M., Sminchisescu, C., Weiss, Y. (Eds.), Computer Vision - ECCV 2018 - 15th European Conference, Munich, Germany, September 8-14, 2018, Proceedings, Part VII, Springer. pp. 381–397.arxiv.org/abs/1712.00673
  20. [21]Madry, A., Makelov, A., Schmidt, L., Tsipras, D., Vladu, A., 2018. Towards deep learning models resistant to adversarial attacks, in: 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings.arxiv.org/abs/1706.06083
  21. [22]Meckes, E., 2012. Approximation of projections of random vectors. Journal of Theoretical Probability 25, 333–352. doi:10.1007/s10959-010-0299-2.
  22. [23]Moosavi-Dezfooli, S., Fawzi, A., Frossard, P., 2016. Deepfool: A simple and accurate method to fool deep neural networks, in: 2016 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2016, Las Vegas, NV, USA, June 27-30, 2016, IEEE Computer Society. pp. 2574–2582.
  23. [24]Nesterov, Y.E., Spokoiny, V.G., 2017. Random gradient-free minimization of convex functions. Found. Comput. Math. 17, 527–566. URL: https://doi.org/10.1007/s10208-015-9296-2, doi:10.1007/s10208-015-9296-2.
  24. [25]Papernot, N., McDaniel, P.D., Goodfellow, I.J., Jha, S., Celik, Z.B., Swami, A., 2017. Practical black-box attacks against machine learning, in: Karri, R., Sinanoglu, O., Seghier, A., Yi, X. (Eds.), Proceedings of the 2017 ACM on Asia Conference on Computer and Communications Security, AsiaCCS 2017, Abu Dhabi, United Arab Emirates, April 2-6, 2017, ACM. pp. 506–519.arxiv.org/abs/1602.02697
  25. [26]Qin, Z., Fan, Y., Zha, H., Wu, B., 2021. Random noise defense against query-based black-box attacks, in: Ranzato, M., Beygelzimer, A., Dauphin, Y.N., Liang, P., Vaughan, J.W. (Eds.), Advances in Neural Information Processing Systems 34: Annual Conference on Neural Information Processing Systems 2021, NeurIPS 2021, December 6-14, 2021, virtual, pp. 7650–7663.arxiv.org/abs/2104.11470
  26. [27]Rebuffi, S., Gowal, S., Calian, D.A., Stimberg, F., Wiles, O., Mann, T.A., 2021. Data augmentation can improve robustness, in: Ranzato, M., Beygelzimer, A., Dauphin, Y.N., Liang, P., Vaughan, J.W. (Eds.), Advances in Neural Information Processing Systems 34: Annual Conference on Neural Information Processing Systems 2021, NeurIPS 2021, December 6-14, 2021, virtual, pp. 29935–29948.arxiv.org/abs/2111.05328
  27. [28]Reza, M.F., Jin, R., Wu, T., Dai, H., 2025. GSBAK: top-k geometric score-based black-box attack, in: The Thirteenth International Conference on Learning Representations, ICLR 2025, Singapore, April 24-28, 2025, OpenReview.net.arxiv.org/abs/2503.12827
  28. [29]Reza, M.F., Rahmati, A., Wu, T., Dai, H., 2023. CGBA: curvature-aware geometric black-box attack, in: IEEE/CVF International Conference on Computer Vision, ICCV 2023, Paris, France, October 1-6, 2023, IEEE. pp. 124–133.arxiv.org/abs/2308.03163
  29. [30]Rice, L., Wong, E., Kolter, J.Z., 2020. Overfitting in adversarially robust deep learning, in: Proceedings of the 37th International Conference on Machine Learning, ICML 2020, 13-18 July 2020, Virtual Event, PMLR. pp. 8093–8104.arxiv.org/abs/2002.11569
  30. [31]Salman, H., Li, J., Razenshteyn, I.P., Zhang, P., Zhang, H., Bubeck, S., Yang, G., 2019. Provably robust deep learning via adversarially trained smoothened classifiers, in: Wallach, H.M., Larochelle, H., Beygelzimer, A., d’Alché-Buc, F., Fox, E.B., Garnett, R. (Eds.), Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada, pp. 11289–11300.
  31. [32]Salman, H., Sun, M., Yang, G., Kapoor, A., Kolter, J.Z., 2020. Denoised smoothing: A provable defense for pretrained classifiers, in: Larochelle, H., Ranzato, M., Hadsell, R., Balcan, M., Lin, H. (Eds.), Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual.arxiv.org/abs/2003.01908
  32. [33]Szegedy, C., Zaremba, W., Sutskever, I., Bruna, J., Erhan, D., Goodfellow, I.J., Fergus, R., 2014. Intriguing properties of neural networks, in: Bengio, Y., LeCun, Y. (Eds.), 2nd International Conference on Learning Representations, ICLR 2014, Banff, AB, Canada, April 14-16, 2014, Conference Track Proceedings.arxiv.org/abs/1312.6199
  33. [34]Tramèr, F., Kurakin, A., Papernot, N., Goodfellow, I.J., Boneh, D., McDaniel, P.D., 2018. Ensemble adversarial training: Attacks and defenses, in: 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings, OpenReview.net.arxiv.org/abs/1705.07204
  34. [35]Virtanen, P., Gommers, R., Oliphant, T.E., Haberland, M., Reddy, T., Cournapeau, D., Burovski, E., Peterson, P., Weckesser, W., Bright, J., van der Walt, S., Brett, M., Wilson, J., Millman, K.J., Mayorov, N., Nelson, A.R.J., Jones, E., Kern, R., Larson, E., Carey, C., Polat, I., Feng, Y., Moore, E.W., VanderPlas, J., Laxalde, D., Perktold, J., Cimmrman, R., Henriksen, I., Quintero, E.A., Harris, C.R., Archibald, A.M., Ribeiro, A.H., Pedregosa, F., van Mulbregt, P., SciPy, 2019. Scipy 1.0-fundamental algorithms for scientific computing in python. CoRR abs/1907.10121. arXiv:1907.10121.DOI
  35. [37]Wang, D., Ju, A., Shelhamer, E., Wagner, D.A., Darrell, T., 2021. Fighting gradients with gradients: Dynamic defenses against adversarial attacks. CoRR abs/2105.08714. arXiv:2105.08714.arxiv.org/abs/2105.08714
  36. [38]Xie, C., Wang, J., Zhang, Z., Ren, Z., Yuille, A.L., 2018. Mitigating adversarial effects through randomization, in: 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings, OpenReview.net.arxiv.org/abs/1711.01991

Paper details

vlnc:W_vngh9m72
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents