Cross Resolution Encoding-Decoding For Detection Transformers

Ashish Kumar, Jaesik Park · DOI

Abstract

Detection Transformers (DETR) face a significant challenge in balancing computational efficiency with the high-resolution feature processing necessary for small object detection. This paper introduces the Cross-Resolution Encoding-Decoding (CRED) framework, which decouples the resolutions of the encoder and decoder. By utilizing two novel components—One Step Multiscale Attention (OSMA) and the Cross Resolution Attention Module (CRAM)—CRED-DETR maintains high detection accuracy while reducing FLOPs by approximately 50% and increasing frame rates by up to 76%.

The Resolution Bottleneck in DETR

DETR models have simplified object detection by eliminating hand-crafted components like Non-Maximum Suppression (NMS). However, their reliance on high-resolution feature maps for small object detection leads to a computational explosion due to the quadratic complexity ($O(H^2W^2)$) of self-attention. While sparse sampling methods like Deformable DETR attempt to mitigate this, they often suffer from hardware-unfriendly memory access patterns. CRED-DETR identifies that the encoder is the primary computational bottleneck and proposes a framework to process global context at low resolution while preserving fine-grained details for the decoder.

Comparison of Single-Scale, IMFA, and the proposed CRED architectures.

Methods: The CRED Framework

The CRED framework optimizes the detection pipeline through two primary innovations that allow the model to "cheat" the quadratic complexity of standard Transformers:

  1. One Step Multiscale Attention (OSMA): Instead of iterative feature fusion, which is computationally expensive, OSMA aggregates multiscale features from the backbone in a single step. This produces an enriched feature map at a target resolution for the encoder, capturing both local and global information efficiently.
  2. Cross Resolution Attention Module (CRAM): CRAM serves as the critical bridge between the low-resolution encoder and the high-resolution decoder. It transfers global semantic context learned by the encoder to high-resolution backbone features. This ensures the decoder receives features that possess both fine-grained spatial detail and global semantic context.
Detailed view of the CRAM-enhanced encoder architecture compared to a vanilla encoder.

Key Results and Insights

Evaluated on the MS-COCO 2017 benchmark, CRED-DETR demonstrates substantial improvements in speed and efficiency across various backbones:

  • Efficiency Gains: When integrated with DN-DETR, CRED achieved a 76% speedup (from 13 to 23 FPS) and halved the FLOPs (from 202G to 103G) without sacrificing accuracy.
  • Accuracy Improvements: For DAB-DETR, the framework provided a 3.3 AP boost compared to the vanilla version with negligible impact on frame rates.
  • Small Object Performance: The model's ability to preserve small object performance even with aggressive encoder downsampling highlights the effectiveness of the CRAM module in maintaining spatial precision.

Conclusion

CRED-DETR offers a hardware-friendly solution to the resolution problem in DETRs by using standard operations like convolutions and linear layers that are well-optimized for modern GPUs. By decoupling encoder and decoder resolutions, it achieves a "best of both worlds" scenario: global context at low cost and local precision where it matters most. Future work may explore combining this approach with sparse sampling or extending the cross-resolution mechanism to segmentation tasks.

Summary updated

BibTeX
@misc{kumar2024cross,
  author = {Ashish Kumar and Jaesik Park},
  title = {{Cross Resolution Encoding-Decoding For Detection Transformers}},
  year = {2024},
  eprint = {2410.04088},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.04088},
}
Figure