idiap / fullgrad-saliency

Full-gradient saliency maps
Other
203 stars 32 forks source link

Checkerboard patterns in FullGrad #16

Open IgnacioHeredia opened 2 years ago

IgnacioHeredia commented 2 years ago

Hi all,

I had a question. When I use Fullgrad (or its smooth version) I experience very strong checkerboard patterns. I'm aware this is a fairly well know issue with gradient methods, but still curious because:

I'm skeptical of opening an issue because the patterns only appear in the model after training. The model with weights pretrained on ImageNet doesn't show these patterns. Therefore it might very well be unrelated to Fullgrad, so feel free to close the issue.

But I am still curious if someone else has had this problem, in case it could be a side effect of the interpolation or whatnot.

Model after training

FullGrad

One can start to sense the patterns.

fullgrad

Smooth FullGrad

Averaging over the default 100 samples really magnifies the patterns.

smooth_fullgrad

Of course, this behavior repeats for all images. Here's another example:

smooth_fullgrad2

GradCam

No checkerboard, although one sees these reticular-like explanations. They also seem to appear in other implementations thus are probably a distinctive feature of GradCam.

gradcam

Model only with ImageNet pretraining

Smooth FullGrad

No patterns.

smfg

GradCam

No patterns, still kind of reticular.

gradcam (1)

So, just sharing in case anyone had any thoughts. Pointers are welcome, thanks! :)

IgnacioHeredia commented 2 years ago

Update

Training on a cleaner/smaller dataset with a MobileNet does not seem to produce patterns. So it probably (?) had to do with the noisiness of the dataset. Still no intuition on why a noisy dataset would be more likely to produce these patterns.

Feel free to close the issue, though still interested to hear if someone has ever experienced something similar.