
resmlp_12_224
Image classification212 ops15.4M params
An image classifier built only from linear layers and MLPs applied to image patches, with residual connections.
Image classification · 416 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
How this diagram was made
timm.create_model('resmlp_big_24_224', pretrained=False) This model is ResMLP-B-24; the paper lists a 24-layer configuration with a wider working dimension of 768.
About this model's family
ResMLP is an image classification network built entirely from multi-layer perceptrons (MLPs). It takes image patches, projects them with a linear layer, and then repeatedly applies two residual steps: a linear layer through which patches exchange information, applied to all channels independently, and a small MLP that mixes channels within each patch. At the end, the patch representations are average pooled and fed to a linear classifier.
The paper presents the design as a simplified Vision Transformer (ViT): the self-attention sublayer is replaced by a linear layer, leaving only linear layers and the GELU non-linearity. There is no positional embedding and no class token, and in place of normalization based on batch statistics it uses a learnable affine operator that only rescales and shifts its input element-wise.
On ImageNet, the paper reports that ResMLP's trade-off between accuracy, FLOPs and throughput is not as good as that of convolutional networks or Transformers, and argues that its accuracy still suggests the layer design's structural constraints do not have a drastic influence on performance. It also finds that ResMLP greatly benefits from distillation from a convnet, as DeiT models do.
Key idea. The paper shows that a residual network built only from linear layers and GELU, given a modern training strategy, attains good accuracy/complexity trade-offs on ImageNet.
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.