objectdetection-saliency-maps icon indicating copy to clipboard operation
objectdetection-saliency-maps copied to clipboard

How to modify to use in RetinaNet?

Open chandlerbing65nm opened this issue 2 years ago • 13 comments

How can I modify the gradcam_yolov3.py to use in RetinaNet?

chandlerbing65nm avatar Mar 16 '22 13:03 chandlerbing65nm

When I tried to modify the config file, using RetinaNet config, an error occurs:

image

chandlerbing65nm avatar Mar 16 '22 13:03 chandlerbing65nm

How can I modify the gradcam_yolov3.py to use in RetinaNet?

In object detection, use grad-cam is not as universal as classification, and the difference between Faster RCNN and YOLO v3 is also very large. Faster R-CNN is a two-stage, YOLO is a single-stage, resulting in the application of GradCAM, the saliency map obtained by YOLO is global, while Faster R-CNN is locally in-box.

I don't know RetinaNet very well, but I guess it is similar to the current one-stage network. The prediction head has a box prediction branch and a class prediction branch. Although it is a single-stage network like YOLO, the implementation details may be different, YOLO uses only one branch to predict box and class.

I am sorry that I have been busy recently and cannot provide a GradCAM case of RetinaNet, but I'm willing to offer you some advice. You should probably find the branch result in the prediction branch of RetinaNet that predicts the class score, and use this result as the score for the backward operation, note that in Tensor format.

RuoyuChen10 avatar Mar 16 '22 14:03 RuoyuChen10

@RuoyuChen10 do you have the working demo of gradcam for faster-RCNN?

chandlerbing65nm avatar Mar 17 '22 08:03 chandlerbing65nm

@RuoyuChen10 do you have the working demo of gradcam for faster-RCNN?

Yes, I will submit the .ipynb demo before Beijing time 3/18/2022 24:00.

RuoyuChen10 avatar Mar 17 '22 09:03 RuoyuChen10

@RuoyuChen10 do you have the working demo of gradcam for faster-RCNN?

Yes, I will submit the .ipynb demo before Beijing time 3/18/2022 24:00.

Thank you

chandlerbing65nm avatar Mar 17 '22 09:03 chandlerbing65nm

@RuoyuChen10 do you have the working demo of gradcam for faster-RCNN?

Yes, I will submit the .ipynb demo before Beijing time 3/18/2022 24:00.

Thank you

Or you can find an implementation here: https://github.com/yizt/Grad-CAM.pytorch, there is both faster R-CNN and retinanet in the project based on the detectron2 framework. I may submit mmdetection version later due to the ddl of ACM MM. Maybe you can offer an email to me and I send you the ipynb file without readme.

RuoyuChen10 avatar Mar 17 '22 12:03 RuoyuChen10

@RuoyuChen10 Yes, I viewed that implementation in detectron2 and thought to re-implement it in mmdetection. Thankfully, I don't need to do anymore since you've done it already.

Thank you for sharing, my email is [email protected]

chandlerbing65nm avatar Mar 17 '22 13:03 chandlerbing65nm

Hi! I have viewed the implementation in detectron2 but failed to re-implement it in mmdetection. Could you provide me with the .ipynb demo on retinanet? my email is [email protected]. Thank you!

Drew-bw avatar Apr 17 '22 07:04 Drew-bw

Hi! I have viewed the implementation in detectron2 but failed to re-implement it in mmdetection. Could you provide me with the .ipynb demo on retinanet? my email is [email protected]. Thank you!

Sorry, I currently don't have retinanet-gradcam implementation on mmdetection. I will submit it to this repo if I have time to implement it.

RuoyuChen10 avatar Apr 17 '22 08:04 RuoyuChen10

Thank you all the same!

---- 回复的原邮件 ---- | 发件人 | Ruoyu @.> | | 日期 | 2022年04月17日 16:33 | | 收件人 | @.> | | 抄送至 | @.@.> | | 主题 | Re: [RuoyuChen10/objectdetection-saliency-maps] How to modify to use in RetinaNet? (Issue #1) |

Hi! I have viewed the implementation in detectron2 but failed to re-implement it in mmdetection. Could you provide me with the .ipynb demo on retinanet? my email is @.*** Thank you!

Sorry, I currently don't have retinanet-gradcam implementation on mmdetection. I will submit it to this repo if I have time to implement it.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

Drew-bw avatar Apr 17 '22 11:04 Drew-bw

@RuoyuChen10 Yes, I viewed that implementation in detectron2 and thought to re-implement it in mmdetection. Thankfully, I don't need to do anymore since you've done it already.

Thank you for sharing, my email is [email protected]

I have updated the Grad-CAM for CUDA computing. See interpretation dir.

RuoyuChen10 avatar Apr 19 '22 21:04 RuoyuChen10

I have finised the demo based on faster R-CNN.

RuoyuChen10 avatar Jan 16 '23 10:01 RuoyuChen10

How can I modify the gradcam_yolov3.py to use in RetinaNet?

I have released an example for retinanet, have a look.

RuoyuChen10 avatar Jan 16 '23 16:01 RuoyuChen10