Interpreting CLIP: Insights on the Robustness to ImageNet Distribution Shifts

Jonathan Crabbé, Pau Rodríguez, Vaishaal Shankar, Luca Zappella, Arno Blaas · DOI

Abstract: What distinguishes robust models from non-robust ones? While for ImageNet distribution shifts it has been shown that such differences in robustness can be traced back predominantly to differences in training data, so far it is not known what that translates to in terms of what the model has learned. In this work, we bridge this gap by probing the representation spaces of 16 robust zero-shot CLIP vision encoders with various backbones and pretraining sets, and comparing them to less robust models. We generate three novel insights: the detection of outlier features in robust zero-shot CLIP vision encoders (observed for the first time in non-language/non-transformer models), the finding that these outliers indicate ImageNet shift robustness, and the observation that while zero-shot CLIP models encode more unique concepts, this is likely due to language supervision rather than being a direct indicator of robustness.

Introduction

Computer vision models often suffer from "brittleness," failing when encountering distribution shifts like sketches or unusual lighting. OpenAI’s CLIP model demonstrated remarkable "zero-shot" robustness to these shifts. While this robustness is linked to massive, diverse training data, the internal mechanisms—the "how" of robustness—have remained unclear. This research investigates the internal representation spaces to identify what distinguishes a robust model from a fragile one.

Methodology and Datasets

The researchers performed a comprehensive analysis of 39 models, including 16 robust zero-shot CLIP encoders and various non-robust counterparts (supervised or finetuned on ImageNet). They utilized pretraining sets such as OpenAI’s internal data, LAION, YFCC15M, and DataComp. Robustness was evaluated against ImageNet and variants like ImageNet-V2, ImageNet-R, and ImageNet-A.

Key analytical techniques included:

  • Activation Kurtosis: Identifying "spiky" distributions to detect outlier features.
  • Singular Value Decomposition (SVD): Identifying "privileged directions" in weight matrices.
  • Concept Probing: Mapping internal directions to human-understandable concepts using the Broden dataset.

Key Insights: The Structural Fingerprint of Robustness

The most striking finding is that robust models possess outlier features—activations significantly larger than the average. This study is the first to document these outliers in ResNets and non-language models; they were previously considered a quirk of Transformers or LLMs. These outliers propagate to create "privileged directions" in the final classification layer, serving as a reliable indicator of robustness.

Activation kurtosis and importance ratios across model architectures. Robust models show significantly higher kurtosis, indicating outlier features.

Furthermore, robust models tend to prioritize generic, abstract concepts (e.g., textures like "meshed" or "knitted") in their most important directions. In contrast, finetuning on ImageNet shifts focus toward specific objects, which actually decreases robustness.

Key Results: Quantifying Robustness

The study quantified the performance gap between robust and non-robust models across various backbones, using Effective Robustness (ER) and accuracy maintenance as primary metrics.

Effective Robustness and accuracy maintenance across various training datasets and backbones.
  • Kurtosis as a Metric: Robust models exhibited activation kurtosis values between 40 and 100, whereas non-robust supervised models hovered around 3.
  • The 80% Pruning Rule: Pruning the bottom 80% of a robust model's representation directions had almost zero impact on performance, confirming that robustness is concentrated in a few "privileged" directions.
  • Concept Count: Zero-shot CLIP models encode 600–700 unique concepts, nearly double the 300–400 concepts found in standard supervised models.

Conclusion

The presence of outlier features serves as a "structural fingerprint" for model robustness. Because these features can be detected without access to shifted datasets, activation kurtosis provides a practical diagnostic tool for practitioners to evaluate the distribution shift robustness of pretrained models during deployment. Future work may explore the universality of these indicators in other domains like medical imaging or audio.

Summary updated

BibTeX
@article{crabbe2024interpreting,
  author = {Jonathan Crabbé and Pau Rodríguez and Vaishaal Shankar and Luca Zappella and Arno Blaas},
  title = {{Interpreting CLIP: Insights on the Robustness to ImageNet Distribution Shifts}},
  journal = {Accepted by TMLR},
  year = {2024},
  url = {https://openreview.net/forum?id=1SCptTFtmV},
}
Figure