TasksSotADatasetsPapersMethodsSubmitAbout
Papers With Code 2

A community resource for machine learning research: papers, code, benchmarks, and state-of-the-art results.

Explore

Notable BenchmarksAll SotADatasetsPapersMethods

Community

Submit ResultsAbout

Data sourced from the PWC Archive (CC-BY-SA 4.0). Built by the community, for the community.

Papers/When Shift Operation Meets Vision Transformer: An Extremel...

When Shift Operation Meets Vision Transformer: An Extremely Simple Alternative to Attention Mechanism

Guangting Wang, Yucheng Zhao, Chuanxin Tang, Chong Luo, Wenjun Zeng

2022-01-26Image ClassificationSemantic SegmentationObject Detection
PaperPDFCodeCode(official)

Abstract

Attention mechanism has been widely believed as the key to success of vision transformers (ViTs), since it provides a flexible and powerful way to model spatial relationships. However, is the attention mechanism truly an indispensable part of ViT? Can it be replaced by some other alternatives? To demystify the role of attention mechanism, we simplify it into an extremely simple case: ZERO FLOP and ZERO parameter. Concretely, we revisit the shift operation. It does not contain any parameter or arithmetic calculation. The only operation is to exchange a small portion of the channels between neighboring features. Based on this simple operation, we construct a new backbone network, namely ShiftViT, where the attention layers in ViT are substituted by shift operations. Surprisingly, ShiftViT works quite well in several mainstream tasks, e.g., classification, detection, and segmentation. The performance is on par with or even better than the strong baseline Swin Transformer. These results suggest that the attention mechanism might not be the vital factor that makes ViT successful. It can be even replaced by a zero-parameter operation. We should pay more attentions to the remaining parts of ViT in the future work. Code is available at github.com/microsoft/SPACH.

Results

TaskDatasetMetricValueModel
Semantic SegmentationADE20KValidation mIoU49.2Shift-B (UperNet)
Semantic SegmentationADE20KValidation mIoU47.9Shift-B
Semantic SegmentationADE20KValidation mIoU47.8Shift-S
Semantic SegmentationADE20KValidation mIoU46.3Shift-T
Object DetectionCOCO minivalAPM42.3Shift-T
Image ClassificationImageNetGFLOPs15.2Shift-B
Image ClassificationImageNetGFLOPs8.5Shift-S
Image ClassificationImageNetGFLOPs4.4Shift-T
3DCOCO minivalAPM42.3Shift-T
2D ClassificationCOCO minivalAPM42.3Shift-T
2D Object DetectionCOCO minivalAPM42.3Shift-T
10-shot image generationADE20KValidation mIoU49.2Shift-B (UperNet)
10-shot image generationADE20KValidation mIoU47.9Shift-B
10-shot image generationADE20KValidation mIoU47.8Shift-S
10-shot image generationADE20KValidation mIoU46.3Shift-T
16kCOCO minivalAPM42.3Shift-T

Related Papers

SeC: Advancing Complex Video Object Segmentation via Progressive Concept Construction2025-07-21Automatic Classification and Segmentation of Tunnel Cracks Based on Deep Learning and Visual Explanations2025-07-18Adversarial attacks to image classification systems using evolutionary algorithms2025-07-17Efficient Adaptation of Pre-trained Vision Transformer underpinned by Approximately Orthogonal Fine-Tuning Strategy2025-07-17Federated Learning for Commercial Image Sources2025-07-17MUPAX: Multidimensional Problem Agnostic eXplainable AI2025-07-17DiffOSeg: Omni Medical Image Segmentation via Multi-Expert Collaboration Diffusion Model2025-07-17SCORE: Scene Context Matters in Open-Vocabulary Remote Sensing Instance Segmentation2025-07-17