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
- Clone the repo
sh git clone https://github.com/marcusnk237/dataset_gradcam_plus_plus.git
- Install the library
python3 setup.py install
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
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
Distributed under the GNU License. See LICENSE.txt
for more information.
-
Project Link: https://github.com/marcusnk237/dataset_gradcam_plus_plus
The authors of the original article about GRAD-CAM++