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

DFF was added to pytorch-grad-cam #3

Open
jacobgil opened this issue Aug 6, 2022 · 0 comments
Open

DFF was added to pytorch-grad-cam #3

jacobgil opened this issue Aug 6, 2022 · 0 comments

Comments

@jacobgil
Copy link

jacobgil commented Aug 6, 2022

This is an amazing method.

I wanted to share that I added it to the pytorch-grad-cam package.

The focus here wasn't about finding shared concepts in a group of images, but instead explaining a single image by finding the concepts in it, as an alternative to methods like grad-cam.

Here is a tutorial about it:
https://jacobgil.github.io/pytorch-gradcam-book/Deep%20Feature%20Factorizations.html

A few additions I added that might be interesting for you were:

  • Classifying the concept embeddings so we can know which categories they correspond to.
    Then we can add a legend to the visualizations, showing what every concept means.
  • Displaying all of the heatmaps on the same image with a color coding (the color coding is something you did in the paper as well).
    Since we have multiple heatmaps that might overlap for some pixels, we have to combine them somehow.
    So for every pixel I just chose the heatmap with the highest value for that pixel.

I'm thinking of improving this by applying some method for automatically finding the number of components.

This is an amazing overlooked method for explainability. It works really well.

example

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