MASCOTS: Model-Agnostic Symbolic COunterfactual explanations for Time Series

Dawid Pludowski, Francesco Spinnato, Piotr Wilczynski, Krzysztof Kotowski, Evridiki Vasileia Ntagiou, Riccardo Guidotti, Przemyslaw Biecek · DOI

Introduction

Time series classification (TSC) has become a cornerstone of modern diagnostic and monitoring systems, ranging from ECG analysis in healthcare to predictive maintenance in industrial engineering. While state-of-the-art models such as InceptionTime or MultiRocket-Hydra achieve high accuracy, they operate as "black boxes." For practitioners in high-stakes fields, understanding why a model classified a specific signal as "abnormal" is often as important as the classification itself.

Counterfactual explanations offer a solution by answering the question: "What is the minimal change required to this specific data point to flip the model's decision?" However, generating these for time series is difficult due to high dimensionality and complex temporal dependencies. Existing methods often rely on model gradients—limiting them to specific neural networks—or require heavy, dataset-specific autoencoders. This paper introduces MASCOTS (Model-Agnostic Symbolic COunterfactual explanations for Time Series), a framework designed to provide sparse, human-readable explanations for any TSC model.

The MASCOTS Framework

MASCOTS shifts the explanation process from the raw numerical domain to a symbolic feature space. The framework is built upon three primary pillars:

1. Symbolic Representation (BoRF)

Instead of processing raw numerical signals, MASCOTS converts time series into a Bag-of-Receptive-Fields (BoRF). By utilizing Symbolic Aggregate Approximation (SAX), the framework transforms subsequences into "words" (e.g., a sequence of low-medium-high values). This transformation reduces dimensionality while preserving the essential patterns that drive model decisions.

2. Interpretable Surrogates

To remain model-agnostic, MASCOTS does not interact with the internal architecture of the black-box classifier. Instead, it trains a simple, interpretable surrogate model—such as a shallow neural network—to mimic the behavior of the complex model using the symbolic counts generated in the previous step.

3. Iterative Pattern Swapping

Using feature attribution methods like SHAP on the surrogate model, MASCOTS identifies which symbolic patterns most strongly support the current classification and which would support the target class. It then iteratively "swaps" these patterns in the original signal. This process continues until the black-box model's prediction actually flips, ensuring the counterfactual is valid for the original classifier.

Experimental Evaluation

The researchers evaluated MASCOTS using 10 diverse benchmark datasets from the UCR (univariate) and UEA (multivariate) archives. These included medical data (TwoLeadECG, Epilepsy), motion and sensor data (GunPoint, BasicMotions, Cricket), and general signals (Earthquakes, ItalyPowerDemand). This variety allowed the authors to test the framework across both simple binary problems and complex multi-class multivariate scenarios.

Key Results and Insights

Sparsity and Interpretability

One of the primary advantages of MASCOTS is its focus on sparsity. Unlike gradient-based methods that often introduce "noisy," imperceptible changes across the entire signal, MASCOTS targets specific, localized chunks of data. On average, MASCOTS altered fewer than 30% of features to achieve a counterfactual, significantly outperforming baselines like Glacier and M-CELS.

Validity and Plausibility

On univariate data, MASCOTS achieved a validity score of approximately 44%, which is competitive with gradient-based methods. Crucially, it maintains this performance even on non-differentiable models where gradient methods fail entirely. Furthermore, using Isolation Forests to measure data distribution, the authors found that MASCOTS-generated counterfactuals remained highly plausible (scoring 0.96 to 0.98), meaning the modified signals still resembled realistic data.

Human-Centric Explanations

By operating in a symbolic space, MASCOTS can generate explanations in plain English. For example: "To change the prediction from abnormal to normal, the pattern in indexes 10–25 must be replaced with [High, High, Medium, Low]." This bridges the gap between complex data science and domain-specific expertise.

Conclusion and Future Work

MASCOTS demonstrates that symbolic representations can make counterfactual explanations for time series more practical, sparse, and interpretable. While the framework's effectiveness is currently tied to the fidelity of the surrogate model, it opens new doors for model-agnostic interpretability.

Future research directions include a "user-in-the-loop" approach, where domain experts can select from multiple proposed pattern swaps to ensure clinical or physical relevance. Additionally, the authors suggest using MASCOTS to generate synthetic training data, potentially improving the robustness of the original black-box models.

Summary updated

BibTeX
@inproceedings{pludowski2025mascots,
  author = {Dawid Pludowski and Francesco Spinnato and Piotr Wilczynski and Krzysztof Kotowski and Evridiki Vasileia Ntagiou and Riccardo Guidotti and Przemyslaw Biecek},
  title = {{MASCOTS: Model-Agnostic Symbolic COunterfactual explanations for Time Series}},
  booktitle = {ECML/PKDD},
  year = {2025},
  doi = {10.1007/978-3-032-06078-5\_6},
}
Figure