Table of Contents
Fetching ...

TriShGAN: Enhancing Sparsity and Robustness in Multivariate Time Series Counterfactuals Explanation

Hongnan Ma, Yiwei Shi, Guanxiong Sun, Mengyue Yang, Weiru Liu

TL;DR

TriShGAN addresses the challenge of generating sparse, robust counterfactual explanations for multivariate time series by integrating a CounteRGAN framework with a triplet loss and a Shapelet Extractor. This combination encourages CFEs to stay close to the queried instance while capturing discriminative feature distributions of the target class, balancing proximity and robustness. Empirical results on four real-world MTS datasets show that TriShGAN achieves strong TCV, high robustness, and sparsity, outperforming existing NUN- and GAN-based baselines in key metrics. The approach offers practical, interpretable CFEs for high-dimensional time series and highlights the value of distribution-aware, shapelet-guided perturbations in robust explanations.

Abstract

In decision-making processes, stakeholders often rely on counterfactual explanations, which provide suggestions about what should be changed in the queried instance to alter the outcome of an AI system. However, generating these explanations for multivariate time series presents challenges due to their complex, multi-dimensional nature. Traditional Nearest Unlike Neighbor-based methods typically substitute subsequences in a queried time series with influential subsequences from an NUN, which is not always realistic in real-world scenarios due to the rigid direct substitution. Counterfactual with Residual Generative Adversarial Networks-based methods aim to address this by learning from the distribution of observed data to generate synthetic counterfactual explanations. However, these methods primarily focus on minimizing the cost from the queried time series to the counterfactual explanations and often neglect the importance of distancing the counterfactual explanation from the decision boundary. This oversight can result in explanations that no longer qualify as counterfactual if minor changes occur within the model. To generate a more robust counterfactual explanation, we introduce TriShGAN, under the CounteRGAN framework enhanced by the incorporation of triplet loss. This unsupervised learning approach uses distance metric learning to encourage the counterfactual explanations not only to remain close to the queried time series but also to capture the feature distribution of the instance with the desired outcome, thereby achieving a better balance between minimal cost and robustness. Additionally, we integrate a Shapelet Extractor that strategically selects the most discriminative parts of the high-dimensional queried time series to enhance the sparsity of counterfactual explanation and efficiency of the training process.

TriShGAN: Enhancing Sparsity and Robustness in Multivariate Time Series Counterfactuals Explanation

TL;DR

TriShGAN addresses the challenge of generating sparse, robust counterfactual explanations for multivariate time series by integrating a CounteRGAN framework with a triplet loss and a Shapelet Extractor. This combination encourages CFEs to stay close to the queried instance while capturing discriminative feature distributions of the target class, balancing proximity and robustness. Empirical results on four real-world MTS datasets show that TriShGAN achieves strong TCV, high robustness, and sparsity, outperforming existing NUN- and GAN-based baselines in key metrics. The approach offers practical, interpretable CFEs for high-dimensional time series and highlights the value of distribution-aware, shapelet-guided perturbations in robust explanations.

Abstract

In decision-making processes, stakeholders often rely on counterfactual explanations, which provide suggestions about what should be changed in the queried instance to alter the outcome of an AI system. However, generating these explanations for multivariate time series presents challenges due to their complex, multi-dimensional nature. Traditional Nearest Unlike Neighbor-based methods typically substitute subsequences in a queried time series with influential subsequences from an NUN, which is not always realistic in real-world scenarios due to the rigid direct substitution. Counterfactual with Residual Generative Adversarial Networks-based methods aim to address this by learning from the distribution of observed data to generate synthetic counterfactual explanations. However, these methods primarily focus on minimizing the cost from the queried time series to the counterfactual explanations and often neglect the importance of distancing the counterfactual explanation from the decision boundary. This oversight can result in explanations that no longer qualify as counterfactual if minor changes occur within the model. To generate a more robust counterfactual explanation, we introduce TriShGAN, under the CounteRGAN framework enhanced by the incorporation of triplet loss. This unsupervised learning approach uses distance metric learning to encourage the counterfactual explanations not only to remain close to the queried time series but also to capture the feature distribution of the instance with the desired outcome, thereby achieving a better balance between minimal cost and robustness. Additionally, we integrate a Shapelet Extractor that strategically selects the most discriminative parts of the high-dimensional queried time series to enhance the sparsity of counterfactual explanation and efficiency of the training process.

Paper Structure

This paper contains 46 sections, 19 equations, 8 figures, 12 tables, 3 algorithms.

Figures (8)

  • Figure 1: The yellow, brown, and red points represent three viable counterfactuals for the $X_{\text{queried}}$, indicated by the blue cross point. Each counterfactual satisfies the condition of differing predicted classes from the original. Among these, the yellow pentagram is identified as the optimal choice due to its greater distance from the decision boundary and higher similarity to $X_{\text{queried}}$. Conversely, the brown point, despite sharing the same class probability with the yellow pentagram, but with high cost. The red cross point, while close to the $X_{{\text{queried}}}$, is positioned near the decision boundary, making it sensitive to minor variations and less desirable for stable counterfactual analysis.
  • Figure 2: The architecture of TriShGAN.
  • Figure 3: Illustration of the process of optimizing triplet loss
  • Figure 4: Trade off between proximity and robustness
  • Figure 5: FM - TriShGAN
  • ...and 3 more figures

Theorems & Definitions (12)

  • Definition 1: Multivariate Time Series
  • Definition 2: Time Series Classification Dataset
  • Definition 3: Time Series Subsequence
  • Definition 4: Minimum subsequence distance (MSD)
  • Definition 5: Shapelet Candidate
  • Definition 6: Shapelet
  • Definition 7: Shapelet Pool
  • Definition 8: Shapelet Extractor
  • Definition 9: Queried and reference time series
  • Definition 10: Factual examples
  • ...and 2 more