Hausdorff Distance Matching with Adaptive Query Denoising for Rotated Detection Transformer

Hakjin Lee, MinKi Song, Jamyoung Koo, Junghoon Seo

TL;DR

The paper introduces RHINO (Rotated detection transformer with Hausdorff distance matching), a novel framework that adapts Detection Transformers (DETRs) for highly accurate oriented object detection. By replacing standard L1 matching costs with a Hausdorff distance metric and introducing an adaptive query denoising strategy, RHINO eliminates duplicate low-confidence predictions and significantly boosts performance on aerial imagery benchmarks.

What Problem Does This Paper Address?

In aerial and satellite imagery, objects like ships, planes, and vehicles are densely packed and arbitrarily oriented. Standard horizontal bounding boxes fail here because they introduce excessive overlap; instead, state-of-the-art models use oriented (rotated) bounding boxes.

While Detection Transformers (DETRs) have revolutionized horizontal object detection, adapting them to rotated objects introduces unique challenges:

  1. The Square-Like Problem & Boundary Discontinuities: In the bipartite matching phase (where predictions are paired with ground truths), standard L1 cost functions struggle with angle parameterization. They overemphasize raw angle differences rather than spatial overlap, leading to unstable matching and duplicate, low-confidence predictions—especially for square-like objects.
  2. Suboptimal Query Denoising: Modern DETRs use "query denoising" (adding noise to ground truths to train the model to reconstruct them) to speed up training convergence. However, in later training stages, a well-trained model's predictions often become more accurate than the artificially noised ground truths. Forcing the model to learn from these noisy targets degrades final performance.

Methods

The authors build a strong baseline by extending a DINO-like DETR architecture from 4D box coordinates to 5D coordinates ($[x, y, w, h, \theta]$). To solve the core limitations, they introduce two main innovations:

  • Hausdorff Distance Matching Cost: Instead of using an L1 loss to match predicted boxes to ground truths, RHINO utilizes the Hausdorff distance. This metric calculates the maximum distance between the corner points (or edge midpoints) of two shapes. It naturally accounts for both axis alignment and rotation without suffering from boundary discontinuity issues.
Figure 2. Matching areas of the Prediction A to the ground truth. The blue area indicates the orange box is matched to the ground truth over the green box, as the center of the orange box moves along a coordinate axis. In each case, both the ground truth and the green box are fixed. Left: Using L1 cost, the orange box which is too far from the ground truth is matched to it over the green box. Right: When using the KLD cost, the matching ignores the axis alignment between two boxes. Conversely, the Hausdorff cost takes this into account.
  • Adaptive Query Denoising (AQD & AQD*): Rather than using a static noise threshold throughout training, RHINO introduces a bipartite matching step between the noised queries and the model's actual predictions. If a noised query is too distorted compared to what the model can already accurately predict, it is dynamically filtered out or its classification loss is suppressed. An enhanced version, AQD*, retains a bounding box regression loss on these filtered queries to continue guiding localization.
Figure 3. Left: Contrastive query denoising where noised queries and ground truths are directly matched, leading to potential misclassifica- tions. Right: Adaptive query denoising where bipartite matching selectively filters out noised queries, improving the accuracy of predictions as training progresses.

Datasets

The model was evaluated across several widely used oriented object detection and scene text benchmarks:

  • DOTA-v1.0, v1.5, and v2.0: Large-scale aerial object detection datasets.
  • DIOR-R: A benchmark dataset for oriented object detection in optical remote sensing images.
  • HRSC2016: A dataset specifically targeting aerial ship detection.
  • MSRA-TD500 & ICDAR2015: Scene text detection datasets.
  • SKU110K-R: A rotated retail product detection dataset.

Key Insights and Ideas

  • L1 Matching is Blind to Geometry: The authors demonstrate that the standard L1 cost function often prefers matching a prediction to a far-away ground truth simply because their normalized angle values match, even if another prediction has a much higher Intersection over Union (IoU). The Hausdorff distance fixes this by treating the box geometrically as a set of points.
  • Supervision Quality Must Adapt: Denoising tasks act as training wheels. Early on, they stabilize the bipartite matching graph. Later on, they act as a ceiling. Repurposing bipartite matching to dynamically prune out unhelpful, overly noisy queries allows the model to continue refining its high-precision predictions in later epochs.

Key Results

RHINO achieved new state-of-the-art results across multiple competitive benchmarks under single-scale training and testing conditions. When using a standard ResNet-50 backbone, RHINO delivered remarkable performance leaps over previous DETR-based oriented detectors:

  • DOTA-v2.0: $+4.18\text{ AP}_{50}$ improvement.
  • DOTA-v1.5: $+4.59\text{ AP}_{50}$ improvement.
  • DIOR-R: $+4.99\text{ AP}_{50}$ improvement.

When scaled up with a Swin-Tiny backbone, RHINO pushed benchmarks even further, reaching $79.42\text{ AP}_{50}$ on DOTA-v1.0 and $73.46\text{ AP}_{50}$ on DOTA-v1.5.

Limitations and Future Work

The primary limitation of RHINO is extended training time. The adaptive query denoising mechanism requires an additional bipartite matching step during training, which increases DOTA-v1.0 training time from 25 hours to 30 hours. However, because these changes only affect the training loss formulation, the model's inference speed and parameter count remain entirely unchanged.

Additionally, the authors noted that adaptive query denoising provides less benefit on purely horizontal datasets (like COCO), suggesting that future work should focus on designing more nuanced, computationally efficient adaptive matching costs tailored specifically for denoising tasks.

Summary updated

BibTeX
@inproceedings{lee2025hausdorff,
  author = {Hakjin Lee and MinKi Song and Jamyoung Koo and Junghoon Seo},
  title = {{Hausdorff Distance Matching with Adaptive Query Denoising for Rotated Detection Transformer}},
  booktitle = {IEEE/CVF Winter Conference on Applications of Computer Vision},
  year = {2025},
  doi = {10.1109/wacv61041.2025.00189},
}
Figure