Coder Social home page Coder Social logo

bimsarapathiraja / mccl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tianzhi0549/fcos

6.0 0.0 2.0 13.9 MB

MCCL: Multiclass Confidence and Localization Calibration for Object Detection

License: Other

C++ 2.67% Python 77.76% Cuda 17.54% Dockerfile 0.49% C 1.52%

mccl's Introduction

Multiclass Confidence and Localization Calibration for Object Detection (CVPR 2023)

Bimsara Pathiraja, Malitha Gunawardhana, Muhammad Haris Khan

paper Project Page

Abstract: Albeit achieving high predictive accuracy across many challenging computer vision problems, recent studies suggest that deep neural networks (DNNs) tend to make overconfident predictions, rendering them poorly calibrated. Most of the existing attempts for improving DNN calibration are limited to classification tasks and restricted to calibrating in-domain predictions. Surprisingly, very little to no attempts have been made in studying the calibration of object detection methods, which occupy a pivotal space in vision-based security-sensitive, and safety-critical applications. In this paper, we propose a new train-time technique for calibrating modern object detection methods. It is capable of jointly calibrating multiclass confidence and box localization by leveraging their predictive uncertainties. We perform extensive experiments on several in-domain and out-of-domain detection benchmarks. Results demonstrate that our proposed train-time calibration method consistently outperforms several baselines in reducing calibration error for both in-domain and out-of-domain predictions.

Citation

If you find our work useful. Please consider giving a star โญ and a citation.

@InProceedings{Pathiraja_2023_CVPR,
        author    = {Pathiraja, Bimsara and Gunawardhana, Malitha and Khan, Muhammad Haris},
        title     = {Multiclass Confidence and Localization Calibration for Object Detection},
        booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
        month     = {June},
        year      = {2023},
        pages     = {19734-19743}

Contents

  1. Highlights
  2. Installation
  3. Training and Evaluation
  4. Results
  5. Visualizations
  6. Contact
  7. Acknowledgement

Highlights

  • Towards improving the calibration performance of object detection methods, inspired by the train-time calibration route, we propose a new train-time calibration approach aims at jointly calibrating the predictive multiclass confidence and bounding box localization.
  • We summarize our key contributions as follows: Contributions: (1) We study the relatively unexplored di- rection of calibrating modern object detectors and observe that they are intrinsically miscalibrated in both in-domain and out-of-domain predictions. Also, the existing calibra- tion techniques for classification are sub-optimal for cali- brating object detectors. (2) We propose a new train-time calibration method for detection, at the core of which is an auxiliary loss term, which attempts to jointly calibrate multiclass confidences and bounding box localization. We leverage predictive uncertainty in multiclass confidences and bounding box localization. (3) Our auxiliary loss term is differentiable, operates on minibatches, and can be uti- lized with other task-specific loss functions. (4) We perform extensive experiments on challenging datasets, featuring several in-domain and out-of-domain scenarios. Our train- time calibration method consistently reduces the calibra- tion error across DNN-based object detection paradigms, including FCOS and Deformable DETR, both in in-domain and out-of-domain predictions.

In the Fig. above, we show that the DNN-based object detectors are inherently miscalibrated for both in-domain and out-of-domain predictions. Also, calibration methods for image classification are sub-optimal for object detection. Our proposed train-time calibration method for object detection is capable of reducing the calibration error (D-ECE%) of DNN-based detectors in both in-domain and out-domain scenarios.

Installation

For complete Installation, and usage instructions, follow guidelines here

Training and Evaluation

The following command line will train FCOS_R_50_FPN_1x on 8 GPUs with

python -m torch.distributed.launch \
            --nproc_per_node=8 \
            --master_port=$((RANDOM + 10000)) \
            tools/train_net.py \
            --config-file configs/fcos/fcos_R_50_FPN_1x.yaml \
            DATALOADER.NUM_WORKERS 2 \
            OUTPUT_DIR OUTPUT_DIR \
            MODEL.FCOS.LOSS_TYPE mccl \ # use MCCL loss
            MODEL.FCOS.MCCL_WEIGHT 1.0 \ # weight for the whole MCCL los
            MODEL.FCOS.NUM_MC_SAMPLES 5 \ # Number of MC dropouts
            MODEL.FCOS.MCCL_IOU_WEIGHT 0.1 \ # weight of the LC component of MCCL
            MODEL.FCOS.MCCL_CLS_DROPOUT 0.5 \ # MC dropout value for class prediction
            MODEL.FCOS.MCCL_IOU_DROPOUT 0.1 # MC dropout value for bounding box prediction

For Detection Expected Calibration Error (D-ECE) evaluation, follow the guidelines here

Results

Results report Detection Expected Calibration Error (D-ECE) for In-Domain (MS-COCO) and Out-Domain (Cor-COCO) for baseline and our proposed method.

Methods D-ECE (MS-COCO) APbox (MS-COCO) D-ECE (CorCOCO) APbox (CorCOCO) model
Baseline 15.42 54.91 15.90 30.01 Link
MCCL (Ours) 14.94 54.85 14.94 29.96 Link

Visualizations

Confidence histograms and reliability diagrams

Calibration heatmaps

Contact

In case of any query, create issue or contact [email protected]

Acknowledgement

This codebase is built on FCOS and Detection Calibration

mccl's People

Contributors

103yiran avatar apacha avatar ausk avatar belowmit avatar bernhardschaefer avatar bimsarapathiraja avatar botcs avatar chhshen avatar climbsrocks avatar coincheung avatar fmassa avatar godricly avatar henrywang1 avatar jario-jin avatar jiayuan-gu avatar keineahnung2345 avatar killthekitten avatar leviviana avatar newstzpz avatar renebidart avatar rodrigoberriel avatar soumith avatar stan-haochen avatar stanstarks avatar tianzhi0549 avatar wat3rbro avatar xudangliatiger avatar yelantf avatar zhangliliang avatar zimenglan-sysu-512 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.