Query-Efficient Black-box Adversarial Examples

Andrew Ilyas, Logan Engstrom, Anish Athalye, Jessy Lin

Abstract

Generating adversarial examples typically requires full access to a model's internal gradients (white-box setting). However, real-world AI systems are often "black boxes" accessible only via APIs. This paper introduces a query-efficient method for black-box adversarial attacks using Natural Evolution Strategies (NES). By estimating gradients through input perturbations, the proposed approach achieves a 100x–1000x improvement in query efficiency over prior methods. The effectiveness of this technique is demonstrated through successful targeted attacks on commercial systems like the Google Cloud Vision API, even under limited information constraints.

Introduction

Adversarial examples—inputs specifically designed to fool machine learning models—pose a significant security risk. While white-box attacks are well-studied, they assume unrealistic access to model architectures and weights. In contrast, black-box attacks operate under the constraint of only observing model outputs, such as confidence scores or top-k labels.

Previous black-box methods were often impractical due to extreme query requirements or reliance on transferable "substitute models" that might not generalize to the target system. This research addresses the efficiency gap, enabling practical attacks against rate-limited commercial APIs by significantly reducing the number of queries needed to generate successful adversarial perturbations.

Methods

The researchers leverage Natural Evolution Strategies (NES) to perform gradient estimation without internal model access.

NES for Gradient Estimation

Instead of direct calculation, NES estimates the gradient by sampling the model’s output for a "population" of slightly perturbed versions of the input image. By analyzing how confidence scores shift across these samples, the algorithm identifies the optimal direction to modify pixels to maximize classification error. This approach is theoretically equivalent to performing finite-difference estimation over a random Gaussian basis, which is far more efficient than coordinate-wise finite differences.

Optimization Techniques

  • Antithetic Sampling: To stabilize estimation and improve efficiency, the method uses pairs of positive and negative perturbations, reducing variance and accelerating convergence.
  • Partial-Information Algorithm: For APIs that only return the top-$k$ results, the authors developed a strategy that begins with an image already belonging to the target class and iteratively "morphs" it toward the source image while using NES to ensure the model maintains the target classification.
  • Expectation Over Transformation (EOT): The method integrates EOT to produce robust adversarial examples that remain effective despite common image transformations like rotation or resizing.

Key Results

The method was evaluated on CIFAR-10, ImageNet (using InceptionV3), and the Google Cloud Vision API.

Efficiency and Success Rates

On ImageNet, the NES-based attack achieved a 99.2% success rate for targeted attacks with an average of only 24,780 queries—a massive improvement over previous state-of-the-art methods like ZOO, which often required millions. Even under partial-information constraints where only the top 10 labels are visible, the success rate remained high at 95.5%.

Adversarial examples generated using the NES-based black-box attack. The top row shows the original correct labels, while the bottom row shows the labels predicted by the model after the attack.

Commercial API Attack

The researchers successfully executed a targeted attack on the Google Cloud Vision API. In one instance, an image of skiers was perturbed until the API classified it as a "dog," despite the original image containing no dog-related features. Furthermore, the generated examples were "transformation-tolerant," maintaining a 95.7% success rate even when rotated by up to $\pm30^\circ$.

Discussion

By reducing query counts by three orders of magnitude, adversarial attacks transition from theoretical curiosities to practical security threats. An attack requiring 20,000 queries is feasible against a rate-limited API, whereas one requiring 20,000,000 is not.

Limitations and Future Work

Despite the efficiency gains, "robust" attacks (using EOT) still require millions of queries (~3.7M on average), posing a bottleneck for systems with heavy pre-processing. Additionally, the "curse of dimensionality" suggests that as image resolution increases, query requirements will likely grow. Future defense mechanisms might include rate-limiting or detection filters, though the efficiency of NES-based attacks makes such defenses significantly harder to implement effectively.

Summary updated

BibTeX
@misc{ilyas2017query,
  author = {Andrew Ilyas and Logan Engstrom and Anish Athalye and Jessy Lin},
  title = {{Query-Efficient Black-box Adversarial Examples}},
  year = {2017},
  eprint = {1712.07113},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1712.07113},
}
Figure