Analyzing Vision Transformers for Image Classification in Class Embedding Space
Martina G. Vilas, Timothy Schaumlöffel, Gemma Roig
摘要
Despite the growing use of transformer models in computer vision, a mechanistic understanding of these networks is still needed. This work introduces a method to reverse-engineer Vision Transformers trained to solve image classification tasks. Inspired by previous research in NLP, we demonstrate how the inner representations at any level of the hierarchy can be projected onto the learned class embedding space to uncover how these networks build categorical representations for their predictions. We use our framework to show how image tokens develop class-specific representations that depend on attention mechanisms and contextual information, and give insights on how self-attention and MLP layers differentially contribute to this categorical composition. We additionally demonstrate that this method (1) can be used to determine the parts of an image that would be important for detecting the class of interest, and (2) exhibits significant advantages over traditional linear probing approaches. Taken together, our results position our proposed framework as a powerful tool for mechanistic interpretability and explainability research.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 17 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Block Recurrent Dynamics in Vision Transformers 引用了 Do Vision Transformers See Like Convolutional Neural Networks?
- Block Recurrent Dynamics in Vision Transformers 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Do Vision Transformers See Like Convolutional Neural Networks? 引用了 Understanding Robustness of Transformers for Image Classification
- Do Vision Transformers See Like Convolutional Neural Networks? 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Do Vision Transformers See Like Convolutional Neural Networks? 引用了 Intriguing Properties of Vision Transformers
- Understanding Robustness of Transformers for Image Classification 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Beyond the Doors of Perception: Vision Transformers Represent Relations Between Objects 引用了 Do Vision Transformers See Like Convolutional Neural Networks?
- Beyond the Doors of Perception: Vision Transformers Represent Relations Between Objects 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Not All Diffusion Model Activations Have Been Evaluated as Discriminative Features 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Decomposing and Interpreting Image Representations via Text in ViTs Beyond CLIP 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Intriguing Properties of Vision Transformers 引用了 Understanding Robustness of Transformers for Image Classification
- Intriguing Properties of Vision Transformers 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
引用它的顶会 Paper17
- Patchscopes: A Unifying Framework for Inspecting Hidden Representations of Language ModelsAsma Ghandeharioun, Avi Caciularu, Adam Pearce, Lucas Dixon 等ICML 2024 · 197 次引用
- Not All Diffusion Model Activations Have Been Evaluated as Discriminative FeaturesBenyuan Meng, Qianqian Xu, Zitai Wang, Xiaochun Cao 等NeurIPS 2024 · 26 次引用
- Decomposing and Interpreting Image Representations via Text in ViTs Beyond CLIPSriram Balasubramanian, Samyadeep Basu, Soheil FeiziNeurIPS 2024 · 26 次引用
- Beyond the Doors of Perception: Vision Transformers Represent Relations Between ObjectsMichael A. Lepori, Alexa R. Tartaglini, Wai Keen Vong, Thomas Serre 等NeurIPS 2024 · 22 次引用
- Block Recurrent Dynamics in Vision TransformersMozes Jacobs, Thomas Fel, Richard Hakim, Alessandra Brondetta 等ICLR 2026 · 17 次引用
它引用的 Paper11
- An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn 等ICLR 2021 · 21,477 次引用
- Do Vision Transformers See Like Convolutional Neural Networks?Maithra Raghu, Thomas Unterthiner, Simon Kornblith, Chiyuan Zhang 等NeurIPS 2021 · 1,553 次引用
- Intriguing Properties of Vision TransformersMuzammal Naseer, Kanchana Ranasinghe, Salman Khan, Munawar Hayat 等NeurIPS 2021 · 863 次引用
- Understanding Robustness of Transformers for Image ClassificationSrinadh Bhojanapalli, Ayan Chakrabarti, Daniel Glasner, Daliang Li 等ICCV 2021 · 501 次引用
- On Identifiability in TransformersGino Brunner, Yang Liu, Damian Pascual, Oliver Richter 等ICLR 2020 · 210 次引用
相关 Paper
- A Simple Interpretable Transformer for Fine-Grained Image Classification and AnalysisDipanjyoti Paul, Arpita Chowdhury, Xinqi Xiong, Feng-Ju Chang 等ICLR 2024 · 27 次引用
- Token Transformation Matters: Towards Faithful Post-Hoc Explanation for Vision TransformerJunyi Wu, Bin Duan, Weitai Kang, Hao Tang 等CVPR 2024 · 8 次引用
- Transformer Interpretability Beyond Attention VisualizationHila Chefer, Shir Gur, Lior WolfCVPR 2021
- Dissecting Query-Key Interaction in Vision TransformersXu Pan, Aaron Philip, Ziqian Xie, Odelia SchwartzNeurIPS 2024 · 18 次引用
- AttCAT: Explaining Transformers via Attentive Class Activation TokensYao Qiang, Deng Pan, Chengyin Li, Xin Li 等NeurIPS 2022 · 66 次引用
