RQFormer: Rotated Query Transformer for end-to-end oriented object detection

Jiaqi Zhao, Zeyu Ding, Yong Zhou, Hancheng Zhu, Wen-Liang Du, Rui Yao, Abdulmotaleb El-Saddik · DOI

TL;DR

This paper introduces RQFormer, an end-to-end oriented object detector that tackles the challenges of aligning object features with their rotated bounding boxes and managing similar queries during training. By proposing Rotated RoI Attention and Selective Distinct Queries, RQFormer achieves state-of-the-art performance on several challenging datasets, offering a more robust and efficient solution for detecting rotated objects.

What Problem Does This Paper Address?

Oriented object detection, crucial for applications like remote sensing and scene text recognition, involves identifying objects and their precise orientations. Existing end-to-end detectors, while simplifying pipelines, struggle with two main issues:

  1. Misalignment: Positional queries (representing object locations and orientations) and image features (keys) don't align well in cross-attention mechanisms, leading to inconsistent localization and classification. This is exacerbated by objects having arbitrary orientations and varying scales.
  2. Query Similarity: When multiple queries are very similar, the one-to-one label assignment process becomes ambiguous, potentially harming training. While some methods increase query numbers to combat this, it leads to significant computational overhead, especially for densely packed objects common in oriented object detection.

Methods

RQFormer introduces two core innovations to address these problems:

  • Rotated RoI Attention (RRoI Attention): This novel attention mechanism aligns positional queries with feature map keys by focusing on specific regions defined by the oriented bounding boxes. It uses a "Rotate RoI Align" operation to extract features precisely from these rotated regions, ensuring better alignment between spatial queries and image features. This is integrated into the cross-attention module of the transformer decoder.
  • Selective Distinct Queries (SDQ): To tackle query similarity, SDQ intelligently selects high-quality queries from intermediate decoder layers. It then filters out redundant, similar queries to produce a set of distinct queries. This process is designed to facilitate the one-to-one label assignment and improve training stability without increasing the overall number of queries or introducing auxiliary branches. SDQ is embedded within the decoder layers, rather than being a separate post-processing step.

Datasets

The authors evaluated RQFormer on a variety of datasets:

  • Oriented Object Detection: DIOR-R, DOTA-v1.0, DOTA-v1.5, DOTA-v2.0. These are large-scale datasets featuring remote sensing imagery with objects at various orientations and scales.
  • Scene Text Detection: ICDAR2015. This dataset focuses on detecting text instances, which are often oriented.
  • Horizontal Object Detection: MS COCO 2017. To demonstrate generalization, RQFormer was also adapted for standard horizontal object detection.

Key Insights and Ideas

  • Aligning Rotated Features is Key: The core challenge in oriented object detection with transformers is aligning the rotated bounding box information with the image features. RRoI Attention directly addresses this by explicitly sampling features based on the object's orientation.
  • Intermediate Queries Hold Value: The observation that queries in later decoder layers already capture significant object information is crucial. SDQ leverages this by selecting these refined queries, avoiding the need for excessive initial queries.
  • Quality over Quantity for Queries: Instead of simply increasing the number of queries to handle dense scenes, SDQ focuses on ensuring the distinctness of queries, which is more efficient and directly aids the one-to-one matching process.
  • End-to-End Efficiency: By integrating RRoI Attention and SDQ within the transformer decoder, RQFormer maintains an end-to-end architecture, reducing the need for complex post-processing steps common in traditional detectors.

Key Results

  • State-of-the-Art Performance: RQFormer achieved a mAP of 67.31% on DIOR-R with a ResNet50 backbone, outperforming several state-of-the-art CNN-based and transformer-based methods.
  • DOTA-v1.0 Improvement: On DOTA-v1.0, RQFormer reached 75.04% mAP (single-scale) and 80.92% mAP (multi-scale training), surpassing many existing methods.
  • Effectiveness on Small Objects: The model showed strong performance on small instances in DOTA-v1.5, improving upon methods like DCFL and ReDet.
  • Reduced Parameters and Improved Speed: RQFormer significantly reduced parameters compared to its baseline (DDQ-O) while maintaining or improving performance and achieving competitive inference speeds. For instance, it achieved 14.28 FPS on DIOR-R.
  • Effective Query Filtering: Ablation studies showed that SDQ significantly reduces the ratio of similar queries, with a notable drop from 15.20% to 0.79% on DOTA-v1.0 at a 0.95 IoU threshold.

Limitations and Future Work

  • Local Focus of RRoI Attention: The authors note that RRoI Attention primarily focuses on object extremities. They suggest that incorporating broader contextual information around these boxes could further enhance attention.
  • Generalization to Text Detection: While successful on ICDAR2015, the paper mentions that using rotated rectangular boxes for text detection is less flexible than dedicated text detection methods.
  • Further Exploration of Query Selection: The paper suggests exploring different combinations of selective query layers and distinct query filtering strategies within SDQ.
  • Contextual Information: Integrating more contextual information into the RRoI attention mechanism is proposed as a future direction.

Summary updated

BibTeX
@article{zhao2025rqformer,
  author = {Jiaqi Zhao and Zeyu Ding and Yong Zhou and Hancheng Zhu and Wen-Liang Du and Rui Yao and Abdulmotaleb El-Saddik},
  title = {{RQFormer: Rotated Query Transformer for end-to-end oriented object detection}},
  journal = {Expert Systems with Applications},
  year = {2025},
  doi = {10.1016/j.eswa.2024.126034},
}
Figure