filipradenovic / cnnimageretrieval-pytorch

CNN Image Retrieval in PyTorch: Training and evaluating CNNs for Image Retrieval in PyTorch
http://cmp.felk.cvut.cz/cnnimageretrieval
MIT License
1.43k stars 322 forks source link

How did you draw Fig2 in the "Fine-tuning CNN ..." paper? #38

Closed SongZRui closed 5 years ago

SongZRui commented 5 years ago

image This figure is very impressive and straightforward to visualize the most distinguish patch of an image. I think it will do a great help in understanding which parts contributed more in my own work. Would you be so kind to opensource that code? Many thanks in advance~

filipradenovic commented 5 years ago

This was done in MATLAB using MatConvNet. Because the final layer, in this case, is global max pooling (MAC), you can take the location of the max for each channel and estimate its location in the original image, as well as the size of the receptive field. This can be done with a function from MatConvNet getVarReceptiveFields. For an example usage, check this thread.

SongZRui commented 5 years ago

Thank you so much. It's very helpful!