
nest_tiny
Image classification323 ops17.1M params
A NesT (Nested Transformer) image classifier: local attention inside image blocks, merged in a hierarchy.
Image classification · 601 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('nest_small_jx', pretrained=False) This model is the small size, NesT-S, for which the paper reports 38M parameters and 83.3% top-1 accuracy on ImageNet.
About this model's family
NesT is a hierarchical vision transformer for image classification that needs only minor code changes to the original vision transformer. It stacks canonical transformer layers that run local self-attention on every image block independently, and then nests the blocks hierarchically.
Blocks exchange information only at the block aggregation step between levels of the hierarchy, which the paper builds from a 3x3 convolution, layer normalization and a 3x3 max pooling. Each aggregation merges four spatially connected blocks into one, so the number of blocks falls by a factor of 4 per level until a single block is left at the top. The authors find that this aggregation function plays a critical role in letting blocks communicate.
The paper defines tiny, small and base versions and reports 83.3% and 83.8% ImageNet accuracy for NesT models with 38M and 68M parameters. It also proposes GradCAT, a method that interprets the model's reasoning by traversing its tree-like structure. The timm version is a PyTorch implementation whose weights were converted from the official Jax code.
Key idea. NesT shows that nesting basic local transformers on non-overlapping image blocks and aggregating them hierarchically gives a simplified vision transformer with improved data efficiency.
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
@misc{zhang2021nestedhierarchicaltransformeraccurate,
title={Nested Hierarchical Transformer: Towards Accurate, Data-Efficient and Interpretable Visual Understanding},
author={Zizhao Zhang and Han Zhang and Long Zhao and Ting Chen and Sercan O. Arik and Tomas Pfister},
year={2021},
eprint={2105.12723},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2105.12723},
}