Skip to main content

XAI method to explain distances in embedded spaces

Project description

DOI workflow pypi badge

distance_explainer

XAI method to explain distances in embedded spaces.

overview schema

Installation

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 .

How to use

See our tutorial 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, please cite

If you use Distance Explainer for your research, please cite our method paper and the software itself:

@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}
}

Contributing

If you want to contribute to the development of distance_explainer, have a look at the contribution guidelines.

Credits

This package was created with Cookiecutter and the NLeSC/python-template.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

distance_explainer-0.5.1.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

distance_explainer-0.5.1-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file distance_explainer-0.5.1.tar.gz.

File metadata

  • Download URL: distance_explainer-0.5.1.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for distance_explainer-0.5.1.tar.gz
Algorithm Hash digest
SHA256 72106b1b81b959643b86ebaf4c547029ffbba1adaf454dec1f275c036b2b69b9
MD5 71373f4f518fdd7a6bb41e8734734142
BLAKE2b-256 ab14180ff612b05751c37d106df17d0ffe82a8729176e4c9e9e85674e11e2d6e

See more details on using hashes here.

Provenance

The following attestation bundles were made for distance_explainer-0.5.1.tar.gz:

Publisher: release.yml on dianna-ai/distance_explainer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file distance_explainer-0.5.1-py3-none-any.whl.

File metadata

File hashes

Hashes for distance_explainer-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 511c130c80b84bdd51bc8c15f51045aea3992a74243a92c0c260a58ec1de151d
MD5 286724ef1eb016c30efb3485c028eb0c
BLAKE2b-256 a1d463afedf9c974745b9d66169193117a6c896bb91f2bd0660e63a0c5172bc5

See more details on using hashes here.

Provenance

The following attestation bundles were made for distance_explainer-0.5.1-py3-none-any.whl:

Publisher: release.yml on dianna-ai/distance_explainer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page