MLP-Mixer: An all-MLP Architecture for Vision

Ilya Tolstikhin, Neil Houlsby, Alexander Kolesnikov, Lucas Beyer, Xiaohua Zhai +7 more
5/4/2021
cs.CVcs.AIcs.LG

Official code: google-research/vision_transformer (12,757 stars, Apache-2.0, last commit 2026-10-01). 1 more implementation below.

Abstract

Convolutional Neural Networks (CNNs) are the go-to model for computer vision. Recently, attention-based networks, such as the Vision Transformer, have also become popular. In this paper we show that while convolutions and attention are both sufficient for good performance, neither of them are necessary. We present MLP-Mixer, an architecture based exclusively on multi-layer perceptrons (MLPs). MLP-Mixer contains two types of layers: one with MLPs applied independently to image patches (i.e. "mixing" the per-location features), and one with MLPs applied across patches (i.e. "mixing" spatial information). When trained on large datasets, or with modern regularization schemes, MLP-Mixer attains competitive scores on image classification benchmarks, with pre-training and inference cost comparable to state-of-the-art models. We hope that these results spark further research beyond the realms of well established CNNs and Transformers.

View on arXivView PDF

Code Implementations(2)

Apache-2.0
12,7571,480Python, Jupyter NotebookOct 21, 20202 weeks agoApache-2.0
PyTorchApache-2.0

The largest collection of PyTorch image encoders / backbones. Including train, eval, inference, export scripts, and pretrained weights -- ResNet, ResNeXT, EfficientNet, NFNet, Vision Transformer (ViT), MobileNetV4, MobileNet-V3 & V2, RegNet, DPN, CSPNet, Swin Transformer, MaxViT, CoAtNet, ConvNeXt, and more

36,9405,171MDX, ShellFeb 2, 20195 months agoApache-2.0
augmixconvnextdistributed-trainingefficientnetimage-classification+15 more

Similar Papers

Cite this paper

@article{tolstikhin2021mlpmixer,
  title  = {MLP-Mixer: An all-MLP Architecture for Vision},
  author = {Ilya Tolstikhin and Neil Houlsby and Alexander Kolesnikov and Lucas Beyer and Xiaohua Zhai and Thomas Unterthiner and Jessica Yung and Andreas Steiner and Daniel Keysers and Jakob Uszkoreit and Mario Lucic and Alexey Dosovitskiy},
  year   = {2021},
  eprint = {2105.01601},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2105.01601}
}

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

Discussion