Using Class Activation Maps (CAM) for visualization


(Arka Sadhu) #1

I wrote a small notebook on how to go about visualizing CAM here https://github.com/TheShadow29/FAI-notes/blob/master/notebooks/Using-CAM-for-CNN-Visualization.ipynb

It also covers when you have a hidden layer after the Adaptive Concat Pooling. Grad-CAM work is still in progress.

Cheers!


(Benoit) #2

Thank you @TheShadow29 I use your code to do the same things with ResNext50 : https://github.com/trancept/deep_learning_tests/blob/master/015-HeatMap.ipynb


(Arka Sadhu) #3

Nice. I will add a link to this in my repo as well :slight_smile:


(Bumblebee) #4

Hi @Benoit_c / @TheShadow29 ,

I have one query regarding class activation maps. If i have a trained model which was initialized using convlearner.pretrained. Now i can load the saved model replace the last layers as per cam and then train the last layers. Is this okay ? or the idea is to retrain the whole network with modified last layers? looking forward to your response.

-bumblebee


(Arka Sadhu) #5

I am not sure unfortunately. I think you can use grad-cam https://arxiv.org/pdf/1610.02391.pdf instead of replacing the last layers.


(Bumblebee) #6

ok. cool. Thanks for prompt response. So need to do a small poc on that part. @Benoit_c any thoughts on this?

Apart from that have you been able to do a small poc on Grand Cam ?


(Benoit) #7

Hi, sorry, I have to retrained the whole model. It will be better if we could visualize an existing model…