Skip to main content
QUICK REVIEW

[Paper Review] An Image is Worth More Than 16x16 Patches: Exploring Transformers on Individual Pixels

Duy-Kien Nguyen, Mahmoud Assran|arXiv (Cornell University)|Jun 13, 2024
Augmented Reality ApplicationsComputer Science8 citations
TL;DR

Shows that vanilla Transformers can operate directly on individual pixels as tokens (PiT) with learnable position embeddings, achieving strong results across supervised, self-supervised, and generative tasks, challenging locality as a necessary inductive bias in vision models.

ABSTRACT

This work does not introduce a new method. Instead, we present an interesting finding that questions the necessity of the inductive bias of locality in modern computer vision architectures. Concretely, we find that vanilla Transformers can operate by directly treating each individual pixel as a token and achieve highly performant results. This is substantially different from the popular design in Vision Transformer, which maintains the inductive bias from ConvNets towards local neighborhoods (e.g. by treating each 16x16 patch as a token). We showcase the effectiveness of pixels-as-tokens across three well-studied computer vision tasks: supervised learning for classification and regression, self-supervised learning via masked autoencoding, and image generation with diffusion models. Although it's computationally less practical to directly operate on individual pixels, we believe the community must be made aware of this surprising piece of knowledge when devising the next generation of neural network architectures for computer vision.

Motivation & Objective

  • Question the necessity of locality as an inductive bias in vision architectures.
  • Demonstrate that Transformers can process images by treating each pixel as a token without 2D grid priors.
  • Evaluate PiT across supervised classification, self-supervised MAE pre-training, and diffusion-based image generation.
  • Compare PiT to ViT under varying input sizes and patch configurations to analyze trade-offs between locality, sequence length, and information content.

Proposed method

  • Propose Pixel Transformer (PiT): apply Transformer encoder directly to an unordered set of image pixels with learnable position embeddings.
  • Treat each pixel as a token via a linear projection to a hidden dimension, append a [cls] token, and feed through standard Transformer blocks with residual connections.
  • Compare PiT against ViT baselines with 2×2 patches across CIFAR-100 and ImageNet under scratch training and with MAE pre-training.
  • Investigate locality by manipulating position embeddings and patchification in ViT through pixel permutations and controlled corruption experiments.
  • Evaluate PiT on image generation using Diffusion Transformer (DiT) architectures operating on latent VQGAN tokens.
  • Provide multiple PiT size variants (Tiny, Small, Base, Large) with corresponding network configurations.
Figure 1 : Overview of a Pixel Transformer (PiT) , which is used to investigate the role of locality. Given an image, we simply treat it as a set of pixels. Besides, we also employ randomly initialized and learnable position embeddings without any information about 2D structure, therefore removing t
Figure 1 : Overview of a Pixel Transformer (PiT) , which is used to investigate the role of locality. Given an image, we simply treat it as a set of pixels. Besides, we also employ randomly initialized and learnable position embeddings without any information about 2D structure, therefore removing t

Experimental results

Research questions

  • RQ1Is locality a necessary inductive bias for Vision Transformers when processing images as sets of individual pixels?
  • RQ2How does a pixel-level tokenization (PiT) compare to patch-based ViT in supervised learning on CIFAR-100 and ImageNet?
  • RQ3What is the impact of self-supervised pre-training (MAE) on PiT performance relative to ViT?
  • RQ4Can PiT extend to generative tasks, specifically diffusion-based image generation on ImageNet latent spaces?
  • RQ5How do locality-design choices (position embeddings, patchification) influence ViT versus PiT performance?

Key findings

  • PiT (pixels-as-tokens) methods achieve competitive or superior Acc@1/Acc@5 compared to patch-based ViT baselines on CIFAR-100 and ImageNet in scratch training.
  • Self-supervised MAE pre-training boosts PiT performance, with larger gains for smaller PiT models, closing gaps to ViT and sometimes surpassing it.
  • In image generation, PiT-L operating on latent VQGAN tokens yields competitive FID, sFID, and IS metrics compared to locality-biased DiT baselines, indicating locality is not essential for high-quality generation.
  • ViT locality designs (patchification and position embeddings) contribute significantly to performance, and removing locality via PiT highlights alternative signal learning potential in Transformers.
  • Pixel-level permutation experiments show patchification contributes substantially to ViT’s performance, whereas PiT maintains performance by relying on learned global token interactions.
(a) Acc@1 with fixed sequence length .
(a) Acc@1 with fixed sequence length .

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.