Assessing the Performance of Transformer for Time Series Anomaly Detection



Published Sep 4, 2023
Takuto Nakashima Takehisa Yairi


This study aims to assess the effectiveness of the Transformer-based reconstruction approach for detecting anomalies in time series data. The reconstruction error-based anomaly detection method was applied to both multivariate time series from NASA SMAP/MSL and univariate time series from UCR. Four deep learning models, including Transformer, Dilated CNN, LSTM, and MLP, were compared in terms of their ability to reconstruct input data. Dilated CNN outperformed the other models in almost all experimental results, achieving a 25% higher score than Transformer on the UCR dataset when trained with random masking, and a 60% higher score when trained with middle masking. These results suggest that the Transformer did not perform as well as expected for anomaly detection based on time series reconstruction errors, and its inferiority to Dilated CNN may be attributed to the characteristics of the time series and the limited training data. Future research should focus on developing Transformer models that can better capture the properties of time series data and investigate the relationship between the model’s performance, data volume, and model complexity.

Abstract 358 | PDF Downloads 329



time series, anomaly detection, transformer, deep learning

Audibert, J., Michiardi, P., Guyard, F., Marti, S., & Zuluaga, M. A. (2020). Usad: Unsupervised anomaly detection on multivariate time series. In Proceedings of the 26th acm sigkdd international conference on knowledge discovery & data mining (pp. 3395–3404).

Doshi, K., Abudalou, S., & Yilmaz, Y. (2022). Tisat: Time series anomaly transformer. arXiv preprint arXiv:2203.05167.

Geiger, A., Liu, D., Alnegheimish, S., Cuesta-Infante, A., & Veeramachaneni, K. (2020). Tadgan: Time series anomaly detection using generative adversarial networks. In 2020 ieee international conference on big data (big data) (pp. 33–43).

Hundman, K., Constantinou, V., Laporte, C., Colwell, I., & Soderstrom, T. (2018). Detecting spacecraft anomalies using lstms and nonparametric dynamic thresholding. In Proceedings of the 24th acm sigkdd international conference on knowledge discovery & data mining (pp. 387–395).

Jeong, Y., Yang, E., Ryu, J. H., Park, I., & Kang, M. (2023). Anomalybert: Self-supervised transformer for time series anomaly detection using data degradation scheme. arXiv preprint arXiv:2305.04468.

Kaplan, J., McCandlish, S., Henighan, T., Brown, T. B., Chess, B., Child, R., . . . Amodei, D. (2020). Scaling laws for neural language models. arXiv preprint arXiv:2001.08361.

Kim, S., Choi, K., Choi, H.-S., Lee, B., & Yoon, S. (2022, Jun.). Towards a rigorous evaluation of time-series anomaly detection. Proceedings of the AAAI Conference on Artificial Intelligence, 36(7), 7194-7201. doi: 10.1609/aaai.v36i7.20680

Malhotra, P., Vig, L., Shroff, G., Agarwal, P., et al. (2015). Long short term memory networks for anomaly detection in time series. In Proceedings (Vol. 89, pp. 89– 94).

Rewicki, F., Denzler, J., & Niebling, J. (2022). Is it worth it? an experimental comparison of six deepand classical machine learning methods for unsupervised anomaly detection in time series. arXiv preprint arXiv:2212.11080.

Su, Y., Zhao, Y., Niu, C., Liu, R., Sun, W., & Pei, D. (2019). Robust anomaly detection for multivariate time series through stochastic recurrent neural network. In Proceedings of the 25th acm sigkdd international conference on knowledge discovery & data mining (pp. 2828– 2837).

Tuli, S., Casale, G., & Jennings, N. R. (2022). TranAD: Deep Transformer Networks for Anomaly Detection in Multivariate Time Series Data. Proceedings of VLDB, 15(6), 1201-1214.

Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., . . . Polosukhin, I. (2017). Attention is all you need. Advances in neural information processing systems, 30.

Wu, R., & Keogh, E. (2021). Current time series anomaly detection benchmarks are flawed and are creating the illusion of progress. IEEE Transactions on Knowledge and Data Engineering.

Xu, J., Wu, H., Wang, J., & Long, M. (2022). Anomaly transformer: Time series anomaly detection with association discrepancy. In International conference on learning representations.

Zhang, C., Song, D., Chen, Y., Feng, X., Lumezanu, C., Cheng, W., . . . Chawla, N. V. (2019). A deep neural network for unsupervised anomaly detection and diagnosis in multivariate time series data. In Proceedings of the aaai conference on artificial intelligence (Vol. 33, pp. 1409–1416).
Regular Session Papers