
tiny_vit_5m_224
Image classification384 ops12.1M params
A small hierarchical vision transformer for image classification, pretrained by distillation from a large teacher.
Image classification · 384 operations Checked
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.
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
How this diagram was made
timm.create_model('tiny_vit_21m_224', pretrained=False) This model is the paper's TinyViT-21M, whose four stages use embedding dimensions of 96, 192, 384 and 576. 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.
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
@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},
}