Home

Awesome

[NeurIPS 2023] Cal-DETR: Calibrated Detection Transformer

Paper (arXiv) | Poster (TBA) | Video (TBA)

Authors: Muhammad Akhtar Munir, Salman Khan, Muhammad Haris Khan, Mohsen Ali, Fahad Shahbaz Khan

This paper is accepted at NeurIPS 2023 and this repository contains the PyTorch implementation of our proposed Cal-DETR.

Abstract

Albeit revealing impressive predictive performance for several computer vision tasks, deep neural networks (DNNs) are prone to making overconfident predictions. This limits the adoption and wider utilization of DNNs in many safety-critical applications. There have been recent efforts toward calibrating DNNs, however, almost all of them focus on the classification task. Surprisingly, very little attention has been devoted to calibrating modern DNN-based object detectors, especially detection transformers, which have recently demonstrated promising detection performance and are influential in many decision-making systems. In this work, we address the problem by proposing a mechanism for calibrated detection transformers (Cal-DETR), particularly for Deformable-DETR, UP-DETR, and DINO. We pursue the train-time calibration route and make the following contributions. First, we propose a simple yet effective approach for quantifying uncertainty in transformer-based object detectors. Second, we develop an uncertainty-guided logit modulation mechanism that leverages the uncertainty to modulate the class logits. Third, we develop a logit mixing approach that acts as a regularizer with detection-specific losses and is also complementary to the uncertainty-guided logit modulation technique to further improve the calibration performance. Finally, we perform extensive experiments on three in-domain and four out-domain scenarios. Results corroborate the effectiveness of Cal-DETR against the competing train-time methods in calibrating both in-domain and out-domain detections while maintaining or even improving the detection performance.

alt text

Results

alt text

Reliability Diagrams: Selected classes from MS-COCO.

alt text

Cal-DETR comparison with baseline, post-hoc, and other train-time calibration losses

Results report Detection Expected Calibration Error (D-ECE) for In-Domain (MS-COCO) and Out-Domain (CorCOCO).

MethodsD-ECE (MS-COCO)APbox (MS-COCO)D-ECE (CorCOCO)APbox (CorCOCO)model
Baseline12.844.010.823.9link
Temp. Scaling14.244.012.323.9-
MDCA12.244.011.123.5link
MbLS15.744.412.423.5link
TCD11.844.110.423.8link
Cal-DETR8.444.48.924.0link

Setup

Requirements: This implementation is on:

Linux, CUDA>=11.0

Python>=3.7

PyTorch>=1.7.0

Installation

Deformable-DETR: For complete Installation and usage instructions, follow the guidelines here

DINO: Follow the guidelines here

UP-DETR: Follow the guidelines here

For more setup details (Training and Evaluation etc.) we refer here

Citation

Please cite the following, if you find this work useful in your research:

@article{munir2023caldetr,
  title={Cal-DETR: Calibrated Detection Transformer},
  author={ Munir, Muhammad Akhtar and Khan, Salman and Khan, Muhammad Haris and Ali, Mohsen and Khan, Fahad},
  journal={Neural Information Processing Systems (NeurIPS)},
  year={2023}
}
@article{munir2023bridging,
  title={Bridging Precision and Confidence: A Train-Time Loss for Calibrating Object Detection},
  author={ Munir, Muhammad Akhtar and Khan, Muhammad Haris and Khan, Salman and Khan, Fahad},
  journal={IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
  year={2023}
}

Contact

In case of any query, create issue or contact akhtar.munir@mbzuai.ac.ae

Acknowledgement

This codebase is built on <a href="https://github.com/fundamentalvision/Deformable-DETR">Deformable-DETR</a> and <a href="https://pypi.org/project/netcal/">Detection Calibration</a>