Identifying Reliable Predictions in Detection Transformers

Young-Jin Park, Carson Sobolewski, Navid AzizanarXiv 2024 · DOI

Abstract

Detection Transformers (DETRs) have revolutionized object detection by removing the need for hand-crafted components like Non-Maximum Suppression. However, they produce hundreds of predictions per image, most of which are suppressed during training. This paper investigates the "specialist strategy" inherent in DETR training, where the model learns to favor a single primary query per object while silencing others. We introduce Object-level Calibration Error (OCE) to address the limitations of standard prediction-centric metrics and propose Contrastive Confidence, a post-hoc uncertainty quantification method that leverages the gap between primary and secondary predictions to identify reliable model outputs.

Introduction

Detection Transformers (DETRs) like DINO and Deformable-DETR have become state-of-the-art by providing an end-to-end detection pipeline. Unlike traditional detectors, they do not require complex post-processing like Non-Maximum Suppression (NMS). However, this simplicity comes at a cost: the model typically outputs a fixed, large number of predictions (e.g., 300 or 900), the vast majority of which must be suppressed. This "noisy" output poses significant challenges for evaluating model reliability and calibration, especially in safety-critical applications like autonomous driving.

The Specialist Strategy

The core of the DETR training objective is the Hungarian Loss, which performs a bipartite matching between predictions and ground-truth objects. Theoretical analysis reveals that this loss incentivizes a "specialist strategy." The model is trained to select exactly one "primary" query to represent a specific object with high confidence. All other "secondary" queries, even those with highly accurate bounding boxes, are forced toward near-zero confidence to avoid redundancy penalties.

Figure 1: The DETR architecture generates multiple object queries, but the training process forces a "specialist strategy" where only one query per object (e.g., Stop Sign: 0.97) is well-calibrated, while others (e.g., Stop Sign: 0.06) are suppressed.

Object-level Calibration Error (OCE)

Standard metrics like Expected Calibration Error (ECE) are "prediction-centric," meaning they average error over every individual prediction. This creates a structural pitfall: a model can achieve a "perfect" calibration score by simply discarding all but its most certain predictions, even if it fails to detect most objects in the scene. This makes ECE fundamentally unsuitable for choosing a confidence threshold in a real-world pipeline.

To address this, we propose Object-level Calibration Error (OCE). Unlike ECE, OCE averages error over every ground-truth object. This ensures the metric penalizes both false negatives (missing objects) and the presence of uncalibrated "secondary" predictions. As shown in Figure 3, a model might produce accurate boxes that are uncalibrated (low confidence for correct locations), a state that OCE is designed to detect and penalize.

Figure 3: Comparison of calibration states. (a) shows a well-calibrated model with accurate boxes. (b) shows random, low-confidence boxes. (c) illustrates the "uncalibrated" state common in DETRs, where accurate boxes are suppressed with low confidence scores.

Uncertainty Quantification via Contrastive Confidence

When a model is uncertain, it often "hedges" its bets, distributing confidence across multiple queries rather than concentrating it in one specialist. We introduce ContrastiveConf, a post-hoc uncertainty quantification (UQ) method. It calculates the difference between the average confidence of "positive" predictions (those above a threshold) and "negative" predictions (the suppressed background boxes). A large gap indicates a reliable, clear scene, while a narrow gap signals model confusion.

Key Results

  • Threshold Identification: OCE successfully identifies "sensible" confidence thresholds (usually around 0.3) that balance precision and recall. In contrast, Average Precision (AP) suggests a threshold of 0.0, and ECE suggests a threshold of 1.0.
  • Reliability Prediction: The ContrastiveConf method showed a significantly higher Pearson correlation with actual model performance (Image-level AP) compared to standard confidence scores. On the COCO dataset, the contrastive approach achieved a correlation of 0.656, while standard methods lagged behind.
  • OOD Robustness: The proposed framework remained effective even in "Foggy Cityscapes" environments, outperforming baseline methods in identifying when the model was likely to fail due to poor visibility.

Conclusion and Future Work

By understanding the specialist strategy of DETRs, we can better evaluate and trust their predictions. OCE provides a more faithful measure of object-level reliability, while Contrastive Confidence offers a practical tool for real-world deployment in uncertain environments. Future work may involve incorporating OCE-style penalties directly into the training loss to produce naturally calibrated models from the outset.

Summary updated

BibTeX
@misc{park2024identifying,
  author = {Young-Jin Park and Carson Sobolewski and Navid Azizan},
  title = {{Identifying Reliable Predictions in Detection Transformers}},
  year = {2024},
  eprint = {2412.01782},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2412.01782},
}
Figure