Contrastive Language-Image Pretraining (CLIP) has proven incredibly powerful for zero-shot image classification. By mapping images and textual class representations into a shared embedding space, CLIP can classify images into categories it has never explicitly been trained on. However, understanding why CLIP makes a specific prediction remains a significant challenge. The vision encoder "sees" image patches, while the text encoder "reads" words, creating a modality gap that obscures the model's internal reasoning.
Existing explainability tools, such as Grad-CAM, typically only highlight the main object in an image (e.g., a dog) without revealing which specific features mattered to the model (Was it the snout? The ears? The fur?). Conversely, models explicitly trained to generate natural language explanations often learn shortcut biases and fail to remain faithful to the original model's reasoning.
To bridge this gap, recent research asks a fundamental question: What specific, fine-grained concepts do both encoders learn in common to push an image and a text label closer together in the joint embedding space? By examining the "mutual knowledge" shared between CLIP's vision and language encoders, we can unlock a new, training-free method to interpret its zero-shot decisions.
Methodology: A Training-Free Extraction Pipeline
To quantify the mutual information between the two modalities, the researchers propose a training-free pipeline that extracts and compares concepts in a shared textual space. The process involves four key steps:
- Visual Concepts Extraction: The pipeline begins by applying spectral graph clustering (eigendecomposition) on CLIP's vision features to identify the most prominent image patches. These patches are then grouped into distinct visual concepts—representing specific object parts—using PCA or K-means clustering.
- Visual-to-Text Mapping: To translate these visual patches into human-readable text, the method employs "visual prompting" (e.g., drawing a red circle around a specific patch in the image) and passes it through CLIP. These embeddings are matched against a massive dictionary of 4,229 LLM-generated, class-agnostic textual descriptors (e.g., "a long snout", "feathered ears"). Optimal Transport is used to ensure diverse and accurate text assignments for different visual parts.
- Language Concepts Extraction: On the text side, the system identifies which textual descriptors from the dictionary are closest to the predicted class label in the language embedding space.
- Mutual Information (MI) Dynamics: With both modalities mapped to the same discrete text space, the Mutual Information (MI) is calculated. To measure the strength and robustness of this shared knowledge, concepts are sequentially removed to plot the drop in MI. The Area Under the Curve (AUC) of this drop serves as a key metric: a higher AUC indicates the model retains shared knowledge robustly even when some concepts are hidden.
Key Insights and Discoveries
The framework was evaluated across multiple datasets, primarily ImageNet, but also Places365 (for scene recognition) and Food-101 (for fine-grained classification). The analysis of 13 different CLIP models—varying in architecture, size, and pretraining datasets—yielded several critical insights:
- MI Dynamics Outperform Raw MI: Relying on a static Mutual Information score is insufficient for evaluating model understanding. The robustness of the shared knowledge (measured via the AUC of the MI drop) is a much stronger indicator of a model's true conceptual grasp.
- Linear Correlation with Accuracy: Within specific architecture families (like ViTs or ResNets), the strength of shared knowledge (AUC) correlates linearly with zero-shot accuracy. This makes AUC a highly useful metric for model selection, especially when raw accuracies are tied.
- Architectural Differences (ViTs vs. CNNs): Vision Transformers (ViTs) exhibit stronger shared knowledge than CNN-based CLIP models (such as ResNets and ConvNeXts). This supports the premise that architectures lacking strict inductive biases scale better and learn richer shared representations when trained on massive datasets.
- General vs. Niche Concepts: CLIP is far more adept at encoding broad, general concepts (like "patterns and styles" for clothing) than highly specific, discriminative concepts (like the unique fur pattern of an endangered animal). This reflects the internet-scraped nature of its training data, where general concepts appear with much higher frequency.
Results and Impact
The proposed approach not only provides a human-friendly way of understanding zero-shot classification but also actively improves model performance. When the extracted multimodal concepts were fed back into CLIP as additional text prompts, zero-shot accuracy on ImageNet improved by up to 3.75% (for instance, ResNet50x16 improved from 68.47% to 72.22%). This demonstrates that the extracted concepts are highly relevant to the model's internal decision-making.
Furthermore, these multimodal explanations outperformed several baselines—including Multimodal Concept Bottleneck Models—on standard explainability metrics such as Deletion, Insertion, and Accuracy Drop.
Limitations and Future Directions
While highly effective, the method has limitations. The PCA/K-means clustering step can occasionally produce noisy, scattered visual concepts that are not perfectly localized, leading to slightly inaccurate textual mappings. Additionally, the current study focuses exclusively on zero-shot image classification.
Future work could extend this framework to non-contrastive models or apply it to broader vision-language tasks, such as image-text retrieval, image segmentation, and object localization, further illuminating the black box of multimodal AI.
Summary updated