All models

mobilevit (MMPretrain)

A light-weight mobile vision transformer that treats transformers as convolutions.

Image classification · 85 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 (26 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

Parameters
731.4K
Operations
85
Framework
PyTorch
Recurrent
No
Published
2021
Authors
Sachin Mehta, Mohammad Rastegari
Source
timm 1.0.30
Name in source
mmpretrain:mobilevit
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
m6985
Graph hash
cf9c0c7ef2015303646b5f7d39eab777e0c0204aad8d7020e16021f68499f803
Skeleton hash
5731e9f5d5fba22331bd042d7f8053e6f5081cab78d4a502b69f126ede44dd45
Architecture hash
ebd54aec2e499d1e15fee629ce5a12843e27b58133e298676127bb75f56503dc
Diagram SHA-256
251432c8e463d43839071b1aa72f12ccc962868ae433265265249bc38f331b55
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

menagerie.classics.wave_b_openmmlab:build_mmpretrain: build({})

What it is

About this model's family

MobileViT is a light-weight, general-purpose vision transformer built for mobile devices. Its authors start from the observation that light-weight CNNs are the de-facto choice for mobile vision tasks because their spatial inductive biases let them learn with fewer parameters, yet these networks are spatially local. Self-attention vision transformers learn global representations instead, but unlike CNNs they are heavy-weight.

The key idea is a different perspective on the global processing of information: treating transformers as convolutions. The Hugging Face documentation puts it as enabling global information processing without the heavy computational cost of standard ViTs. The model does not operate on sequential data and is purely designed for image tasks, with feature maps used directly instead of token embeddings.

On ImageNet-1k, MobileViT reaches 78.4% top-1 accuracy with about 6 million parameters, which the paper reports as 3.2% and 6.2% more accurate than MobileNetv3 and DeIT at a similar parameter count. On MS-COCO object detection it is 5.7% more accurate than MobileNetv3 for a similar number of parameters. The paper was accepted at ICLR'22.

The captured timm members mobilevit_s, mobilevit_xs and mobilevit_xxs take their MobileVitBlock and checkpoints from Apple's ml-cvnets code, with the rest of the network assembled by Ross Wightman. The Transformers members add an image-classification head pretrained on ImageNet-1k and a semantic-segmentation head that uses DeepLabV3 and is pretrained on PASCAL VOC. One quirk to know before feeding it your own images: the pretrained Transformers weights expect BGR input, not RGB.

Key idea. MobileViT treats transformers as convolutions to get a light-weight, low-latency network for mobile vision. The paper reports that it significantly outperforms CNN- and ViT-based networks across different tasks and datasets.

  • mobilevit
  • mobile vit
  • mobile vision transformer
  • light-weight vision transformer
  • apple
  • ml-cvnets
  • cvnets
  • image classification
  • mobilevit_s
  • mobilevit_xs
  • mobilevit_xxs
  • transformers as convolutions

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

Cite the paper

@misc{mehta2022mobilevitlightweightgeneralpurposemobilefriendly,
      title={MobileViT: Light-weight, General-purpose, and Mobile-friendly Vision Transformer}, 
      author={Sachin Mehta and Mohammad Rastegari},
      year={2022},
      eprint={2110.02178},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2110.02178}, 
}