Investigating the Limitation of CLIP Models: The Worst-Performing Categories

Jie-Jing Shao, Jiang-Xin Shi, Xiaowen Yang, Lan-Zhe Guo, Yufeng LiarXiv 2023 · DOI

Introduction

Contrastive Language-Image Pre-training (CLIP) has revolutionized computer vision by enabling robust zero-shot recognition. However, high average accuracy often masks significant failures at the category level. In many benchmarks, CLIP models exhibit "blind spots"—specific classes where accuracy drops to near zero. This study investigates these limitations and proposes a framework to identify and "rescue" these worst-performing categories without requiring labeled training data.

Quantifying Inference Confusion with CMM

The authors introduce Class-wise Matching Margin (CMM), a metric designed to measure the reliability of a model's prediction for a specific class. CMM calculates the gap between the similarity score of an image with its correct class prompt and its similarity with the most confusing incorrect prompt.

Figure 4: Correlation between the proposed CMM metric and actual accuracy across various benchmarks, demonstrating its effectiveness as a diagnostic tool for identifying weak categories.

As shown in the scatter plots above, CMM correlates strongly with actual class-wise accuracy across diverse datasets like ImageNet, CIFAR100, and specialized domains like Eurosat. This correlation allows researchers to predict model failure points in an unsupervised manner using pseudo-labels.

The CMM-based Prompt Ensemble (CPE)

To address these identified weaknesses, the paper proposes the CMM-based Prompt Ensemble (CPE). This framework employs two primary strategies:

  1. Description Enrichment: For categories identified as "worst-performing" via low CMM scores, the system queries a Large Language Model (LLM) to generate detailed visual descriptions. These descriptions provide CLIP with more granular features (e.g., specific wing patterns for a butterfly species) to distinguish between visually similar classes.
  2. Weighted Ensemble: Rather than using a uniform average of prompt templates, CPE assigns higher weights to templates that yield better CMM scores for a given dataset, effectively filtering out noisy or confusing prompts.

Experimental Results

The CPE method was evaluated across 12 benchmarks, including ImageNet and various fine-grained classification tasks. The results demonstrate a significant boost in the "tail" of the performance distribution.

Figure 1: Comparison of accuracy on the worst-100 categories of ImageNet. The proposed method (Ours) achieves 24.0%, a significant improvement over the 20.9% baseline.

On ImageNet, accuracy for the worst-10 categories improved from 0% to 5.2%, while the worst-100 categories saw an increase from 20.9% to 24.0%. Crucially, these gains in the worst-case scenarios did not come at the expense of overall average accuracy, which remained stable or slightly improved across all tested benchmarks.

Conclusion and Future Work

By shifting focus from average-case to worst-case performance, this research highlights a critical path for making zero-shot models more reliable for real-world deployment. While the method is highly effective, it remains dependent on the quality of LLM-generated descriptions. Future work may explore more robust ways to handle pseudo-label noise in extremely difficult domains where the initial model performance is exceptionally low.

Summary updated

Abstract

Contrastive Language-Image Pre-training (CLIP) provides a foundation model by integrating natural language into visual concepts, enabling zero-shot recognition on downstream tasks. It is usually expected that satisfactory overall accuracy can be achieved across numerous domains through well-designed textual prompts. However, we found that their performance in the worst categories is significantly inferior to the overall performance. For example, on ImageNet, there are a total of 10 categories with class-wise accuracy as low as 0\%, even though the overall performance has achieved 64.1\%. This phenomenon reveals the potential risks associated with using CLIP models, particularly in risk-sensitive applications where specific categories hold significant importance. To address this issue, we investigate the alignment between the two modalities in the CLIP model and propose the Class-wise Matching Margin (\cmm) to measure the inference confusion. \cmm\ can effectively identify the worst-performing categories and estimate the potential performance of the candidate prompts. We further query large language models to enrich descriptions of worst-performing categories and build a weighted ensemble to highlight the efficient prompts. Experimental results clearly verify the effectiveness of our proposal, where the accuracy on the worst-10 categories on ImageNet is boosted to 5.2\%, without manual prompt engineering, laborious optimization, or access to labeled validation data.
BibTeX
@misc{shao2023investigating,
  author = {Jie-Jing Shao and Jiang-Xin Shi and Xiaowen Yang and Lan-Zhe Guo and Yufeng Li},
  title = {{Investigating the Limitation of CLIP Models: The Worst-Performing Categories}},
  year = {2023},
  eprint = {2310.03324},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2310.03324},
}
Figure