This code package implements the modeling of CNN layers activity with Gaussian mixture model and Inference Graphs visualization technique from the paper "Inference graphs for CNN Interpretation".
- Graphvis V 0.10.1
- Tensorflow 1.11.0
- Keras 2.2.5
- Specify the directory for saving the model and configuration
- Specify the layers names as used in the CNN you wish to model.
- Specify the number of Gaussian (clusters) for each layer (as the same order you did in 2.).
- Choose between discriminative/generative for training method (as explained in the paper).
- Run main.py.
- Specify the directory you gave in 1. above.
- Run gather_clusters_stats.py script.
- Specify the directory you gave in 1. above.
- Insert the cluster visualiztion technique (rectangle/patches).
- Run draw_clusters.py.
- Specify the directory you gave in 1. above.
- Specify the CNN layers name to visualize in the graph and the clusters visualiztion technique for each layer.
- Specify the class name you want to build the graph for.
- Run draw_class_inference_graph.py.
- Specify the directory you gave in 1. above.
- Specify the CNN layers name to visualize in the graph and the clusters visualiztion technique for each layer.
- Specify whther you want to analyze a well-classified images or wrongly-classified images.
- Specify the number of images/graphs you want to build.
- Run draw_image_inference_graph.py.