Delving into the Openness of CLIP

Shuhuai Ren, Lei Li, Xuancheng Ren, Guangxiang Zhao, Xu Sun

TL;DR

This paper challenges the widely held belief that CLIP-like models are truly "open-vocabulary" by demonstrating significant performance degradation as recognition targets scale. The authors introduce new metrics for extensibility and stability to quantify this decline and propose Retrieval-enhanced Prompt Engineering (REPE) as a lightweight solution to bolster model robustness in open-world scenarios.

What Problem Does This Paper Address?

Contrastive Language-Image Pre-training (CLIP) has revolutionized computer vision by enabling "open-vocabulary" recognition—the ability to identify images from arbitrary class sets in a zero-shot manner. However, the authors argue that current evaluation protocols are flawed. Most benchmarks test CLIP on static, closed-set downstream datasets, which fails to capture the dynamic nature of the real world where new categories emerge constantly (e.g., new diseases in medical imaging or new products in e-commerce).

The core question is: How does CLIP actually perform as the vocabulary size increases? The paper addresses the gap between theoretical "infinite" vocabulary support and practical accuracy, revealing that CLIP’s openness is often overestimated.

Methods

The researchers propose a new evaluation protocol based on an incremental perspective:

  • Extensibility (Acc-E): Measures the model's ability to handle new visual concepts by incrementally expanding the vocabulary with both new classes and their associated images.
  • Stability (Acc-S): Measures how stable predictions remain for "old" classes when new "distractor" classes (which have no corresponding images in the test set) are introduced.
  • Feature Space Dissection: The authors analyze the joint embedding space using metrics for inter-modal alignment (how close an image is to its correct text description) and intra-modal uniformity (how well-distributed features are within the same modality).
  • Retrieval-enhanced Prompt Engineering (REPE): To improve performance, they propose a method that retrieves diverse, relevant captions from a pre-training corpus to create a more discriminative "prompt ensemble" for each class, rather than relying on a single generic template like "a photo of a [CLASSNAME]."
The proposed evaluation protocol for extensibility (Acc-E) and stability (Acc-S).

Datasets

The study utilizes several standard benchmarks adapted for incremental expansion:

  • CIFAR100: Grouped into 20 vocabularies based on its superclass hierarchy.
  • ImageNet: Specifically the Entity13 (13 vocabularies, 20 classes each) and Living17 (17 vocabularies, 4 classes each) subsets.
  • Generic Dataset Expansion: A mix of CIFAR10, CIFAR100, Caltech101, SUN397, and ImageNet to test cross-dataset robustness.
  • Specialized Dataset Expansion: Flowers102, OxfordPets, and StanfordCars.
  • CC12M: A subset of CLIP's pre-training data used for the retrieval component of REPE.

Key Insights and Ideas

  • Openness is an Illusion: CLIP's accuracy is not invariant to vocabulary size. As the number of classes grows, performance drops significantly. For example, CLIP (RN101) sees a 12.9% accuracy drop on CIFAR100 when the vocabulary expands from 5 to 100 classes.
  • The "Confusion" Problem: The performance drop isn't because the model fails to see the similarity between an image and its correct label. Instead, it's because the text features of different classes are too similar, leading the model to "drift" toward incorrect but semantically related distractors.
  • Razor-Thin Margins: The margin between positive and negative image-text pairs is dangerously small (median value of ~0.005). This makes the model highly vulnerable to "adversarial" class names.
  • Vulnerability to Malicious Vocabularies: Adding just three carefully chosen adversarial class names (like "bitmap" or "equidae") can cause an absolute 52.7% accuracy drop on CIFAR10.
  • Uniformity Matters: Models that incorporate intra-modal contrastive learning (like DeCLIP or SLIP) tend to have better extensibility because they force the textual features to be more spread out and distinguishable.
Performance degradation (Acc-C vs Acc-S) across different superclasses in CIFAR100.

Key Results

  • Extensibility Decline: Across generic dataset expansions, CLIP-like models showed an average performance decline of 15.3%.
  • Stability Issues: On CIFAR100, the stability metric (Acc-S) for CLIP (RN101) decreased by 13.4% as distractors were added.
  • REPE Effectiveness: The proposed REPE method consistently improved extensibility and stability by an average of 1.2% across all datasets. Crucially, it increased the median margin from 0.005 to 0.01, making predictions harder to invert.
  • Prompt Tuning Superiority: CoOp, which uses learnable prompts, achieved the best extensibility results, though it requires access to downstream training data, unlike the zero-shot REPE.

Limitations and Future Work

  • Evaluation Proxy: The authors acknowledge that their incremental protocol is still just an approximation of the true, infinite-scale open world.
  • Theoretical Grounding: While empirical results are strong, the authors call for more rigorous theoretical investigation into the risks of vocabulary expansion.
  • Category Properties: Future work should explore how factors like a category's level of abstraction or its density in the original pre-training data affect its stability in an open-vocabulary setting.
  • Generative Models: The study focused on contrastive models; investigating the extensibility of generative vision-language models (like Flamingo) remains an open area.

Summary updated

BibTeX
@inproceedings{ren2023delving,
  author = {Shuhuai Ren and Lei Li and Xuancheng Ren and Guangxiang Zhao and Xu Sun},
  title = {{Delving into the Openness of CLIP}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  doi = {10.18653/v1/2023.findings-acl.610},
}
Figure