Natural Adversarial Examples

Dan Hendrycks, Kevin Zhao, Steven Basart, Jacob Steinhardt, Dawn Song

Abstract: We introduce two challenging datasets that reliably cause machine learning model performance to substantially degrade. The datasets are collected with a simple adversarial filtration technique to create datasets with limited spurious cues. Our datasets' real-world, unmodified examples transfer to various unseen models reliably, demonstrating that computer vision models have shared weaknesses. The first dataset is called ImageNet-A and is like the ImageNet test set, but it is far more challenging for existing models. We also curate an adversarial out-of-distribution detection dataset called ImageNet-O, which is the first out-of-distribution detection dataset created for ImageNet models. On ImageNet-A a DenseNet-121 obtains around 2% accuracy, an accuracy drop of approximately 90%, and its out-of-distribution detection performance on ImageNet-O is near random chance levels. We find that existing data augmentation techniques hardly boost performance, and using other public training datasets provides improvements that are limited. However, we find that improvements to computer vision architectures provide a promising path towards robust models.

The Brittleness of Modern Computer Vision

Deep learning models have achieved "superhuman" performance on standard benchmarks like ImageNet. However, it has long been known that these models can be easily fooled by "adversarial examples"—images with invisible digital noise engineered to trigger incorrect predictions. While some dismissed these as digital artifacts, researchers are now uncovering a more fundamental problem: distribution shift in the real world.

In natural settings, objects appear in varied lighting, against complex backgrounds, and in unusual orientations. Current models often rely on spurious cues (shortcuts) rather than true object understanding. For instance, a model might identify a "cow" primarily by the presence of green grass. When these shortcuts fail, model performance collapses.

Methodology: Adversarial Filtration

To systematically study these failures, the authors used a technique called adversarial filtration to "mine" for hard, real-world images. Rather than digitally altering images, they searched through millions of unmodified photos from sources like iNaturalist and Flickr.

The process involved:

  1. Downloading millions of images related to 200 ImageNet classes.
  2. Filtering out any image that a standard ResNet-50 model could correctly classify.
  3. Manually reviewing the remaining "hard" images to ensure they were high-quality, single-class, and easily identifiable by humans.

Benchmarking Failure: ImageNet-A and ImageNet-O

This research introduces two primary benchmarks that highlight different failure modes of modern vision systems:

  • ImageNet-A: 7,500 real-world, unmodified images belonging to ImageNet classes that cause state-of-the-art classifiers to fail. These images often contain textures or backgrounds that trigger "shortcut" logic.
  • ImageNet-O: 2,000 "out-of-distribution" (OOD) images. These are images of classes not in the training set (e.g., a "T-Rex") that models mistakenly classify as known objects (e.g., a "triceratops") with high confidence.
Examples of natural adversarial examples from ImageNet-A and ImageNet-O showing high-confidence misclassifications.

Key Insights and Quantitative Results

The performance of standard models on these datasets is a significant wake-up call for the community. A DenseNet-121, which typically achieves ~90% accuracy on ImageNet, plummets to just 2% accuracy on ImageNet-A. Furthermore, on ImageNet-O, the ability of models to detect that an image is anomalous is near random chance.

Accuracy on ImageNet-A and detection performance (AUPR) on ImageNet-O across various popular architectures.

Several critical observations emerged from this data:

  • Shared Weaknesses: Natural adversarial examples transfer across models. An image that fools a ResNet often fools a DenseNet or VGG, suggesting different architectures are learning the same flawed shortcuts.
  • The Shortcut Trap: Models rely heavily on texture. For example, a dragonfly might be misclassified as a "manhole cover" due to the repeating patterns in the background.
  • Augmentation Limits: Popular data augmentation tricks (like Mixup or CutMix) provide almost no benefit against these natural shifts. They don't teach the model to ignore wrong cues; they just shift the model's reliance to different ones.
  • Architecture as a Path Forward: While more data (even 10x more) only provides modest gains, changing the model architecture itself (e.g., using Vision Transformers) showed the most promise for improving robustness.

Conclusion

ImageNet-A and ImageNet-O demonstrate that current computer vision models are far from robust. They rely on fragile patterns that do not generalize to the complexities of the real world. Future work must focus on training objectives that penalize the use of spurious cues, moving beyond simple pattern matching toward causal reasoning and true object understanding.

Summary updated

BibTeX
@inproceedings{hendrycks2021natural,
  author = {Dan Hendrycks and Kevin Zhao and Steven Basart and Jacob Steinhardt and Dawn Song},
  title = {{Natural Adversarial Examples}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2021},
  url = {https://openreview.net/forum?id=oZjcP75hVO2},
}
Figure