EXplainable Artificial Intelligence (XAI) methods are increasingly accepted as effective tools to trace complex machine learning models’ decision-making processes. In the multi-sensor time series domain, there are two types of artificial intelligence explainability models, traditional factual methods and emerging counterfactual models. While the first family of methods uses feature attribution techniques that alter the features space and observe the impact on the decision function, the counterfactual models aim at providing the smallest possible change to the feature vector that can change the prediction outcome. With the recent upsurge of Internet of Things (IoT) sensor data, counterfactual methods have gained a lot of momentum given their ability to generate actionable feedback that can lead to a ’better’ desirable outcome. In this paper, we propose TimeX, a new model-agnostic time series counterfactual explanation algorithm that provides sparse, interpretable, and contiguous explanations. We validated our model using real-world sensor datasets and shown that our approach is able to explain sensor time series data with up to 20% fewer outliers in comparison with other state-of-the-arts competing models and responds to all the desirable properties of an ideal counterfactual model.
Counterfactual explanation from arabica to robusta coffee species
Counterfactual explanation from robusta to arabica coffee species
Data sets Metadata
Two-dimensional Principal Components Analysis on the ECG200 dataset
Instructions:
Run the mainTS.py file to get the evaluation results presented in the paper.
Modify the variable path in line 100 to provide the path to the fcn_weights.
Other important requirements: NumPy, tensorflow, and scipy.spatial.
For testing the model with other datasets, you can download additional pre-trained models to explain.