Introduction
Deep neural networks are notoriously overconfident. While calibration—the alignment of predicted confidence with actual accuracy—has been extensively studied for image classification, object detection (OD) presents unique challenges. In OD, "correctness" is not binary; it depends on spatial overlap (IoU) and class labels. This paper introduces a mathematically rigorous framework for OD calibration and a novel, differentiable estimator based on Kernel Density Estimation (KDE).
A Unified Framework for OD Calibration
Standard metrics like Expected Calibration Error (ECE) rely on discrete bins, which are non-differentiable and statistically inconsistent. The authors propose a framework using a "link function" ($\psi$) and a similarity measure ($L$). This allows for a flexible definition of correctness, ranging from hard IoU thresholds to continuous localization-aware scales.
The KDE Estimator
To overcome the limitations of binning, the authors employ Kernel Density Estimation. This creates a smooth, continuous surface to estimate the probability of a detection being correct given its confidence score. Crucially, this estimator is differentiable, allowing it to be used as an auxiliary loss term during training: $$\mathcal{L} = \mathcal{L}_{det} + \lambda \widehat{CE}$$ This "Calibration-regularized" training encourages models to produce more honest uncertainty estimates.
Experimental Evaluation
The approach was validated on MS COCO, Cityscapes, and PASCAL VOC using three architectures: Faster R-CNN, RetinaNet, and FCOS.
Key Findings
- Intrinsic Miscalibration: Modern detectors, especially those not using Focal Loss, are significantly overconfident.
- Stability: As shown in the figure above, the KDE-based estimator ($\widehat{CE}$) converges to the ground truth much faster and more reliably than traditional binned metrics (D-ECE), particularly when data is sparse.
- Fine-tuning Efficiency: Calibration can be significantly improved by fine-tuning pre-trained models for just a few epochs with the KDE loss, avoiding the need for full retraining.
Results
The proposed method consistently outperforms post-hoc techniques like Temperature Scaling (TS). On the PASCAL VOC dataset, the KDE-based approach achieved the lowest calibration error among all tested methods.
Importantly, these improvements in calibration come with negligible impact on detection performance (mAP). For instance, on COCO with RetinaNet, calibration error was reduced from 21.89 to 9.72 while maintaining high precision.
Conclusion and Future Work
By moving beyond discrete binning to a continuous density-based framework, this work provides a robust tool for both measuring and improving object detection calibration. Future research should explore the application of this framework to transformer-based architectures and its impact on safety-critical downstream tasks like autonomous vehicle path planning.
Summary updated