This is the code for the paper "Feature Attribution Explanation to Detect Harmful Dataset Shift" in International Joint Conference on Neural Networks (IJCNN) 2023, in which we proposed a method that combines feature attribution explanation and two sample tests to detect harmful dataset shifts.
Code is based on "Failing Loudly: An Empirical Study of Methods for Detecting Dataset Shift": (https://github.com/steverab/failing-loudly) and "Detecting Covariate Drift with Explanations" (https://github.com/DFKI-NLP/xai-shift-detection)
Run experiments using:
python pipeline.py Dataset Shift_Type multiv Model_Name
Example: python pipeline.py mnist adversarial_shift multiv resnet50
We require the following dependencies:
keras
: https://github.com/keras-team/kerastensorflow
: https://github.com/tensorflow/tensorflowpytorch
: https://github.com/pytorch/pytorchsklearn
: https://github.com/scikit-learn/scikit-learnmatplotlib
: https://github.com/matplotlib/matplotlibtorch-two-sample
: https://github.com/josipd/torch-two-samplekeras-resnet
: https://github.com/broadinstitute/keras-resnet