SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2203.05962 · ICLR · 2022

Anti-Oversmoothing in Deep Vision Transformers via the Fourier Domain Analysis: From Theory to Practice

Tianlong Chen, Zhangyang Wang, Wenqing Zheng, Peihao Wang

arXiv · PDF · Open in the Atlas

Code that ran

We lifted 5 functions out of this paper's own repositories and ran 1 of them in a sandbox. "Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results.

RepositoryRoleRan
VITA-Group/ViT-Anti-Oversmoothing canonical 1 of 5
FunctionStatusWhere it lives
build_transform Ran VITA-Group/ViT-Anti-Oversmoothing/datasets.py
code served (permissive licence) · get_code("1c791d67454f3922")
build_dataset Not yet run VITA-Group/ViT-Anti-Oversmoothing/datasets.py
code served (permissive licence) · get_code("ccfff191e1bbe653")
checkpoint_filter_fn Not yet run VITA-Group/ViT-Anti-Oversmoothing/vit.py
code served (permissive licence) · get_code("5dac11fdc41c896b")
resize_pos_embed Not yet run VITA-Group/ViT-Anti-Oversmoothing/vit.py
code served (permissive licence) · get_code("1dbef2d4da4ee10f")
throughput Not yet run VITA-Group/ViT-Anti-Oversmoothing/engine.py
code served (permissive licence) · get_code("9e5fe36aa1e60a48")

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Vision Transformer (ViT) has recently demonstrated promise in computer vision problems. However, unlike Convolutional Neural Networks (CNN), it is known that the performance of ViT saturates quickly with depth increasing, due to the observed attention collapse or patch uniformity. Despite a couple of empirical solutions, a rigorous framework studying on this scalability issue remains elusive. In this paper, we first establish a rigorous theory framework to analyze ViT features from the Fourier spectrum domain. We show that the self-attention mechanism inherently amounts to a low-pass filter, which indicates when ViT scales up its depth, excessive low-pass filtering will cause feature maps to only preserve their Direct-Current (DC) component. We then propose two straightforward yet effective techniques to mitigate the undesirable low-pass limitation. The first technique, termed AttnScale, decomposes a self-attention block into low-pass and high-pass components, then rescales and combines these two filters to produce an all-pass self-attention matrix. The second technique, termed FeatScale, re-weights feature maps on separate frequency bands to amplify the high-frequency signals. Both techniques are efficient and hyperparameter-free, while effectively overcoming relevant ViT training artifacts such as attention collapse and patch uniformity. By seamlessly plugging in our techniques to multiple ViT variants, we demonstrate that they consistently help ViTs benefit from deeper architectures, bringing up to 1.1% performance gains "for free" (e.g., with little parameter overhead). We publicly release our codes and pre-trained models at https://github.com/VITA-Group/ViT-Anti-Oversmoothing.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2203.05962")
get_code_for_paper("2203.05962")
have("2203.05962")

Connect an agent — have() is free.