Nonlinear Projection Based Gradient Estimation for Query Efficient Blackbox Attacks

Huichen Li, Linyi Li, Xiaojun Xu, Xiaolu Zhang, Shuang Yang, Bo Li

Abstract

Gradient estimation and vector space projection have been studied as two distinct topics. We aim to bridge the gap between the two by investigating how to efficiently estimate gradient based on a projected low-dimensional space. We first provide lower and upper bounds for gradient estimation under both linear and nonlinear projections, and outline checkable sufficient conditions under which one is better than the other. Moreover, we analyze the query complexity for the projection-based gradient estimation and present a sufficient condition for query-efficient estimators. Built upon our theoretic analysis, we propose a novel query-efficient Nonlinear Gradient Projection-based Boundary Blackbox Attack (NonLinear-BA). We conduct extensive experiments on four image datasets: ImageNet, CelebA, CIFAR-10, and MNIST, and show the superiority of the proposed methods compared with the state-of-the-art baselines. In particular, we show that the projection-based boundary blackbox attacks are able to achieve much smaller magnitude of perturbations with 100% attack success rate based on efficient queries. Both linear and nonlinear projections demonstrate their advantages under different conditions. We also evaluate NonLinear-BA against the commercial online API MEGVII Face++, and demonstrate the high blackbox attack performance both quantitatively and qualitatively.

Introduction: The Challenge of Black-box Attacks

Adversarial attacks—small, imperceptible changes to an image that trick a machine learning model—are well-understood in "white-box" settings where the attacker has full access to the model's parameters. However, in "black-box" settings, such as attacking a commercial API, the attacker can only observe the model's output (e.g., labels or confidence scores).

The primary hurdle in black-box attacks is query complexity. Estimating the "gradient" (the direction in which pixels should be modified to flip a prediction) typically requires sampling thousands of random perturbations. Given that modern images are high-dimensional (e.g., 150,000+ dimensions), this process is computationally expensive and slow. While previous research explored linear subspaces to reduce dimensionality, this paper investigates whether nonlinear projections can further enhance gradient estimation efficiency.

Methodology: NonLinear-BA

The proposed framework, NonLinear-BA (Nonlinear Gradient Projection-based Boundary Attack), shifts from simple linear mappings to complex, nonlinear projections facilitated by deep generative models.

Overview of the Nonlinear Projection-based Gradient Estimation process.

The core components of the method include:

  1. Generative Projections: Pre-trained models—specifically Autoencoders (AE), Variational Autoencoders (VAE), and Generative Adversarial Networks (GAN)—serve as the projection functions. These models are trained on image gradients from "reference" models to learn the structural priors of effective perturbations.
  2. Latent Space Sampling: Instead of perturbing the high-dimensional image directly, the attack samples small perturbations in a low-dimensional "latent" space. The generative model then projects these back into the high-dimensional pixel space.
  3. Gradient Estimation: A Monte Carlo sampling method, based on the signs of the model's responses to these projected perturbations, is used to estimate the true gradient direction.
  4. Boundary Search: After estimating the gradient, the image is moved along that direction. A binary search is then employed to remain on the "decision boundary" of the target model, iteratively minimizing the distance to the original image.

Experimental Evaluation

The researchers evaluated NonLinear-BA across four standard computer vision benchmarks:

  • ImageNet: Large-scale general object recognition.
  • CelebA: Human face attributes classification.
  • CIFAR-10 & MNIST: Standard benchmarks for smaller-scale image classification.
  • MEGVII Face++: A real-world, commercial online API used to validate the practical effectiveness of the attack.

Key Results and Insights

The theoretical analysis demonstrates that nonlinear projections can achieve a strictly higher cosine similarity with the true gradient than linear ones, leading to more accurate direction estimation.

Mean Squared Error (MSE) vs. Number of Queries across four datasets, comparing NLBA variants against state-of-the-art baselines.
  • Significant Query Reduction: On the CelebA dataset, the NLBA-GAN variant reached a target perturbation distance (MSE < $10^{-4}$) in just a few hundred queries. In contrast, the baseline HSJA required over 10,000 queries to achieve comparable results.
  • Enhanced Stealth: The attacks maintained a 100% success rate while achieving significantly smaller perturbation magnitudes than linear baselines like QEBA and HSJA.
  • Real-World Generalization: The method successfully compromised the commercial Face++ API. Notably, generative models trained on ImageNet generalized effectively even when the attacker had no knowledge of the target API's training data or architecture.

Discussion and Future Work

While highly effective, the study identified certain limitations. GAN instability was observed; although GAN-based projections were fastest in some scenarios (like CelebA), they were less stable on complex datasets, sometimes leading to "bad local optima." Furthermore, the current reliance on reference models for training nonlinear projections raises questions about optimal reference data selection. Future work will focus on developing more efficient search algorithms to navigate these nonlinear spaces with stronger theoretical guarantees.

Summary updated

BibTeX
@inproceedings{li2021nonlinear,
  author = {Huichen Li and Linyi Li and Xiaojun Xu and Xiaolu Zhang and Shuang Yang and Bo Li},
  title = {{Nonlinear Projection Based Gradient Estimation for Query Efficient Blackbox Attacks}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2021},
  url = {https://openreview.net/forum?id=uqyYVoWlqKP},
}
Figure