All models

repvit_m2

A pure lightweight CNN rebuilt from MobileNetV3 with ViT-style block, macro and micro design.

Image classification · 393 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (28 KB)

Open in a new tab

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

Family
RepViT
Parameters
8.8M
Operations
393
Framework
PyTorch
Recurrent
No
Published
2023
Cited by
26 (as of 10 October 2026)
Authors
Ao Wang, Hui Chen, Zijia Lin and others
License
Apache-2.0
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m8796
Graph hash
8914c7ffcb2fcd7681d63e16b56c52d543c2e5172d957e63b55dd04baf79e1d7
Skeleton hash
b489246444f188ca35d0627e05c272f3f6983756fb87c02d84efc5820e1298ac
Architecture hash
a8fc8befc928b8ac73fb749804022ae80b0aca7cb09d8c38e673a69a6a55b423
Diagram SHA-256
512aa1e4165c7861eabe4f3bf0a8113eb6ddddbca8d629cc60c490757c016653
TorchLens version
2.35.3
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

How this diagram was made

timm.create_model('repvit_m2', pretrained=False)

What it is

About this model's family

RepViT is a family of pure lightweight CNNs for mobile devices, made by taking a standard lightweight CNN, MobileNetV3, and integrating the efficient architectural designs of lightweight Vision Transformers. The question behind it is whether ViT design choices can help CNNs, since lightweight ViTs usually adopt the MetaFormer block structure while lightweight CNNs favour the inverted residual bottleneck. The headline result: on ImageNet, RepViT achieves over 80% top-1 accuracy with 1.0 ms latency on an iPhone 12, which the authors call the first time for a lightweight model, to the best of their knowledge.

The RepViT block separates the token mixer from the channel mixer: the depthwise convolution is moved up, and the optional squeeze-and-excitation layer is placed after it because it depends on spatial information interaction. Structural re-parameterization on the depthwise layer lets the skip connection's computational and memory costs be eliminated at inference, which the paper calls especially advantageous for mobile devices. The channel mixer uses an expansion ratio of 2 in all stages. Width is doubled after each stage, ending at 48, 96, 192 and 384 channels.

At the macro level the stages follow a ratio of 1:1:7:1. All modules prioritize simple 3 by 3 convolutions, since larger kernels are not friendly for mobile devices because of their computation complexity and memory access costs. Squeeze-and-excitation layers are placed cross-block, in the 1st, 3rd, 5th and so on block of each stage, to maximize the accuracy benefit with a minimal latency increment. Eight members are captured in timm, repvit_m0_9 through repvit_m3, adapted from the official implementation at github.com/jameslahm/RepViT.

Key idea. Modernizing MobileNetV3-L with lightweight-ViT design choices yields RepViT, a pure CNN that reaches over 80% ImageNet top-1 at 1.0 ms on an iPhone 12.

  • repvit
  • rep-vit
  • repvit_m0_9
  • repvit_m1
  • repvit_m2
  • repvit_m3
  • mobilenetv3
  • lightweight cnn
  • mobile backbone
  • image classification

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{wang2024repvitrevisitingmobilecnn,
      title={RepViT: Revisiting Mobile CNN From ViT Perspective}, 
      author={Ao Wang and Hui Chen and Zijia Lin and Jungong Han and Guiguang Ding},
      year={2024},
      eprint={2307.09283},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2307.09283}, 
}