All models

mobilevitv2_150

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

Image classification · 378 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 (15 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
10.6M
Operations
378
Framework
PyTorch
Recurrent
No
Published
2022
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
m7376
Graph hash
8e84e1a5c2be303d81f4744b712698e080090e8a2593ca6b7051c341e6bd68a9
Skeleton hash
62102401d14b8865849f7d6a9adc2406caf94ff69dd4006628eedaffd0aa764d
Architecture hash
5a79df3716b5de10899ed32b26a48ad1c5dc841fffe3c762ab1ab26ba4b8dad2
Diagram SHA-256
d71ecdb8365ff7666f1a512a52054ccd42856fcd6d250e1a9542da2df7ad7daa
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('mobilevitv2_150', pretrained=False)

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.