Spatially Transformed Adversarial Examples

Chaowei Xiao, Jun-Yan Zhu, Bo Li, Warren He, Mingyan Liu, Dawn Song

TL;DR

Most adversarial attacks fool neural networks by subtly changing pixel colors, often leaving unnatural "static" or grain. This paper introduces stAdv, a novel method that creates adversarial examples by slightly "nudging" pixel positions instead. These spatially transformed images look perfectly natural to human observers but successfully bypass state-of-the-art defenses designed to stop traditional pixel-manipulation attacks.

The Problem with Traditional Attacks

Deep Neural Networks (DNNs) are notoriously fragile. Researchers have long known that adding a tiny amount of carefully crafted "noise" to an image can trick a model into misclassifying a cat as a toaster. Traditionally, these attacks are bounded by the $L_p$ norm, a mathematical constraint that ensures the color of any individual pixel doesn't change too drastically.

Comparison of adversarial examples generated by FGSM, C&W, and the proposed stAdv method. Notice how stAdv avoids the unnatural static or grain seen in traditional attacks.

However, the authors argue that $L_p$ distance is a poor proxy for human perception. For example, if you shift an entire image just one pixel to the left, the $L_p$ distance to the original image is massive (because almost every pixel value has changed), yet a human would say the images are identical. Conversely, traditional adversarial noise often looks like static or grain, which is easy for humans to spot. To address this, the authors aim to create a new class of adversarial attacks based on spatial transformation—deforming the geometry of the image rather than just changing its colors.

Methodology: Spatially Transformed Attacks (stAdv)

The authors propose stAdv (Spatially Transformed Adversarial Examples). Instead of calculating a direct change in pixel value ($\delta$), they calculate a flow field ($f$) that dictates how pixels should move.

The stAdv generation process: A flow field is optimized to displace pixels from the benign image using differentiable bilinear interpolation, creating a spatially transformed adversarial image.
  1. Flow Field Calculation: For every pixel in the target adversarial image, the algorithm calculates a displacement vector $(\Delta u, \Delta v)$ that points to where that pixel should "pull" its color from in the original image.
  2. Differentiable Interpolation: Because the displacement might point to a non-integer coordinate (e.g., move 0.5 pixels left), the authors use bilinear interpolation. Crucially, this process is differentiable, allowing them to use backpropagation to "train" the flow field to fool a classifier.
  3. The Objective Function: The optimization balances two primary goals:
  4. Adversarial Loss: Force the model to predict the wrong class (or a specific target class).
  5. Flow Loss ($L_{flow}$): A Total Variation (TV) penalty ensures that the displacement of one pixel is very similar to its neighbors. This prevents the image from looking "shattered" and ensures the deformation is smooth and locally consistent.

Datasets Evaluated

The researchers evaluated stAdv across three standard computer vision benchmarks:

  • MNIST: Handwritten digits (28x28 pixels).
  • CIFAR-10: Small color images of 10 categories like airplanes and dogs (32x32 pixels).
  • ImageNet: Large-scale, high-resolution images (evaluated on an ImageNet-compatible set from the NIPS 2017 adversarial competition).

Key Insights and Ideas

  • Breaking the $L_p$ Defense Paradigm: Most current defenses (like adversarial training) work by "hardening" the model against small pixel-value changes. Because stAdv changes the geometry of the image, it produces examples that fall entirely outside the "safety zone" these defenses were built to protect.
  • Perceptual Realism: Because the attack mimics natural variations—like slight changes in camera angle, lens distortion, or object pose—the resulting images are incredibly difficult for humans to distinguish from the originals.
  • Attention Shifting: By using Class Activation Mapping (CAM), the authors show that stAdv doesn't just confuse the model; it actively shifts the model's "attention." For instance, a model might correctly look at a bike's wheels to identify it, but after a spatial transformation, the model's attention might drift to a random patch of background, leading to a misclassification.

Key Results

  • High Success Rates: stAdv achieved nearly 100% attack success on MNIST and CIFAR-10 in white-box settings.
  • Resilience to Defenses: This is the most striking result. On MNIST, models defended with "Ensemble Adversarial Training" reduced traditional attacks (like C&W) to a ~4% success rate. However, stAdv maintained a ~48% success rate against the exact same defended model.
  • Human Indistinguishability: In a user study on Amazon Mechanical Turk, participants were shown an original image and an stAdv image side-by-side for 2 seconds. They chose the stAdv image as "more realistic" 47.01% of the time. Since 50% would mean they are guessing randomly, this strongly suggests the attacks are virtually imperceptible to human eyes.

Limitations and Future Work

  • The Metric Gap: The authors acknowledge that the field currently lacks a good mathematical metric to bound spatial transformations. While $L_p$ works for color changes, new metrics are needed to define what constitutes a "small" geometric distortion.
  • Defense Development: The paper serves as a "call to arms." It demonstrates that current defenses are over-fitted to a specific type of attack. Future work is urgently needed to create models that are robust to both pixel-level noise and geometric deformations.
  • Black-box Attacks: While this paper focuses on white-box settings (where the attacker knows the model's weights), exploring how well these spatial transformations transfer between different models (black-box) is a logical next step for understanding real-world threat models.

Summary updated

BibTeX
@inproceedings{xiao2018spatially,
  author = {Chaowei Xiao and Jun-Yan Zhu and Bo Li and Warren He and Mingyan Liu and Dawn Song},
  title = {{Spatially Transformed Adversarial Examples}},
  booktitle = {International Conference on Learning Representations},
  year = {2018},
  url = {https://openreview.net/forum?id=HyydRMZC-},
}
Figure