zhoubolei / CAM

Class Activation Mapping
http://cnnlocalization.csail.mit.edu/
MIT License
1.84k stars 467 forks source link

Applying threshold on negative weight values or not? #22

Closed ozancaglayan closed 6 years ago

ozancaglayan commented 6 years ago

Hello,

I saw that in Places365 CAM code, a thresholding is applied over the softmax layer weights while in this repository and in the original paper, there's no mention about this trick.

Is there an explanation for this?

Thanks!

zhoubolei commented 6 years ago

Thresholding the softmax weight will make the heatmap highlight all the positively contributed areas. Also previously I found the rendering code for the heatmap didn't handle the negative feature map very well.

But it is interesting to explore the negative image region for the prediction, for example, a sofa region would have a negative effect on predicting beach category.

ozancaglayan commented 6 years ago

thanks for the quick reply!

neouyghur commented 6 years ago

Hi, I also find negative weights in my implementation. I also used the threshold for avoiding negative weights. However, I am curious what have you done in your experiments. Could you explain it in more detail? Thanks.