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

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

Read TriShGAN: Enhancing Sparsity and Robustness in Multivariate Time Series Counterfactuals Explanation by Hongnan Ma, Yiwei Shi, Guanxiong Sun, Mengyue Yang, Weiru Liu (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2511-06529.txt.

Introduction

Hongnan Ma and co-authors generate counterfactual explanations for decisions made on multivariate time series. A counterfactual shows what minimal change would flip a model's verdict, but time series explanations built by swapping in chunks from other examples often look unrealistic. Generative alternatives fix realism yet hug the decision boundary, so a small model change can void the explanation.

TriShGAN works inside a generative adversarial framework with triplet loss added for distance learning. Explanations stay close to the original series, resemble the desired outcome class, and keep a safer margin from the boundary. A shapelet extractor picks the most telling segments of the series, keeping the suggested changes sparse and readable.

Catalog record

CREATORHongnan Ma, Yiwei Shi, Guanxiong Sun, Mengyue Yang, Weiru Liu
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE67 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2511-06529

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

TriShGAN: Enhancing Sparsity and Robustness in Multivariate Time Series Counterfactuals Explanation Hongnan Ma, Yiwei Shi, Guanxiong Sun, Mengyue Yang, Weiru Liu 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 (MTS) presents challenges due to their complex, multi-dimensional nature. Traditional Nearest Unlike Neighbor (NUN)-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 (CounteRGAN)-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. Our experiments across four datasets demonstrate that the introduction of a Shapelet Extractor and triplet regularization improves both the sparsity and robustness of the generated explanations. Introduction Explainable Artificial Intelligence (XAI) has gained increasing popularity for enhancing the transparency and trustworthiness of black-box models. Counterfactual explanation (CFE) ( 28 ) provides actionable insights by identifying how modifications to the queried instance can lead to a desired outcome of AI system ( 1 ; 12 ) . While numerous CFE methods have been proposed for models trained on tabular and image data, the area of time series data, particularly MTS, has been largely overlooked due to its complex nonlinear temporal dependencies and multi-dimensional nature ( 27 ) . In real-world applications such as medical diagnostics and stock forecasting, understanding model decisions is crucial for ensuring trust and accountability in AI systems ( 17 ; 3 ; 8 ; 29 ) . Existing CFE methods for MTS primarily fall into two categories: NUN-based methods and CounteRGAN-based methods. NUN-based methods focus on selecting the NUN with the target class as a CF candidate, and then replacing the most influential subsequence of the NUN with the corresponding region in the queried time series X_{\text{queried}} to generate a closely aligned CFE ( 7 ) . Meanwhile, CounteRGAN-based methods apply a RGAN in conjunction with a pre-trained classifier. Instead of generating complete synthetic CFEs, RGAN learns to produce residuals that represent minimal yet meaningful perturbations. These residuals are then added back to X_{\text{queried}} to generate the X_{\text{cf}} . RGAN generates CFEs by optimizing a minimax objective between a generator and a discriminator, enabling the model to approximate complex probability distributions through backpropagation and gradient descent ( 25 ) . Despite their effectiveness in generating CFE, these methods face significant limitations. CFE generated by NUN-based methods often enforces rigid constraints, such as substituting a single time series ( 2 ) or a fixed-length subsequence of all signals ( 21 ) , limiting their flexibility. It is not always practical in real-world scenarios. For instance, in medical diagnostics, it is both impractical and unethical to substitute time series subsequences from one patient with those of another. While CounteRGAN-based methods solve this issue by learning from the distribution of observed data, this approach aims at minimizing cost relative to the X_{\text{queried}} and tends to overlook the importance of distancing the generated CFEs from decision boundaries and ensuring robustness. The decision boundary, a conceptual surface that delineates data points across different class labels, is visualized as a white band between classes as shown in Figure 1 . The proximity of CFEs to these boundaries indicates a high sensitivity to minor modifications in model parameters or during retraining which lead to these CFEs invalid, significantly limiting their reliability ( 9 ) . Although increasing the cost associated with generating a CFE can enhance its robustness in linear models, the trade-offs between cost and robustness in complex neural networks still need to be explored ( 9 ) . 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. To overcome the constraints of traditional NUN-based methods, we introduce a CounteRGAN-based framework that synthesizes CFE with improved robustness and efficiency. By adopting the triplet loss method from unsupervised learning, we map its three elements—anchor, positive samples, and negative samples—to the counterfactual domain. Specifically, we treat X_{\text{queried}} as the anchor, which is optimized as X_{\text{cf}} at the conclusion of the process; factual examples serve as positive samples, while counterfactual examples act as negative samples. During training, the model minimizes the distance between X_{\text{cf}} and factual samples while maximizing the distance from counterfactual samples. This strategy based on distance metric ensures the X_{\text{cf}} is close to X_{\text{queried}} and forces the model to learn feature distributions that are critical for achieving the counterfactual outcome, thereby balancing the trade-off between cost and robustness of the generated CFEs. Furthermore, to address the challenge of redundancy in high-dimensional MTS, which often leads the model to modify uninformative regions, we implement a pre-training phase using a Shapelet Extractor to extract highly discriminative time series subsequences. It allows the model to strategically pinpoint and extract class-specific subsequences. This targeted approach not only augments the sparsity but also boosts the effectiveness. The contributions of this paper are threefold: First, we identify and discuss the limitations of traditional NUN-based and CounteRGAN-based methods for generating CFEs. Second, as illustrated in Figure 2 , we introduce a novel framework - TriShGAN (built on CounteR GAN , incorporates Tri plet loss within the generator, along with a pre-trained Sh apelet extractor), to generate sparse and robust CFEs for MTS more efficiently. Third, we validate our approach through comprehensive experiments on four real-world datasets, comparing our method against existing baselines. The results demonstrate that our framework not only addresses previous limitations but also efficiently balances the trade-off between cost and robustness. Figure 2: The architecture of TriShGAN. Related Work We present extended analyses of the two additional CFE methods for MTS -

Read the complete text