TLDR: SHAPEX is a new framework for explaining time series classification models. It moves beyond timestep-level explanations by identifying and evaluating the importance of “shapelets” – key subsequences that drive classification outcomes. Using a Shapelet Describe-and-Detect (SDD) framework to learn these patterns and Shapley values to assess their contribution, SHAPEX provides more precise and causally faithful explanations. Experiments show it outperforms existing methods across various datasets and models, offering clearer insights into model decisions, especially in critical applications.
Understanding why an artificial intelligence model makes a particular decision is becoming increasingly important, especially in critical fields like healthcare and finance. When these models are used for classifying time series data – sequences of data points indexed in time, like heartbeats or stock prices – knowing which parts of the sequence influenced the decision is crucial for trust and transparency.
Traditional methods for explaining time series classification models often focus on individual data points, or “timesteps.” However, these models frequently rely on specific, meaningful subsequences, known as “shapelets,” to make their classifications. Imagine an electrocardiogram (ECG) signal: a specific pattern like the QRS complex is far more indicative of a heart condition than any single point in time. Existing explanation methods often miss this fundamental insight, leading to fragmented and less intuitive explanations.
Introducing SHAPEX: Explaining Time Series with Key Patterns
To address this gap, researchers have developed SHAPEX, an innovative framework designed to provide clearer and more reliable explanations for time series classification models. SHAPEX stands out by focusing on these crucial shapelets. Instead of looking at individual timesteps, it breaks down a time series into meaningful, shapelet-driven segments and then uses a powerful concept called Shapley values to determine how important each segment is to the model’s prediction.
A key advantage of SHAPEX is its ability to uncover causal relationships, not just correlations. This means it helps identify the actual drivers behind a model’s decision, making the explanations more robust and trustworthy, particularly in high-stakes applications.
How SHAPEX Works: Learning and Attributing Importance
SHAPEX operates in two main phases: a training phase where it learns the important shapelets, and an inference phase where it uses these shapelets to explain a model’s predictions.
During the training phase, SHAPEX employs a unique “Shapelet Describe-and-Detect (SDD)” framework. This framework effectively learns a diverse and representative set of shapelets that are most critical for classification. Think of it like teaching the system to recognize the essential patterns in the data. It uses a “descriptor” to find similarities between these learned shapelets and parts of the input time series, and a “detector” to pinpoint the exact locations of these key subsequences. The learning process is guided by different objectives, ensuring the shapelets are not only good for classification but also distinct and well-aligned with the actual data patterns.
Once these shapelets are learned, SHAPEX moves to the inference phase to explain a specific prediction. It uses the learned shapelets to intelligently segment the new time series into meaningful parts. Then, it applies Shapley value analysis to these shapelet-driven segments. This involves a clever technique called “Shapelet-driven Segment-Level (SDSL) Perturbation,” where SHAPEX simulates the presence or absence of a segment by smoothly interpolating its values. By observing how the model’s prediction changes when a segment is included or excluded, SHAPEX calculates a saliency score for each segment, indicating its importance.
Why Causal Explanations Matter
The design of SHAPEX allows it to move beyond simply identifying correlations. By treating the inclusion or masking of a segment as a deliberate “intervention” in the model’s input, SHAPEX can approximate what is known as the “Conditional Average Treatment Effect” (CATE). In simpler terms, it measures the expected change in the model’s prediction directly caused by a specific segment, given the context of other segments. This causal understanding is vital for building AI systems that are not only accurate but also truly interpretable and reliable.
Also Read:
- Understanding AI’s ECG Diagnoses with Prototype Explanations
- Bridging Accuracy and Interpretability: A New Method to Distill Complex AI Models
Demonstrated Performance and Real-World Impact
Extensive experiments on both synthetic and real-world datasets, including the ECG dataset and over 100 datasets from the UCR Archive, show that SHAPEX consistently outperforms existing explanation methods. It achieves higher precision in identifying the most relevant subsequences and offers stronger causal fidelity in its explanations. SHAPEX has also proven to be robust across various black-box classification models, such as Transformers, LSTMs, CNNs, and MultiRocket.
Case studies further highlight SHAPEX’s interpretive precision. For instance, when analyzing medical imaging data like the PhalangesOutlinesCorrect dataset, SHAPEX accurately pinpoints the growth plate transition region, which is medically significant for determining bone maturity. In facial contour analysis (FaceAll dataset), it focuses on facial boundaries and expression-related areas. For gesture recognition (UWaveGestureLibraryAll dataset), SHAPEX highlights subsequences corresponding to gesture transitions, like decreasing acceleration during turns.
While SHAPEX represents a significant advancement, the researchers acknowledge some limitations, such as the need for user-defined hyperparameters and a separate training phase for shapelets. Future work aims to address these by exploring automated parameter selection and more integrated training strategies.
For more technical details, you can refer to the full research paper: SHAPEX : Shapelet-Driven Post Hoc Explanations for Time Series Classification Models.


