Transformer-based Context Condensation for Boosting Feature Pyramids in Object Detection

Zhe Chen, Jing Zhang, Yufei Xu, Dacheng Tao · DOI

Abstract

This paper introduces Transformer-based Context Condensation (TCC), a lightweight module designed to enhance feature pyramids in object detectors. By condensing complex visual context into a few key local and global representations and utilizing a Transformer decoder for feature refinement, TCC achieves a significant boost in detection accuracy while simultaneously reducing computational complexity (GFLOPs).

Introduction

Feature Pyramids (FPs) are fundamental to modern object detection, enabling the identification of objects across various scales. To be effective, these pyramids require Multi-level Feature Fusion (MFF) to bridge the representation gap between different levels. However, current state-of-the-art fusion methods—such as those found in NasFPN or RFP—often rely on heavy, iterative architectures that incur substantial computational overhead. TCC addresses this by providing an efficient mechanism to capture comprehensive context without the typical GFLOPs penalty.

Methodology

The core innovation of TCC is the deconstruction of visual context into two condensed representations, which avoids the need to process dense, heavy feature maps in their entirety:

  1. Locally Concentrated Representation: Uses dilated convolutions with significantly reduced channel counts to capture immediate neighborhood cues.
  2. Globally Summarized Representation: Employs a small sub-network to predict a handful of key locations (typically four) across the entire image. Features are gathered from these specific points to represent the global scene.

The Transformer Decoder

Once condensed, these features are processed by a Transformer decoder. The local feature requiring refinement acts as the Query, while the condensed local and global features serve as Keys and Values. By calculating attention between these elements, the model learns which contextual cues are most relevant for identifying specific objects. To maintain high efficiency, channel dimensions are reduced by up to 64x before processing.

Overview of the Transformer-based Context Condensation (TCC) architecture, illustrating the flow from feature pyramid to condensed context and transformer-based refinement.

Experimental Setup

The researchers evaluated TCC using the MS COCO dataset (val and test-dev splits), the standard benchmark for large-scale object detection. The module was tested as a "plug-and-play" component across several major architectures, including Faster R-CNN, RetinaNet, and HTC.

Results and Discussion

TCC demonstrated consistent performance improvements across various feature pyramid baselines, including FPN, NasFPN, FPG, and RFP. A key finding is that TCC can replace standard 3x3 refinement convolutions in an FPN, which actually lowers total GFLOPs while increasing Average Precision (AP).

AP vs. GFLOPs comparison showing how TCC (dotted circles) improves accuracy while reducing complexity across different baseline architectures.

Key Metrics: * Accuracy Boost: Relative AP improved by up to 7.8%. * Complexity Reduction: GFLOPs were reduced by up to 20%. For a standard ResNet50-FPN, TCC improved AP from 37.3 to 40.6 while dropping GFLOPs from 208 to 163. * Semantic Attention: Qualitative visualizations confirm the model attends to semantically relevant areas; for example, when detecting a surfboard, the module focuses on the surrounding water and the person's feet.

Conclusion and Future Work

While TCC offers a rare "win-win" for accuracy and efficiency, the authors noted that performance saturates when using more than 4-8 global key points. Additionally, while the decoder is lightweight, its attention mechanism may require specific hardware optimizations. Future research will explore extending this condensation approach to other tasks such as instance segmentation and scene parsing.

Summary updated

BibTeX
@article{chen2023transformer,
  author = {Zhe Chen and Jing Zhang and Yufei Xu and Dacheng Tao},
  title = {{Transformer-based Context Condensation for Boosting Feature Pyramids in Object Detection}},
  journal = {Int. J. Comput. Vis.},
  year = {2023},
  doi = {10.1007/s11263-023-01830-w},
}
Figure