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

QuadTree Attention for Vision Transformers

About

Transformers have been successful in many vision tasks, thanks to their capability of capturing long-range dependency. However, their quadratic computational complexity poses a major obstacle for applying them to vision tasks requiring dense predictions, such as object detection, feature matching, stereo, etc. We introduce QuadTree Attention, which reduces the computational complexity from quadratic to linear. Our quadtree transformer builds token pyramids and computes attention in a coarse-to-fine manner. At each level, the top K patches with the highest attention scores are selected, such that at the next level, attention is only evaluated within the relevant regions corresponding to these top K patches. We demonstrate that quadtree attention achieves state-of-the-art performance in various vision tasks, e.g. with 4.0% improvement in feature matching on ScanNet, about 50% flops reduction in stereo matching, 0.4-1.5% improvement in top-1 accuracy on ImageNet classification, 1.2-1.8% improvement on COCO object detection, and 0.7-2.4% improvement on semantic segmentation over previous state-of-the-art transformers. The codes are available at https://github.com/Tangshitao/QuadtreeAttention.

Shitao Tang, Jiahui Zhang, Siyu Zhu, Ping Tan• 2022

Related benchmarks

TaskDatasetResultRank
Object DetectionCOCO 2017 (val)
AP42.6
2643
Image ClassificationImageNet-1K 1.0 (val)
Top-1 Accuracy84.1
1952
Instance SegmentationCOCO 2017 (val)
APm0.401
1201
Image ClassificationImageNet-1k (val)
Top-1 Accuracy82.7
844
Object DetectionCOCO 2017
AP (Box)47.3
321
Relative Pose EstimationMegaDepth (test)
Pose AUC @5°62.06
83
Homography EstimationHPatches
Overall Accuracy (< 1px)48
81
Image ClassificationImageNet-1K
Top-1 Accuracy82.7
78
Image ClassificationImageNet-1K 1.0 (val)
Top-1 Accuracy80
48
Pose EstimationMegaDepth 1500 (test)
AUC @ 5°54.6
38
Showing 10 of 23 rows

Other info

Follow for update