zhangst431 / TPRO

12 stars 1 forks source link

how to create the Grad-CAM of this TPRO model? #5

Open Beliefzp opened 3 months ago

Beliefzp commented 3 months ago

Now I want to create the Grad-CAM of this model, like the figure 1 in your TPRO paper. But I don't know which layer to choose to create the Grad-CAM. Could you tell me how to create the activation map like figure 1?

thanck you very much.

zhangst431 commented 3 months ago

Hello,

In our work, we did not extract Grad-CAM for the TPRO model. The class activation maps displayed in the Introduction section are obtained by weighting cam2, cam3, and cam4 from the model's forward function.

Regarding the approach of directly utilizing feature maps in models structured as feature map -> GAP -> cls_pred, you might find the following paper insightful: Li R, Mai Z, Zhang Z, et al. Transcam: Transformer attention-based cam refinement for weakly supervised semantic segmentation. Journal of Visual Communication and Image Representation, 2023, 92: 103800.

Beliefzp commented 3 months ago

OK,thank you very much.