[Paper Review] Exploring Visual Interpretability for Contrastive Language-Image Pre-training
This paper proposes ECLIP, a method to enhance the visual interpretability of Contrastive Language-Image Pre-training (CLIP) by identifying that CLIP erroneously prioritizes background regions over foregrounds due to semantic shift in pooling layers. By replacing attention pooling with Masked Max Pooling guided by self-supervised attention maps during training, ECLIP corrects visualization bias without sacrificing recognition accuracy, achieving state-of-the-art explainability on three benchmarks.
Contrastive Language-Image Pre-training (CLIP) learns rich representations via readily available supervision of natural language. It improves the performance of downstream vision tasks, including but not limited to the zero-shot, long tail, segmentation, retrieval, caption, and video. However, the visual explainability of CLIP is rarely studied, especially for the raw feature map. To provide visual explanations of its predictions, we propose the Image-Text Similarity Map (ITSM). Based on it, we surprisingly find that CLIP prefers the background regions than the foregrounds, and shows erroneous visualization results against human understanding. This phenomenon is universal for both vision transformers and convolutional networks, which suggests this problem is unique and not owing to certain network. Experimentally, we find the devil is in the pooling part, where inappropriate pooling methods lead to a phenomenon called semantic shift. For this problem, we propose the Explainable Contrastive Language-Image Pre-training (ECLIP), which corrects the explainability via the Masked Max Pooling. Specifically, to avoid the semantic shift, we replace the original attention pooling by max pooling to focus on the confident foreground, with guidance from free attention during training. Experiments on three datasets suggest that ECLIP greatly improves the explainability of CLIP, and beyond previous explainability methods at large margins. The code will be released later.
Motivation & Objective
- To investigate why CLIP's visual explanations contradict human perception, particularly its tendency to favor background regions over foregrounds.
- To identify the root cause of this counterintuitive behavior in the pooling mechanism, especially the role of average-like pooling operations.
- To develop a method that enhances visual explainability of CLIP predictions while preserving its original recognition performance.
- To propose a training-time solution using free attention masks to guide feature selection toward discriminative foreground regions.
Proposed method
- Introduce the Image-Text Similarity Map (ITSM) to visualize raw CLIP predictions by computing similarity between text features and image token features.
- Replace the original attention pooling in CLIP with Max Pooling to reduce semantic shift and improve focus on confident foreground regions.
- Apply a self-supervised attention map (from MoCoV3 or DINO) as a mask during training to guide the max pooling operation, without modifying inference.
- Introduce a new pair of learnable linear projections to decouple interpretability from classification, preserving CLIP’s original performance.
- Train the model with frozen CLIP backbone and only fine-tune the new linear layers and masked max pooling, ensuring no accuracy drop.
- Propose two variants: RCLIP (reversed CLIP, no training) and ECLIP (with masked max pooling), both achieving improved explainability.
Experimental results
Research questions
- RQ1Why does CLIP produce visual explanations that contradict human understanding, favoring background over foreground regions?
- RQ2Is the background bias in CLIP due to architectural design, or is it caused by a specific module within the network?
- RQ3Can the semantic shift caused by average-like pooling be corrected without retraining the entire model or using human-annotated masks?
- RQ4Does using a self-supervised attention map during training improve the alignment between text and discriminative image regions?
- RQ5Can a simple, non-backpropagation-based method achieve superior explainability compared to existing gradient-based or attention-based methods?
Key findings
- CLIP consistently favors background regions over foregrounds in visual explanations, as revealed by the Image-Text Similarity Map, regardless of using ResNet or Vision Transformer backbones.
- The root cause of this behavior is identified as semantic shift in the pooling layer, particularly due to average-like operations such as attention pooling and global average pooling.
- Replacing attention pooling with max pooling reduces the background bias and improves explainability, increasing mIoU by 17.55% and mSC by 30.53% over the baseline.
- Introducing a self-supervised attention mask during training further boosts performance, increasing mIoU to 45.52 and mSC to 26.16 with DINO guidance.
- ECLIP maintains the same recognition accuracy as original CLIP (e.g., 90.54 mAP on ImageNet-S50) while significantly improving explainability.
- ECLIP outperforms existing explainability methods such as Grad-CAM and the latest ViT-based method [9] in both qualitative and quantitative evaluations, showing superior localization of relevant image regions.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.