[Paper Review] P2T: Pyramid Pooling Transformer for Scene Understanding
This paper proposes Pyramid Pooling Transformer (P2T), a vision transformer backbone that replaces single pooling operations in Multi-Head Self-Attention (MHSA) with pyramid pooling to simultaneously reduce sequence length and enhance contextual representation. P2T achieves state-of-the-art performance across image classification, semantic segmentation, object detection, and instance segmentation, outperforming prior CNN- and transformer-based models on ImageNet-1K and ADE20K benchmarks.
Recently, the vision transformer has achieved great success by pushing the state-of-the-art of various vision tasks. One of the most challenging problems in the vision transformer is that the large sequence length of image tokens leads to high computational cost (quadratic complexity). A popular solution to this problem is to use a single pooling operation to reduce the sequence length. This paper considers how to improve existing vision transformers, where the pooled feature extracted by a single pooling operation seems less powerful. To this end, we note that pyramid pooling has been demonstrated to be effective in various vision tasks owing to its powerful ability in context abstraction. However, pyramid pooling has not been explored in backbone network design. To bridge this gap, we propose to adapt pyramid pooling to Multi-Head Self-Attention (MHSA) in the vision transformer, simultaneously reducing the sequence length and capturing powerful contextual features. Plugged with our pooling-based MHSA, we build a universal vision transformer backbone, dubbed Pyramid Pooling Transformer (P2T). Extensive experiments demonstrate that, when applied P2T as the backbone network, it shows substantial superiority in various vision tasks such as image classification, semantic segmentation, object detection, and instance segmentation, compared to previous CNN- and transformer-based networks. The code will be released at https://github.com/yuhuan-wu/P2T.
Motivation & Objective
- To address the high computational cost of vision transformers due to long sequence lengths from patch tokens.
- To improve the representational power of pooled features in vision transformers beyond single pooling operations.
- To integrate pyramid pooling into Multi-Head Self-Attention (MHSA) for better context abstraction while reducing sequence length.
- To design a universal, efficient, and powerful vision transformer backbone for diverse scene understanding tasks.
- To demonstrate that pyramid pooling in MHSA leads to consistent performance gains across multiple vision benchmarks.
Proposed method
- Replace standard single pooling in MHSA with pyramid pooling, applying multiple average pooling operations with different kernel sizes and strides to the input feature map.
- Use adaptive average pooling to generate pooled features at multiple scales (e.g., {1, 2, 3, 6}) for each stage, preserving spatial context.
- Integrate the pooled features into MHSA via concatenation or element-wise combination, enabling global attention over enriched, multi-receptive-field representations.
- Adopt relative positional encoding (RPE) to model spatial relationships in pooled features, especially effective at low resolution.
- Incorporate depthwise convolution in the feed-forward network (IRB) to enhance local inductive bias and improve feature learning.
- Use overlapping patch embedding to maintain spatial continuity and improve feature representation in the initial stage.
Experimental results
Research questions
- RQ1Can pyramid pooling in MHSA reduce sequence length while improving feature representation in vision transformers?
- RQ2How does pyramid pooling compare to single pooling in terms of performance and efficiency in vision transformer backbones?
- RQ3Does integrating pyramid pooling into MHSA lead to consistent gains across diverse vision tasks like classification, segmentation, and detection?
- RQ4What design choices—such as pooling type, pooling ratio, activation function, and positional encoding—most significantly affect performance?
- RQ5Can a unified transformer backbone with pyramid pooling achieve state-of-the-art results across multiple benchmarks?
Key findings
- P2T achieves a top-1 accuracy of 79.7% on ImageNet-1K and a 44.1% mIoU on ADE20K semantic segmentation, outperforming ResNet, Swin Transformer, and PVT.
- Using average pooling instead of max or depthwise convolution improves performance by up to 2.8% in mIoU, indicating its superiority for feature abstraction.
- Fixing pooled sizes instead of ratios reduces GFLOPs by 12% and memory by 10%, but causes a 0.3% drop in top-1 accuracy and 2.4% drop in mIoU, so fixed ratios are preferred.
- Relative positional encoding (RPE) improves top-1 accuracy by 1.7% and mIoU by 1.7% when added to the baseline, showing its value in low-resolution pooled features.
- The addition of IRB (depthwise convolution in feed-forward network) boosts mIoU by 5.4% and top-1 accuracy by 3.2%, demonstrating the benefit of 2D locality in feature learning.
- Overlapping patch embedding improves top-1 accuracy by 0.2% and mIoU by 1.4%, confirming its positive impact on feature representation.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.