Beyond Classification: Definition and Density-based Estimation of Calibration in Object Detection

Teodora Popordanoska, Aleksei Tiulpin, Matthew B. Blaschko

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.

Stability of the KDE estimator ($\widehat{CE}$) vs. binned D-ECE as sample size increases.

Experimental Evaluation

The approach was validated on MS COCO, Cityscapes, and PASCAL VOC using three architectures: Faster R-CNN, RetinaNet, and FCOS.

Key Findings

  1. Intrinsic Miscalibration: Modern detectors, especially those not using Focal Loss, are significantly overconfident.
  2. 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.
  3. 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.

Comparison of calibration error across different methods on PASCAL VOC.

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

BibTeX
@inproceedings{popordanoska2024beyond,
  author = {Teodora Popordanoska and Aleksei Tiulpin and Matthew B. Blaschko},
  title = {{Beyond Classification: Definition and Density-based Estimation of Calibration in Object Detection}},
  booktitle = {IEEE/CVF Winter Conference on Applications of Computer Vision},
  year = {2024},
  doi = {10.1109/wacv57701.2024.00064},
}
Figure