-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Can GradCAM be applied to CNN regression models with multiple input images? #544
Comments
Hi, Do you want to quantify the contribution of each input image, For the first option you might need something custom, depending on how the images look. |
Hi, Thank you very much for your reply and clarification. I greatly appreciate your time and assistance. The problem I am addressing involves using a CNN to model the regression relationship between remotely sensed evapotranspiration (target) and temperature & precipitation (input) images for land regions (with ocean pixels assigned a constant value of zero). Specifically, I am interested in identifying which input pixels contribute the most to predicting evapotranspiration in a region like the Amazon River Basin. Based on your explanation, it seems my problem aligns with the second case you mentioned—analyzing visual contributions within each image. Thank you again for your insights, and I look forward to any further guidance or suggestions you may have. Best regards, Shaoxing |
I would start with the low hanging fruit, which is getting a CAM image that identifies any relevant pixels. Following the example in the Readme: targets = [RawScoresOutputTarget()]
with GradCAM(model=model, target_layers=target_layers) as cam:
grayscale_cam = cam(input_tensor=input_tensor, targets=targets) The problem is that this does not tell us if the pixel was important for the temperature image, the precipitation, or both of them. It will only tell us it was relevant for at least one of them. |
Thank you very much for your detailed reply and explanations. I apologize for the delay in responding, as I just returned from holiday. |
Hello, I am working on a CNN model designed for regression tasks with multiple input images (channels). The goal is to predict a target output image based on multiple predictor images. I would like to know if GradCAM can be used to quantify the contribution of each input image to the predictions. If so, could you please provide guidance or examples on how to implement this?
Thank you very much for your time and assistance!
The text was updated successfully, but these errors were encountered: