Abstract
LIMESegment is a novel framework that adapts the Locally Interpretable Model-Agnostic Explanations (LIME) method specifically for time series classification. By introducing a shape-aware segmentation algorithm (NNSegment), a frequency-based perturbation strategy (Realistic Background Perturbation, or RBP), and utilizing Dynamic Time Warping (DTW) for locality, it produces explanations that are significantly more faithful to the model and robust to noise than previous adaptations. Evaluations across diverse datasets, including clinical Sepsis data, demonstrate that LIMESegment provides more semantically meaningful and reliable insights into model behavior.
Introduction
Explainable AI (XAI) has seen significant success with LIME in domains such as image and text processing. LIME works by perturbing parts of an input—such as "super-pixels" or words—and observing the resulting changes in model predictions. However, time series data presents unique challenges. Unlike images, time series lack obvious interpretable units. Previous attempts to apply LIME to time series often relied on fixed-length windows, which suffer from three primary flaws: arbitrary boundaries that split meaningful motifs, unrealistic perturbations (like zeroing out segments) that create out-of-distribution artifacts, and a lack of temporal sensitivity in distance metrics like Euclidean distance.
Methodology
LIMESegment addresses these challenges through three core technical innovations designed to respect the temporal and spectral properties of the data.
NNSegment: Meaningful Segmentation
Instead of arbitrary fixed windows, LIMESegment employs NNSegment, a shape-aware segmentation algorithm. It identifies "super segments" by searching for repeating patterns (motifs) or sudden anomalies using normalized cross-correlation. By identifying where the shape-based adjacency of patterns breaks, NNSegment ensures that segments represent homogeneous behaviors, such as distinct physiological states in medical recordings.
Realistic Background Perturbation (RBP)
To "delete" a segment without introducing adversarial artifacts, the authors propose Realistic Background Perturbation (RBP). This method operates in the frequency domain using the Discrete Short Time Frequency Transform (STFT). By identifying the most persistent "background" frequency band, the algorithm replaces the target segment with synthetic noise that matches the signal's natural background. This ensures the perturbed sample remains within a realistic data distribution, preventing the model from reacting to artificial discontinuities.
DTW-based Locality
LIME requires weighting perturbed samples based on their proximity to the original input. LIMESegment replaces the rigid Euclidean distance with Dynamic Time Warping (DTW). DTW is far more effective at recognizing similarity between signals that may be slightly shifted or stretched in time, leading to more stable and robust local explanations.
Evaluation and Results
The framework was rigorously evaluated using synthetic benchmarks, the Apnea-ECG dataset, the UCR Time Series Archive, and a high-stakes Sepsis cohort from the MIMIC-III database.
- Segmentation Accuracy: NNSegment outperformed existing methods like FLUSS and standard change-point detection (DynP), achieving higher F-scores and lower Hausdorff distances.
- Faithfulness: In the Sepsis study, LIMESegment achieved a faithfulness score of 0.29, compared to 0.02 and 0.12 for prior LIME adaptations. This indicates that the features identified as important by LIMESegment are truly influential to the model's decision-making process.
- Clinical Relevance: In predicting Sepsis survival, LIMESegment correctly identified that temperature fluctuations immediately following sepsis onset were the most influential features, a finding that aligns with established medical literature.
Conclusion
LIMESegment provides a robust and semantically grounded approach to explaining time series models. By prioritizing shape similarity and realistic data perturbations, it overcomes the limitations of previous window-based methods. Future research will explore extending this framework to multivariate time series and conducting human-in-the-loop studies with domain experts to further validate the interpretability of the generated segments.
Summary updated