Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checkerboard patterns in FullGrad #16

Open
IgnacioHeredia opened this issue Jul 6, 2022 · 1 comment
Open

Checkerboard patterns in FullGrad #16

IgnacioHeredia opened this issue Jul 6, 2022 · 1 comment

Comments

@IgnacioHeredia
Copy link
Contributor

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:

  • GradCam implementation (from this very same repo) does not show them
  • I don't see any mention of them in either the repo or the paper
  • I'm using a fairly standard architecture (ResNet18) from torchvision.models. No fancy stuff.

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
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant