Source-linked AI summary

Instance-based Counterfactual Explanations for Time Series Classification

Eoin Delaney, Derek Greene, Mark T. Keane

arXiv:2009.13211v2cs.LGstat.ML

TL;DR

Time-series classification has received less explanation research than image and tabular prediction. Native Guide uses case-base instances and discriminative time-series regions to generate counterfactuals; experiments report stronger plausibility than w-CF and significant proximity over NUNS on ℓ1 and ℓ2.

  • Problem

    XAI research has focused more on image and tabular data than on time-series predictions, which pose challenges from multidimensionality, feature dependencies, and context.

    Source: §1 · pp. 1–2
  • Method

    Native Guide adapts case-base instances and integrates discriminative feature information to generate counterfactual explanations for time-series classifiers.

    Source: §2 · p. 4, §4 · p. 6
  • Results

    Native Guide counterfactuals are consistently more plausible than w-CF; Native Guide and w-CF are significantly closer to queries than NUNS on ℓ1 and ℓ2 (Wilcoxon, p<0.01).

    Source: Results and discussion · p. 10, §5.2 · p. 11
  • Takeaways & Limitations

    Proximity to the query is a poor heuristic for plausibility in these evaluations.

    Source: §5.2 · p. 11

    DiCE did not generate diverse counterfactuals within reasonable time limits, suggesting it may not suit high-dimensional time series, even with shallower ANNs.

    Source: §5 · p. 8

Abstract

from arXiv · show

In recent years, there has been a rapidly expanding focus on explaining the predictions made by black-box AI systems that handle image and tabular data. However, considerably less attention has been paid to explaining the predictions of opaque AI systems handling time series data. In this paper, we advance a novel model-agnostic, case-based technique -- Native Guide -- that generates counterfactual explanations for time series classifiers. Given a query time series, $T_{q}$, for which a black-box classification system predicts class, $c$, a counterfactual time series explanation shows how $T_{q}$ could change, such that the system predicts an alternative class, $c'$. The proposed instance-based technique adapts existing counterfactual instances in the case-base by highlighting and modifying discriminative areas of the time series that underlie the classification. Quantitative and qualitative results from two comparative experiments indicate that Native Guide generates plausible, proximal, sparse and diverse explanations that are better than those produced by key benchmark counterfactual methods.

1 Introduction

Time-series classification has received less XAI attention than image and tabular prediction, despite the challenges posed by multidimensional data, feature dependencies, and context. Native Guide is introduced as a case-based counterfactual method for time-series classifiers.

1 Introduction

  • Most XAI research focuses on image and tabular data, while time-series explanations face multidimensionality, strong feature dependencies, and context-setting challenges.The paper motivates time-series explanations with applications including ECG abnormality detection and food spectroscopy.Source: §1 · pp. 1–2
  • Native Guide is a novel, model-agnostic technique that generates counterfactual explanations for time-series classification predictions.The paper frames it as an explainable case-based reasoning solution.Source: §1 · pp. 1–2
  • In healthcare, explanations can help practitioners identify informative ECG portions for detecting abnormalities such as myocardial infarction.The paper also points to food spectroscopy and identifying time-series portions relevant to classification.Source: §1 · p. 2

2 Related Work

Prior time-series XAI work largely emphasizes visualization and feature importance, with comparatively little instance-based explanation. The paper positions Native Guide as a case-based counterfactual approach that integrates discriminative feature information.

2 Related Work

  • Early time-series XAI mainly used visualization and feature-importance methods rather than factual or counterfactual instances.CAM highlights discriminative areas for deep networks; shapelets identify discriminative subsequences, though interpretability concerns have been raised for learned shapelets.Source: §2 · p. 3
  • Feature weights can come directly from linear classifiers or be estimated with model-agnostic methods such as LIME and SHAP.Reported stability concerns include perturbation sensitivity; one comparison found LIME poor across evaluated datasets, while saliency methods and SHAP were more robust across architectures.Source: §2 · pp. 3–4
  • Time-series prototypes provide class-representative examples but do not identify the most discriminative areas, while existing case-based approaches do not provide counterfactual explanations.An earlier unpublished version retrieved case-base instances but did not integrate discriminative feature information into counterfactual generation.Source: §2 · p. 4

3 Good Counterfactuals for Time Series: Key Properties

The paper frames good time-series counterfactuals around proximity, sparsity, plausibility, and diversity. It argues that these properties must be considered together, including whether changes preserve meaningful subsequences and plausible data patterns.

3 Good Counterfactuals for Time Series: Key Properties

  • Proximity measures how close a query is to its counterfactual, using distance metrics and a relative counterfactual distance measure.The relative measure compares generated counterfactuals with existing in-sample counterfactual solutions.Source: §3 · pp. 4–5
  • Sparse time-series counterfactuals should modify one contiguous, discriminative subsequence rather than scattered individual time points.The paper argues that a simple feature-count sparsity rule from tabular data does not transfer directly to multidimensional time series.Source: §3 · p. 5
  • Plausibility may be better assessed by whether a counterfactual falls within or represents the data distribution than by proximity alone.The paper notes that a close counterfactual can still be out of distribution.Source: §3 · p. 5
  • The method generates multiple explanations for a query, but diversity should not sacrifice plausibility or semantically meaningful information..Source: §3 · p. 5

