
gcvit_xxtiny
Image classification749 ops12M params
A hierarchical vision transformer that alternates local window attention with global context attention.
Image classification · 1,639 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('gcvit_base', pretrained=False) About this model's family
GC ViT, short for global context vision transformer, is a hierarchical vision transformer that pairs global context self-attention with standard local self-attention. The aim is to model both long and short-range spatial interactions without expensive operations such as computing attention masks or shifting local windows.
Every GC ViT stage is composed of alternating local and global self-attention modules. Both operate in local windows like Swin Transformer, but the global self-attention has access to global features extracted by a global query generator. The query generator is a CNN-like module that extracts features from the entire image only once at every stage. After each stage, a downsampling block decreases the spatial resolution by 2 and increases the number of channels by 2. That block uses a modified Fused-MBConv block, which the paper says provides inductive bias and modeling of inter-channel dependencies.
On ImageNet-1K classification, the paper reports 84.3%, 85.0% and 85.7% Top-1 accuracy for GC ViT models with 51M, 90M and 201M parameters, at 224 image resolution and without any pre-training. The timm implementation is free of any code related to the NVIDIA GCVit implementation and was written from scratch in the style of timm swin_transformer_v2_cr.py.
Key idea. GC ViT pairs global context self-attention modules with standard local self-attention to model both long and short-range spatial interactions without attention masks or shifted local windows.
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
@misc{hatamizadeh2023globalcontextvisiontransformers,
title={Global Context Vision Transformers},
author={Ali Hatamizadeh and Hongxu Yin and Greg Heinrich and Jan Kautz and Pavlo Molchanov},
year={2023},
eprint={2206.09959},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2206.09959},
}