Table of Contents
Fetching ...

ShapeX: Shapelet-Driven Post Hoc Explanations for Time Series Classification Models

Bosong Huang, Ming Jin, Yuxuan Liang, Johan Barthelemy, Debo Cheng, Qingsong Wen, Chenghao Liu, Shirui Pan

TL;DR

ShapeX tackles the challenge of explaining time series classifiers by shifting from timestep-centric explanations to shapelet-driven segment explanations. It introduces the Shapelet Describe-and-Detect (SDD) framework to learn a compact, diverse set of shapelets and uses a Shapelet-driven Segment-Level (SDSL) perturbation coupled with Shapley value attribution to quantify segment-level contributions to predictions. The authors provide a causal-interpretation rationale by linking the Shapley-based attributions to model-level CATE under standard identification assumptions, and they demonstrate superior saliency quality and robustness across synthetic and real-world benchmarks, including a large-scale occlusion study on the UCR archive. Overall, ShapeX advances faithful, interpretable post hoc explanations for time series classification with practical implications for high-stakes domains such as healthcare and finance.

Abstract

Explaining time series classification models is crucial, particularly in high-stakes applications such as healthcare and finance, where transparency and trust play a critical role. Although numerous time series classification methods have identified key subsequences, known as shapelets, as core features for achieving state-of-the-art performance and validating their pivotal role in classification outcomes, existing post-hoc time series explanation (PHTSE) methods primarily focus on timestep-level feature attribution. These explanation methods overlook the fundamental prior that classification outcomes are predominantly driven by key shapelets. To bridge this gap, we present ShapeX, an innovative framework that segments time series into meaningful shapelet-driven segments and employs Shapley values to assess their saliency. At the core of ShapeX lies the Shapelet Describe-and-Detect (SDD) framework, which effectively learns a diverse set of shapelets essential for classification. We further demonstrate that ShapeX produces explanations which reveal causal relationships instead of just correlations, owing to the atomicity properties of shapelets. Experimental results on both synthetic and real-world datasets demonstrate that ShapeX outperforms existing methods in identifying the most relevant subsequences, enhancing both the precision and causal fidelity of time series explanations.

ShapeX: Shapelet-Driven Post Hoc Explanations for Time Series Classification Models

TL;DR

ShapeX tackles the challenge of explaining time series classifiers by shifting from timestep-centric explanations to shapelet-driven segment explanations. It introduces the Shapelet Describe-and-Detect (SDD) framework to learn a compact, diverse set of shapelets and uses a Shapelet-driven Segment-Level (SDSL) perturbation coupled with Shapley value attribution to quantify segment-level contributions to predictions. The authors provide a causal-interpretation rationale by linking the Shapley-based attributions to model-level CATE under standard identification assumptions, and they demonstrate superior saliency quality and robustness across synthetic and real-world benchmarks, including a large-scale occlusion study on the UCR archive. Overall, ShapeX advances faithful, interpretable post hoc explanations for time series classification with practical implications for high-stakes domains such as healthcare and finance.

Abstract

Explaining time series classification models is crucial, particularly in high-stakes applications such as healthcare and finance, where transparency and trust play a critical role. Although numerous time series classification methods have identified key subsequences, known as shapelets, as core features for achieving state-of-the-art performance and validating their pivotal role in classification outcomes, existing post-hoc time series explanation (PHTSE) methods primarily focus on timestep-level feature attribution. These explanation methods overlook the fundamental prior that classification outcomes are predominantly driven by key shapelets. To bridge this gap, we present ShapeX, an innovative framework that segments time series into meaningful shapelet-driven segments and employs Shapley values to assess their saliency. At the core of ShapeX lies the Shapelet Describe-and-Detect (SDD) framework, which effectively learns a diverse set of shapelets essential for classification. We further demonstrate that ShapeX produces explanations which reveal causal relationships instead of just correlations, owing to the atomicity properties of shapelets. Experimental results on both synthetic and real-world datasets demonstrate that ShapeX outperforms existing methods in identifying the most relevant subsequences, enhancing both the precision and causal fidelity of time series explanations.
Paper Structure (44 sections, 2 theorems, 29 equations, 16 figures, 11 tables)

This paper contains 44 sections, 2 theorems, 29 equations, 16 figures, 11 tables.

Key Result

Proposition 1

Let $f(X)$ denote the model’s prediction for input $X$, and let $X_{(S_n)}$ denote the segment aligned with shapelet $n \in \mathcal{G}$, where $\mathcal{G} = \{1, \dots, N\}$ is the index set of all segments. Then, under the intervention defined by retaining or masking segment $X_{(S_n)}$, the Shap is equivalent to the model-level CATE $\tau_n^{\text{model}}$, conditioned on context $\mathcal{G}'

Figures (16)

  • Figure 1: Perturbation strategies on an ECG example. (a) shows the original signal with saliency labels derived from QRS complexes---clinically critical regions for arrhythmia classification. (b)--(d) apply timestep-level, equal-length, and shapelet-driven perturbations, respectively. Only (d) maintains alignment with the salient regions.
  • Figure 2: Overview of ShapeX. In the training phase, given time series from dataset and the initialized shapelets, [mycircled,red]a11 descriptor generates activation maps by [mycircled,red]a13 taking shapelets as the 1D convolution kernel, demonstrating to which extent the input time series aligns with each shapelet. Meanwile, [mycircled,red]a12 detector locates key subsequences for the morphological matching of shapelets. Simultaneously, the shapelets are optimized using three loss functions. In inference, the learned shapelets first trigger a shapelet-driven segmentation of the test series; the resulting segments are next perturbed by SDSL to obtain [mycircled,red]a14 $P(X,M_{\mathcal{G'}})$. Finally, Shapley value is applied to compute the final saliency scores.
  • Figure 3: The saliency scores generated by ShapeX and TimeX++ on PhalangesOutlineCorrect dataset.
  • Figure 4: Occlusion results under different perturbation ratios, where higher AUROC indicates better saliency.
  • Figure 5: Ablation study on ShapeX by replacing SDSL with equal-length segmentation, leading to performance drop.
  • ...and 11 more figures

Theorems & Definitions (3)

  • Proposition 1: Shapley Value as Model-Level CATE
  • Proposition 1: Shapley Value as Model-Level CATE
  • proof