Skip to content

One of the firsts dataset level explanability libraries for 1d signal using GRAD-CAM++

License

Notifications You must be signed in to change notification settings

marcusnk237/dataset_gradcam_plus_plus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Dataset level explainability for time series classification

Table of Contents
  1. About
  2. Getting Started
  3. Usage
  4. License
  5. Contact
  6. Acknowledgments

About The Project

One of the main challenges in artificial intelligence for the researchers is to understands how model predictions works. Many contributions has been made, especially GRAD-CAM++. Grad-CAM++ give a visual representation of the keys features responsible of the classification, and give human-level understanding of the model prediction. Despite its advantages, GRAD-CAM++ have drawbacks:

  • GRAD-CAM ++ is not initially design for time series

  • GRAD-CAM ++ works only for local classification. It can give any information about key features responsible of the classification at a dataset-level.

Our library not only give a GRAD-CAM ++ visualisation for time series, but also give keys feature importances at a dataset level

(back to top)

Built With

Python Tensorflow

(back to top)

Getting Started

Prerequisites

Tensorflow Opencv Pandas Matplotlib Numpy

Installation

  1. Clone the repo
    sh git clone https://github.com/marcusnk237/dataset_gradcam_plus_plus.git
    
  2. Install the library
    python3 setup.py install
    

(back to top)

Usage

Local visual explanation

from dataset_gradcam_plus_plus  import local_features_importances
local_features_importances(model,data,time,layer_name,label)
Arguments:
> - model : The model trained
> - data : The data sample
> - time : The time range (The user can create a linspace vector and use it as the time range).
> - layer_name : The last layer of the feature extraction part of the model. Usually, it is the last layer before the Flattening operation.
> - label : The label output list

Alt text

Dataset level feature relevance

from dataset_gradcam_plus_plus import dataset_features_importances

dataset_features_importances(model,datas,layer_name,feature_names,flag=True)

Arguments:
> - model : The model trained
> - datas : the dataset. Due of Hardware limitations, the max size of datas is 5000 samples.
> - layer_name : The last layer of the feature extraction part of the model. Usually, it is the last layer before the Flattening operation.
> - feature_names : The feature list
> - flag : True, return the global feature importance plot; False, return the feature importance frequency and the corresponding features

Alt text

License

Distributed under the GNU License. See LICENSE.txt for more information.

(back to top)

Contact

(back to top)

Acknowledgments

The authors of the original article about GRAD-CAM++

(back to top)