Teaching Matters: Investigating the Role of Supervision in Vision Transformers

Matthew Walmer, Saksham Suri, Kamal Gupta, Abhinav Shrivastava
12/7/2022
cs.CVcs.LG
transformer-attentioncontrastive-ssl

Official code: mwalmer-umd/vit_analysis (36 stars, Jupyter Notebook, MIT, last commit 2023-06-13).

Abstract

Vision Transformers (ViTs) have gained significant popularity in recent years and have proliferated into many applications. However, their behavior under different learning paradigms is not well explored.

Show full abstract

We compare ViTs trained through different methods of supervision, and show that they learn a diverse range of behaviors in terms of their attention, representations, and downstream performance. We also discover ViT behaviors that are consistent across supervision, including the emergence of Offset Local Attention Heads. These are self-attention heads that attend to a token adjacent to the current token with a fixed directional offset, a phenomenon that to the best of our knowledge has not been highlighted in any prior work. Our analysis shows that ViTs are highly flexible and learn to process local and global information in different orders depending on their training method. We find that contrastive self-supervised methods learn features that are competitive with explicitly supervised features, and they can even be superior for part-level tasks. We also find that the representations of reconstruction-based models show non-trivial similarity to contrastive self-supervised models. Project website (https://www.cs.umd.edu/~sakshams/vit_analysis) and code (https://www.github.com/mwalmer-umd/vit_analysis) are publicly available.

View on arXivView PDF

Code Implementations(1)

MIT
368Jupyter Notebook, PythonDec 7, 20223 years agoMIT

Similar Papers

Cite this paper

@article{walmer2022teaching,
  title  = {Teaching Matters: Investigating the Role of Supervision in Vision Transformers},
  author = {Matthew Walmer and Saksham Suri and Kamal Gupta and Abhinav Shrivastava},
  year   = {2022},
  eprint = {2212.03862},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2212.03862}
}

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

Discussion