arXiv:2501.09333cs.CVcs.AI2025-01CVPR被引 11

让视觉Transformer看清细粒度差异,定位物种独特特征

Prompt-CAM: Making Vision Transformers Interpretable for Fine-Grained Analysis

  • 用可学习提示捕捉类别特有图像块,通过注意力图定位关键特征
  • 在12个不同数据集上显著优于Grad-CAM等方法,准确定位鸟类等相似物种差异
  • 只需修改预测头即可应用,无需复杂训练,适合快速部署到各类细粒度识别任务

我们提出一种简单方法——提示类注意力图(Prompt-CAM),使预训练视觉Transformer(ViT)在细粒度分析中具备可解释性,旨在识别并定位区分外观相似类别的特征,如鸟类物种。尽管DINO等预训练ViT能提取局部判别性特征,但梯度类激活图(Grad-CAM)常生成模糊、粗略的热图,仅突出整体物体而非具体特征。Prompt-CAM通过为每个类别学习特定提示,并利用其对应输出进行分类,迫使真类别提示关注其他类别图像中不存在的独特图像块(即特征)。由此,真实类别的多头注意力图能精准揭示这些特征及其位置。实现上,Prompt-CAM几乎“零成本”,仅需对视觉提示调优(VPT)的预测头进行微调。该方法在多个领域共12个数据集(如鸟类、鱼类、昆虫、真菌、花卉、食物、汽车)上的广泛实验证明其解释能力显著优于现有方法。代码与演示已公开于https://github.com/Imageomics/Prompt_CAM。

原文摘要 · Abstract (English)

We present a simple approach to make pre-trained Vision Transformers (ViTs) interpretable for fine-grained analysis, aiming to identify and localize the traits that distinguish visually similar categories, such as bird species. Pre-trained ViTs, such as DINO, have demonstrated remarkable capabilities in extracting localized, discriminative features. However, saliency maps like Grad-CAM often fail to identify these traits, producing blurred, coarse heatmaps that highlight entire objects instead. We propose a novel approach, Prompt Class Attention Map (Prompt-CAM), to address this limitation. Prompt-CAM learns class-specific prompts for a pre-trained ViT and uses the corresponding outputs for classification. To correctly classify an image, the true-class prompt must attend to unique image patches not present in other classes' images (i.e., traits). As a result, the true class's multi-head attention maps reveal traits and their locations. Implementation-wise, Prompt-CAM is almost a ``free lunch,'' requiring only a modification to the prediction head of Visual Prompt Tuning (VPT). This makes Prompt-CAM easy to train and apply, in stark contrast to other interpretable methods that require designing specific models and training processes. Extensive empirical studies on a dozen datasets from various domains (e.g., birds, fishes, insects, fungi, flowers, food, and cars) validate the superior interpretation capability of Prompt-CAM. The source code and demo are available at https://github.com/Imageomics/Prompt_CAM.

可解释性视觉Transformer细粒度识别提示调优

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。