XAI Viz is a visualization tool for convolutional Keras models. It uses Feature Visualization and Grad-CAM to create visual representations of hidden layers of convolutional neural networks.
- Generate Feature Visualizations for filters or individual neurons.
- Investigate filter activations at spatial locations on your input image.
- Generate visual representations of hidden layers using Feature Visualization.
- Show the attribution to the models prediction of spatial locations on these representations using Grad-CAM.
- Form groups of activations using non-negative matrix factorization.
- Visualize these groups using Feature Visualization and activation maps.
-
If your model requires special input preprocessing clone the repo and update the prepare_input function in backend.util to your needs.
-
After that install the requirements.txt and run the install script to generate an executable or simply run main.py.
-
This application is designed for and tested with python 3.7 and tensorflow 2.7.
- Export your Keras model using tf.keras.models.save_model()
- Start the tool and import your model
- Generate/Import a dictionary containing Feature Visualizations for each filter in your model (generating may take some time depending on your models complexity)
- Load an input and start visualizing
- This tool implements many of the ideas proposed by Olah et al.
- Feature Visualization and Grad-CAM engines are based on the tutorials provided by Keras.
- Color scheme: qdarkstyle.