Vision Transformer

Also: ViT

A ViT flattens each patch, projects it linearly to an embedding, adds positional embeddings and a learnable [CLS] token, then runs a standard Transformer encoder. It lacks a CNN’s built-in locality, so it needs more data but scales better.

Example

A 224×224 image cut into 16×16 patches gives (224/16)² = 196 patch tokens; with the [CLS] token the sequence length is 197, and each RGB patch holds 16·16·3 = 768 values.

See it in the lesson: Vision Transformers →

Related terms

More in Neural Architectures