Giter VIP home page Giter VIP logo

featsvisdl's Introduction

Maps visualization for Deep Learning models in PyTorch

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

CAM (Class Activation Map)

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

Grad-CAM

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.

$$w_{k}^{c}=\sum_{i} \sum_{j} \frac{\partial Y^{c}}{\partial A_{i j}^{k}}$$

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

Feature maps visualization on Layers

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

Note for myself.

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.