Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

FLatten Transformer: Vision Transformer using Focused Linear Attention

About

The quadratic computation complexity of self-attention has been a persistent challenge when applying Transformer models to vision tasks. Linear attention, on the other hand, offers a much more efficient alternative with its linear complexity by approximating the Softmax operation through carefully designed mapping functions. However, current linear attention approaches either suffer from significant performance degradation or introduce additional computation overhead from the mapping functions. In this paper, we propose a novel Focused Linear Attention module to achieve both high efficiency and expressiveness. Specifically, we first analyze the factors contributing to the performance degradation of linear attention from two perspectives: the focus ability and feature diversity. To overcome these limitations, we introduce a simple yet effective mapping function and an efficient rank restoration module to enhance the expressiveness of self-attention while maintaining low computation complexity. Extensive experiments show that our linear attention module is applicable to a variety of advanced vision Transformers, and achieves consistently improved performances on multiple benchmarks. Code is available at https://github.com/LeapLabTHU/FLatten-Transformer.

Dongchen Han, Xuran Pan, Yizeng Han, Shiji Song, Gao Huang• 2023

Related benchmarks

TaskDatasetResultRank
Semantic segmentationADE20K (val)
mIoU44.8
2888
Object DetectionCOCO 2017 (val)--
2643
Image ClassificationImageNet-1K
Top-1 Acc79.5
1239
Instance SegmentationCOCO 2017 (val)
APm0.441
1201
Semantic segmentationADE20K
mIoU37.2
1024
Image ClassificationImageNet 1k (test)
Top-1 Accuracy84.5
450
Object DetectionCOCO
AP50 (Box)68.5
237
Semantic segmentationADE20K (test)
mIoU44.8
50
Semantic segmentationURUR
mIoU43
16
Semantic segmentationArchaeoscape
mIoU53.4
15
Showing 10 of 11 rows

Other info

Follow for update