Phase-Shifting Coder: Predicting Accurate Orientation in Oriented Object Detection

Yi Yu, Feipeng DaCVPR 2022 · DOI

Introduction

Oriented object detection (OOD) is a critical task in computer vision, particularly for domains like aerial imaging, scene text detection, and industrial inspection where objects appear at arbitrary rotations. Unlike standard horizontal bounding boxes, oriented bounding boxes (OBB) require predicting an additional orientation angle $\theta$. This introduces two significant challenges: the boundary discontinuity problem, where numerically distant values (e.g., $-90^\circ$ and $+90^\circ$) represent the same physical orientation, and the square-like object ambiguity, where $90^\circ$ rotations of symmetric objects are indistinguishable.

Methodology: The Phase-Shifting Coder

To address these issues, we introduce the Phase-Shifting Coder (PSC), a novel differentiable angle-encoding method inspired by phase-shifting coding in 3D optical metrology.

Angle as Periodic Phase

Instead of direct regression of the angle $\theta$, PSC maps the orientation to a principal phase $\phi = k\theta$, where $k$ corresponds to the rotational symmetry of the object (e.g., $k=2$ for rectangles). This phase is then encoded into a set of $N_{step}$ continuous phase-shifting patterns using periodic functions (sine and cosine). This formulation naturally handles the boundary problem because the periodic nature of the functions ensures that the loss remains smooth across the wrap-around points.

The Phase-Shifting Coder architecture integrates into standard detection backbones, replacing direct angle regression with a periodic encoding/decoding block.

Dual-Frequency Encoding (PSCD)

For datasets containing both rectangular and square-like objects, we propose a dual-frequency version (PSCD). By employing two different frequencies and a "phase unwrapping" technique during inference, the model can uniquely identify orientations while maintaining robustness to high-order symmetries. Because the entire process is differentiable, the network can learn fine-grained angular features, enabling sub-degree precision.

Experimental Results

The PSC was evaluated on major benchmarks including DOTA (aerial), HRSC (maritime), and OCDPCB (industrial).

High-Precision Detection

A key strength of PSC is its performance in high-precision metrics. On the DOTA dataset with a YOLOv5m backbone, the dual-frequency PSCD achieved a 2.36% improvement in $mAP_{75}$ over the state-of-the-art KLD method. This indicates that PSC produces significantly tighter and more accurate bounding boxes.

Robustness and Efficiency

In industrial scenarios (OCDPCB), PSC outperformed existing methods by an average of 9.83%, demonstrating its adaptability across domains. Furthermore, the method is highly efficient, adding negligible latency (0.2ms to 0.5ms) to the inference pipeline, making it ideal for real-time deployment.

Visual results demonstrate that PSC produces accurate, unquantized detections free from boundary discontinuities across various object types.

Conclusion

The Phase-Shifting Coder provides an elegant, cross-disciplinary solution to orientation prediction in OOD. By treating orientation as a periodic phase problem, it eliminates boundary jumps and handles complex symmetries within a unified, differentiable framework. Future work will explore extending this approach to full $360^\circ$ orientation and higher-order industrial symmetries.

Summary updated

BibTeX
@misc{yu2022phase,
  author = {Yi Yu and Feipeng Da},
  title = {{Phase-Shifting Coder: Predicting Accurate Orientation in Oriented Object Detection}},
  year = {2022},
  eprint = {2211.06368},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2211.06368},
}
Figure