This repository contains some features visualization methods for DL models in PyTorch.
codes/
is the folder of source scripts
data/
is the folder of some samples
model/
is the pretrained ResNet34 model on ImageNet
results/
is the folder for attention / saliency / features maps
Another repo for more techniques: pytorch-cnn-visualizations
Paper reference: Learning Deep Features for Discriminative Localization
To visualize the model where it focus on by activation maps.
The limitation is that the model must has a Global Pooling followed by one fully connected layer to classes.
Original Images | Activation Maps | Overlapped Images |
Paper reference: Grad-CAM: Visual Explanations from Deep Networks via Gradient-based Localization
This Grad-CAM method is a strict generalization of CAM, which are not limited to GAP and fc.
Generated attention maps of Grad-CAM is the same as CAM's when the model is ResNet34 with GAP and fc.
Original Images | Activation Maps | Overlapped Images |
To visualize the features maps after each layer, which can also be viewed as the method for DL features extraction.
Original Image | Maps after 1st maxpool | Maps after Layer1 |
Maps after Layer2 | Maps after Layer3 | Maps after Layer4 |
git init
git remote add origin [email protected]:gatsby2016/FeatsVisDL.git
git add README.md
git commit -m "first commit"
git push -u origin master