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

GradCAM does not detect correct convolutional layer in multi-input case #96

Open
marieff587 opened this issue Dec 19, 2022 · 1 comment

Comments

@marieff587
Copy link

Thank you for this useful visualization package!

Right now I have a two-input, one-output model as follows
image

I am using GradCAM, with code snippet below. I have stated my penultimate layer to be 'ria-conv', which happens after concatenation of both networks.

image

However, the dimension of cam is 2 - one for each network (15 * 256 * 320 is my image count * image dimensions) , as shown in this screenshot
image

As far as my understanding goes, since the actual last convolutional layer is after concatenation, cam should be 1 * 15 * 256 * 320? This happens both when I explicitly state the penultimate layer and when I state it as -1.

@keisen
Copy link
Owner

keisen commented Jan 20, 2023

Hi, @marieff587 . Thank you for your good question.

I think that the size of two inputs of your model are the same. Please imagine that they are different. The specification of Gradcam is returning cam images that are the same size as the input images. So, if the model has two or more inputs, Gradcam returns multiple cam images corresponding to each input.

Thanks!

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

2 participants