4 Native Guide: Counterfactual XAI for Time Series

Native Guide builds counterfactuals from in-sample cases, then adapts discriminative contiguous regions to change a black-box classifier’s prediction while targeting proximity, sparsity, plausibility, and diversity.

  • A counterfactual changes query Tq so the black-box classifier predicts an alternative class c′, with proximity, sparsity, plausibility, and diversity prioritized.Source: §4 · p. 6
  • Native Guide retrieves an in-sample counterfactual from the case-base, typically the query’s nearest unlike neighbor, which ensures plausibility by staying within the data distribution.Source: §4 · pp. 5–6
  • For deep learners, feature weights can direct changes to semantically meaningful features rather than raw time-series values, supporting sparse explanations.Source: §4 · pp. 6–7
  • It adapts the native guide by replacing influential contiguous regions of Tq with guide values, using feature-weight magnitude to identify the region.Source: §4 · p. 7
  • The modified subsequence can grow iteratively until the classifier predicts c′, reaching the full query-series length in the worst case; other in-sample guides can provide diverse alternatives.Source: §4 · p. 7

5 Testing Native Guide: Two Comparative Experiments

Across five UCR datasets, the experiments compare Native Guide with w-CF and NUN-CF on counterfactual proximity, sparsity, plausibility, and diversity. Native Guide is reported as more plausible than w-CF and can produce diverse explanations, while Experiment 1 finds both Native Guide and w-CF closer than NUNs on ℓ1 and ℓ2 metrics.

5 Testing Native Guide: Two Comparative Experiments

  • The tests focused on a fully convolutional neural network classifier and evaluated proximity and sparsity in Experiment 1, then plausibility and diversity in Experiment 2.Experiment 2 used Local Outlier Factor, Isolation Forest, and OC-SVM novelty detection, including OC-SVM on matrix-profile representations.Source: §5 · pp. 7–8, §5.2 · p. 11
  • The experiments used five binary and multiclass UCR datasets with archive-provided train-test splits and compared Native Guide against w-CF and NUN-CF.NUN-CF uses the query’s nearest unlike neighbor directly; Native Guide adapts an in-sample counterfactual using CAM feature-importance weights, while w-CF minimizes a loss function.Source: §5 · pp. 7–8
  • The authors report that DiCE did not generate diverse counterfactuals within reasonable time limits in these tests.They suggest it may not be well suited to high-dimensional time series, even for shallower ANNs.Source: §5 · p. 8

5.1 Experiment 1: Probing Proximity and Sparsity

  • Both Native Guide and w-CF produced explanations significantly closer than existing NUNs on ℓ1 and ℓ2 distances (Wilcoxon, p<0.01).Native Guide constrains perturbations to selected contiguous subsequences, whereas w-CF often changes features at non-contiguous locations.Source: Results and discussion · p. 10
  • w-CF’s counterfactuals sometimes contained erratic spikes and non-contiguous changes, while Native Guide edited contiguous subsequences.The authors describe these w-CF spikes as potentially out-of-distribution and note that ℓ∞ can help diagnose erratic feature values.Source: Results and discussion · pp. 10–11, Figure 6 · p. 10
  • Native Guide counterfactuals were more proximate than w-CF counterfactuals on ℓ∞, which the authors suggest may indicate that w-CF outputs are unrealistic.The authors also caution that plausibility needs more robust evaluation.Source: Results and discussion · p. 11

5.2 Experiment 2: Exploring Plausibility and Diversity

  • Native Guide counterfactuals were consistently more plausible than w-CF counterfactuals across the evaluated OOD metrics.Table 2 compares the methods using four OOD metrics, with lower percentages of out-of-distribution explanations indicating better results.Source: §5.2 · p. 11, Table 2 · p. 11
  • Native Guide can generate diverse counterfactual explanations by using alternative counterfactual instances as guides.Figure 8 shows two explanations for the same query based on perturbing different in-sample counterfactual cases.Source: §5.2 · p. 12, Figure 8 · p. 12

6 Conclusion and Future Directions

Native Guide uses case-base instances to produce counterfactual explanations for time series classification, with reported advantages over two benchmark methods. The conclusion also identifies possible data-augmentation applications and future human-user studies.

  • On diverse UCR datasets with a fully convolutional neural network, Native Guide explanations were significantly better than NUN-CF case-base explanations and w-CF constraint-based explanations.Source: §6 · p. 12
  • Native Guide uses existing case-base instances to generate counterfactual candidates that are proximate, sparse, plausible, and diverse.Source: §6 · p. 12
  • Methods designed for tabular data often failed to produce meaningful explanations in the time series domain.Source: §6 · p. 12
  • Native Guide generates new time series data that the authors say holds promise for data augmentation.Source: §6 · p. 12
  • The authors identify experiments with human users and case-based reasoning solutions as future work.Source: §6 · p. 12
Loading 2009.13211v2…