All models

mobilevitv2 (image classification)

MobileViTV2 swaps MobileViT's multi-headed attention for linear-cost separable self-attention.

Image classification · 276 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 (18 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
4.4M
Operations
276
Framework
PyTorch
Recurrent
No
Name in source
mobilevitv2:image-classification
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
m7370
Graph hash
7f4f009c30ecab45438b8f517ab858e5525011d531d6a85eb99dd71b75d402da
Skeleton hash
d96d92c12985ffdfa10bae00a370d6d40d34e4d447a40c96549be5db93b1c5a2
Architecture hash
39411126b5e7df654707a1cc488ef2f08b9cd1060cb578f3e2194492b3b33380
Diagram SHA-256
1ea0a5597df70c240d7ef8cfe01c08b5e1c9bc309e96d0b9270f299a6bd830bc
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

About this model's family

MobileViTV2 is the second version of MobileViT, built by replacing MobileViT's multi-headed self-attention with separable self-attention. The main efficiency bottleneck in MobileViT is multi-headed self-attention, which costs O(k2) time in the number of tokens k. Separable self-attention has linear complexity, O(k), and uses element-wise operations rather than costly batch-wise matrix multiplications, which suits resource-constrained devices. With about three million parameters, MobileViTV2 reaches 75.6% top-1 on ImageNet, about 1% above MobileViT while running 3.2× faster on a mobile device.

In practice it behaves more like a CNN than a transformer: it works on batches of images rather than sequences, has no embeddings, and the backbone outputs a feature map. One quirk: the pretrained checkpoints expect images in BGR pixel order, not RGB.

Key idea. Separable self-attention with linear O(k) complexity, computed with element-wise operations, replacing multi-headed self-attention in MobileViT.

  • mobilevitv2
  • mobilevit v2
  • mobilevit
  • separable self-attention
  • mobile vision transformer
  • apple
  • ml-cvnets
  • image classification

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