Modeling CNN layers activity with Gaussian mixture model

Overview

GMM-CNN

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".

Requirements:

  • Graphvis V 0.10.1
  • Tensorflow 1.11.0
  • Keras 2.2.5

Instructions - Work Flow

GMM-CNN model training (main.py):

  1. Specify the directory for saving the model and configuration
  2. Specify the layers names as used in the CNN you wish to model.
  3. Specify the number of Gaussian (clusters) for each layer (as the same order you did in 2.).
  4. Choose between discriminative/generative for training method (as explained in the paper).
  5. Run main.py.

Gathering clusters statistics (gather_clusters_stats.py):

  1. Specify the directory you gave in 1. above.
  2. Run gather_clusters_stats.py script.

Creating clusters images (draw_clusters.py):

  1. Specify the directory you gave in 1. above.
  2. Insert the cluster visualiztion technique (rectangle/patches).
  3. Run draw_clusters.py.

Creating class infernce graphs (draw_class_inference_graph.py):

  1. Specify the directory you gave in 1. above.
  2. Specify the CNN layers name to visualize in the graph and the clusters visualiztion technique for each layer.
  3. Specify the class name you want to build the graph for.
  4. Run draw_class_inference_graph.py.

Creating image infernce graphs (draw_image_inference_graph.py):

  1. Specify the directory you gave in 1. above.
  2. Specify the CNN layers name to visualize in the graph and the clusters visualiztion technique for each layer.
  3. Specify whther you want to analyze a well-classified images or wrongly-classified images.
  4. Specify the number of images/graphs you want to build.
  5. Run draw_image_inference_graph.py.
You might also like...
This code is 3d-CNN model that can predict environmental value

Predict-environmental-value-3dCNN This code is 3d-CNN model that can predict environmental value. Firstly, I built a model that can create a lot of bu

This is a model to classify Vietnamese sign language using Motion history image (MHI) algorithm and CNN.
This is a model to classify Vietnamese sign language using Motion history image (MHI) algorithm and CNN.

Vietnamese sign lagnuage recognition using MHI and CNN This is a model to classify Vietnamese sign language using Motion history image (MHI) algorithm

Attention-based CNN-LSTM and XGBoost hybrid model for stock prediction

Attention-based CNN-LSTM and XGBoost hybrid model for stock prediction Requirements The code has been tested running under Python 3.7.4, with the foll

Activity image-based video retrieval

Cross-modal-retrieval Our approach is focus on Activity Image-to-Video Retrieval (AIVR) task. The compared methods are state-of-the-art single modalit

This is the research repository for Vid2Doppler: Synthesizing Doppler Radar Data from Videos for Training Privacy-Preserving Activity Recognition.
This is the research repository for Vid2Doppler: Synthesizing Doppler Radar Data from Videos for Training Privacy-Preserving Activity Recognition.

Vid2Doppler: Synthesizing Doppler Radar Data from Videos for Training Privacy-Preserving Activity Recognition This is the research repository for Vid2

Shallow Convolutional Neural Networks for Human Activity Recognition using Wearable Sensors
Shallow Convolutional Neural Networks for Human Activity Recognition using Wearable Sensors

-IEEE-TIM-2021-1-Shallow-CNN-for-HAR [IEEE TIM 2021-1] Shallow Convolutional Neural Networks for Human Activity Recognition using Wearable Sensors All

Group Activity Recognition with Clustered Spatial Temporal Transformer

GroupFormer Group Activity Recognition with Clustered Spatial-TemporalTransformer Backbone Style Action Acc Activity Acc Config Download Inv3+flow+pos

PyZebrascope - an open-source Python platform for brain-wide neural activity imaging in behaving zebrafish
PyZebrascope - an open-source Python platform for brain-wide neural activity imaging in behaving zebrafish

PyZebrascope - an open-source Python platform for brain-wide neural activity imaging in behaving zebrafish

HiPAL: A Deep Framework for Physician Burnout Prediction Using Activity Logs in Electronic Health Records
HiPAL: A Deep Framework for Physician Burnout Prediction Using Activity Logs in Electronic Health Records

HiPAL Code for KDD'22 Applied Data Science Track submission -- HiPAL: A Deep Framework for Physician Burnout Prediction Using Activity Logs in Electro

Comments
  • Bug fixes and code improvements

    Bug fixes and code improvements

    Main solved issues:

    • In find_max() function, the image index was not taken care properly.
    • gmm layer name bug fix.
    • gmm-classification layer is not learned and was set to be equal to the network classification layer.
    • add a center red dot in patches clusters.
    opened by yaelkon 0
Owner
null
Beyond a Gaussian Denoiser: Residual Learning of Deep CNN for Image Denoising

Beyond a Gaussian Denoiser: Residual Learning of Deep CNN for Image Denoising

Kai Zhang 1.2k Dec 29, 2022
DEMix Layers for Modular Language Modeling

DEMix This repository contains modeling utilities for "DEMix Layers: Disentangling Domains for Modular Language Modeling" (Gururangan et. al, 2021). T

Suchin 43 Nov 11, 2022
NFT-Price-Prediction-CNN - Using visual feature extraction, prices of NFTs are predicted via CNN (Alexnet and Resnet) architectures.

NFT-Price-Prediction-CNN - Using visual feature extraction, prices of NFTs are predicted via CNN (Alexnet and Resnet) architectures.

null 5 Nov 3, 2022
Multistream CNN for Robust Acoustic Modeling

Multistream Convolutional Neural Network (CNN) A multistream CNN is a novel neural network architecture for robust acoustic modeling in speech recogni

ASAPP Research 37 Sep 21, 2022
SMD-Nets: Stereo Mixture Density Networks

SMD-Nets: Stereo Mixture Density Networks This repository contains a Pytorch implementation of "SMD-Nets: Stereo Mixture Density Networks" (CVPR 2021)

Fabio Tosi 115 Dec 26, 2022
Tutel MoE: An Optimized Mixture-of-Experts Implementation

Project Tutel Tutel MoE: An Optimized Mixture-of-Experts Implementation. Supported Framework: Pytorch Supported GPUs: CUDA(fp32 + fp16), ROCm(fp32) Ho

Microsoft 344 Dec 29, 2022
Audio Source Separation is the process of separating a mixture into isolated sounds from individual sources

Audio Source Separation is the process of separating a mixture into isolated sounds from individual sources (e.g. just the lead vocals).

Victor Basu 14 Nov 7, 2022
Pytorch implementation of paper: "NeurMiPs: Neural Mixture of Planar Experts for View Synthesis"

NeurMips: Neural Mixture of Planar Experts for View Synthesis This is the official repo for PyTorch implementation of paper "NeurMips: Neural Mixture

James Lin 101 Dec 13, 2022
[ICLR 2022] Pretraining Text Encoders with Adversarial Mixture of Training Signal Generators

AMOS This repository contains the scripts for fine-tuning AMOS pretrained models on GLUE and SQuAD 2.0 benchmarks. Paper: Pretraining Text Encoders wi

Microsoft 22 Sep 15, 2022
Ultra-lightweight human body posture key point CNN model. ModelSize:2.3MB HUAWEI P40 NCNN benchmark: 6ms/img,

Ultralight-SimplePose Support NCNN mobile terminal deployment Based on MXNET(>=1.5.1) GLUON(>=0.7.0) framework Top-down strategy: The input image is t

null 223 Dec 27, 2022