Exploring Visual Interpretability for Contrastive Language-Image Pre-training

Yi Li, Hualiang Wang, Yiqun Duan, Hang Xu, Xiaomeng Li
9/15/2022
cs.CV

Official code: xmed-lab/ICLIP (12 stars, PyTorch, last commit 2022-09-24).

Abstract

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations(1)

xmed-lab/ICLIPOfficial100%
PyTorch

Exploring Visual Interpretability for Contrastive Language-Image Pretraining

120Sep 4, 20224 years ago
clipinterpretabilitymultimodalpytorch

Similar Papers

Cite this paper

@article{li2022exploring,
  title  = {Exploring Visual Interpretability for Contrastive Language-Image Pre-training},
  author = {Yi Li and Hualiang Wang and Yiqun Duan and Hang Xu and Xiaomeng Li},
  year   = {2022},
  eprint = {2209.07046},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2209.07046}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2209.07046.svg)](https://codeofpaper.com/paper/2209.07046)

Discussion