Early Methods for Detecting Adversarial Images

Dan Hendrycks, Kevin Gimpel

Introduction

Deep neural networks are notoriously brittle. By adding a tiny amount of carefully calculated noise to an image, an attacker can cause a model to confidently misclassify a handwritten digit on a check or allow malware to bypass a filter. Because these changes are often imperceptible to humans, there is a dangerous disconnect between human and computer vision.

This paper introduces three detection methods—PCA whitening, softmax distribution analysis, and autoencoder reconstruction—that flag these "pathological" inputs. The goal isn't just to stop the attack, but to impose an "adversarial tax": making the cost of attacking so high that any successful exploit would have to be visible to a human observer.

Detection Strategies

The authors propose three distinct statistical and reconstructive strategies to identify adversarial images:

1. PCA Whitening

Adversarial perturbations tend to place abnormal emphasis on the lower-ranked principal components—the parts of the data that usually contain the least variance or noise. By performing Principal Component Analysis (PCA) and "whitening" the input, these subtle adversarial signals are amplified, making them easy to spot.

PCA coefficients for clean vs. adversarial images

2. Softmax Distribution Analysis

Building on prior work, the authors note that clean, correctly classified images typically produce a specific type of probability distribution in the final "softmax" layer. Adversarial images, however, often produce flatter or more unusual distributions that can be statistically flagged.

3. Reconstruction with Logits

The authors trained an autoencoder to reconstruct images using both the image itself and the model's classification "logits" (the raw scores before the final probability layer). Because adversarial images contain conflicting information—they look like one thing but are tuned to score highly as another—the autoencoder produces a much lower-quality reconstruction for adversarial inputs than for clean ones.

Autoencoder reconstructions of clean and adversarial MNIST digits

Additionally, the paper introduces a modified "guided backpropagation" saliency map technique to more clearly visualize which parts of an image drive a network's (potentially incorrect) decision.

Key Insights and Results

The methods were evaluated on three standard computer vision benchmarks: MNIST, CIFAR-10, and Tiny-ImageNet. The detectors proved remarkably effective, especially against Fast Gradient Sign (FGS) attacks.

  • Perfect Detection on FGS: The PCA detection method achieved a 100.0% AUROC against FGS attacks across Tiny-ImageNet, CIFAR-10, and MNIST.
  • Robustness to Iterative Attacks: Against more sophisticated iterative attacks, the PCA detector still performed well, reaching 92.4% AUROC on Tiny-ImageNet.
  • Reconstruction Efficacy: On MNIST, the reconstruction-based detector achieved a 96.2% AUROC.
  • The "Adversarial Tax": The most profound insight is that detection creates a strict trade-off for the attacker. When researchers tried to force an iterative attack on CIFAR-10 to "look normal" to the PCA detector, 92% of the images could no longer be converted into successful adversarial examples. To bypass the detector, attackers are forced to make much larger, visually obvious modifications to the image.

Limitations and Future Work

While promising, these defenses are not silver bullets. The authors acknowledge an ad-hoc vulnerability: if an attacker knows exactly which single detector is being used, they can often design an attack to bypass it (though at the cost of image quality).

To counter this, the authors argue for defense through ensembling. While any single detector might be bypassed, an ensemble of diverse detectors (statistical, distributional, and reconstructive) is much harder to defeat simultaneously. However, the paper leaves the formal framework for optimally weighting or combining these detectors to future work. Finally, they briefly suggest that simple preprocessing—like squaring pixels and applying a Gaussian blur—can strip away adversarial noise, though this requires further study to ensure it doesn't degrade model accuracy on clean data.

Summary updated

BibTeX
@inproceedings{hendrycks2017early,
  author = {Dan Hendrycks and Kevin Gimpel},
  title = {{Early Methods for Detecting Adversarial Images}},
  booktitle = {Workshops @ ICLR},
  year = {2017},
}
Figure