Reimplementation of CVPR Paper - GradCAM: Visual Explanations from Deep Networks via Gradient-based Localization
Paper link is provided here.
This repo will provide an example of GradCAM for object detection using YOLOv3.
This tutorial will use this YOLOv3 repo as the reference YOLOv3 model.
Most tutorials on GradCAM are made for Image Classification tasks.
For one of my research projects, I would like to visualize YOLOv3's Objectness Score Heatmap using GradCAM.
Due to limited examples of TF 2.0 based YOLOv3 GradCAM, I decided to create my own based on this reference.
The repo is originally for image classification task, and I modified it for my applications.
- GradCAM for Objectness Score of YOLOv3
- GradCAM for Classification Score for Each Detected Objects by YOLOv3
Priority is given for the first task, because I needed it for my research projects.
Feel free to contribute :)
As shown in the plots above, we can see that the GradCAM Heatmap visualize where the objects are detected.
From Left to Right:
Left: The heatmap highlighted small objects
Mid: The heatmap highlighted middle-sized objects
Right: The heatmap highlighted large-sized objects
This is because each of the head model in YOLOv3 is responsible in detecting small, middle-sized, and large objects, respectively.