Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

Neural network visualization toolkit for tf.keras

Project description


Downloads PyPI version Build Status License: MIT

tf-keras-vis is a visualization toolkit for debugging tf.keras models in Tensorflow2.0+. Currently supported methods for visualization include:

tf-keras-vis is designed to be light-weight, flexible and ease of use. All visualizations have the features as follows:

  • Support N-dim image inputs, that's, not only support pictures but also such as 3D images.
  • Support batchwise processing, so, be able to efficiently process multiple input images.
  • Support the model that have either multiple inputs or multiple outputs, or both.
  • Support Optimizers embedded in tf.keras to process Activation maximization.


Visualize Dense Layer

Visualize Convolutional Filer


The images above are generated by GradCAM++.

Saliency Map

The images above are generated by SmoothGrad.


  • Python 3.6-3.8
  • tensorflow>=2.0.2


  • PyPI
$ pip install tf-keras-vis tensorflow
  • Docker (container that run Jupyter Notebook)
$ docker run -itd -p 8888:8888 keisen/tf-keras-vis:0.5.0

If you have GPU processors,

$ docker run -itd --runtime=nvidia -p 8888:8888 keisen/tf-keras-vis:0.5.0-gpu

You can find other images at Docker Hub.


Please see below for details:

Getting Started Guides

[NOTE] If you have ever used keras-vis, you may feel that tf-keras-vis is similar with keras-vis. Actually tf-keras-vis derived from keras-vis, and both provided visualization methods are almost the same. But please note that tf-keras-vis APIs does NOT have compatibility with keras-vis.

Guides (ToDo)

  • Visualizing multiple attention or activation images at once utilizing batch-system of model
  • Define various loss functions
  • Visualizing attentions with multiple inputs models
  • Visualizing attentions with multiple outputs models
  • Advanced loss functions
  • Tuning Activation Maximization
  • Visualizing attentions for N-dim image inputs


  • Guide documentations
  • API documentations
  • We're going to add some methods such as below.
    • Deep Dream
    • Style transfer

Known Issues

  • With InceptionV3, ActivationMaximization doesn't work well, that's, it might generate meaninglessly blur image.
  • With cascading model, Gradcam and Gradcam++ don't work well, that's, it might occur some error. So we recommend, in this case, to use FasterScoreCAM.
  • channels-first models and data is unsupported.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for tf-keras-vis, version 0.5.5
Filename, size File type Python version Upload date Hashes
Filename, size tf_keras_vis-0.5.5-py3-none-any.whl (19.6 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size tf-keras-vis-0.5.5.tar.gz (15.9 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page