All models

nest_tiny_jx

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

Image classification · 325 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
17.1M
Operations
325
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
m7665
Graph hash
eb8e317dd0297e0a5c2c63f7c4e57c5d77000629f45be2cad6b9b369eb301917
Skeleton hash
a8fe37ad695613a3a2db001557de13c4bd035f09474e4a5947ed1249513a340f
Architecture hash
fa986d0471e64d4d0e8d9f0ab3e85ec4e142a640f63e3a9d4daaab8b259c09b5
Diagram SHA-256
acad620f604c39671fcb0ce0bb9acde2c7c1f84b4bb108fcbca1109efc3daf64
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_tiny_jx', pretrained=False)

What it is

This model is the tiny size, NesT-T, for which the paper reports 17M parameters and 81.5% 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}, 
}