ramprs / grad-cam

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

it does not match exactly. Why? #14

Closed bemoregt closed 6 years ago

bemoregt commented 6 years ago

Hi, @varunagrawal @abhshkdz @mcogswell @Ramprasaath @vrama91

As a result of classifying with Resnet, Accuarcy is over 99%. If you hit map the object area with gradCAM with that model file, it does not match exactly. Why?

It seems to be a problem of GradCAM rather than Resnet classification learning. The objects to be hit-mapped are not as local or blob like dogs or cats, but close to a long straight line. In this case, GradCAM seems to miss the object area. Have you experienced this?

For a well-trainedd Resnet model, how do you optimize GradCAM?

Thanks, in advance.

from @bemoregt.

abhshkdz commented 6 years ago

As a result of classifying with Resnet, Accuarcy is over 99%. If you hit map the object area with gradCAM with that model file, it does not match exactly. Why?

If I understand correctly, you're saying that the Grad-CAM heatmap doesn't correspond to the region of the image containing the object category (even though prediction is accurate). Yeah, this sounds plausible, and may happen if the model doesn't ground its prediction accurately. It'd be easier for us to analyze if you could share the CNN definition, visualization figures and class labels.

It seems to be a problem of GradCAM rather than Resnet classification learning. The objects to be hit-mapped are not as local or blob like dogs or cats, but close to a long straight line. In this case, GradCAM seems to miss the object area. Have you experienced this?

Unless there's a bug, this is definitely not a common error mode, and it might even be a failure of the CNN itself (than of the visualization method). Again, it would help if you could share visualizations.

For a well-trainedd Resnet model, how do you optimize GradCAM?

Sorry, what do you mean by "optimize"? Grad-CAM is an inference-time procedure and doesn't involve any optimization.

Unless there's a bug in the implementation, I'd suggest continuing this thread over email than on a github issue.

bemoregt commented 6 years ago

@abhshkdz

Thanks a lot.

I have fixed this issue with Guided-GradCAM or Guided-BP. I found that in the case of thin line object, GGCM or GBP are more efficient to heat mapping of object area.

Thank you.

from @bemoregt.