Code Monkey home page Code Monkey logo

explainable-cnn's Introduction

Explainable CNNs

Torch Version Torchvision Version Python Version Price Maintained

๐Ÿ“ฆ PyTorch based visualization package for generating layer-wise explanations for CNNs.

It is a common notion that a Deep Learning model is considered as a black box. Working towards this problem, this project provides flexible and easy to use pip package explainable-cnn that will help you to create visualization for any torch based CNN model. Note that it uses one of the data centric approach. This project focusses on making the internal working of the Neural layers more transparent. In order to do so, explainable-cnn is a plug & play component that visualizes the layers based on on their gradients and builds different representations including Saliency Map, Guided BackPropagation, Grad CAM and Guided Grad CAM.

Architechture

โญ Star us on GitHub โ€” it helps!

Usage

Install the package

pip install explainable-cnn

To create visualizations, create an instance of CNNExplainer.

from explainable_cnn import CNNExplainer

x_cnn = CNNExplainer(...)

The following method calls returns numpy arrays corresponding to image for different types of visualizations.

saliency_map = x_cnn.get_saliency_map(...)

grad_cam = x_cnn.get_grad_cam(...)

guided_grad_cam = x_cnn.get_guided_grad_cam(...)

To see full list of arguments and their usage for all methods, please refer to this file

You may want to look at example usage in the example notebook.

Output

Below is a comparison of the visualization generated between GradCam and GuidedGradCam

Contributors โœจ

Thanks goes to these wonderful people (emoji key):


Ashutosh Hathidara

๐Ÿ’ป ๐ŸŽจ ๐Ÿ”ฌ ๐Ÿšง โœ… โš ๏ธ

Lalit Pandey

๐Ÿ”ฌ ๐Ÿ“–

This project follows the all-contributors specification. Contributions of any kind welcome!

References

explainable-cnn's People

Contributors

ashutosh1919 avatar l-pandey avatar allcontributors[bot] avatar

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.