Countering Adversarial Images using Input Transformations

Chuan Guo, Mayank Rana, Moustapha Cisse, Laurens van der Maaten

TL;DR

This paper demonstrates that simple, model-agnostic input transformations—specifically Total Variance (TV) minimization and Image Quilting—can effectively neutralize adversarial attacks. By introducing non-differentiability and randomness into the image-processing pipeline, these defenses eliminate up to 90% of strong black-box attacks and 60% of gray-box attacks on the ImageNet dataset.

The Vulnerability of Deep Networks

Deep neural networks are notoriously fragile; small, imperceptible perturbations (adversarial examples) can cause them to misclassify images with high confidence. Most existing defenses fall into two camps: model-specific (like adversarial training, which is often computationally expensive and specific to one type of attack) and model-agnostic (pre-processing the input).

The authors argue that previous model-agnostic defenses, such as basic JPEG compression, were too simple to be effective. Meanwhile, model-specific defenses often fail Kerckhoffs’ principle: they assume the adversary doesn't know the defense strategy. This paper seeks to find robust, model-agnostic transformations that remove adversarial noise while preserving enough information for correct classification, even when the attacker knows the model's architecture and parameters (a "gray-box" setting).

Defensive Transformations

The researchers explored five different image transformations applied before the image reaches the classifier:

  1. Image Cropping and Rescaling: Randomly cropping the image and resizing it back to the original dimensions.
  2. Bit-depth Reduction: Quantizing pixel values (e.g., reducing 8-bit color to 3-bit) to remove small variations.
  3. JPEG Compression: Using standard lossy compression to "wash out" high-frequency adversarial noise.
  4. Total Variance (TV) Minimization: A compressed sensing technique that reconstructs an image from a random subset of pixels. It seeks the "simplest" version of the image that is consistent with the sampled pixels, effectively smoothing out localized adversarial perturbations.
  5. Image Quilting: A non-parametric method that synthesizes a new image by stitching together small patches from a database of "clean" image patches.

The Secret Sauce: The authors found that these defenses work best when the neural network is trained on transformed images. This ensures the model is familiar with the artifacts introduced by the defense (like the "blocky" look of quilting or the smoothness of TV minimization).

Datasets and Attack Methods

The study was conducted using the ImageNet classification dataset. They evaluated their defenses against four major attack methods: FGSM, I-FGSM, DeepFool, and Carlini-Wagner (CW-L2), using a ResNet-50 model as the primary target.

Visualizing different adversarial attacks and their underlying noise perturbations at varying strengths.

Key Insights

  • Non-Differentiability as a Shield: Gradient-based attacks (like FGSM) rely on backpropagating through the model to find the "perfect" perturbation. TV minimization and Image Quilting are non-differentiable or involve complex optimizations, making it extremely difficult for an adversary to calculate the gradients needed to circumvent the defense.
  • The Power of Randomness: Both TV minimization (which samples pixels randomly) and Image Quilting (which selects patches from a set of neighbors at random) are stochastic. This means the "defended" image is different every time, forcing an adversary to attack a distribution of possible inputs rather than a single fixed target.
  • Model-Agnostic Generalization: Unlike adversarial training, which often overfits to a specific attack, these transformations remove the structure of adversarial noise generally, making them effective across a wide variety of attack types.

Key Results

  • Black-Box Attacks: In settings where the attacker doesn't know the model, the best defense (an ensemble of cropping, TV minimization, and quilting) eliminated 90% of strong attacks.
  • Gray-Box Attacks: Even when the attacker knows the model architecture and weights (but not the defense), the transformations eliminated 60% of attacks.
  • Superiority over Prior Work: The proposed transformations significantly outperformed "Ensemble Adversarial Training" (the previous state-of-the-art) on iterative attacks. For example, against DeepFool, the transformation-based defense was 18–24x more robust than ensemble training.
  • Accuracy Trade-off: While these defenses slightly reduce accuracy on "clean" images (e.g., from 76% to ~70%), they provide a massive net gain in security.

Limitations and Future Work

  • White-Box Vulnerability: The paper focuses on gray-box settings. A "white-box" adversary who knows the exact transformation and its parameters might still find ways to attack, perhaps by using differentiable approximations of the transformations.
  • Computational Overhead: TV minimization and Image Quilting are computationally more intensive than simple JPEG compression, which might limit their use in real-time, high-throughput systems.
  • Expansion to Other Domains: The authors suggest these ideas could be adapted for other fields, such as "spectrogram quilting" for defending speech recognition systems.

Summary updated

BibTeX
@inproceedings{guo2018countering,
  author = {Chuan Guo and Mayank Rana and Moustapha Cisse and Laurens van der Maaten},
  title = {{Countering Adversarial Images using Input Transformations}},
  booktitle = {International Conference on Learning Representations},
  year = {2018},
  url = {https://openreview.net/forum?id=SyJ7ClWCb},
}
Figure