Score-based Black-box Attack via Adversarial Condition Guided Diffusion Model

Yuhang Chen, Chih-Hong Cheng, Kurt Debattista, Siddartha Khastgir, Xingyu ZhaoarXiv 2026

TL;DR

Fooling an image classifier without seeing its internal weights usually means training an attack on a substitute "surrogate" model and hoping it transfers—a clumsy process that often ruins image quality or misses the target entirely. By weaving classic query-based black-box attacks directly into the denoising loop of a diffusion model, the authors steer images smoothly across a target model's true decision boundary using only its output probabilities. The result? Adversarial images that look remarkably natural while fooling classifiers—even hardened, adversarially trained ones—far more reliably than transfer-based methods.

What Problem Does This Paper Address?

Classic adversarial attacks add tiny, mathematically bounded pixel static ($\ell_p$-norm perturbations) to trick neural networks. Lately, researchers have shifted toward unrestricted adversarial examples (UAEs): using generative priors like diffusion models to create natural, photorealistic tweaks (subtle shifts in texture or lighting) that fool classifiers while looking completely benign to human eyes.

In a realistic black-box setting—where you don't have access to the victim model's architecture or gradients—existing diffusion attacks rely on transferability. You craft the adversarial image against a white-box surrogate model you do own, hoping it also fools the hidden victim.

Figure 1. Transfer-based diffusion attacks versus ours. (a) The sur- rogate gradient pushes the sample towards p(x | ytar), yet it stays on the original side of the victim boundary. (b) Adversarial guid- ance and score-based queries move it across the victim boundary while it stays close to p(x | yori).

As illustrated above, this has three major headaches:

  1. Boundary mismatch: Pushing an image across a surrogate's decision boundary doesn't guarantee it crosses the victim's, especially if one is a CNN and the other is a Vision Transformer.
  2. Visual artifacts: Cranking up the optimization pressure to force transferability often warps the image's semantics or introduces bizarre visual glitches.
  3. Underused diffusion priors: To keep the image faithful to the original, existing methods lock the diffusion prompt to the original label, leaving the diffusion model's rich knowledge of other classes sitting on the bench.

Methods

Instead of guessing with a surrogate, the authors bring score-based black-box attacks—methods that estimate gradients by querying the victim and observing its output class probabilities—inside the reverse denoising trajectory of Stable Diffusion v2.0.

Figure 2. Overview of latent score-based adversarial sampling. The clean image is inverted to xT and denoised step by step. At each step, the switch keeps the original condition cori or routes xt to ATG or TSG, and the score-based attack updates xt−1 from the scores of at most Q queries to the victim. Thumbnails are decoded latents of Latent-NES against ResNet-50.

Here is how the pipeline works:

  • Latent Score-Based Sampling: A clean image is encoded and partially inverted into a noisy latent representation ($x_T$) over the final $T=5$ DDIM steps. As the model denoises step-by-step back to a clean image, the authors pause at each step, run a score-based attack (evaluating six classics like NES, ZOsignSGD, and Square Attack) in the latent space using at most $Q$ queries to the victim, and nudge the latent vector toward misclassification. Subsequent denoising steps naturally polish these latent nudges into realistic textures.
  • Adaptive-Target Guidance (ATG): Under tight query budgets, latent nudges alone might fall short. ATG taps into classifier-free guidance: it spends just one extra query per step to identify the victim's current "runner-up" class, then blends that competing class prompt into the denoising step to actively pull the image toward the decision boundary.
  • Target-Search Guidance (TSG): Pushing too hard toward a competing class with ATG can bleed unwanted features into the image. TSG solves this by keeping the prompt close to home: it uses a score-based attack ($Q_c$ queries) to find a tiny perturbation right around the original prompt embedding, boosting attack power without altering the scene's semantics.

Datasets

The framework is evaluated on the standard ImageNet-Compatible Dataset, consisting of 1,000 validation images. No new datasets are introduced; instead, the authors test across a diverse gauntlet of 15 victim models—five CNNs (e.g., ResNet-50, ConvNeXt), four Vision Transformers (e.g., ViT-B, Swin-B), two MLP-Mixers, and four adversarially trained models.

