GCGFormer: Geometry-Compatibility-Guided Attention for Rotated Object Detection
Huiji Wang, Dandan Huang, Zhi Liu, Zhichao Han, Yunhe Qiu, Chunpeng PanRotated object detection in remote sensing imagery requires both semantic understanding and accurate geometric reasoning. Existing geometry-aware detectors commonly introduce geometric information through oriented proposals or decoder queries, making their designs dependent on specific detection architectures, while geometric relationships among feature tokens remain insufficiently explored. To address this limitation, we propose GCGFormer, a geometry-compatibility-guided attention module for rotated object detection. Specifically, GCGFormer constructs a dual-token representation and a geometry compatibility matrix to model pairwise spatial relationships, including positional proximity, aspect ratio consistency, and orientation alignment. The matrix is integrated into self-attention to jointly optimize semantic similarity and geometric coherence. The proposed module can be readily integrated into existing detectors without extensive modifications. As an architecture-independent module placed before the detection head, GCGFormer can be integrated into different rotated object detectors. Experiments on DOTA-v1.0 show that GCGFormer improves the mAP of Oriented R-CNN from 65.1% to 65.6%, Rotated Faster R-CNN from 63.3% to 63.8%, Rotated ATSS from 61.7% to 62.1%, S2ANet from 62.7% to 63.1%, and YOLOv8-OBB from 72.7% to 72.9%. These consistent, although modest, improvements demonstrate that explicit feature-token geometric compatibility provides a generally applicable complement to semantic attention for rotated object detection.