Vision Transformer Visualization: What Neurons Tell and How Neurons Behave?

Van-Anh Nguyen, Khanh Pham Dinh, Long Tung Vuong, Thanh-Toan Do, Quan Hung Tran +2 more
10/14/2022
cs.CVcs.LG
transformer-attention

Official code: byM1902/ViT_visualization (11 stars, Jupyter Notebook, last commit 2022-05-26).

Abstract

Recently vision transformers (ViT) have been applied successfully for various tasks in computer vision. However, important questions such as why they work or how they behave still remain largely unknown.

Show full abstract

In this paper, we propose an effective visualization technique, to assist us in exposing the information carried in neurons and feature embeddings across the ViT's layers. Our approach departs from the computational process of ViTs with a focus on visualizing the local and global information in input images and the latent feature embeddings at multiple levels. Visualizations at the input and embeddings at level 0 reveal interesting findings such as providing support as to why ViTs are rather generally robust to image occlusions and patch shuffling; or unlike CNNs, level 0 embeddings already carry rich semantic details. Next, we develop a rigorous framework to perform effective visualizations across layers, exposing the effects of ViTs filters and grouping/clustering behaviors to object patches. Finally, we provide comprehensive experiments on real datasets to qualitatively and quantitatively demonstrate the merit of our proposed methods as well as our findings. https://github.com/byM1902/ViT_visualization

View on arXivView PDF

Code Implementations(1)

112Jupyter Notebook, PythonMay 22, 20224 years ago

Similar Papers

Cite this paper

@article{nguyen2022vision,
  title  = {Vision Transformer Visualization: What Neurons Tell and How Neurons Behave?},
  author = {Van-Anh Nguyen and Khanh Pham Dinh and Long Tung Vuong and Thanh-Toan Do and Quan Hung Tran and Dinh Phung and Trung Le},
  year   = {2022},
  eprint = {2210.07646},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2210.07646}
}

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

Discussion