You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am the developer of CAM. Recently I found this blog article (https://thehive.ai/blog/inside-a-neural-networks-mind) to introduce CAM and grad-CAM. The overview on the CAM and grad-CAM in the blog article is good, but found there is some bias or misleading claim to CAM, compared to grad-CAM. This wrong claim has been existing for a while that I would like to clarify as below:
First of all, nowadays all the mainstream network architectures such as resnet, densenet, or other squeezenet use global average pooling at the end, so the class activation map (the heatmap) could be generated directly using CAM, without modifying any network architectures. So the claim that the grad-Cam is superior over CAM because of using grad-cam without modifying architecture is false.
Meanwhile, if you are using resnet or densenet or squeeznet or any modern networks, so you can basically generate heatmap using CAM directly (see example code at https://github.com/metalbubble/CAM/blob/master/pytorch_CAM.py), without needing the extra step to compute the gradient as in grad-CAM. Through that you save the backward computation, in which you save almost half of the computation. This is crucial in some application such as video processing that CAM is able to use the forward pass only to generate the prediction and heatmap for each frame. So in the associated code of that blog (https://github.com/hiveml/tensorflow-grad-cam), they are already using the resnet, but still use the gradient to generate CAM. It simply wastes the computation.
The text was updated successfully, but these errors were encountered:
I am the developer of CAM. Recently I found this blog article (https://thehive.ai/blog/inside-a-neural-networks-mind) to introduce CAM and grad-CAM. The overview on the CAM and grad-CAM in the blog article is good, but found there is some bias or misleading claim to CAM, compared to grad-CAM. This wrong claim has been existing for a while that I would like to clarify as below:
First of all, nowadays all the mainstream network architectures such as resnet, densenet, or other squeezenet use global average pooling at the end, so the class activation map (the heatmap) could be generated directly using CAM, without modifying any network architectures. So the claim that the grad-Cam is superior over CAM because of using grad-cam without modifying architecture is false.
Meanwhile, if you are using resnet or densenet or squeeznet or any modern networks, so you can basically generate heatmap using CAM directly (see example code at https://github.com/metalbubble/CAM/blob/master/pytorch_CAM.py), without needing the extra step to compute the gradient as in grad-CAM. Through that you save the backward computation, in which you save almost half of the computation. This is crucial in some application such as video processing that CAM is able to use the forward pass only to generate the prediction and heatmap for each frame. So in the associated code of that blog (https://github.com/hiveml/tensorflow-grad-cam), they are already using the resnet, but still use the gradient to generate CAM. It simply wastes the computation.
The text was updated successfully, but these errors were encountered: