A Sober Look at the Robustness of CLIPs to Spurious Features

Qizhou Wang, Yong Lin, Yongqiang Chen, Ludwig Schmidt, Bo Han, Tong Zhang

TL;DR

Contrastive Language-Image Pre-training (CLIP) models are widely celebrated for their exceptional robustness to distribution shifts, but this paper shows that this reputation might be an artifact of biased benchmarking. By introducing CounterAnimal, a dataset tracking real-world background corruptions, the authors reveal that CLIP models heavily rely on spurious correlations present in web-scale training data. Surprisingly, standard ImageNet-trained models often show greater robustness to these specific web-native shortcuts than CLIP does.

What Problem Does This Paper Address?

Vision-language models like CLIP have redefined robustness, routinely outperforming traditional supervised models on distribution shifts like ImageNet-A or ImageNet-R. However, the authors point out a critical blind spot: these evaluation benchmarks were specifically designed to exploit the weaknesses of ImageNet-trained models.

Because CLIP is trained on massive, uncurated web datasets (like LAION), it naturally inherits a completely different set of real-world biases and spurious correlations (e.g., associating an "ice bear" exclusively with snow). Evaluating CLIP primarily on ImageNet-centric shifts creates an illusion of universal robustness. This paper addresses this gap by asking: How robust are CLIP models to the spurious features native to their own web-scale training distributions?

Methods

To systematically expose CLIP's reliance on shortcuts, the authors developed a dataset curation pipeline that targets background-driven spurious features.

  1. Data Collection & Curation: They gathered raw animal images from iNaturalist matching ImageNet classes and manually filtered out low-quality, ambiguous, or heavily occluded images.
  2. Background Labeling: Backgrounds were manually annotated into distinct categories (e.g., snow, grass, water, sky).
  3. Spurious Feature Discovery: Using a standard CLIP model (CLIP-LAION400M-ViT-B/32) as a proxy, they identified pairs of backgrounds for each animal class that caused severe performance drops. This allowed them to split the dataset into easy groups (animals in common backgrounds) and hard groups (animals in uncommon but plausible backgrounds).

Complementing this empirical approach, the authors provided a rigorous theoretical analysis proving that the standard contrastive learning objective does not inherently protect models from learning spurious features if those correlations are strong enough in the pre-training data.

Datasets

The paper introduces and utilizes several datasets:

  • CounterAnimal (New): The primary benchmark, consisting of 45 animal classes across 7,174 "easy" photos and 5,926 "hard" photos.
  • CounterAnimal-I (New): A control variant curated using an ImageNet-trained ResNet50 instead of CLIP, used to demonstrate how different training sets breed entirely different spurious vulnerabilities.
  • ColoredCOCO & MultiColoredMNIST: Synthetic datasets featuring controlled spurious correlations (like digit-color pairings) used to validate the paper's theoretical claims.

Key Insights and Ideas

  • The Robustness Illusion: CLIP's robustness is highly contextual. While it successfully avoids ImageNet's specific biases, it readily succumbs to shortcuts prevalent on the open web.
  • ImageNet Models Can Be More Robust: When evaluated on CounterAnimal, traditional ImageNet-supervised models actually exhibit stronger effective robustness (less performance drop between easy and hard groups) than CLIP models.
Easy vs. Hard Performance Trends
  • Data Quality > Data Scale: Simply increasing the size of an uncurated pre-training dataset does not mitigate spurious correlations. However, training CLIP on stringently filtered, high-quality datasets (such as DataComp or Data Filtering Networks) significantly reduces its reliance on shortcuts.
  • Model Scaling Helps: Unlike data scaling, scaling up the model architecture (e.g., moving from ViT-B to ViT-L or ViT-G) consistently improves robustness against spurious features.

Key Results

The performance degradation of CLIP models on CounterAnimal is stark. For instance, the proxy CLIP model achieves 97.62% accuracy on ice bears in the snow, but this plummets to 70.91% accuracy when the ice bear is on grass.

As illustrated in the benchmark evaluations, when mapping easy-group accuracy against hard-group accuracy, ImageNet models (represented in red) consistently sit closer to the ideal $y=x$ line (indicating zero bias) than standard CLIP configurations (represented in blue).

1 vs. 20 Evaluation Setup

Across almost all animal classes, shifting the background context results in non-trivial accuracy drops for CLIP, confirming that web-scale multi-modal pre-training introduces systematic vulnerabilities to environmental context.

Limitations and Future Work

While CounterAnimal successfully exposes these vulnerabilities, the authors note several limitations:

  • Semantic Scope: The dataset is currently restricted to 45 animal classes.
  • Type of Spurious Features: The focus is primarily on background-based shortcuts rather than other forms of spurious correlations, such as texture or co-occurring objects.
  • Data Source: Relying solely on iNaturalist introduces specific photographic and ecological distribution biases.

Future work will focus on expanding the dataset to broader semantic categories, diversifying raw data sources, and devising new training objectives capable of mitigating web-native distribution shifts.

Summary updated

BibTeX
@inproceedings{wang2024sober,
  author = {Qizhou Wang and Yong Lin and Yongqiang Chen and Ludwig Schmidt and Bo Han and Tong Zhang},
  title = {{A Sober Look at the Robustness of CLIPs to Spurious Features}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=wWyumwEYV8},
}
Figure