Skip to content

CAM and ScoreCAM do not match. ScoreCAM yields visually similar activation maps for binary classification. #213

Answered by frgfm
CHILLQQ asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @CHILLQQ 👋

Thanks for the question! For clarifications:

  • what do you mean by "make sure that CAM and ScoreCAM yield same activation maps" ? They are different methods so it's normal that it yields different outputs, and no, ScoreCAM cannot be reduced to CAM (cf. equations in https://frgfm.github.io/torch-cam/methods.html#torchcam.methods.ScoreCAM)
  • however about the other problem you're mentioning, I can only see only 2 cases where switching between two class_idx gets you the same activation map:
    • if there is a NaN & the activation map is uniform
    • if the activations are right on prob=0.5

To be able to help you further, I'd need a minimal runnable snippet so that I can reproduce 😅

Let…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@CHILLQQ
Comment options

@frgfm
Comment options

@CHILLQQ
Comment options

@frgfm
Comment options

frgfm Jul 4, 2023
Maintainer

Answer selected by CHILLQQ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
module: methods Related to torchcam.methods awaiting response
2 participants