Learning High-Precision Bounding Box for Rotated Object Detection via Kullback-Leibler Divergence

Xue Yang, Xiaojiang Yang, Jirui Yang, Qi Ming, Wentao Wang, Qi Tian, Junchi Yan

Introduction

Rotated object detection is a critical task in computer vision, particularly for aerial imagery and scene text recognition where objects appear in arbitrary orientations. Traditional methods often extend horizontal object detectors by adding an angular parameter ($\theta$) and regressing it using standard losses like Smooth L1. However, this "inductive" approach fails to account for the inherent coupling between spatial parameters and the boundary discontinuities of angles. This paper proposes a "deductive" approach that represents rotated bounding boxes as 2D Gaussian distributions and optimizes them using Kullback-Leibler Divergence (KLD).

The Deductive Approach

The core innovation lies in shifting from an inductive paradigm to a deductive one. In the inductive paradigm, a rotated box is treated as a special case of a horizontal box with an added angle. In contrast, the deductive paradigm treats the rotated box as the general case. By converting a rotated bounding box $(x, y, w, h, \theta)$ into a 2D Gaussian distribution $\mathcal{N}(\mu, \Sigma)$, the detector can naturally handle orientation. The center $(x, y)$ corresponds to the mean $\mu$, while the dimensions $(w, h)$ and orientation $\theta$ define the covariance matrix $\Sigma$.

Figure 1: Comparison between the traditional inductive approach and the proposed deductive approach using KLD.

Kullback-Leibler Divergence Loss

The authors utilize KLD to measure the distance between the predicted and ground-truth Gaussian distributions. Unlike standard regression losses, KLD naturally couples the box parameters. Mathematical analysis of the KLD gradient reveals a self-modulating property: the gradient of the angle parameter is automatically weighted by the aspect ratio of the object. For long, thin objects (high $w/h$), the model prioritizes angular accuracy, as even a small rotation error significantly impacts the overlap. Conversely, for square-like objects, the angle becomes less critical.

To ensure training stability, the authors apply a non-linear transformation to the loss: $L = \log(KLD + 1)$. This prevents the loss from exploding when distributions are far apart. Furthermore, KLD is scale-invariant, ensuring consistent optimization across objects of varying sizes—a significant advantage over previous attempts like the Gaussian Wasserstein Distance (GWD).

Experimental Results

The proposed method was evaluated on seven challenging datasets, including DOTA (aerial), HRSC2016 (ships), and ICDAR2015 (text). These datasets are ideal for testing because they contain many objects with extreme aspect ratios and varying orientations. The KLD loss consistently outperformed baseline methods, particularly in high-precision metrics like $AP_{75}$. For instance, on the HRSC2016 dataset, a KLD-based RetinaNet achieved an $AP_{75}$ of 72.39%, a massive jump from the 48.42% achieved by standard Smooth L1 loss.

Figure 6: Visual comparison of detection results across various datasets. KLD-based models produce more precise alignments for objects with high aspect ratios.

Conclusion and Future Work

By rethinking rotated object detection through the lens of distribution divergence, this work provides a robust framework for high-precision localization. The KLD loss's ability to self-modulate gradients based on object geometry addresses long-standing issues with parameter independence and scale sensitivity. While currently limited to rotated rectangles, the deductive Gaussian representation opens new avenues for general shape detection in complex scenes. Future work may explore symmetric versions of the divergence, such as Jensen-Shannon Divergence, to address the mathematical asymmetry of KLD.

Summary updated

BibTeX
@inproceedings{yang2021learning,
  author = {Xue Yang and Xiaojiang Yang and Jirui Yang and Qi Ming and Wentao Wang and Qi Tian and Junchi Yan},
  title = {{Learning High-Precision Bounding Box for Rotated Object Detection via Kullback-Leibler Divergence}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
}
Figure