Skip to main content

Post-hoc Saliency Methods Fail to Capture Latent Feature Importance in Time Series Data

  • Conference paper
  • First Online:
Trustworthy Machine Learning for Healthcare (TML4H 2023)

Abstract

Saliency methods provide visual explainability for deep image processing models by highlighting informative regions in the input images based on feature-wise (pixels) importance scores. These methods have been adopted to the time series domain, aiming to highlight important temporal regions in a sequence. This paper identifies, for the first time, the systematic failure of such methods in the time series domain when underlying patterns (e.g., dominant frequency or trend) are based on latent information rather than temporal regions. The latent feature importance postulation is highly relevant for the medical domain as many medical signals, such as EEG signals or sensor data for gate analysis, are commonly assumed to be related to the frequency domain. To the best of our knowledge, no existing post-hoc explainability method can highlight influential latent information for a classification problem. Hence, in this paper, we frame and analyze the problem of latent feature saliency detection. We first assess the explainability quality of multiple state-of-the-art saliency methods (Integrated Gradients, DeepLift, Kernel SHAP, Lime) on top of various classification methods (LSTM, CNN, LSTM and CNN trained via saliency-guided training) using simulated time series data with underlying temporal or latent space patterns. In conclusion, we identify that Integrated Gradients and DeepLift, if redesigned, could be potential candidates for latent saliency scores.

