ReX: Causal Responsibility EXplanations for image classifiers
ReX is a causal explainability tool for image classifiers. It also works on tabular and 3D data.
Given an input image and a classifier, ReX calculates a causal responsibility map across the data and identifies a minimal, sufficient, explanation.
ReX is black-box, that is, agnostic to the internal structure of the classifier. ReX finds single explanations, non-contiguous explanations (for partially obscured images), multiple independent explanations, contrastive explanations and lots of other things! It has a host of options and parameters, allowing you to fine tune it to your data.
For background information and detailed usage instructions, see our documentation.
Installation
ReX can be installed using pip.
We recommend creating a virtual environment to install ReX.
ReX has been tested using versions of Python >= 3.10.
The following instructions assume conda:
conda create -n rex python=3.13
conda activate rex
pip install rex_xai
This should install an executable rex in your path.
To check that ReX is installed correctly, run:
ReX --help
To build from source, clone the repository and run:
git clone git@github.com:ReX-XAI/ReX.git
cd ReX
conda create -n rex python=3.13
conda activate rex
pip install .
Note:
By default,
onnxruntimewill be installed. If you wish to use a GPU, you should uninstallonnxruntimeand installonnxruntime-gpuinstead. You can alternatively clone the project and edit thepyproject.tomlto read "onnxruntime-gpu >= 1.17.0" rather than "onnxruntime >= 1.17.0".
If you want to use ReX with 3D data, you will need to install some optional extra dependencies:
pip install 'rex_xai[3D]'
Feedback
Bug reports, questions, and suggestions for enhancements are welcome - please check the GitHub Issues to see if there is already a relevant issue, or open a new one!
How to Contribute
Your contributions are highly valued and welcomed. To get started, please review the guidelines outlined in the CONTRIBUTING.md file. We look forward to your participation!
Metadata
Release files for rex-xai 0.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| rex_xai-0.4.1.tar.gz | 49.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rex_xai-0.4.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 108.5 kB
Release files / rex_xai-0.4.1.tar.gz
| Download URL | rex_xai-0.4.1.tar.gz |
|---|---|
| Size | 49.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e2cb9d97e6b85cad0c3c9ae02b5d6079c0e2d6fe5997924970ecbdb9c29d9762
|
|
BLAKE2b-256 checksum How to use checksums |
5eafb36be9d41665cd80143ec3da941c0ec4b2e45e57eb00a647b358b67d9fe5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 22, 2025.
Transparency logRelease files / rex_xai-0.4.1-py3-none-any.whl
| Download URL | rex_xai-0.4.1-py3-none-any.whl |
|---|---|
| Size | 58.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
62b30b3f7e7e17c6f3e1c8c04c6233449c4057a0c8b6be917b3020e1395e2ae9
|
|
BLAKE2b-256 checksum How to use checksums |
657ba83c304d13edecb85420bc152b9db33fafd50eabbf12657d01ef3ca8f76f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 22, 2025.
Transparency log