DIANNA
Deep Insight And Neural Network Analysis, DIANNA is the only Explainable AI, XAI library for scientists supporting Open Neural Network Exchange, ONNX - the de facto standard models format.
Explainable AI tool for explaining models that create embeddings.
distance_explainerXAI method to explain distances in embedded spaces.

There are 2 ways to install distance_explainer. To install distance_explainer from PyPI (recommended) run:
pip install distance_explainer
To instead install distance_explainer from the GitHub repository, run:
git clone git@github.com:dianna-ai/distance_explainer.git
cd distance_explainer
python3 -m pip install .
See our documentation and tutorial notebook for how to use this package. In short:
image1 = np.random.random((100, 100, 3))
image2 = np.random.random((100, 100, 3))
image2_embedded = model(image2)
explainer = DistanceExplainer(axis_labels={2: 'channels'})
attribution_map = explainer.explain_image_distance(model, image1, image2_embedded)
If you use Distance Explainer for your research, please cite our method paper and the software itself:
distance_explainer — doi:10.5281/zenodo.10018768@article{meijer2025explainable,
title={Explainable embeddings with {D}istance {E}xplainer},
author={Meijer, Christiaan and Bos, E. G. Patrick},
journal={arXiv preprint arXiv:2505.15516},
year={2025},
note={To appear in the XAI26 proceedings}
}
@software{meijer2023distance,
title={distance_explainer},
author={Meijer, Christiaan and Bos, Patrick},
doi={10.5281/zenodo.10018768},
year={2023}
}
If you want to contribute to the development of distance_explainer, have a look at the contribution guidelines.
This package was created with Cookiecutter and the NLeSC/python-template.
What is happening in your machine-learned embedded spaces?
Explainable AI tool for scientists
Deep Insight And Neural Network Analysis, DIANNA is the only Explainable AI, XAI library for scientists supporting Open Neural Network Exchange, ONNX - the de facto standard models format.