Introduction
While Contrastive Language-Image Pre-training (CLIP) models are celebrated for their remarkable zero-shot generalization, are they truly "safe" for real-world deployment? In machine learning, robustness is often equated solely with classification accuracy under distribution shifts. However, for critical applications like autonomous driving or medical imaging, a model must also excel in three safety pillars: resilience to visual factor variations (e.g., lighting, pose), reliable out-of-distribution (OOD) detection, and well-calibrated predictive uncertainty.
This paper provides a massive-scale audit to evaluate these safety-critical dimensions, revealing that CLIP is not a universal fix for model reliability. Its performance is highly nuanced, dependent on training sources, and sometimes degrades after standard fine-tuning.
Methodology and Datasets
The researchers conducted a comprehensive comparative study involving over 200 models:
- 83 CLIP Models: Including 51 zero-shot models and 32 fine-tuned versions (CLIP-FT), spanning various architectures (ResNet, ViT, ConvNeXt) and training sources (LAION, WIT).
- 127 ImageNet Classifiers: Serving as baselines, including standard supervised models, contrastive learning models, and models pre-trained on massive datasets (like ImageNet-21K).
The team analyzed these models across a wide array of benchmarks to test different facets of safety:
- Robustness: Evaluated on ImageNet-X (which isolates 16 visual factors), Stylized-ImageNet, and cue-conflict stimuli to measure shape versus texture bias.
- OOD Detection: ImageNet served as the "in-distribution" set, tested against iNaturalist, SUN, PLACES, TEXTURE, and ImageNet-O.
- Calibration: Evaluated on ImageNet-V2, ImageNet-R (Rendition), ImageNet-A (Adversarial), ImageNet-Sketch, ObjectNet, and ImageNet-Vid-Robust.
Key Findings
Visual Robustness and the Pose Paradox
CLIP generally outperforms standard models on 6 out of 10 visual factors, such as Color, Size, and Subcategory. However, it exhibits a surprising vulnerability: it is significantly less robust when it comes to object pose and partial views. This suggests that language-image pre-training might prioritize semantic content over spatial orientation.
Fine-tuning "Corrupts" Shape Bias
Zero-shot CLIP models exhibit a "shape bias" similar to human vision, allowing them to recognize objects by their outlines rather than just their surface textures. However, once fine-tuned on ImageNet, they revert to a "texture bias," becoming much more like traditional CNNs. Essentially, the fine-tuning process trades a more robust, human-like internal representation for higher dataset-specific accuracy.
The Calibration Myth
Previous research suggested that CLIP is inherently well-calibrated out of the box. This paper contradicts that belief, showing that CLIP’s calibration is highly dependent on its training source. For instance, models trained on LAION-80M were often less calibrated than standard supervised models.
Despite this, CLIP models respond exceptionally well to temperature scaling. After calibration on an in-distribution set, CLIP maintains much more reliable uncertainty estimates under distribution shifts compared to other model groups.
Source Matters More Than Size
When it comes to OOD detection and calibration, the choice of training data (e.g., LAION vs. WIT) has a more profound impact than simply increasing the number of training samples. For OOD detection specifically, while in-distribution accuracy correlates strongly with OOD performance for models from the same source, CLIP models fine-tuned on ImageNet-12K were significantly better at detecting anomalies than those fine-tuned only on ImageNet-1K.
Conclusion and Future Work
While CLIP models offer incredible zero-shot capabilities, their safety properties require careful consideration. Training sources dictate behavior more than scale, and standard fine-tuning can actively degrade desirable traits like shape bias.
Future research should investigate the specific characteristics of training datasets that cause these behavioral shifts and explore fine-tuning techniques that preserve CLIP's zero-shot shape bias. Additionally, it remains to be seen if these insights generalize to other massive vision-language models like ALIGN or BASIC.
Summary updated