All models

nest_base

A NesT (Nested Transformer) image classifier: local attention inside image blocks, merged in a hierarchy.

Image classification · 599 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 (18 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
NesT
Parameters
67.7M
Operations
599
Framework
PyTorch
Recurrent
No
Published
AAAI (arXiv 2021)
Cited by
173 (as of 26 October 2026)
Authors
Zizhao Zhang, Han Zhang, Long Zhao 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
m7660
Graph hash
c3dd79c5ef4782f0668353432ca49fea2a685b9d4b7150585c8bd4056c6c442f
Skeleton hash
b0cb27128e39c972a957bc59c4958546589604bcecc0f756c4937b0a5b74a995
Architecture hash
42442728735db3a9000984b2a7d347d55b2343b5cd76aec25e5108c410d1aee3
Diagram SHA-256
657d31b5963211e7134bc9859b6b6d729de572199a2b0b032790b9d060a38d26
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('nest_base', pretrained=False)

What it is

This model is the base size, NesT-B, for which the paper reports 68M parameters and 83.8% 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.

  • nest
  • nested transformer
  • nested hierarchical transformer
  • aggregating nested transformers
  • hierarchical vision transformer
  • block aggregation
  • gradcat
  • image classification

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

Cite the paper

@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}, 
}