This repository contains eXplain-NNs Library - an open-source library with explainable AI (XAI) methods for analyzing neural networks. This library provides several XAI methods for latent spaces analysis and uncertainty estimation.
XAI methods implemented in the library
- visualization of latent spaces
- homology analysis of latent spaces
- uncertainty estimation via bayesianization
Thus compared to other XAI libraries, eXplain-NNs Library:
- Provides homology analysis of latent spaces
- Impelemnts a novel method of uncertainty estimation via bayesianization
Details of implemented methods.
- The library supports only models that are:
- fully connected or convolutional
- designed for classification task
Requirements: Python 3.8
- [optional] create Python environment, e.g.
$ conda create -n eXNN python=3.8 $ conda activate eXNN
- install requirements from requirements.txt
$ pip install -r requirements.txt
- install the library as a package
$ python -m pip install git+ssh://[email protected]/Med-AI-Lab/eXplain-NNs
Video demonstration of installation process is available here.
Requirements: Python 3.8
- [optional] create Python environment, e.g.
$ conda create -n eXNN python=3.8 $ conda activate eXNN
- clone repository and install all requirements
$ git clone [email protected]:Med-AI-Lab/eXplain-NNs.git $ cd eXplain-NNs $ pip install -r requirements.txt
- run tests
$ pytest tests/tests.py
- fix code style to match PEP8 automatically
$ make format
- check that code style matches PEP8
$ make check
- build a PyPi package locally
$ python3 -m pip install --upgrade build $ python3 -m build
The general description is available here.
eXplain-NNs Library API is available here
We provides examples of different levels of complexity:
- [minimal] minimalistic examples presenting our API
- [basic] applying eXNN to simple tasks like MNIST classification
- [use cases] demonstation of eXplain-NN usage for solving different use cases in industrial tasks
This colab contains minimalistic demonstration of our API on dummy objects:
Here are colabs demonstrating how to work with different modules of our API on simple tasks:
Colab Link | Module |
---|---|
bayes | |
topology | |
visualization |
This block provides examples how eXplain-NNs can be used to solve different use cases in industrial tasks. For demonstration purposed 3 tasks are used:
- [satellite] landscape classification from satellite imagery
- [electronics] electronic components and devices classification
- [ECG] ECG diagnostics
The contribution guide is available in the repository.
The study is supported by the Research Center Strong Artificial Intelligence in Industry of ITMO University as part of the plan of the center's program: Development and testing of an experimental prototype of a library of strong AI algorithms in terms of algorithms for explaining the results of modeling on data using the semantics and terminology of the subject and problem areas in tasks with high uncertainty, including estimation of the uncertainty of neural network models predictions, analysis and visualization of interlayer transformations of the input variety inside neural networks.
- A. Vatyan - team leader
- N. Gusarova - chief scientific advisor
- I. Tomilov
- T. Polevaya
- Ks. Nikulina
- Alexandra Vatyan [email protected] for collaboration suggestions
- Tatyana Polevaya [email protected] for technical questions