DIANNA is a Python package that brings explainable AI (XAI) to your research project. It wraps carefully selected XAI methods in a simple, uniform interface. It's built by, with and for (academic) researchers and research software engineers working on machine learning projects.
DIANNA software is addressing needs of both (X)AI reseachers and mostly the various domains scientists who are using or will use AI models for their research without being experts in (X)AI. DIANNA is future-proof: the only XAI library supporting the Open Neural Network Exchange (ONNX) format.
- Provides an easy-to-use interface for non (X)AI experts
- Implements well-known XAI methods (LIME, RISE and Kernal SHAP) chosen by systematic and objective evaluation criteria
- Supports the de-facto standard format for neural network models - ONNX.
- Includes clear instructions for export/conversions from Tensorflow, Pytorch, Keras and skikit-learn to ONNX.
- Supports both images and text data modalities. Time series, tabular data and even embeddings support is planned.
- Comes with simple intuitive image and text benchmarks
- Easily extendable to other XAI methods
For more information on the unique stengths of DIANNA with comparision to other tools, please see the context landscape.
DIANNA can be installed from PyPI using pip on any of the supported Python versions (see badge):
python3 -m pip install dianna
To install the most recent development version directly from the GitHub repository run:
python3 -m pip install git+https://github.com/dianna-ai/dianna.git
DIANNA comes with simple datasets. Their main goal is to provide intuitive insight into the working of the XAI methods. They can be used as benchmarks for evaluation and comparison of existing and new XAI methods.
Dataset | Description | Examples | Generation |
---|---|---|---|
Binary MNIST | Greyscale images of the digits "1" and "0" - a 2-class subset from the famous MNIST dataset for handwritten digit classification. | Binary MNIST dataset generation | |
Simple Geometric (circles and triangles) | Images of circles and triangles for 2-class geometric shape classificaiton. The shapes of varying size and orientation and the background have varying uniform gray levels. | Simple geometric shapes dataset generation | |
Simple Scientific (LeafSnap30) | Color images of tree leaves - a 30-class post-processed subset from the LeafSnap dataset for automatic identification of North American tree species. | LeafSnap30 dataset generation |
Dataset | Description | Examples | Generation |
---|---|---|---|
Stanford sentiment treebank | Dataset for predicting the sentiment, positive or negative, of movie reviews. | This movie was actually neither that funny, nor super witty. | Sentiment treebank |
We work with ONNX! ONNX is a great unified neural network standard which can be used to boost reproducible science. Using ONXX for your model also gives you a boost in performance! In case your models are still in another popular DNN (deep neural network) format, here are some simple recipes to convert them:
- pytorch
- tensorflow
- keras
- scikit-learn
And here are links to notebooks showing how we created our models on the benchmark datasets:
- Binary MNIST model
- Simple Geometric model
- Simple Scientific model
- Movie reviews model
We envision the birth of the ONNX Scientific models zoo soon...
DIANNA supports different data modalities and XAI methods. The table contains links to the relevant XAI method's papers. There are DIANNA tutorials covering each supported method and data modality on a least one dataset. Our future plans to expand DIANNA with more data modalities and XAI methods are given at the ROADMAP.md.
Data \ XAI | RISE | LIME | KernelSHAP |
---|---|---|---|
Images | ✅ | ✅ | ✅ |
Text | ✅ | ✅ | planned |
Embedding | coming soon | coming soon | coming soon |
Timeseries | planned | planned | planned |
Tabular | planned | planned | planned |
LRP and PatternAttribution also feature in the top 5 of our thoroughly evaluated XAI methods using objective critera (details in coming blog-post). Contributing by adding these and more (new) post-hoc explainability methods on ONNX models is very welcome!
For detailed information on using specific DIANNA functions, please visit the documentation page hosted at Readthedocs.
If you want to contribute to the development of DIANNA, have a look at the contribution guidelines.
If you use this package for your scientific work, please consider citing it as:
Ranguelova, Elena, Bos, Patrick, Liu, Yang, Meijer, Christiaan, & Oostrum, Leon. (2021). dianna (*[VERSION YOU USED]*). Zenodo. https://zenodo.org/record/5592607
See also the Zenodo page for exporting the citation to BibTteX and other formats.
This package was created with Cookiecutter and the NLeSC/python-template.