Nested Hierarchical Transformer: Towards Accurate, Data-Efficient and Interpretable Visual Understanding

Zizhao Zhang, Han Zhang, Long Zhao, Ting Chen, Sercan O. Arik +1 more
5/26/2021
234 citations
cs.CV
transformer-attention

Official code: google-research/nested-transformer (206 stars, Jupyter Notebook, Apache-2.0, last commit 2026-03-03).

Abstract

Hierarchical structures are popular in recent vision transformers, however, they require sophisticated designs and massive datasets to work well. In this paper, we explore the idea of nesting basic local transformers on non-overlapping image blocks and aggregating them in a hierarchical way.

Show full abstract

We find that the block aggregation function plays a critical role in enabling cross-block non-local information communication. This observation leads us to design a simplified architecture that requires minor code changes upon the original vision transformer. The benefits of the proposed judiciously-selected design are threefold: (1) NesT converges faster and requires much less training data to achieve good generalization on both ImageNet and small datasets like CIFAR; (2) when extending our key ideas to image generation, NesT leads to a strong decoder that is 8$\times$ faster than previous transformer-based generators; and (3) we show that decoupling the feature learning and abstraction processes via this nested hierarchy in our design enables constructing a novel method (named GradCAT) for visually interpreting the learned model. Source code is available https://github.com/google-research/nested-transformer.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

Nested Hierarchical Transformer https://arxiv.org/pdf/2105.12723.pdf

20627Jupyter Notebook, PythonJun 1, 20219 months agoApache-2.0
imagenettransformervision

Similar Papers

Cite this paper

@article{zhang2021nested,
  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},
  url    = {https://arxiv.org/abs/2105.12723}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2105.12723.svg)](https://codeofpaper.com/paper/2105.12723)

Discussion