The repository contains demo code for our paper
The repository includes two Jupyter notebooks, namely
./notebooks/demo.ipynb
demonstrates our disentangled explanation framework. More specifically, the notebook shows how to obtain disentanged explanations from PRCA and DRSA for classbasketball
using activation and LRP context vectors fromVGG16-TV
atConv4_3
. The demonstration reproduces Fig. 1 in the main paper../notebooks/lrp-nfnet.ipynb
demonstrates our LRP implementation for NFNet-F0. It reproduces heatmaps similar to the ones in Fig. D.2 in Supplementary Note D.
Remark: Make sure that PYTHONPATH
includes $(pwd)/cxai
when starting a Jupyter instance. Or, start the instance using PYTHONPATH=$(pwd)/cxai jupyter notebook
.
If you find our demo code for your research, please consider citing our paper:
@ARTICLE{10497845,
author={Chormai, Pattarawat and Herrmann, Jan and Müller, Klaus-Robert and Montavon, Grégoire},
journal={IEEE Transactions on Pattern Analysis and Machine Intelligence},
title={Disentangled Explanations of Neural Network Predictions by Finding Relevant Subspaces},
year={2024},
pages={1-18},
doi={10.1109/TPAMI.2024.3388275}
}
We use Python version 3.8.6. Necessary dependencies can be installed via
pip install -r requirements.txt
Please run the unit test command below to check that necessary functionalities work.
# testing important functions (approximately 3 minutes on CPUs)
make fast-test
# test all functions (approximately 6 minutes on Tesla V100)
make test