Skip to content

Cyang-Zhao/ODAM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ODAM:Gradient-based instance-specific Visual Explanation for Object Detection

ODAM is a straightforward and easy-to-implement method to generate visual explanation heat maps for predictions of object detection. The framework and results are shown here:

Example of Generating visual explanation maps by ODAM:

ODAM is easy to be applied on different detector architectures. Here is an example:

  • Detector: FCOS
  • Data: MS COCO val2017
  • Demo for one image: Demo_ODAM ; Demo based on DETR minimal implementation: Demo_ODAM_detr

Steps to save heat maps and evaluation:

  1. The path of the dataset is set in config_coco.py.

  2. Download the fcos detector model and put into the folder ./model/fcos_regular/coco_model/; faster rcnn detector model and put into the folder ./model/rcnn_regular/coco_model/.

  3. cd tools

  4. Saving heat maps for high-quality predictions

  • Saving ODAM explanation maps:
python savefig_odam.py -md fcos_regular -r 12
  • Saving D-RISE explanation maps:
python savefig_drise.py -md fcos_regular -r 12
  1. Evaluation of ODAM and D-RISE:
  • Point Game
python eval_pointgame.py -md fcos_regular -t odam
  • Visual Explanation Accuracy (Mask IoU)
python eval_mask_IoU.py -md fcos_regular -t odam
  • ODI
python eval_odi.py -md fcos_regular -t odam
  • Deletion
python eval_delet.py -md fcos_regular -r 12 -t odam
  • Insertion
python eval_insert.py -md fcos_regular -r 12 -t odam

Odam-Train and Odam-NMS:

Train and test on CrowdHuman dataset, the data path is set in config_crowdhuman.py.

  • For train, download the initial weights, and the path is set in config_crowdhuman.py, then run:
cd tools
python train_crowdhuman.py -md fcos_odamTrain
  • For test, download the fcos model and put into the folder ./model/fcos_odamTrain/outputs/ and faster rcnn model to ./model/rcnn_odamTrain/outputs/. The NMS method choosing option is set in config_crowdhuman.py, then run:
cd tools
python test_crowdhuman.py -md fcos_odamTrain -r 30

Citation

If you use the code in your research, please cite:

@inproceedings{chenyangodam,
  title={ODAM: Gradient-based Instance-Specific Visual Explanations for Object Detection},
  author={Chenyang, ZHAO and Chan, Antoni B},
  booktitle={The Eleventh International Conference on Learning Representations},
  month = {May},
  year = {2023}
}

Contact

If you have any questions, please do not hesitate to contact Chenyang ZHAO (zhaocy2333@gmail.com).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published