M. Schröder and A. Zamanian—Authors contributed equally.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 109.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 139.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. Akiba, T., Sano, S., Yanase, T., Ohta, T., Koyama, M.: Optuna: a next-generation hyperparameter optimization framework. In: Proceedings of the 25st ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD 2019), Anchorage, USA (2019)

    Google Scholar 

  2. Ates, E., Aksar, B., Leung, V.J., Coskun, A.K.: Counterfactual explanations for multivariate time series. In: Proceedings of the 2021 International Conference on Applied Artificial Intelligence (ICAPAI), Halden, Norway, pp. 1–8 (2021)

    Google Scholar 

  3. Bach, S., Binder, A., Montavon, G., Klauschen, F., Müller, K., Samek, W.: On pixel-wise explanations for non-linear classifier decisions by layer-wise relevance propagation. PLoS One 10(7) (2015). https://doi.org/10.1371/journal.pone.0130140

  4. Bastings, J., Filippova, K.: The elephant in the interpretability room: why use attention as explanation when we have saliency methods? In: Proceedings of the 2020 EMNLP Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP (2020)

    Google Scholar 

  5. Bracewell, R.N.: The Fourier Transform and Its Applications, 3rd edn. McGraw-Hill, New York (2000)

    MATH  Google Scholar 

  6. Carrillo, A., Cantú, L.F., Noriega, A.: Individual explanations in machine learning models: a survey for practitioners. arXiv (2021). https://doi.org/10.48550/arXiv.2104.04144

  7. Charte, D., Charte, F., del Jesus, M.J., Herrera, F.: An analysis on the use of autoencoders for representation learning: fundamentals, learning task case studies, explainability and challenges. Neurocomputing 404, 93–107 (2020). https://doi.org/10.1016/j.neucom.2020.04.057

    Article  Google Scholar 

  8. Datta, A., Sen, S., Zick, Y.: Algorithmic transparency via quantitative input influence: theory and experiments with learning systems. In: Proceedings of the 2016 IEEE Symposium on Security and Privacy (SP), San Jose, USA, pp. 598–617 (2016)

    Google Scholar 

  9. Delaney, E., Greene, D., Keane, M.T.: Instance-based counterfactual explanations for time series classification. In: Sánchez-Ruiz, A.A., Floyd, M.W. (eds.) ICCBR 2021. LNCS (LNAI), vol. 12877, pp. 32–47. Springer, Cham (2021). https://doi.org/10.1007/978-3-030-86957-1_3

    Chapter  Google Scholar 

  10. Falcon, W.: Pytorch lightning (2019). https://doi.org/10.5281/zenodo.3828935

  11. Fong, R.C., Vedaldi, A.: Interpretable explanations of black boxes by meaningful perturbation. In: Proceedings of the 2017 IEEE International Conference on Computer Vision (ICCV), Venice, Italy, pp. 3449–3457 (2017)

    Google Scholar 

  12. Geweke, J.F., Singleton, K.J.: Latent variable models for time series: a frequency domain approach with an application to the permanent income hypothesis. J. Econometrics 17, 287–304 (1981). https://doi.org/10.1016/0304-4076(81)90003-8

    Article  MathSciNet  MATH  Google Scholar 

  13. Guidotti, R., Monreale, A., Ruggieri, S., Turini, F., Giannotti, F., Pedreschi, D.: A survey of methods for explaining black box models. ACM Comput. Surv. 51(5) (2018). https://doi.org/10.1145/3236009

  14. Guidotti, R., Monreale, A., Spinnato, F., Pedreschi, D., Giannotti, F.: Explaining any time series classifier. In: Proceedings of the 2020 IEEE Second International Conference on Cognitive Machine Intelligence (CogMI), Atlanta, USA, pp. 167–176 (2020)

    Google Scholar 

  15. Hochreiter, S., Schmidhuber, J.: Long short-term memory. Neural Comput. 9(8), 1735–1780 (1997)

    Article  Google Scholar 

  16. Ismail, A.A., Corrada Bravo, H., Feizi, S.: Improving deep learning interpretability by saliency guided training. In: Proceedings of the 35th Conference on Neural Information Processing Systems (NeurIPS 2021), pp. 26726–26739 (2021)

    Google Scholar 

  17. Ismail, A.A., Gunady, M.K., Corrada Bravo, H., Feizi, S.: Benchmarking deep learning interpretability in time series predictions. In: Proceedings of the 34th Conference on Neural Information Processing Systems (NeurIPS), pp. 6441–6452 (2020)

    Google Scholar 

  18. Karlsson, I., Rebane, J., Papapetrou, P., Gionis, A.: Locally and globally explainable time series tweaking. Knowl. Inf. Syst. 62(5), 1671–1700 (2019). https://doi.org/10.1007/s10115-019-01389-4

    Article  Google Scholar 

  19. Kokhlikyan, N., et al.: Captum: a unified and generic model interpretability library for PyTorch. arXiv (2020). https://doi.org/10.48550/arXiv.2009.07896

  20. Le Cun, Y., et al.: Handwritten digit recognition: applications of neural network chips and automatic learning. IEEE Commun. Mag. 27(11), 41–46 (1989). https://doi.org/10.1109/35.41400

    Article  Google Scholar 

  21. Lim, B., Arik, S., Loeff, N., Pfister, T.: Temporal fusion transformers for interpretable multi-horizon time series forecasting. Int. J. Forecast. 37, 1748–1764 (2021). https://doi.org/10.1016/j.ijforecast.2021.03.012

    Article  Google Scholar 

  22. Lipovetsky, S., Conklin, M.: Analysis of regression in game theory approach. Appl. Stoch. Model. Bus. Ind. 17, 319–330 (2001). https://doi.org/10.1002/asmb.446

    Article  MathSciNet  MATH  Google Scholar 

  23. Loeffler, C., Lai, W.C., Eskofier, B., Zanca, D., Schmidt, L., Mutschler, C.: Don’t get me wrong: how to apply deep visual interpretations to time series. arXiv (2022). https://doi.org/10.48550/ARXIV.2203.07861

  24. Lundberg, S.M., Lee, S.I.: A unified approach to interpreting model predictions. In: Proceedings of the 31st International Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, USA, pp. 4768–4777 (2017)

    Google Scholar 

  25. Mikolov, T., Sutskever, I., Chen, K., Corrado, G.S., Dean, J.: Distributed representations of words and phrases and their compositionality. In: Proceedings of the 27th Conference on Neural Information Processing Systems (NeurIPS 2013), Lake Tahoe, USA (2013)

    Google Scholar 

  26. Montavon, G., Lapuschkin, S., Binder, A., Samek, W., Müller, K.R.: Explaining nonlinear classification decisions with deep Taylor decomposition. Pattern Recogn. 65, 211–222 (2017). https://doi.org/10.1016/j.patcog.2016.11.008

    Article  Google Scholar 

  27. Neely, M., Schouten, S.F., Bleeker, M.J.R., Lucic, A.: Order in the court: explainable AI methods prone to disagreement. In: Proceedings of the ICML Workshop on Theoretic Foundation, Criticism, and Application Trend of Explainable AI (2021)

    Google Scholar 

  28. Parvatharaju, P.S., Doddaiah, R., Hartvigsen, T., Rundensteiner, E.A.: Learning saliency maps to explain deep time series classifiers. In: Proceedings of the 30th ACM International Conference on Information & Knowledge Management, Virtual Event, Queensland, Australia, pp. 1406–1415 (2021)

    Google Scholar 

  29. Paszke, A., et al.: PyTorch: an imperative style, high-performance deep learning library. In: Proceedings of the 32nd Conference on Neural Information Processing Systems (NeurIPS 2019), Vancouver, Canada, pp. 8024–8035 (2019)

    Google Scholar 

  30. Petsiuk, V., Das, A., Saenko, K.: Rise: randomized input sampling for explanation of black-box models. In: Proceedings of the 29th British Machine Vision Conference (BMVC), Newcastle, UK (2018)

    Google Scholar 

  31. Ribeiro, M.T., Singh, S., Guestrin, C.: “Why should I trust you?” explaining the predictions of any classifier. In: Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD 2016), New York, USA, pp. 1135–1144 (2016)

    Google Scholar 

  32. Schlegel, U., Keim, D.A.: Time series model attribution visualizations as explanations. In: Proceedings of the 2021 IEEE Workshop on TRust and EXpertise in Visual Analytics (TREX), New Orleans, USA, pp. 27–31 (2021)

    Google Scholar 

  33. Schlegel, U., Oelke, D., Keim, D.A., El-Assady, M.: An empirical study of explainable AI techniques on deep learning models for time series tasks. In: Proceedings of the Pre-registration Workshop NeurIPS 2020, Vancouver, Canada (2020)

    Google Scholar 

  34. Shapley, L.S.: A Value for N-Person Games, pp. 307–317. Princeton University Press, Princeton (1953)

    Google Scholar 

  35. Shrikumar, A., Greenside, P., Kundaje, A.: Learning important features through propagating activation differences. In: Proceedings of the 34th International Conference on Machine Learning (ICML 2017), Sydney, Australia, vol. 70 (2017)

    Google Scholar 

  36. Shrikumar, A., Greenside, P., Shcherbina, A., Kundaje, A.: Not just a black box: learning important features through propagating activation differences. In: Proceedings of the 33rd International Conference on Machine Learning (ICML 2016), New York, USA, vol. 48 (2016)

    Google Scholar 

  37. Simonyan, K., Vedaldi, A., Zisserman, A.: Deep inside convolutional networks: visualising image classification models and saliency maps. arXiv (2014). https://doi.org/10.48550/arXiv.1312.6034

  38. Smilkov, D., Thorat, N., Kim, B., Kim, B., Viégas, F.B., Wattenberg, M.: SmoothGrad: removing noise by adding noise. arXiv (2017). https://doi.org/10.48550/arXiv.1706.03825

  39. Springenberg, J.T., Dosovitskiy, A., Brox, T., Riedmiller, M.A.: Striving for simplicity: the all convolutional net. arXiv (2015). https://doi.org/10.48550/arXiv.1412.6806

  40. Sundararajan, M., Taly, A., Yan, Q.: Axiomatic attribution for deep networks. In: Proceedings of the 34th International Conference on Machine Learning (ICML 2017), Sydney, Australia, pp. 3319–3328 (2017)

    Google Scholar 

  41. Štrumbelj, E., Kononenko, I.: Explaining prediction models and individual predictions with feature contributions. Knowl. Inf. Syst. 41(3), 647–665 (2014)

    Article  Google Scholar 

  42. Wang, Z., Samsten, I., Mochaourab, R., Papapetrou, P.: Learning time series counterfactuals via latent space representations. In: Soares, C., Torgo, L. (eds.) DS 2021. LNCS (LNAI), vol. 12986, pp. 369–384. Springer, Cham (2021). https://doi.org/10.1007/978-3-030-88942-5_29

    Chapter  Google Scholar 

  43. Wiegreffe, S., Pinter, Y.: Attention is not not explanation. In: Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), Hong Kong, China, pp. 11–20 (2019)

    Google Scholar 

  44. Ye, L., Keogh, E.: Time series shapelets: a new primitive for data mining. In: Proceedings of the 15th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD 2009), Paris, France, pp. 947–956 (2009)

    Google Scholar 

  45. Zeiler, M.D., Fergus, R.: Visualizing and understanding convolutional networks. In: Fleet, D., Pajdla, T., Schiele, B., Tuytelaars, T. (eds.) ECCV 2014. LNCS, vol. 8689, pp. 818–833. Springer, Cham (2014). https://doi.org/10.1007/978-3-319-10590-1_53

    Chapter  Google Scholar 

