From Colors to Classes: Emergence of Concepts in Vision Transformers
Teresa Dorszewski, Lenka Tětková, Robert Jenssen, Lars Kai Hansen, Kristoffer Knutsen Wickstrøm
TL;DR
The paper investigates how Vision Transformers develop semantic concepts across layers using neuron labeling (via CLIP-Dissect). By analyzing four pretrained ViTs and a CNN, it shows a consistent progression from simple concepts (colors, textures) in early layers to complex concepts (objects, natural elements) in later layers, with increasing concept diversity per layer. Finetuning to downstream tasks reduces the number of concepts and shifts them toward task-relevant categories, sometimes at the expense of previously learned information. The work deepens understanding of ViT representations, highlights the potential for concept-based explainability, and underscores model- and task-dependent shifts that inform transfer learning and robustness considerations.
Abstract
Vision Transformers (ViTs) are increasingly utilized in various computer vision tasks due to their powerful representation capabilities. However, it remains understudied how ViTs process information layer by layer. Numerous studies have shown that convolutional neural networks (CNNs) extract features of increasing complexity throughout their layers, which is crucial for tasks like domain adaptation and transfer learning. ViTs, lacking the same inductive biases as CNNs, can potentially learn global dependencies from the first layers due to their attention mechanisms. Given the increasing importance of ViTs in computer vision, there is a need to improve the layer-wise understanding of ViTs. In this work, we present a novel, layer-wise analysis of concepts encoded in state-of-the-art ViTs using neuron labeling. Our findings reveal that ViTs encode concepts with increasing complexity throughout the network. Early layers primarily encode basic features such as colors and textures, while later layers represent more specific classes, including objects and animals. As the complexity of encoded concepts increases, the number of concepts represented in each layer also rises, reflecting a more diverse and specific set of features. Additionally, different pretraining strategies influence the quantity and category of encoded concepts, with finetuning to specific downstream tasks generally reducing the number of encoded concepts and shifting the concepts to more relevant categories.
