Skip to content

viniaraujoo/deepinterpretability

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deep Learning Interpretability

Build Status

Save Model

The templates are saved in mongodb database for future explanation, the template download URL is the key to access in the future.

model: Keras model URL saved in file type H5

Example

URL : /api/uploadmodel

Method : POST

Data example

{
    "model": "https://github.com/viniaraujoo/model_Example/raw/master/model_incep.h5"
}

LIME:

model: Template key (URL) saved to the database

example: URL of the image you want to use as an example of model explanation

top_labels: Explanation for K labels with higher probability.

num_samples: size of the neighborhood to learn the linear model

hide_color: 0 or 1

Example

URL : /api/explanationlime

Method : GET

Data example

{
    "model": "https://github.com/viniaraujoo/model_Example/raw/master/model_incep.h5",
    "example": "https://raw.githubusercontent.com/marcotcr/lime/master/doc/notebooks/data/cat_mouse.jpg",
    "top_labels": 5,
    "num_samples": 1000,
    "hide_color": 0

}

Result

Success Response

Code : 200 OK

Error Response

Code : 400

SHAP:

model: Template key (URL) saved to the database

example: Image URL in numpy compressed ZIP file (Image that you want the explanation).

train: ZIP of the set of images numpy array train format of the explanation.

Example

URL : /api/shap

Method : GET

Data example

{
    "model": "https://github.com/viniaraujoo/model_Example/raw/master/model_incep.h5",
    "example": "",
    "train": ,

}

Result

Success Response

Code : 200 OK

Error Response

Code : 400

License

Foo