Encoding Time-Series Explanations through Self-Supervised Model Behavior Consistency

Owen Queen, Thomas Hartvigsen, Teddy Koker, Huan He, Theodoros Tsiligkaridis, Marinka Zitnik

Introduction

Deep learning has revolutionized time-series analysis, enabling critical advancements in fields ranging from cardiology to industrial maintenance. High-capacity models now routinely detect heart arrhythmias and predict power grid failures with high precision. However, these models often operate as "black boxes," where the logic behind a specific prediction remains opaque. While interpretability tools for computer vision and natural language processing are relatively mature, time-series data presents unique challenges that render standard explanation methods less effective.

To address this, researchers from Harvard, MIT, and UVA presented TIMEX at NeurIPS 2023. TIMEX is a self-supervised framework designed to provide faithful explanations for time-series models by ensuring that an interpretable surrogate model mimics the internal logic—not just the output—of the original black-box model.

The Challenge of Time-Series Interpretability

Interpreting time-series models is notoriously difficult due to three primary factors:

  1. Visual Unintelligibility: Unlike images, where a human can easily recognize a cat or a car, raw sensor signals (e.g., voltage or frequency) are often unintelligible to the naked eye. This makes it difficult to verify if an explanation "makes sense."
  2. Dense and Continuous Features: In images, objects are often defined by discrete clusters of pixels. In time series, every timestep is part of a continuous, dense signal. Small shifts in shape, phase, or frequency can carry significant semantic meaning, making it hard to isolate specific "features."
  3. The Faithfulness Gap: Many post-hoc explainers rely on "masking" or perturbing parts of the input to see how the output changes. However, masking time-series data often creates "out-of-distribution" samples that confuse the model, leading to explanations that reflect the model's confusion rather than its actual decision-making logic.

The TIMEX Framework

The core innovation of TIMEX is Model Behavior Consistency (MBC). Rather than simply training a surrogate to match the final labels of a pre-trained model, TIMEX enforces consistency between the latent spaces of the two models. If the original model perceives two ECG signals as similar, the TIMEX surrogate is constrained to ensure their explanations are also similar in its own latent space. This topological alignment ensures the explainer remains faithful to the original model's internal representations.

Key Components

  • Explanation Generator ($H^E$): TIMEX utilizes a Transformer-based architecture to produce an attribution mask, which identifies the most influential segments of the input signal.
  • Discrete Masking with Straight-Through Estimators (STEs): Traditional explainers often use "soft" masks (values between 0 and 1). However, soft masks can inadvertently alter the frequency or amplitude of a signal, creating artifacts. TIMEX employs STEs to generate binary (0 or 1) masks, ensuring that the signal is either present or absent, which leads to more robust training and clearer attributions.
  • Explanation Landmarks: To move beyond instance-level explanations, TIMEX learns a set of representative "prototypes" or landmarks in the explanation space. These landmarks provide a global view of the model's behavior, allowing users to see the typical patterns the model relies on across an entire dataset.

Experimental Evaluation

The researchers evaluated TIMEX against eight diverse datasets, including four synthetic benchmarks (FreqShapes, SeqComb-UV, SeqComb-MV, LowVar) designed to test specific temporal dynamics like frequency shifts and multivariate dependencies. Real-world testing included:

  • ECG: Heart arrhythmia detection.
  • PAM: Human activity recognition from wearables.
  • Epilepsy: Seizure detection from EEG signals.
  • Boiler: Mechanical fault detection in water heaters.

Key Results and Insights

TIMEX consistently outperformed state-of-the-art baselines, such as Integrated Gradients and Dynamask, across multiple dimensions:

  • Superior Accuracy: On synthetic datasets, TIMEX improved ground-truth explanation accuracy (AUPRC) by an average of 10.01% over the strongest existing baselines.
  • Enhanced Faithfulness: In occlusion experiments—where important features are hidden to observe the drop in model performance—TIMEX proved significantly more reliable. On the Boiler dataset, it maintained a 27.8% higher AUROC than its closest competitor under high occlusion scenarios.
  • Operational Efficiency: Although TIMEX requires an initial training phase, it is significantly faster during inference. Generating an explanation for a new sample requires only a single forward pass, making it suitable for real-time applications.

Theoretical Contributions

The paper highlights that matching the topology (relative distances between data points) of the latent space is more effective than direct alignment. This flexibility allows the explainer to adapt to the surrogate's architecture while remaining anchored to the original model's logic. Furthermore, the use of discrete masking avoids the "occlusion problem," where models fail because the input looks "weird" rather than because a relevant feature was removed.

Limitations and Future Work

Despite its strengths, TIMEX has certain limitations. Training a high-capacity surrogate can be computationally intensive for extremely large models. Additionally, the current framework requires access to the internal embeddings of the pre-trained model, which may not be possible in "black-box-as-a-service" environments. While the authors demonstrated promising results for forecasting, further research is required to fully adapt MBC to complex regression tasks.

Conclusion

TIMEX represents a significant step forward in making deep learning for time-series data more transparent. By prioritizing model behavior consistency and utilizing discrete masking, it provides a framework that is both technically faithful and human-interpretable through the use of explanation landmarks. For practitioners in high-stakes fields like medicine and industrial safety, such tools are essential for building trust in automated systems.

Summary updated

BibTeX
@inproceedings{queen2023encoding,
  author = {Owen Queen and Thomas Hartvigsen and Teddy Koker and Huan He and Theodoros Tsiligkaridis and Marinka Zitnik},
  title = {{Encoding Time-Series Explanations through Self-Supervised Model Behavior Consistency}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=yEfmhgwslQ},
}
Figure