Paper deep dive
xaitimesynth: A Python Package for Evaluating Attribution Methods for Time Series with Synthetic Ground Truth
Gregor Baer
Intelligence
Status: succeeded | Model: google/gemini-3.1-flash-lite-preview | Prompt: intel-v1 | Confidence: 96%
Last extracted: 3/13/2026, 12:20:04 AM
Summary
xaitimesynth is a Python package designed to standardize the evaluation of time series attribution methods by providing infrastructure for generating synthetic datasets with known ground truth feature locations. It addresses the lack of reusable evaluation tools by offering a fluent API and YAML configuration for creating synthetic time series, alongside a suite of localization-based metrics such as AUC-PR, AUC-ROC, and Relevance Mass Accuracy.
Entities (5)
Relation Signals (3)
xaitimesynth â generates â Synthetic Time Series
confidence 100% · The package generates synthetic time series following an additive model
xaitimesynth â provides â Localization Metrics
confidence 100% · The package also provides standard localization metrics, including AUC-PR, AUC-ROC, Relevance Mass Accuracy, and Relevance Rank Accuracy.
xaitimesynth â complements â Captum
confidence 90% · It complements existing attribution and evaluation libraries by providing the reusable data generation infrastructure they lack.
Cypher Suggestions (0)
No Cypher suggestions yet.
Abstract
Abstract:Evaluating time series attribution methods is difficult because real-world datasets rarely provide ground truth for which time points drive a prediction. A common workaround is to generate synthetic data where class-discriminating features are placed at known locations, but each study currently reimplements this from scratch. We introduce xaitimesynth, a Python package that provides reusable infrastructure for this evaluation approach. The package generates synthetic time series following an additive model where each sample is a sum of background signal and a localized, class-discriminating feature, with the feature window automatically tracked as a ground truth mask. A fluent data generation API and YAML configuration format allow flexible and reproducible dataset definitions for both univariate and multivariate time series. The package also provides standard localization metrics, including AUC-PR, AUC-ROC, Relevance Mass Accuracy, and Relevance Rank Accuracy. xaitimesynth is open source and available at this https URL.
Tags
Links
- Source: https://arxiv.org/abs/2603.06781v1
- Canonical: https://arxiv.org/abs/2603.06781v1
Trouble viewing inline? Open PDF directly â
Full Text
21,488 characters extracted from source content.
Expand or collapse full text
xaitimesynth: Evaluating Attribution Methods with Synthetic Ground Truth xaitimesynth: A Python Package for Evaluating Attribution Methods for Time Series with Synthetic Ground Truth Gregor Baerg.baer@tue.nl Information Systems, Industrial Engineering & Innovation Sciences Eindhoven University of Technology Eindhoven, The Netherlands Abstract Evaluating time series attribution methods is difficult because real-world datasets rarely pro- vide ground truth for which time points drive a prediction. A common workaround is to gener- ate synthetic data where class-discriminating features are placed at known locations, but each study currently reimplements this from scratch. We introducexaitimesynth, a Python pack- age that provides reusable infrastructure for this evaluation approach. The package generates synthetic time series following an additive model where each sample is a sum of background signal and a localized, class-discriminating feature, with the feature window automatically tracked as a ground truth mask. A fluent data generation API and YAML configuration for- mat allow flexible and reproducible dataset definitions for both univariate and multivariate time series. The package also provides standard localization metrics, including AUC-PR, AUC-ROC, Relevance Mass Accuracy, and Relevance Rank Accuracy.xaitimesynthis open source and available at https://github.com/gregorbaer/xaitimesynth. Keywords: explainable AI, time series classification, synthetic benchmarks, XAI evalua- tion, attribution methods 1 Introduction Explainable AI (XAI) methods aim to make machine learning predictions interpretable, commonly by producing attributions that indicate how much each input feature contributed to a prediction. As deep learning models see growing adoption for time series classification (Fawaz et al., 2019), attribution methods are increasingly adapted to temporal data (for a review, see Theissler et al. (2022)). Yet producing attributions is only half the problem: we also need to evaluate them. XAI methods are commonly assessed through functional evaluation, where computational metrics quantify desirable properties of explanations (Nauta et al., 2023). One central property is correctness: how accurately an explanation reflects the modelâs decision-making process. A widely used family of correctness metrics is perturbation-based, measuring how model output changes when supposedly important features are altered. However, these metrics can be sensitive to implementation choices (Schlegel and Keim, 2023; Bluecher et al., 2024; Ć imiÄ et al., 2025) and yield systematically different results across classes (Baer et al., 2025a,b), raising questions about their reliability as standalone evaluation tools. Localization-based metrics offer a complementary approach. Instead of perturbing inputs, they measure the spatial agreement between attributions and known ground truth feature locations. Since real-world datasets rarely provide such ground truth, researchers generate synthetic data where class-discriminating features occupy known regions (Ismail et al., 2020; 1 arXiv:2603.06781v1 [cs.LG] 6 Mar 2026 Baer TurbĂ© et al., 2023; Enguehard, 2023a; Serramazza et al., 2024; Nguyen et al., 2024; Baer et al., 2025a; Nguyen and Ifrim, 2025; Holzapfel et al., 2025). This strategy can serve as a sanity check (Adebayo et al., 2018). Synthetic evaluation has been critiqued for not reflecting the modelâs learned decision boundary (Rawal et al., 2025). A common assumption, also recognized by Nauta et al. (2023), is that if the only class-discriminating information in the data is the simulated feature and a model achieves high accuracy, it likely relies on that feature. This assumption can break down through shortcut learning: if the generation process introduces unintended artifacts, such as systematic differences in signal statistics between classes, the model may exploit those instead. This is a risk researchers should consider when designing synthetic evaluation setups. Despite these limitations, synthetic data gives researchers full control over the data-generating process, allowing them to investigate attribution behavior in settings where the ground truth is known by construction. In practice, however, each study reimplements synthetic data generation independently. We introducexaitimesynth, a Python package that standardizes this evaluation workflow for time series attribution methods. Following the same principle as CLEVR-XAI (Arras et al., 2022), which provides ground truth feature locations for evaluating visual explanations, the package generates synthetic time series where each sample combines a background signal with a localized, class-discriminating feature, and records the feature location as a ground truth mask. A fluent data generation API and YAML configuration format support reproducible dataset definitions for both univariate and multivariate time series, with fine-grained control over feature placement across channels. The package also provides standard localization metrics, including AUC-PR, AUC-ROC, Relevance Mass Accuracy, and Relevance Rank Accuracy. 2 Related Work Several packages produce post-hoc attributions. Captum (Kokhlikyan et al., 2020) is a widely used library for feature attribution in PyTorch, applicable across data modalities; it also includes perturbation-based evaluation metrics such as infidelity and sensitivity. Since general-purpose explanation libraries typically require adaptation for temporal data, packages like TSInterpret (Höllig et al., 2023) and Time Interpret (Enguehard, 2023b) extend Captum and other backends to provide unified interfaces for time series attribution methods. For evaluation, Quantus (Hedström et al., 2023) offers a comprehensive collection of explanation quality metrics, including localization metrics such as those we implement, but targets primarily image data and does not support time series generation. AIX360 (Arya et al., 2019) includes evaluation metrics such as faithfulness and monotonicity, but not localization-based metrics or synthetic data generation. Among existing packages, Time Interpret (Enguehard, 2023b) comes closest to supporting localization-based evaluation for time series: it provides both perturbation-based and localization metrics alongside its attribution methods. However, it does not include synthetic data generation utilities. On the data generation side, TimeSynth (Maat et al., 2017) generates synthetic time series from configurable signal and noise processes, and GluonTS (Alexandrov et al., 2020) includes some synthetic data utilities for forecasting. Neither tracks ground truth feature locations, as they are not designed for XAI evaluation. 2 xaitimesynth: Evaluating Attribution Methods with Synthetic Ground Truth Table 1: Comparison of related packages.xaitimesynthcombines synthetic time series generation with localization metrics for evaluating attribution correctness. PackageXAI methods Perturbation metrics Localization metrics Synth. time series TSInterpretââ Captumââ AIX360ââ Quantusâââ Time Interpretââ TimeSynthââ GluonTSââ xaitimesynthââ In practice, researchers who need localization-based evaluation for time series often implement their own synthetic data pipelines. These implementations vary in complexity and are not always reusable across studies.xaitimesynthfills this gap by combining configurable synthetic time series generation, with automatic ground truth tracking, and standard localization metrics in a single package. It complements existing attribution and evaluation libraries by providing the reusable data generation infrastructure they lack. Table 1 summarizes the capabilities of the different packages. 3 Package Design The package has two main components: a data generation module that produces synthetic time series with tracked ground truth masks, and an evaluation module that scores attributions against those masks. We describe each below. 3.1 Data Generation Following the additive generation approach used in Baer et al. (2025a), each synthetic time series x = n + f is constructed as the sum of a background signal n and a class-specific feature f, where n represents a background pattern (e.g., Gaussian noise, a random walk, or a seasonal signal) and f contains the class-discriminating pattern within a designated time window, with zeros elsewhere. The package records this window as a binary ground truth mask for every sample. For multivariate time series, each channel can carry independent signals and features, with optional alignment of feature windows across channels. The builder API lets the user declaratively specify signals and features for each class; the package handles ground truth tracking, normalization, and output formatting internally. The following example in Listing 1 defines a two-class dataset, generates train and test splits, and evaluates attributions against the ground truth masks. Figure 1 shows one example per class from this dataset. Built-in signal types include Gaussian noise, uniform noise, red noise, random walk, seasonal, and trend; built-in feature types include peak, trough, and Gaussian pulse. While the package distinguishes between signals and features, all generators can be used in ei- 3 Baer Listing 1: Example workflow: defining a two-class synthetic dataset, generating train/test splits, and evaluating attributions against ground truth masks. from xaitimesynth import TimeSeriesBuilder , gaussian_noise , gaussian_pulse , seasonal from xaitimesynth.metrics import auc_pr_score , relevance_mass_accuracy # Define dataset settings base_builder = ( TimeSeriesBuilder(n_timesteps =100, normalization="zscore") .for_class (0) .add_signal(gaussian_noise(sigma =1.0)) .add_feature( gaussian_pulse(amplitude =3.0) , random_location=True , length_pct =0.3, ) .for_class (1) .add_signal(gaussian_noise(sigma =1.0)) .add_feature( seasonal(period =10, amplitude =3.0), random_location=True , length_pct =0.3, ) ) # Generate datasets with different seeds and sample counts train = base_builder.clone(n_samples =200, random_state =42).build() test = base_builder.clone(n_samples =50, random_state =43).build () # Obtain attributions from your XAI method; # (shape: (n_samples , n_dims , n_timesteps) attributions = xai_method.explain(test["X"]) # pseudo -code # Evaluate against ground truth auc = auc_pr_score(attributions , test , normalize=True) rma = relevance_mass_accuracy(attributions , test) ther role, so researchers can flexibly compose the data-generating process to match their experimental needs. Amanualcomponent accepts arbitrary generator functions, and custom components can be registered via a decorator API, making the package extensible with- out modifying source files. Dataset definitions can alternatively be written in YAML and loaded withload_builders_from_config(), which supports YAML anchors for sharing class configurations across datasets. 4 xaitimesynth: Evaluating Attribution Methods with Synthetic Ground Truth 0 BackgroundFeaturesAggregated Class 0 050100 0 050100050100 Class 1 Value Time Steps Figure 1:One example per class from the synthetic dataset defined in Listing 1. Each row shows one class; columns show the background signal, the localized feature, and their sum. The shaded region in the rightmost column marks the ground-truth feature window. Class 0 contains a Gaussian pulse, class 1 an oscillation burst; both share a Gaussian noise background. Generated withplot_components(train), a built-in visualization utility. Table 2: Localization metrics currently included in xaitimesynth. MetricFunctionReference AUC-ROC auc_roc_scoreFawcett (2006) AUC-PR auc_pr_scoree.g., Baer et al. (2025a) Relevance Mass Accuracy relevance_mass_accuracy Arras et al. (2022) Relevance Rank Accuracy relevance_rank_accuracy Arras et al. (2022) Pointing Game pointing_gameZhang et al. (2018) Normalized Attribution Correspondence nac_scorePeters et al. (2005) MAE mean_absolute_errorâ MSE mean_squared_errorâ 3.2 Evaluation Metrics The included metrics measure the overlap between attribution scores and the binary ground truth masks from the build step, quantifying whether high attributions concentrate in the correct regions. Table 2 lists the included metrics. AUC-ROC and AUC-PR treat attributions as scores and the ground truth mask as labels, measuring ranking quality; both support normalization to remove the effect of ground truth prevalence. Relevance Mass Accuracy and Relevance Rank Accuracy measure overlap between the highest-attributed timesteps and the ground truth window at different granularities: the former computes the fraction of total attribution mass inside the ground truth, while the latter checks whether the top-Kranked timesteps fall within it. The Pointing Game reduces this to a single binary check on the maximum attribution. Normalized Attribution 5 Baer Correspondence, adapted from the normalized scanpath saliency (NSS) metric in eye-tracking, measures the mean z-scored attribution at ground truth locations. MAE and MSE treat evaluation as regression, measuring pointwise error between attributions and the binary mask. 4 Availability and Documentation xaitimesynth is released under the MIT license and available athttps://github.com/ gregorbaer/xaitimesynth. It can be installed via pip: pip install xaitimesynth The package requires Python 3.10 or later. Runtime dependencies are NumPy, pandas, PyYAML, and lets-plot; no deep learning framework is required for data generation or metric computation. Documentation, including usage guides, API reference, and YAML configuration examples, is available athttps://gregorbaer.github.io/xaitimesynth/. The documentation also covers output data shapes and worked examples for both univariate and multivariate settings. A persistent archive is available athttps://doi.org/10.5281/ zenodo.18888778. 5 Conclusion xaitimesynth standardizes localization-based evaluation of time series attribution methods by combining synthetic data generation with automatic ground truth tracking and standard localization metrics, replacing per-study reimplementation with a shared toolkit. The builder API and YAML configuration format make dataset definitions concise, reproducible, and straightforward to share alongside code. Acknowledgments and Disclosure of Funding This work is supported by the European Unionâs HORIZON Research and Innovation Program under grant agreement No. 101120657, project ENFIELD (European Lighthouse to Manifest Trustworthy and Green AI). References J. Adebayo, J. Gilmer, M. Muelly, I. Goodfellow, M. Hardt, and B. Kim. Sanity Checks for Saliency Maps. In Advances in Neural Information Processing Systems, volume 31, 2018. URLhttps://proceedings.neurips.c/paper_files/paper/2018/ hash/294a8ed24b1ad22ec2e7efea049b8737-Abstract.html. A. Alexandrov, K. Benidis, M. Bohlke-Schneider, V. Flunkert, J. Gasthaus, T. Januschowski, D. C. Maddix, S. Rangapuram, D. Salinas, and J. Schulz. Gluonts: Probabilistic and neural time series modeling in python. Journal of Machine Learning Research, 21:1â6, 2020. URL http://w.jmlr.org/papers/v21/19-820.html. 6 xaitimesynth: Evaluating Attribution Methods with Synthetic Ground Truth L. Arras, A. Osman, and W. Samek. CLEVR-XAI: A benchmark dataset for the ground truth evaluation of neural network explanations. Information Fusion, 81:14â40, 2022. doi: 10.1016/j.inffus.2021.11.008. V. Arya, R. K. E. Bellamy, P.-Y. Chen, A. Dhurandhar, M. Hind, S. C. Hoffman, S. Houde, Q. V. Liao, R. Luss, A. MojsiloviÄ, S. Mourad, P. Pedemonte, R. Raghavendra, J. Richards, P. Sattigeri, K. Shanmugam, M. Singh, K. R. Varshney, D. Wei, and Y. Zhang. One Explanation Does Not Fit All: A Toolkit and Taxonomy of AI Explainability Techniques, 2019. G. Baer, I. Grau, C. Zhang, and P. V. Gorp. Why Do Class-Dependent Evaluation Effects Occur with Time Series Feature Attributions? A Synthetic Data Investigation, 2025a. G. Baer, I. Grau, C. Zhang, and P. Van Gorp. Class-Dependent Perturbation Effects in Evaluating Time Series Attributions. In R. Guidotti, U. Schmid, and L. Longo, editors, Explainable Artificial Intelligence, pages 292â314, 2025b. doi: 10.1007/978-3-032-08330-2_ 14. S. Bluecher, J. Vielhaben, and N. Strodthoff. Decoupling Pixel Flipping and Occlusion Strategy for Consistent XAI Benchmarks. Transactions on Machine Learning Research, 2024. URL https://openreview.net/forum?id=bIiLXdtUVM. J. Enguehard. Learning perturbations to explain time series predictions. In International Conference on Machine Learning, pages 9329â9342, 2023a. URLhttps://proceedings. mlr.press/v202/enguehard23a.html. J. Enguehard. Time Interpret: A Unified Model Interpretability Library for Time Series, 2023b. URL http://arxiv.org/abs/2306.02968. H. I. Fawaz, G. Forestier, J. Weber, L. Idoumghar, and P.-A. Muller. Deep learning for time series classification: A review. Data Mining and Knowledge Discovery, 33:917â963, 2019. doi: 10.1007/s10618-019-00619-1. T. Fawcett. An introduction to ROC analysis. Pattern Recognition Letters, 27:861â874, 2006. doi: 10.1016/j.patrec.2005.10.010. A. Hedström, L. Weber, D. Krakowczyk, D. Bareeva, F. Motzkus, W. Samek, S. Lapuschkin, and M. M.-C. Höhne. Quantus: An Explainable AI Toolkit for Responsible Evaluation of Neural Network Explanations and Beyond. Journal of Machine Learning Research, 24: 1â11, 2023. URL http://jmlr.org/papers/v24/22-0142.html. J. Höllig, C. Kulbach, and S. Thoma. TSInterpret: A Python Package for the Interpretabilityof Time Series Classification. Journal of Open Source Software, 8:5220, 2023. doi: 10.21105/ joss.05220. A. Holzapfel, A. F. Posada Moreno, and S. Trimpe. Concept Extraction for Time Series with ECLAD-ts. In R. Guidotti, U. Schmid, and L. Longo, editors, Explainable Artificial Intelligence, volume 2576, pages 90â112. Springer Nature Switzerland, 2025. doi: 10.1007/ 978-3-032-08317-3_5. 7 Baer A. A. Ismail, M. Gunady, H. Corrada Bravo, and S. Feizi. Benchmarking deep learning interpretability in time series predictions. Advances in neural information processing systems, 33:6441â6452, 2020. URLhttps://proceedings.neurips.c/paper_files/ paper/2020/hash/47a3893c405396a5c30d91320572d6d-Abstract.html. N. Kokhlikyan, V. Miglani, M. Martin, E. Wang, B. Alsallakh, J. Reynolds, A. Melnikov, N. Kliushkina, C. Araya, S. Yan, and O. Reblitz-Richardson. Captum: A unified and generic model interpretability library for PyTorch, 2020. J. R. Maat, A. Malali, and P. Protopapas. TimeSynth: A Multipurpose Library for Synthetic Time Series in Python, 2017. URL https://github.com/TimeSynth/TimeSynth. M. Nauta, J. Trienes, S. Pathak, E. Nguyen, M. Peters, Y. Schmitt, J. Schlötterer, M. Van Keulen, and C. Seifert. From Anecdotal Evidence to Quantitative Evaluation Methods: A Systematic Review on Evaluating Explainable AI. ACM Computing Surveys, 55:1â42, 2023. doi: 10.1145/3583558. T. L. Nguyen and G. Ifrim. TSHAP: Fast and Exact SHAP for Explaining Time Series Classification and Regression. In R. P. Ribeiro, B. Pfahringer, N. Japkowicz, P. Larrañaga, A. M. Jorge, C. Soares, P. H. Abreu, and J. Gama, editors, Machine Learning and Knowledge Discovery in Databases. Research Track, volume 16016, pages 60â77, 2025. doi: 10.1007/978-3-032-06078-5_4. T. T. Nguyen, T. Le Nguyen, and G. Ifrim. Robust explainer recommendation for time series classification. Data Mining and Knowledge Discovery, 38:3372â3413, 2024. doi: 10.1007/s10618-024-01045-8. R. J. Peters, A. Iyer, L. Itti, and C. Koch. Components of bottom-up gaze allocation in natural images. Vision Research, 45:2397â2416, 2005. doi: 10.1016/j.visres.2005.03.019. K. Rawal, Z. Fu, E. Delaney, and C. Russell. Evaluating Model Explanations without Ground Truth. In Proceedings of the 2025 ACM Conference on Fairness, Accountability, and Transparency, pages 3400â3411, 2025. doi: 10.1145/3715275.3732219. U. Schlegel and D. A. Keim. A Deep Dive into Perturbations as Evaluation Technique for Time Series XAI. In L. Longo, editor, Explainable Artificial Intelligence, volume 1903, pages 165â180. Springer Nature Switzerland, 2023. doi: 10.1007/978-3-031-44070-0_9. D. I. Serramazza, T. L. Nguyen, and G. Ifrim. Improving the Evaluation and Actionability of Explanation Methods for Multivariate Time Series Classification. In A. Bifet, J. Davis, T. KrilaviÄius, M. Kull, E. Ntoutsi, and I. Ćœliobait Ìe, editors, Machine Learning and Knowledge Discovery in Databases. Research Track, pages 177â195, 2024. doi: 10.1007/ 978-3-031-70359-1_11. I. Ć imiÄ, E. Veas, and V. Sabol. A comprehensive analysis of perturbation methods in explainable AI feature attribution validation for neural time series classifiers. Scientific Reports, 15:26607, 2025. doi: 10.1038/s41598-025-09538-2. 8 xaitimesynth: Evaluating Attribution Methods with Synthetic Ground Truth A. Theissler, F. Spinnato, U. Schlegel, and R. Guidotti. Explainable AI for Time Series Classification: A Review, Taxonomy and Research Directions. IEEE Access, 10:100700â 100724, 2022. doi: 10.1109/ACCESS.2022.3207765. H. TurbĂ©, M. Bjelogrlic, C. Lovis, and G. Mengaldo. Evaluation of post-hoc interpretability methods in time-series classification. Nature Machine Intelligence, 5:250â260, 2023. doi: 10.1038/s42256-023-00620-w. J. Zhang, S. A. Bargal, Z. Lin, J. Brandt, X. Shen, and S. Sclaroff. Top-Down Neural Attention by Excitation Backprop. International Journal of Computer Vision, 126:1084â1102, 2018. doi: 10.1007/s11263-017-1059-x. 9