RepMLPNet
A four-stage vision MLP whose fully-connected layers absorb parallel convolutions after training.
Image classification · 628 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.
At a glance
- Task
- Image classification
- Parameters
- 68.2M
- Operations
- 628
- Framework
- PyTorch
- Recurrent
- No
- Published
- CVPR 2022
- Cited by
- 85 (as of 28 October 2026)
- Authors
- Xiaohan Ding, Honghao Chen, Xiangyu Zhang and others
- Source
- mmpretrain 1.2.0
- License
- MIT
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
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.
Details
- Stable ID
- m19822
- Graph hash
- 25c552d6fa6163d47eb2466974368ecaa8687c00436a61a1fef1b6c513946392
- Skeleton hash
- ba5fde3076f5ce06e4325ea7c82a9793661af3ad9539979a7bfd0dc209ba4748
- Architecture hash
- 7e3893298226e767e9e87b66b46282b7efddfccf03d08f5ba91261ff559347b4
- Diagram SHA-256
- 7ca67c7bc7cc79cdf08d07cab1695da45a53a8deb48178a92ea4f44aafdf013c
- TorchLens version
- 2.36.0
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
What it is
RepMLPNet is an image-recognition network made of fully-connected blocks arranged hierarchically: as the feature map shrinks, the channel count grows. The paper starts from the observation that fully-connected (FC) layers are better than convolutions at modeling long-range dependencies but worse at capturing local patterns. Its answer, Locality Injection, trains a convolution in parallel with an FC layer and then merges the trained conv kernel into the FC kernel.
A training-time RepMLP Block mixes FC, conv and batch normalization layers, and it can be converted exactly into an inference-time block with only three FC layers. The blocks are arranged in four stages. Between stages, an embedding layer halves the width and height of the feature maps and doubles the channels. Channels share a configurable number of parameter sets in the spatial FC layer, and the authors use fewer sets in the earlier stages to hold the parameter count down.
The B224 configuration takes 224×224 inputs, with 2, 2, 12 and 2 blocks in its four stages and 96 channels in the first. The repository's table of released models lists RepMLPNet-B224 at 80.32 ImageNet-1K accuracy. Because every stage produces a feature map, the paper also uses the network as a segmentation backbone and presents it as the first MLP transferred to Cityscapes semantic segmentation.
Key idea. The paper introduces Locality Injection, which merges a trained parallel convolution into a fully-connected kernel, and builds the hierarchical RepMLPNet from blocks that use it.
- RepMLPNet
- RepMLP
- RepMLPNet-B224
- Locality Injection
- vision MLP
- structural re-parameterization
- hierarchical MLP
- image classification
- ImageNet
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{ding2022repmlpnethierarchicalvisionmlp,
title={RepMLPNet: Hierarchical Vision MLP with Re-parameterized Locality},
author={Xiaohan Ding and Honghao Chen and Xiangyu Zhang and Jungong Han and Guiguang Ding},
year={2022},
eprint={2112.11081},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2112.11081},
}