Research map / Vision-language and multimodal / Human and embodied modeling
Gradient-based Visual Explanation for Transformer-based CLIP
Read the paperCheck your idea against 108,967 papers
AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Proposes Grad-ECLIP, a training-free gradient-based visual explanation method for CLIP that weights token value features by channel gradients and loosened spatial attention to produce image-text matching heat maps.
Problem
Interpreting which image regions or words drive CLIP's image-text matching score; existing Transformer explanation methods (attention rollout, GAME, Grad-CAM, similarity-map methods) give sparse or noisy maps for CLIP.
Approach
Decomposes CLIP's last attention layer so the matching score is approximately linear in value features; channel weights come from gradients of the similarity w.r.t. the attention output, and spatial weights come from a loosened (non-softmax) query-key similarity normalized to [0,1], yielding result-specific heat maps without modifying or training CLIP.
Key results
- On ImageNet deletion (ground-truth text, top-1), Grad-ECLIP achieves AUC 0.2464 vs 0.2535 for w/o wi and 0.3115 for CLIPSurgery, the next best.
- On ImageNet-S Point Game, Grad-ECLIP reaches 0.8899 vs 0.5759 for CLIPSurgery and 0.4706 for GAME.
- Averaged processing time is 0.0165 s/img, comparable to raw attention and Grad-CAM, versus 6.24 s/img for RISE.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| Use Grad-ECLIP instead of CLIPSurgery | CLIP ViT-B/16 explanations · ImageNet val (ground-truth prompt) | Deletion AUC @1: 0.3115 -> 0.2464 | Helped |
| Use Grad-ECLIP instead of CLIPSurgery | CLIP ViT-B/16 explanations · ImageNet val (ground-truth prompt) | Insertion AUC @1: 0.3832 -> 0.3838 | Helped |
| Use Grad-ECLIP instead of GAME | CLIP ViT-B/16 text explanations · MS COCO Karpathy val | Deletion AUC (image retrieval): 0.1083 -> 0.0996 | Helped |
| Use Grad-ECLIP instead of GAME | CLIP ViT-B/16 text explanations · MS COCO Karpathy val | Insertion AUC (text retrieval): 0.2301 -> 0.2536 | Helped |
| Use loosened spatial weights wi instead of setting wi = 1 (ablation) | Grad-ECLIP · ImageNet val (ground-truth prompt) | Deletion AUC @1: 0.2535 -> 0.2464 | Helped |
| Use loosened spatial weights wi instead of setting wi = 1 (ablation) | Grad-ECLIP · ImageNet val (ground-truth prompt) | Insertion AUC @1: 0.3715 -> 0.3838 | Helped |
| Use loosened spatial weights wi instead of setting wi = 1 (ablation) | Grad-ECLIP · MS COCO Karpathy val | Deletion AUC (image retrieval): 0.1116 -> 0.0996 | Helped |
| Use loosened spatial weights wi instead of setting wi = 1 (ablation) | Grad-ECLIP · MS COCO Karpathy val | Insertion AUC (text retrieval): 0.2361 -> 0.2536 | Helped |
| Use loosened spatial weights wi instead of setting wi = 1 (ablation) | Grad-ECLIP · ImageNet-S val | Point Game: 0.8356 -> 0.8899 | Helped |
| Use loosened spatial weights wi instead of setting wi = 1 (ablation) | Grad-ECLIP · ImageNet-S val | Pixel accuracy: 0.7365 -> 0.7056 | Hurt |
| Use loosened spatial weights wi instead of setting wi = 1 (ablation) | Grad-ECLIP · ImageNet-S val | maskIoU: 0.3314 -> 0.2869 | Hurt |
Surprising findings
- Softmax-based spatial weights reduce the method to raw attention, so the loosened similarity is necessary for the spatial importance.
- CLIPSurgery scores well on insertion and maskIoU but poorly on deletion and Point Game, showing segmentation quality does not imply faithful explanation.
Limitations
- Derivation assumes the last-layer attention output has a linear relationship with the final embedding, so it does not directly apply to CoCa or ALBEF with attention pooling or cross-attention.
- Analysis of CLIP attribute understanding is qualitative, based on a single CLEVR example image.
- Text explanation is evaluated only with a word-deletion test on MS COCO retrieval.
Experimental setup
Datasets: ImageNet MS COCO ImageNet-S CLEVR
Benchmarks: ImageNet MS COCO ImageNet-S
Metrics: deletion AUC insertion AUC Point Game PG-energy pixel accuracy AP maskIoU processing time
Baselines: raw attention Rollout Grad-CAM GAME MaskCLIP CLIPSurgery M2IB RISE
Builds on: Grad-CAM Attention Rollout GAME MaskCLIP CLIPSurgery
Closest papers by meaning
- Diffusion Feedback Helps CLIP See Better (ICLR 2025 · similarity 0.88)
- Demystifying CLIP Data (ICLR 2024 · similarity 0.88)
- un$^2$CLIP: Improving CLIP's Visual Detail Capturing Ability via Inverting unCLIP (NeurIPS 2025 · similarity 0.88)
- SuperCLIP: CLIP with Simple Classification Supervision (NeurIPS 2025 · similarity 0.88)
- FineLIP: Extending CLIP's Reach via Fine-Grained Alignment with Longer Text Inputs (CVPR 2025 · similarity 0.88)
- TripletCLIP: Improving Compositional Reasoning of CLIP via Synthetic Vision-Language Negatives (NeurIPS 2024 · similarity 0.88)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.
