All models

tiny_vit_5m_224

A small hierarchical vision transformer for image classification, pretrained by distillation from a large teacher.

Image classification · 384 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 (21 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

Family
TinyViT
Parameters
12.1M
Operations
384
Framework
PyTorch
Recurrent
No
Published
Lecture Notes in Computer Science (arXiv 2022)
Cited by
404 (as of 9 October 2026)
Authors
Kan Wu, Jinnian Zhang, Houwen Peng and others
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
m10549
Graph hash
44d4f7a345832962218f10f871f4c7ffc850969eeaf3e1c06393e1318cd158be
Skeleton hash
30cb93efa5ee06531069ac965cac614c6025bcdc9dd2bc8db10c5378b71590da
Architecture hash
870006bd54e8403c49afa854911f36b9633c2d07e1dc8a9a3adec92e8b5b4dec
Diagram SHA-256
8ea006b668ebbcc198340a00b5affdbe714dd53d580f121cb36e363cb20b07e4
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('tiny_vit_5m_224', pretrained=False)

What it is

This model is the paper's TinyViT-5M, whose four stages use embedding dimensions of 64, 128, 160 and 320. Its classifier has 21,841 outputs, the number of categories in ImageNet-21k.

About this model's family

TinyViT is a family of small image classifiers built on vision transformers and pretrained on large-scale datasets with a fast distillation framework. The paper's motivation is that most vision transformer models have so many parameters that they are hard to use on devices with limited resources. Its central idea is to transfer knowledge from large pretrained models to small ones during pretraining, so the small models also benefit from massive pretraining data. To keep that affordable, the teacher's outputs (logits) are sparsified and stored on disk in advance, so the teacher does not run while the student trains.

The network has four stages with a gradual reduction in resolution, similar to Swin and LeViT. Stage 1 and the downsampling blocks use MBConv convolution blocks, on the reasoning that convolutions in early layers learn low-level representation efficiently. The last three stages are transformer blocks that use window attention to reduce computational cost.

The paper reports 84.8% top-1 accuracy on ImageNet-1k for the 21M-parameter TinyViT after distilled pretraining on ImageNet-21k. On COCO object detection it reports an AP of 50.2 for TinyViT-21M, 2.1 points above Swin-T.

Key idea. The paper introduced a fast knowledge distillation method for pretraining small vision transformers and showed that small models can also benefit from massive pretraining data under a large teacher.

  • tinyvit
  • tiny vit
  • tiny_vit
  • tiny vision transformer
  • small vision transformer
  • pretraining distillation
  • knowledge distillation
  • image classification
  • imagenet-21k

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

Cite the paper

@misc{wu2022tinyvitfastpretrainingdistillation,
      title={TinyViT: Fast Pretraining Distillation for Small Vision Transformers}, 
      author={Kan Wu and Jinnian Zhang and Houwen Peng and Mengchen Liu and Bin Xiao and Jianlong Fu and Lu Yuan},
      year={2022},
      eprint={2207.10666},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2207.10666}, 
}