Sparse patches adversarial attacks via extrapolating point-wise information

Yaniv Nemcovsky, Avi Mendelson, Chaim Baskin

This paper, presented at the AdvML-Frontiers workshop at NeurIPS 2024, introduces a powerful new method for generating sparse and patch-based adversarial attacks. By shifting the perspective from "where should I place a patch?" to "which pixels in a dense attack are most important?", the authors achieve state-of-the-art results across a variety of deep learning architectures.

TL;DR

The authors propose PGDTrim, a novel approach that generates sparse and patch adversarial attacks by starting with a dense perturbation and iteratively "trimming" it down to a target sparsity. This method enables the simultaneous optimization of both patch locations and the perturbations themselves, significantly outperforming existing state-of-the-art sparse attacks on ImageNet.

What Problem Does This Paper Address?

Adversarial attacks typically involve adding small, often imperceptible, noise to an image to fool a neural network. Most research focuses on $L_\infty$ or $L_2$ norm bounds (limiting the magnitude of noise). However, sparse attacks ($L_0$ norm) limit the number of pixels changed, while patch attacks constrain those changes to specific shapes (like a square sticker).

Patch attacks are particularly dangerous because they are highly realistic—think of a physical sticker on a stop sign or a pattern on a t-shirt. The core challenge is optimization: finding the best locations for these patches while simultaneously finding the best noise to put in them is a combinatorial nightmare. Previous methods usually simplified the problem by fixing the locations first or only optimizing a single patch.

Methods

The researchers introduce a process called TrimStep. Instead of trying to pick the best pixels from scratch, they start with a "dense" adversarial perturbation (where many pixels are modified) and then prune it.

  1. Point-wise Evaluation: They use Monte Carlo sampling to estimate the "significance" of each pixel. They apply random binary masks to the dense perturbation and measure how much each pixel contributes to the attack's success on average.
  2. Iterative Trimming: They don't jump straight to the final sparsity. They use a logarithmic trimming schedule, gradually reducing the number of allowed pixels.
  3. Robust Optimization: To ensure the dense perturbation remains effective even after pixels are removed, they employ a specialized Bernoulli dropout scheme during the optimization phase. This forces the attack to be "robust" to the trimming process that follows.
  4. Patch Constraints: For patch attacks (PGDTrimKernel), they adapt the trimming process to select groups of pixels that form the desired patch shapes, using a "max-out" scheme to handle overlapping patches.
Figure 1: Flowchart of our sparse (top) and 2 × 2 patch (bottom) adversarial attacks trim process on Imagenet standard Resnet50 model, for attacks bounded to ϵ0 = 224. We present the adversarial inputs produced for distinct ϵ0 bounds during the process and the predicted label for each, compared to the true label.

Datasets

The method was evaluated on the ImageNet classification task using several prominent model architectures:

  • CNNs: InceptionV3 and ResNet50 (both standard and adversarially robust versions).
  • Vision Transformers (ViTs): Swin-B and ConvNeXt-B.

Key Insights and Ideas

  • Extrapolation over Search: The fundamental "aha" moment is that a dense adversarial perturbation contains latent information about which regions of an image are most vulnerable. By "extrapolating" this point-wise information, you can bypass the need for complex combinatorial searches for patch locations.
  • Simultaneous Optimization: Unlike prior work that alternated between finding locations and finding noise, PGDTrim optimizes both at once through the trimming process.
  • Universality: The approach is architecture-agnostic. It works just as well on traditional CNNs as it does on modern Vision Transformers, suggesting that the "importance" of specific input points is a general property of how these models process data.

Key Results

The authors report a significant jump in Adversarial Success Rate (ASR) compared to previous state-of-the-art methods like GreedyFool, SparseFool, and Homotopy.

  • Dominance in Sparsity: On InceptionV3, PGDTrim reaches nearly 100% ASR with an $L_0$ bound of 128 pixels, while previous methods were often below 60% at the same level.
  • Patch Efficiency: Even when constrained to $2 \times 2$ or $4 \times 4$ patches, the method remains highly effective. Interestingly, the $2 \times 2$ patch attack often performs comparably to the best unconstrained sparse attacks from previous literature.
  • Robustness to Defense: The method is particularly effective against "robust" models (trained with adversarial defense), outperforming other attacks by an even wider margin in these challenging settings.
Figure 2: We compare our method to previous sparse attack works(left) and with various patch sizes (right) on the Imagenet dataset InceptionV 3 model. We report the ASR as a function of l0 for all attacks.

Limitations and Future Work

  • Independence Assumption: The current point-wise evaluation assumes that the benefit of a pixel is somewhat independent of others. While this works well in practice, it might miss complex, highly-correlated adversarial patterns.
  • Patch Shapes: While the framework supports any shape, the current experiments focused on standard square patches. The authors suggest that optimizing for arbitrary, non-rectangular shapes is a promising direction for future work.
  • Computational Cost: The Monte Carlo sampling and iterative trimming steps add computational overhead compared to simple one-step attacks, though the authors provide a reference implementation to mitigate this.

A reference implementation is available at https://github.com/yanemcovsky/SparsePatches.git.

Summary updated

BibTeX
@inproceedings{nemcovsky2024sparse,
  author = {Yaniv Nemcovsky and Avi Mendelson and Chaim Baskin},
  title = {{Sparse patches adversarial attacks via extrapolating point-wise information}},
  booktitle = {AdvML-Frontiers @ NeurIPS},
  year = {2024},
  url = {https://openreview.net/forum?id=5DCCVCN2st},
}
Figure