All models

hf_mobilevitv2_semantic_segmentation

MobileViT's mobile backbone with linear-cost separable self-attention, here topped by a DeepLabV3 segmentation head.

Segmentation · 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
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
m5317
Graph hash
e8abed8cbbfb6d8230e2fae5f79f886324cf6ccd1be16de3b8e2c98f4312c032
Skeleton hash
953ec2a5e2bdfe9c393dee33abcc3ee40dfad4aff8b10980be513bb19e47e823
Architecture hash
e0fa1da761bc3d1727bccadb1064eb91f0bd7a4cacb9bdbb7a5cf68657319be4
Diagram SHA-256
3ae8086f22e7a3e00190dbd0bb6c110a169ededeac88a35e1b772387dac9b995
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

MobileViTV2 is the second version of MobileViT, built by replacing the multi-headed self-attention in MobileViT with separable self-attention. The paper behind it, Separable Self-attention for Mobile Vision Transformers by Sachin Mehta and Mohammad Rastegari, goes after latency: the main efficiency bottleneck in MobileViT is the multi-headed self-attention, which costs quadratic time in the number of tokens. The replacement has linear complexity and uses element-wise operations for computing self-attention, making it a good choice for resource-constrained devices. With about three million parameters, MobileViTV2 achieves a top-1 accuracy of 75.6% on the ImageNet dataset, outperforming MobileViT by about 1% while running 3.2× faster on a mobile device.

The captured member is the semantic segmentation variant, which adds a DeepLabV3 head to the backbone. Despite the name, MobileViTV2 is more like a CNN than a Transformer model: it does not work on sequence data but on batches of images, there are no embeddings, and the backbone outputs a feature map.

Key idea. Separable self-attention with linear complexity in the token count, replacing MobileViT's multi-headed self-attention so the model runs faster on mobile devices.

  • MobileViTV2
  • MobileViT v2
  • MobileViT
  • separable self-attention
  • mobile vision transformer
  • semantic segmentation
  • DeepLabV3
  • Hugging Face Transformers
  • PASCAL VOC

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