Region of interest from classifier

I was wondering if it was possible to generate a region of interest or mask from a classifier?

let me explain, say we have a classifier that classifies dogs vs cat, and it is a good classifier, now if we give it a new image and it classifies it correctly, can we also get a mask like image which could tell us what was the minimum region that was important for making that classification, this could help us know if the classifier is picking the right region and sometimes gives us the new insights as well

and if this is possible, please point me towards a demo or research about it

this is relatable:

You may want to look at Class Activation Map (CAM). Below is a notebook from fastbook that covers the topic.

Thanks, silly of me to not read the whole thing before asking :sweat_smile: