Skip to content

Checkerboard patterns in FullGrad #16

@IgnacioHeredia

Description

@IgnacioHeredia

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! :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions