Pyramid Sparse Transformer: Enhancing Multi-Scale Feature Fusion with Dynamic Token Selection
Junyi Hu, Tian Bai, Fengyi Wu, Zhenming Peng, Yi Zhang
TL;DR
The paper tackles the high computational cost of attention-based feature fusion in vision models by introducing the Pyramid Sparse Transformer (PST), a lightweight cross-layer fusion module that uses coarse-to-fine token selection with shared attention parameters. PST achieves this efficiency through a two-stage process: a coarse cross-layer attention that reduces complexity, followed by a sparse, fine-attention stage guided by top-$k$ coarse similarities, with all parameters shared between stages. The authors demonstrate PST as a plug-in for both detection (PST-DET) and classification (PST-CLS), yielding consistent accuracy gains on COCO and ImageNet with minimal latency impact and without retraining when enabling the fine-attention path at inference. The practical impact is a hardware-friendly, adaptable enhancement for real-time detection and large-scale classification that can augment backbones like ResNet and detectors like YOLOv11.
Abstract
Feature fusion is critical for high-performance vision models but often incurs prohibitive complexity. However, prevailing attention-based fusion methods often involve significant computational complexity and implementation challenges, limiting their efficiency in resource-constrained environments. To address these issues, we introduce the Pyramid Sparse Transformer (PST), a lightweight, plug-and-play module that integrates coarse-to-fine token selection and shared attention parameters to reduce computation while preserving spatial detail. PST can be trained using only coarse attention and seamlessly activated at inference for further accuracy gains without retraining. When added to state-of-the-art real-time detection models, such as YOLOv11-N/S/M, PST yields mAP improvements of 0.9%, 0.5%, and 0.4% on MS COCO with minimal latency impact. Likewise, embedding PST into ResNet-18/50/101 as backbones, boosts ImageNet top-1 accuracy by 6.5%, 1.7%, and 1.0%, respectively. These results demonstrate PST's effectiveness as a simple, hardware-friendly enhancement for both detection and classification tasks.
