All models

mobilevitv2 (semantic segmentation)

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

Image classification · 298 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 (29 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
13.3M
Operations
298
Framework
PyTorch
Recurrent
No
Name in source
mobilevitv2:semantic-segmentation
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
m7371
Graph hash
e8abed8cbbfb6d8230e2fae5f79f886324cf6ccd1be16de3b8e2c98f4312c032
Skeleton hash
953ec2a5e2bdfe9c393dee33abcc3ee40dfad4aff8b10980be513bb19e47e823
Architecture hash
307233e723def2c5aafebf566feb44011c2b9ad00f2fa8ac3df8ae62b4fb935e
Diagram SHA-256
7a4ed55841b9f48d8af1421cba4e8bef2f73585550d35b0822e65c6e3dbec970
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.