Key Insights and Ideas

  • Dense beats sparse in diffusion latent space: Score-based attacks that perturb all latent coordinates simultaneously (like ZOsignSGD and NES) vastly outperform sparse or local methods like SimBA (which tweaks one coordinate at a time). In a compressed latent space under tight query limits, broad directional estimates do much heavier lifting.
  • Denoising acts as a natural regularizer: Updating latents inside the reverse process lets the diffusion prior heal adversarial artifacts on the fly. Even without pixel-level $\ell_p$ constraints, image quality (measured by FID, where lower means more natural) stays remarkably close to clean images.
  • Prompt perturbations give stealthy leverage: Ablations reveal that while condition guidance (ATG or TSG) cannot reliably fool models on its own, pairing TSG with latent perturbations gives a massive boost in attack success while adding almost zero perceptual degradation (increasing FID by at most 0.7).

Key Results

Note that in adversarial attacks, lower victim top-1 accuracy means a stronger attack:

  • Unguided Latent Attacks: With 720 max queries per image ($Q=120$ over 5 steps plus initial $x_T$), unguided Latent-ZOsignSGD drops average accuracy across 11 standard models from 89.4% down to 12.1% with an FID of 59.6, handily beating the strongest transfer baseline, APA-GC (17.7% accuracy, 72.0 FID).
  • Guidance Variants: Adding ATG ($s=2.5$) drives Latent-ZOsignSGD victim accuracy down to a remarkable 6.1% (at 67.4 FID). Meanwhile, TSG at a tighter latent budget ($Q=60, Q_c=60$) hits 15.4% accuracy while keeping FID at a crisp 60.1.
  • Defended & Decision-Based Comparisons: Against four adversarially trained models, Latent-ZOsignSGD + ATG drops average accuracy from 83.2% to 5.5% (versus 16.5% for APA-GC). On ResNet-50, Latent-ZOsignSGD at 360 queries (20.8% acc, 59.6 FID) outperforms the decision-based Latent-HSJA even when the latter is given 10$\times$ to 20$\times$ the query budget (45.2% acc at 7,200 queries).
Figure 3. Qualitative comparison with ResNet-50 as the victim and as the white-box surrogate of the transfer-based baselines.

Qualitatively, transfer baselines like ACA hallucinate extra airplanes or rewrite backgrounds, and APA-GC leaves scribble-like artifacts on racetracks. The authors' method preserves object identity and pose, limiting changes to subtle textures like grass or license plates.

Limitations and Future Work

While the paper does not feature a dedicated "Limitations and Future Work" section, several practical trade-offs emerge directly from the authors' analysis:

  • Effectiveness vs. Stealthiness in ATG: Cranking up the guidance scale in ATG significantly boosts attack success, but explicitly pulling toward a runner-up class inevitably degrades image quality (raising FID by up to 9.3 points) and introduces stronger texture shifts.
  • Computational and Query Overhead in TSG: While TSG preserves visual fidelity, searching the prompt embedding space is not free—it requires $T(Q_c + 1)$ additional victim queries and $O(T Q_c)$ extra diffusion noise predictions per image.
  • Access Assumptions: Unlike transfer-based attacks (which require zero queries to the victim at test time) or decision-based attacks (which only need the final top-1 label), this framework assumes the attacker can repeatedly query the victim model and read its continuous output probability scores.

Summary updated

Abstract

Generative models enable unrestricted adversarial attacks that aim to fool classifiers while preserving the natural appearance and semantics of the original image. However, existing diffusion-based black-box attacks largely rely on transferability from surrogates, making their effectiveness sensitive to differences between surrogate and victim. Improving transferability can also distort semantic content and degrade image quality. Moreover, retaining the original prompt to preserve fidelity leaves the diffusion model's conditional prior underused for adversarial guidance. We address these limitations by adapting score-based black-box attacks to reverse diffusion, using the victim's output probabilities to guide latent updates without accessing its gradients. We further introduce adaptive-target guidance, which uses the victim's current runner-up class as an adversarial condition to steer denoising towards the decision boundary. Because such guidance can introduce unwanted semantic changes, we also propose target-search guidance, which searches for a small perturbation of the original condition embedding using a score-based attack. This achieves comparable attack effectiveness with better image quality than runner-up guidance. Experiments on the ImageNet-Compatible dataset show that our framework outperforms transfer-based baselines in both attack effectiveness and image quality.
BibTeX
@misc{chen2026score,
  author = {Yuhang Chen and Chih-Hong Cheng and Kurt Debattista and Siddartha Khastgir and Xingyu Zhao},
  title = {{Score-based Black-box Attack via Adversarial Condition Guided Diffusion Model}},
  year = {2026},
  eprint = {2611.34564},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.34564},
}
Figure