Table of Contents
Fetching ...

MASCOTS: Model-Agnostic Symbolic COunterfactual explanations for Time Series

Dawid Płudowski, Francesco Spinnato, Piotr Wilczyński, Krzysztof Kotowski, Evridiki Vasileia Ntagiou, Riccardo Guidotti, Przemysław Biecek

TL;DR

Time series classifiers are highly accurate butOften opaque, especially for ensemble models. The paper introduces MASCOTS, a model-agnostic counterfactual explainer that operates in a symbolic BoRF space derived from SAX to generate sparse, plausible counterfactuals for univariate and multivariate time series. By training a lightweight surrogate on BoRF features and guiding perturbations with feature attributions, MASCOTS produces interpretable explanations that can be conveyed visually or in natural language without relying on autoencoders or access to internal model parameters. Experimental results show that MASCOTS matches or exceeds baselines in validity and proximity while delivering substantially higher sparsity and maintaining plausible perturbations, with reasonable runtimes. This approach expands the toolbox for time-series explainability, enabling actionable, human-friendly counterfactual reasoning across diverse models and domains.

Abstract

Counterfactual explanations provide an intuitive way to understand model decisions by identifying minimal changes required to alter an outcome. However, applying counterfactual methods to time series models remains challenging due to temporal dependencies, high dimensionality, and the lack of an intuitive human-interpretable representation. We introduce MASCOTS, a method that leverages the Bag-of-Receptive-Fields representation alongside symbolic transformations inspired by Symbolic Aggregate Approximation. By operating in a symbolic feature space, it enhances interpretability while preserving fidelity to the original data and model. Unlike existing approaches that either depend on model structure or autoencoder-based sampling, MASCOTS directly generates meaningful and diverse counterfactual observations in a model-agnostic manner, operating on both univariate and multivariate data. We evaluate MASCOTS on univariate and multivariate benchmark datasets, demonstrating comparable validity, proximity, and plausibility to state-of-the-art methods, while significantly improving interpretability and sparsity. Its symbolic nature allows for explanations that can be expressed visually, in natural language, or through semantic representations, making counterfactual reasoning more accessible and actionable.

MASCOTS: Model-Agnostic Symbolic COunterfactual explanations for Time Series

TL;DR

Time series classifiers are highly accurate butOften opaque, especially for ensemble models. The paper introduces MASCOTS, a model-agnostic counterfactual explainer that operates in a symbolic BoRF space derived from SAX to generate sparse, plausible counterfactuals for univariate and multivariate time series. By training a lightweight surrogate on BoRF features and guiding perturbations with feature attributions, MASCOTS produces interpretable explanations that can be conveyed visually or in natural language without relying on autoencoders or access to internal model parameters. Experimental results show that MASCOTS matches or exceeds baselines in validity and proximity while delivering substantially higher sparsity and maintaining plausible perturbations, with reasonable runtimes. This approach expands the toolbox for time-series explainability, enabling actionable, human-friendly counterfactual reasoning across diverse models and domains.

Abstract

Counterfactual explanations provide an intuitive way to understand model decisions by identifying minimal changes required to alter an outcome. However, applying counterfactual methods to time series models remains challenging due to temporal dependencies, high dimensionality, and the lack of an intuitive human-interpretable representation. We introduce MASCOTS, a method that leverages the Bag-of-Receptive-Fields representation alongside symbolic transformations inspired by Symbolic Aggregate Approximation. By operating in a symbolic feature space, it enhances interpretability while preserving fidelity to the original data and model. Unlike existing approaches that either depend on model structure or autoencoder-based sampling, MASCOTS directly generates meaningful and diverse counterfactual observations in a model-agnostic manner, operating on both univariate and multivariate data. We evaluate MASCOTS on univariate and multivariate benchmark datasets, demonstrating comparable validity, proximity, and plausibility to state-of-the-art methods, while significantly improving interpretability and sparsity. Its symbolic nature allows for explanations that can be expressed visually, in natural language, or through semantic representations, making counterfactual reasoning more accessible and actionable.

Paper Structure

This paper contains 12 sections, 1 equation, 5 figures, 2 tables.

Figures (5)

  • Figure 1: A simplified graphical abstract of mascots. Given a time series $X$ classified by a black-box model $b$ as cylinder, $X$ is transformed into a symbolic representation, $\mathbf{z}$, using the Bag-of-Receptive-Fields (BoRF) spinnato2024fast. In this semantic space, $X$ is represented as symbolic subsequences. To identify a candidate counterfactual, the most important positive and negative patterns (0,2,2 and 0,1,2 in the illustration) are selected. The negative pattern is then swapped within the time series to generate a candidate counterfactual. If the black-box model's predicted class remains unchanged, the process repeats. Otherwise, the final counterfactual is returned.
  • Figure 2: Example of the iterative process of mascots, where a time series is incrementally perturbed from a cylinder to a bell. Inserted patterns are marked by the black dashed line.
  • Figure 3: Box-plots of evaluation measures. For validity, sparsity, and plausibility, the higher score is better, while for proximity, the smaller the better. mascots stands out in sparsity with a decent validity and proximity. The difference between mascots-$\lambda=0.0$ and mascots-$\lambda=0.1$ suggests a trade-off between validity and other measures.
  • Figure 4: Example of mascots on the TwoLeadECG dataset to explain InceptionTime. mascots is able to create sparse counterfactual which maintain its local structure. On the other hand, M-CELS and Glacier produce small (perhaps adversarial) undesirable changes to the original time series, varying in this way its initial shape.
  • Figure 5: Example of mascots on the TwoLeadECG dataset to explain MultiRocket-Hydra. Changes are presented both as visualization and natural language. If positive and negative patterns have corresponding symbols (for example, the 1st, 3rd, and 4th symbols in the middle plot), mascots does not change them.

Theorems & Definitions (5)

  • definition thmcounterdefinition: Time Series Data
  • definition thmcounterdefinition: Time Series Classification
  • definition thmcounterdefinition: Counterfactual
  • definition thmcounterdefinition: Bag-of-Receptive-Fields
  • definition thmcounterdefinition: Feature Importance