Download references

Acknowledgments

We thank Oleksandr Zadorozhnyi for his valuable support throughout the course of the research project. We thank Ruijie Chen, Elisabeth Pachl and Adrian Schwaiger for proofreading the manuscript and providing instructive feedback.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Maresa Schröder .

Editor information

Editors and Affiliations

A Appendix

A Appendix

1.1 A.1 Synthetic Data Generation

Based on the Fourier series latent model, a time series \(x_t, t=1,...,T\) is modeled as

$$\begin{aligned} x_t&= a_0 + \sum _{n=1}^{\infty } a_n \cos (\omega _nt) + \sum _{n=1}^{\infty } b_n \sin (\omega _nt) \\&= a_0 + \sum _{n=1}^{\infty } A_n \cos (\omega _nt + \phi _n)\\&= a_0 + \sum _{n=1}^{\infty } A_n \sin (\omega _nt + \phi _n + \frac{\pi }{2}). \end{aligned}$$

To simulated data, let \(\tilde{n}\) represent the number of amplitudes present in the series, i.e. \(\forall i > \tilde{n}, A_i = 0\). For simplicity, we consider centered stationary periodic time series in the data generation process, i.e. \(a_0 = 0\). In this case, the value at every time step t is calculated as

$$\begin{aligned} x_t = \sum _{i=1}^{\tilde{n}} A_i \sin (\omega _i t + \phi _i + \frac{\pi }{2}). \end{aligned}$$
(1)

