how to take a gradient with respect to a specific class to visualize

109 views
Skip to first unread message

SMA

unread,
Jun 27, 2015, 9:25:54 PM6/27/15
to caffe...@googlegroups.com
Hi 

I would like to visualize the gradient data after calling 
  net.backward()
with respect to a specific class.
e.g. the image is a cat's image and it is wanted to visualize the saliency map mentioned in Simonyan et al 14 with respect to this class.
the saliency map taken so far is just by implementing net.backward() and plotting the result which is assumed to be visualization of gradient data with respect to all classes. although the result is similar to a cat.
now wondering how to change net.backward command to give the gradient data with respect to e.g. cat's class.
Thanks a lot in advance for guiding the new generation of Caffe frameworks learner.

best,

P.S. the force_backward =  true  is placed in deploy file and the softmax layer is replaced with softmaxwithloss. 
the pretrained imagenet is being used using the code written for filter visualization existing in Caffe website

Emory

unread,
Aug 6, 2015, 4:05:22 PM8/6/15
to Caffe Users
Hi David,

I am wondering if you have got any luck on this?
I am playing with this saliency map method, and it will be great if you have any experience to share.
Actually I tried "force_backward" trick, but I could not get any diff values from input blob (all values are 0).

Thanks a lot!
Reply all
Reply to author
Forward
0 new messages