Attention Guided CAM: Visual Explanations of Vision Transformer Guided by Self-Attention

Saebom Leem, Hyunseok Seo
2/7/2024
cs.CVcs.AI

No official code found. Best implementation: LeemSaebom/Attention-Guided-CAM-Visual-Explanations-of-Vision-Transformer-Guided-by-Self-Attention (25 stars, last commit 2024-02-07).

Abstract

Vision Transformer(ViT) is one of the most widely used models in the computer vision field with its great performance on various tasks. In order to fully utilize the ViT-based architecture in various applications, proper visualization methods with a decent localization performance are necessary, but these methods employed in CNN-based models are still not available in ViT due to its unique structure. In this work, we propose an attention-guided visualization method applied to ViT that provides a high-level semantic explanation for its decision. Our method selectively aggregates the gradients directly propagated from the classification output to each self-attention, collecting the contribution of image features extracted from each location of the input image. These gradients are additionally guided by the normalized self-attention scores, which are the pairwise patch correlation scores. They are used to supplement the gradients on the patch-level context information efficiently detected by the self-attention mechanism. This approach of our method provides elaborate high-level semantic explanations with great localization performance only with the class labels. As a result, our method outperforms the previous leading explainability methods of ViT in the weakly-supervised localization task and presents great capability in capturing the full instances of the target class object. Meanwhile, our method provides a visualization that faithfully explains the model, which is demonstrated in the perturbation comparison test.

View on arXivView PDF

Code Implementations(1)

The official code for Attention Guided CAM: Visual Explanations of Vision Transformer Guided by Self-Attention

252Python, Jupyter NotebookFeb 7, 20242 years ago

Similar Papers

Cite this paper

@article{leem2024attention,
  title  = {Attention Guided CAM: Visual Explanations of Vision Transformer Guided by Self-Attention},
  author = {Saebom Leem and Hyunseok Seo},
  year   = {2024},
  eprint = {2402.04563},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2402.04563v1}
}

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/2402.04563.svg)](https://codeofpaper.com/paper/2402.04563)

Discussion