Skip to main content
QUICK REVIEW

[Paper Review] A Closer Look at the Robustness of Contrastive Language-Image Pre-Training (CLIP)

Weijie Tu, Weijian Deng|arXiv (Cornell University)|Feb 12, 2024
Interpreting and Communication in HealthcareHealth Professions4 citations
TL;DR

This paper conducts a comprehensive empirical study of CLIP models' robustness across visual factor variations, out-of-distribution (OOD) detection, and predictive uncertainty calibration. Using 83 CLIP models and 127 ImageNet classifiers across diverse architectures and training sources, it reveals that CLIP models are not consistently more calibrated than ImageNet models, exhibit strong dependency on training data distribution, and maintain relatively reliable uncertainty estimates under distribution shifts after calibration—challenging prior assumptions about their inherent robustness.

ABSTRACT

Contrastive Language-Image Pre-training (CLIP) models have demonstrated remarkable generalization capabilities across multiple challenging distribution shifts. However, there is still much to be explored in terms of their robustness to the variations of specific visual factors. In real-world applications, reliable and safe systems must consider other safety objectives beyond classification accuracy, such as predictive uncertainty. Yet, the effectiveness of CLIP models on such safety-related features is less-explored. Driven by the above, this work comprehensively investigates the safety objectives of CLIP models, specifically focusing on three key properties: resilience to visual factor variations, calibrated uncertainty estimations, and the ability to detect anomalous inputs. To this end, we study 83 CLIP models and 127 ImageNet classifiers. They are diverse in architecture, (pre)training distribution and training strategies. We consider 10 visual factors (e.g., shape and pattern), 5 types of out-of-distribution data, and 8 natural and challenging test conditions with different shift types, such as texture, style, and perturbation shifts. Our study has unveiled several previously unknown insights into CLIP models. For instance, they are not consistently more calibrated than other ImageNet models, which contradicts existing findings. Additionally, our analysis underscores the significance of training source design by showcasing its profound influence on the three safety-related properties. We believe our comprehensive study can shed light on and help guide the development of more robust and reliable CLIP models.

Motivation & Objective

  • To investigate the robustness of CLIP models to variations in specific visual factors such as pose, lighting, and occlusion.
  • To evaluate CLIP models' performance in detecting out-of-distribution (OOD) inputs across multiple OOD benchmarks.
  • To assess whether CLIP models provide well-calibrated predictive uncertainty estimates under distribution shifts.
  • To examine the influence of training data distribution and model architecture on these safety-critical properties.
  • To challenge and clarify conflicting prior claims about CLIP's superiority in calibration and robustness.

Proposed method

  • Evaluated 83 CLIP models with diverse vision encoders (e.g., ResNet, ViT), training sources (WIT, LAION), and dataset sizes.
  • Compared against 127 ImageNet fine-tuned models to establish a baseline for performance and reliability.
  • Assessed visual factor robustness using 10 factors (e.g., pose, lighting, background) from the ImageNet-X dataset.
  • Tested OOD detection on 5 OOD benchmarks (e.g., SUN, Places-OOD) using ImageNet as in-distribution set.
  • Evaluated predictive uncertainty using canonical shift types: texture, style, and perturbation shifts.
  • Applied temperature scaling for uncertainty calibration and used robust linear regression to analyze prompt effects.

Experimental results

Research questions

  • RQ1How does CLIP performance vary across different visual factor variations, and does it consistently outperform standard ImageNet classifiers?
  • RQ2To what extent do CLIP models generalize to OOD inputs, and how does this generalize across different training sources and model architectures?
  • RQ3Are CLIP models more calibrated than standard ImageNet models, and how does this vary with training data distribution?
  • RQ4How do test-time prompt choices affect CLIP’s classification accuracy, OOD detection, and uncertainty calibration?
  • RQ5What is the relative impact of training data distribution and quantity on CLIP’s safety-related properties?

Key findings

  • CLIP models are not consistently more calibrated than standard ImageNet models, contradicting prior claims and highlighting the influence of training distribution on calibration.
  • CLIP models exhibit superior robustness to 6 out of 10 visual factors (e.g., color, background) but are less robust to pose variations, indicating architectural and distributional dependencies.
  • Training source design has a profound influence on all three safety properties: models trained on WIT show stronger OOD detection and robustness than those on LAION, even with similar accuracy.
  • After ID calibration with temperature scaling, CLIP models maintain reasonably good uncertainty estimates under distribution shifts, outperforming non-CLIP models in this regard.
  • Using fewer prompts (e.g., one or five) during inference can improve OOD detection and calibration performance compared to using 80 prompts, suggesting prompt design is critical for reliability.
  • The shape bias in CLIP models diminishes after fine-tuning on ImageNet, becoming comparable to standard ImageNet models, indicating adaptation reduces inductive bias.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.