bmsookim / gradcam.pytorch

Pytorch Implementation of Visual Explanations from Deep Networks via Gradient-based Localization
MIT License
126 stars 19 forks source link

GradCAM does not match exactly. Why? #2

Open bemoregt opened 6 years ago

bemoregt commented 6 years ago

Hi, @meliketoy

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 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 Resnet34 model, how do you optimize GradCAM?

Thanks, in advance.

from @bemoregt.

linzhiqiu commented 6 years ago

Same issue here. @bemoregt Have you found out whether it is an implementation problem?

bmsookim commented 6 years ago

Hi, sorry for the extremely late response :(

I've currently not tested this much in everyday objects (as I am doing a project on medical images)

Could you provide me a brief example of 'heat-map area being close to a long straight line?'

linzhiqiu commented 6 years ago

I am using resnet for a binary classification task and I found out that CAM method also produces the same result. So I think it's not your implementation problem :-)