DiscoX
Project Summary
The opacity inherent in machine learning models presents a significant hindrance to their widespread incorporation into decision-making processes. To address this challenge and foster trust among stakeholders while ensuring decision fairness, the data mining community has been actively advancing the Explainable Artificial Intelligence (XAI) paradigm. This paper contributes to the evolving field by focusing on time series counterfactual generation, a domain where research is relatively scarce. We develop, a post-hoc, model agnostic counterfactual explanation algorithm that leverages the Matrix Profile ($MP$) to map time series discords to their nearest neighbors in a target sequence and use this mapping to generate new counterfactual instances. To our knowledge, this is the first effort towards the use of time series discords for counterfactual explanations. We evaluate our algorithm on the University of California Riverside (UCR) and University of East Anglia (UEA) archives and compare it to three state-of-the-art univariate and multivariate methods.
Source Code
Instructions:
Install requirements in requirements.txt.Â
Download desired UCR datasets from here and UEA datasets from here and save in the 'data' directory.
Train black-box models (the sample code is for ResNet models (see 'classifiers' directory) and save in the 'models' directory'
We uploaded pre-trained models for the Coffee and ArticularyWordRecognition datasets.
Run 'python discox_ucr.py $name' to augment dataset '$name' from the UCR archive.
Run 'python discox_uea.py $name' to augment dataset '$name' from the UEA archive.