ramprs / grad-cam

[ICCV 2017] Torch code for Grad-CAM
https://arxiv.org/abs/1610.02391
1.5k stars 226 forks source link

Why do the results show linear or rectangular shape on heatmap? #11

Closed mijung-kim closed 6 years ago

mijung-kim commented 6 years ago

Hello,

I was wondering why the localized results show certain pattern like lines or rectangular shape. Anybody knows about the phenomenon? Thank you in advance!

ramprs commented 6 years ago

Hi Mijung,

   Are you referring to the rectangular patterns at the edges of the image? If so, this could be due to zero-padding the original image before feeding it to the network. Zero-padding introduces high gradients due to which some neurons might fire. And since Grad-CAM visualizations are a weighted sum of neuron activations, these effects become visible there as well.
mijung-kim commented 6 years ago

@ramprs, Yeah. I was wondering about it. Thank you so much!