GitPedia

CNN Visualization

TensorFlow implementations of visualization of convolutional neural networks, such as Grad-Class Activation Mapping and guided back propagation

From conan7882·Updated November 12, 2025·View on GitHub·

- This repository contains implementations of visualizatin of CNN in recent papers. - The source code in the repository can be used to demostrate the algorithms as well as test on your own data. The project is written primarily in Python, distributed under the MIT License license, first published in 2017. Key topics include: class-activation-maps, cnn, computer-vision, deep-learning, grad-cam.

Visualization of Deep Covolutional Neural Networks

<!--- [![Build Status](https://travis-ci.org/conan7882/CNN-Visualization.svg?branch=master)](https://travis-ci.org/conan7882/CNN-Visualization) [![Coverage Status](https://coveralls.io/repos/github/conan7882/CNN-Visualization/badge.svg?branch=master)](https://coveralls.io/github/conan7882/CNN-Visualization?branch=master) -->
  • This repository contains implementations of visualizatin of CNN in recent papers.
  • The source code in the repository can be used to demostrate the algorithms as well as test on your own data.

Requirements

Algorithms

Visulization of filters and feature maps of GoogLeNet

  • The most straightforward approach to visualize a CNN is to show the feature maps (activations) and filters.
  • Details of the implementation and more results can be found here
<p align = 'left'> <img src ="doc/firstfilter/figs/GoogLeNet.png" height="250" /> <img src ="doc/firstfilter/figs/GoogLeNet_inception3a.png" height="250" /> </p>

Deconvnet

  • Pick a specific activation on a feature map and set other activation to zeros, then reconstruct an image by mapping back this new feature map to input pixel space.
  • Details of the implementation and more results can be found here. Some results:
<p align = 'left'> <img src ="doc/deconv/figs/people/conv1_2_feat.png" height="200" /> <img src ="doc/deconv/figs/people/conv1_2_im.png" height="200" /> <img src ="doc/deconv/figs/people/conv2_2_feat.png" height="200" /> <img src ="doc/deconv/figs/people/conv2_2_im.png" height="200" /> <img src ="doc/deconv/figs/people/conv3_4_feat.png" height="200" /> <img src ="doc/deconv/figs/people/conv3_4_im.png" height="200" /> <img src ="doc/deconv/figs/people/conv4_4_feat.png" height="200" /> <img src ="doc/deconv/figs/people/conv4_4_im.png" height="200" /> </p>

Guided back propagation

<!--- Guided backpropagation generates clearer visulizations than deconvnet for higher layers.-->
  • Details of the implementation and more results can be found here. Some results:

gbp

Class Activation Mapping (CAM)

  • The class activation map highlights the most informative image regions relevant to the predicted class. This map can be obtained by adding a global average pooling layer at the end of convolutional layers.
  • Details of the implementation and more results can be found here. Some results:

celtech_change

Gradient-weighted Class Activation Mapping (Grad-CAM)

  • Grad-CAM generates similar class heatmap as CAM, but it does not require to re-train the model for visualizatin.
  • Details of the implementation and more results can be found here. Some results:

grad-cam-result

Contributors

Showing top 1 contributor by commit count.

View all contributors on GitHub →

This article is auto-generated from conan7882/CNN-Visualization via the GitHub API.Last fetched: 6/19/2026