Time is Not Enough: Time-Frequency based Explanation for Time-Series Black-Box Models

Hyunseung Chung, Sumin Jo, Yeonsu Kwon, Edward ChoiarXiv 2024 · DOI

TL;DR

This paper introduces SpectralX, a novel framework for explaining time-series classification models by considering both time and frequency domain features. They also propose Feature Importance Approximations (FIA), an efficient perturbation-based XAI method that achieves better explanations by focusing on class-specific insights.

What Problem Does This Paper Address?

Time-series classification (TSC) models, especially deep learning ones like LSTMs and Transformers, have become incredibly accurate but are often "black boxes." Existing explainability (XAI) methods for these models primarily focus on the time-domain, neglecting the crucial frequency components inherent in time-series data. This limitation can lead to incomplete or misleading explanations, especially in domains where frequency characteristics are key discriminators (e.g., medical signals like ECG or EEG). The paper aims to bridge this gap by providing explanations that leverage both temporal and spectral information.

Methods

The core of the proposed solution is the SpectralX framework. It works by:

  1. Short-Time Fourier Transform (STFT): Converting the raw time-series data into a time-frequency representation (spectrogram).
  2. Perturbation-based XAI: Applying existing or novel perturbation-based XAI methods to this time-frequency representation. This involves strategically masking or altering parts of the spectrogram to observe their impact on the model's prediction.
  3. Inverse STFT: Reverting the perturbed time-frequency representation back to the time-domain.
  4. Model Prediction: Feeding the reconstructed, perturbed time-series back into the black-box classifier to obtain new probability scores.

To enhance the explanation process, the authors introduce Feature Importance Approximations (FIA), a new perturbation-based XAI method. FIA offers three variations:

  • Insertion: Progressively adding significant features to a baseline signal and observing the impact on class probability.
  • Deletion: Progressively removing features from the original signal and observing the impact.
  • Combined: A weighted combination of insertion and deletion scores, aiming to capture both positive and negative impacts of features.

FIA is designed to be computationally efficient and class-specific, providing more targeted explanations.

Datasets

The authors evaluated their methods on:

  • A generated synthetic dataset with known time-frequency features, serving as a ground truth for explanation evaluation.
  • Nine UCR Time-Series datasets: CincECGTorso, TwoPatterns, MixedShapes, Arrowhead, Strawberry, Yoga, Ford A, Ford B, and GunpointMaleFemale.

Key Insights and Ideas

  • Time-Frequency is Crucial: The paper strongly argues and demonstrates that explanations derived from the time-frequency domain are superior to those solely from the time-domain for time-series classification. This is because frequency components often capture essential class-specific characteristics that temporal patterns alone might miss.
  • SpectralX is Adaptable: The framework is designed to be "plug-and-play," allowing integration with various existing XAI methods and different time-series classification models without architectural changes.
  • FIA's Efficiency and Specificity: The proposed FIA methods offer a more efficient way to approximate feature importance compared to traditional methods. Their class-specific nature allows for more precise and actionable insights.
  • Combined FIA Outperforms: The combined FIA method, which balances insertion and deletion, consistently shows the best performance across various evaluation metrics.

Key Results

  • Faithfulness and Robustness: Experiments showed that SpectralX with FIA generally achieved higher Faithfulness scores (indicating more accurate explanations) and Robustness scores (indicating stability against noise) in the time-frequency domain compared to the time-domain for most datasets and methods.
  • FIA vs. Baselines: The proposed FIA methods, particularly the combined version, outperformed baseline XAI methods like LIME, KernelSHAP, and RISE in both Faithfulness and Robustness metrics in the time-frequency domain. For instance, in Table 4, the combined FIA achieved the highest Faithfulness@k scores for most k values.
  • User Study: A user study confirmed the practicality of FIA, with participants preferring explanations generated by the combined FIA method more often than others.
  • Classification Performance: The paper also includes classification results (Table 7) showing that the underlying models (LSTM, CNN, Transformer) achieve high accuracy across the datasets, validating their suitability for explanation analysis.

Limitations and Future Work

  • Hyperparameter Optimization: The authors acknowledge that the optimal hyperparameters for the STFT window function (they used Hann) were not explored in depth and could potentially influence performance.
  • Sample-Specific Explanations: While FIA provides class-specific explanations, it lacks detailed explanations for individual samples, unlike local models like LIME.
  • Broader Applicability: The authors suggest that FIA is a generic XAI method with potential applications beyond time-series classification, such as in Natural Language Processing or Computer Vision, which they propose as future research directions.

Summary updated

BibTeX
@misc{chung2024time,
  author = {Hyunseung Chung and Sumin Jo and Yeonsu Kwon and Edward Choi},
  title = {{Time is Not Enough: Time-Frequency based Explanation for Time-Series Black-Box Models}},
  year = {2024},
  eprint = {2408.03636},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2408.03636},
}
Figure