How use gradcam in a multitask network
Author: regedit818Created Aug 31, 2025Updated Aug 31, 2025
Hi, my network is of a single encoder and dual decoder structure. One decoder outputs the mask, and the other decoder outputs the edge. I overloaded the forward function of GradCam. I also tried various combinations, such as edge loss + mask loss, or using only the mask loss. However, the visualization results were not satisfactory(Specifically, a phenomenon of global activation will be presented.). At the same time, I found that the visualization of the single decoder network was normal.
Source: jacobgil/pytorch-grad-cam