We refer to the notions amplitude A, frequency \(\omega \), phase shift \(\phi \) as concepts. The separate Fourier coefficients \(A_i, \omega _i, \phi _i\) for \(i=1,...,\tilde{T}\) are referred to as latent features. The latent features frequency \(\omega _i\) and phase shift \(\phi _i\) are each sampled from a uniform distribution. The sampling intervals are chosen with respect to the specific intention in the experiment design. To simulate the amplitude parameters \(A_i\), a dominant amplitude \(A_1\) is sampled. The next amplitudes are calculated considering an exponential decay with a fixed rate dec:

$$\begin{aligned} A_i = A_1 \exp (-i \cdot dec), \quad i=1,...,\tilde{n}. \end{aligned}$$

This makes the first frequency i.e. \(\omega _1\) to be the dominant frequency of the Fourier series. Throughout the experiments, all time series were generated with an equal length of 300 time steps. i.e. \(T=300\).

For assigning class labels to the time series samples, we consider the following two scenarios.

Scenario 1: Label based on the presence of a shapelet

For assigning shape-based labels to the time series, a shapelet is inserted at a random or fixed position into all time series \(X \in D\) belonging to one class. The shapelet is a second simulated Fourier series of length \(l \le T\), where \(l = \text {window-ratio} \cdot T\) for a chosen window ratio. We define the sampling intervals for the latent features of the shapelet to be non-intersecting with the sampling intervals of the latent features of the original time series X. The resulting shapelet replaces the original time series in the interval \([j, j+l]\), where

$$\begin{aligned} j \sim \mathcal {U}(1, T-l). \end{aligned}$$
Table 2. Label-making features per experiment. The overlapping ranges refer to the sampling intervals for frequency and phase shift.
Table 3. Overview of simulation parameters of the Fourier series. If two entries are present in one cell, each the classes were sampled from different distributions. The first entry in each cell corresponds to the sampling parameter of class 0, the second entry to class 1.

Scenario 2: Label based on differences in the latent features

Following the investigation of the effectiveness of explainability methods for latent features, we introduce a second simulation scenario where the labels depend on a difference in the sampling distribution of latent features of the time series. This scenario highlights the main focus of this project and represents our novel view of explainability methods for time series. Similar to the first scenario, the time series are sampled as discretized Fourier series with latent variables \(\omega , A\) and \(\phi \). The latent dependency is induced as follows:

  1. 1.

    Two normal distributions with different means (based on Table 3) are selected for classes 0 and 1. For positive parameters, the distributions are log-normal.

  2. 2.

    Per each class, N/2 Fourier parameters are sampled from the given distributions.

  3. 3.

    The rest of the parameters are sampled from the same distribution for both classes.

  4. 4.

    Sampled parameters are given to the deterministic Fourier series in Eq. 1 to generate the temporal samples. Rows are then labeled with the associated class, from the corresponding distribution of which the informative parameters are sampled.

1.2 A.2 Data Set Description

Based on the data generation method described above, we design ten different mechanisms for binary classification of univariate time series. Table 2 lists the parameters and algorithms for assigning labels to each sample. In Table 3 the parameters used for sampling the Fourier series are presented. The complete simulation code base can be found in the GitHub repository at https://github.com/m-schroder/TSExplainability.

Rights and permissions

Reprints and permissions

Copyright information

© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Schröder, M., Zamanian, A., Ahmidi, N. (2023). Post-hoc Saliency Methods Fail to Capture Latent Feature Importance in Time Series Data. In: Chen, H., Luo, L. (eds) Trustworthy Machine Learning for Healthcare. TML4H 2023. Lecture Notes in Computer Science, vol 13932. Springer, Cham. https://doi.org/10.1007/978-3-031-39539-0_10

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-39539-0_10

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-39538-3

  • Online ISBN: 978-3-031-39539-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics