为CLIP模型提供基于梯度的图文匹配解释,精准定位关键区域和词汇。
Grad-ECLIP: Gradient-based Visual and Textual Explanations for CLIP
- 通过梯度分解编码器结构,结合通道与空间权重生成高精度热力图。
- 在多个数据集上优于现有方法,显著提升对图像区域和文本词的归因准确性。
- 适用于理解CLIP机制、优化微调,适合视觉语言模型可解释性研究者。
尽管对比语言-图像预训练(CLIP)模型在性能提升和下游应用方面取得显著进展,但其可解释性仍较少受到关注。本文提出一种基于梯度的视觉与文本解释方法——Grad-ECLIP,用于解释特定图像-文本对在CLIP中的匹配结果。通过分解编码器架构并揭示匹配相似度与中间空间特征之间的关系,Grad-ECLIP生成有效热力图,展现图像区域或词语对结果的影响。不同于以往依赖自注意力图的方法(在CLIP中通常极稀疏),本方法通过对令牌特征施加通道和空间权重,生成高质量视觉解释。定性和定量评估表明,Grad-ECLIP在多项指标上优于当前最优方法。进一步分析揭示了图像-文本匹配的工作机制、CLIP在归因识别中的优劣势,以及词语具体性/抽象性与其在模型中使用方式的关系。最后,基于解释图能指示文本特异性图像区域的能力,我们提出一个新应用:利用Grad-ECLIP增强CLIP微调过程中的细粒度对齐。代码已开源:https://github.com/Cyang-Zhao/Grad-Eclip。
原文摘要 · Abstract (English)
Significant progress has been achieved on the improvement and downstream usages of the Contrastive Language-Image Pre-training (CLIP) vision-language model, while less attention is paid to the interpretation of CLIP. We propose a Gradient-based visual and textual Explanation method for CLIP (Grad-ECLIP), which interprets the matching result of CLIP for specific input image-text pair. By decomposing the architecture of the encoder and discovering the relationship between the matching similarity and intermediate spatial features, Grad-ECLIP produces effective heat maps that show the influence of image regions or words on the CLIP results. Different from the previous Transformer interpretation methods that focus on the utilization of self-attention maps, which are typically extremely sparse in CLIP, we produce high-quality visual explanations by applying channel and spatial weights on token features. Qualitative and quantitative evaluations verify the effectiveness and superiority of Grad-ECLIP compared with the state-of-the-art methods. Furthermore, a series of analysis are conducted based on our visual and textual explanation results, from which we explore the working mechanism of image-text matching, the strengths and limitations in attribution identification of CLIP, and the relationship between the concreteness/abstractness of a word and its usage in CLIP. Finally, based on the ability of explanation map that indicates text-specific saliency region of input image, we also propose an application with Grad-ECLIP, which is adopted to boost the fine-grained alignment in the CLIP fine-tuning. The code of Grad-ECLIP is available here: https://github.com/Cyang-Zhao/Grad-Eclip.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。