Abstract
Most reconstruction-based multivariate time series (MTS) anomaly detection methods tend to learn point-wise information, failing to extract a robust overall representation. Some studies have tried to introduce contrastive learning to alleviate this problem, but two key challenges remain: (1) Most data augmentation approaches follow the inductive bias from computer vision, which may destroy the time series patterns. (2) The instance discrimination proxy task of traditional contrastive learning will cause the generation of numerous false negative samples and the loss of common information when applied to MTS anomaly detection. In this paper, a contrastive autoencoder with multi-resolution segment-consistency discrimination (MRSCD) is proposed for MTS anomaly detection. Firstly, a time series data augmentation method is proposed, which constructs positive and negative samples by down-sampling the original time series in different resolutions and orders. Then an encoder is used to extract different levels of temporal information from the multi-resolution sample pairs which are randomly combined by positive and negative samples with the same resolution. Finally, a proxy task of segment-consistency discrimination is proposed for contrastive autoencoder to distinguish positive and negative sample pairs through the order of the down-sampled segments, enabling the model to extract inter-segment contextual information at the same time as learning point-wise information. The experimental results on five public datasets show that MRSCD significantly outperforms the baseline methods in three evaluation metrics.
Similar content being viewed by others
Data Availability
The datasets supporting the results of this article are SMD, SWaT, MSL, PSM, and SMAP public datasets, and the authors confirm that the datasets are indicated in the reference list.
References
Zhu Z, Huang G, Deng J, Ye Y, Huang J, Chen X, Zhu J, Yang T, Du D, Lu J et al (2022) Webface260M: A benchmark for million-scale deep face recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence 45(2):2627–2644. https://doi.org/10.48550/arXiv.2204.10149
Wang Y, Zhao Y (2023) Arbitrary Spatial Trajectory Reconstruction based on A Single Inertial Sensor. IEEE Sensors Journal 23:10009–10022. https://doi.org/10.1109/JSEN.2023.3257867
Yang H, Li P, Li H (2022) An oil imports dependence forecasting system based on fuzzy time series and multi-objective optimization algorithm: Case for china. Knowledge-Based Systems 246:108687. https://doi.org/10.1016/j.knosys.2022.108687
Mathur AP, Tippenhauer NO (2016) Swat: A water treatment testbed for research and training on ics security. In: 2016 International Workshop on Cyber-physical Systems for Smart Water Networks (CySWater), pp. 31–36. https://doi.org/10.1109/CySWater.2016.7469060
Liu P, Sun X, Han Y, He Z, Zhang W, Wu C (2022) Arrhythmia classification of lstm autoencoder based on time series anomaly detection. Biomedical Signal Processing and Control 71:103228. https://doi.org/10.1016/j.bspc.2021.103228
Wang Y, Perry M, Whitlock D, Sutherland JW (2022) Detecting anomalies in time series data from a manufacturing system using recurrent neural networks. Journal of Manufacturing Systems 62:823–834. https://doi.org/10.1016/j.jmsy.2020.12.007
Zhang W, Zhang C, Tsung F (2022) Grelen: Multivariate time series anomaly detection from the perspective of graph relational learning. In: Proceedings of the Thirty-First International Joint Conference on Artificial Intelligence, IJCAI-22, pp. 2390–2397. https://doi.org/10.24963/ijcai.2022/332
Chen Z, Peng Z, Zou X, Sun H (2022) Deep learning based anomaly detection for muti-dimensional time series: A survey. In: Cyber Security: 18th China Annual Conference, CNCERT 2021, Beijing, China, July 20–21, 2021, Revised Selected Papers, pp. 71–92. https://doi.org/10.1007/978-981-16-9229-1_5
Breunig MM, Kriegel HP, Ng RT, Sander J (2000) Lof: identifying densitybased local outliers. In: Proceedings of the 2000 ACM SIGMOD International Conference on Management of Data, pp. 93–104. https://doi.org/10.1145/335191.335388
Gu X, Akoglu L, Rinaldo A (2019) Statistical analysis of nearest neighbor methods for anomaly detection. Advances in Neural Information Processing Systems 32. https://doi.org/10.48550/arXiv.1907.03813
Jiang J, Yasakethu L (2013) Anomaly detection via one class svm for protection of scada systems. In: 2013 International Conference on Cyber-Enabled Distributed Computing and Knowledge Discovery, pp. 82–88. https://doi.org/10.1109/CyberC.2013.22
Chevrot A, Vernotte A, Legeard B (2022) Cae: Contextual auto-encoder for multivariate time-series anomaly detection in air transportation. Computers & Security 116:102652. https://doi.org/10.1016/j.cose.2022.102652
Li G, Jung JJ (2022) Deep learning for anomaly detection in multivariate time series: Approaches, applications, and challenges. Inf. Fusion 91:93–102. https://doi.org/10.1016/j.inffus.2022.10.008
Zhang G, Gao X, Wang L, Xue B, Fu S, Yu J, Huang Z, Huang X (2022) Probabilistic autoencoder with multi-scale feature extraction for multivariate time series anomaly detection. Applied Intelligence 1–18. https://doi.org/10.1007/s10489-022-04324-3
Yao Y, Ma J, Ye Y (2022) Kfreqgan: Unsupervised detection of sequence anomaly with adversarial learning and frequency domain information. Knowledge-Based Systems 236:107757. https://doi.org/10.1016/j.knosys.2021.107757
Deng A, Hooi B (2021) Graph neural network-based anomaly detection in multivariate time series. Proceedings of the AAAI Conference on Artificial Intelligence 35:4027–4035. https://doi.org/10.1609/aaai.v35i5.16523
Chen Z, Chen D, Zhang X, Yuan Z, Cheng X (2021) Learning graph structures with transformer for multivariate time-series anomaly detection in iot. IEEE Internet of Things Journal 9(12):9179–9189. https://doi.org/10.1109/JIOT.2021.3100509
He K, Fan H, Wu Y, Xie S, Girshick R (2020) Momentum contrast for unsupervised visual representation learning. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp 9729–9738. https://doi.org/10.1109/CVPR42600.2020.00975
Chen T, Kornblith S, Norouzi M, Hinton G (2020) A simple framework for contrastive learning of visual representations. In: International Conference on Machine Learning, pp 1597–1607. https://doi.org/10.48550/arXiv.2002.05709
Shi J, Liang C, Hou L, Li JZ, Liu Z, Zhang H (2018) Deepchannel: Salience estimation by contrastive learning for extractive document summarization. In: AAAI Conference on Artificial Intelligence, vol. 33, pp. 6999–7006. https://doi.org/10.48550/arXiv.1811.02394
Saeed A, Grangier D, Zeghidour N (2021) Contrastive learning of general-purpose audio representations. In: ICASSP 2021-2021 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp 3875–3879. https://doi.org/10.1109/ICASSP39728.2021.9413528
Jaiswal A, Babu AR, Zadeh MZ, Banerjee D, Makedon F (2020) A survey on contrastive self-supervised learning. Technologies 9(1):2. https://doi.org/10.3390/technologies9010002
Yue Z, Wang Y, Duan J, Yang T, Huang C, Tong Y, Xu B (2022) Ts2vec: Towards universal representation of time series. Proceedings of the AAAI Conference on Artificial Intelligence 36:8980–8987. https://doi.org/10.1609/aaai.v36i8.20881
Zhang C, Song D, Chen Y, Feng X, Lumezanu C, Cheng W, Ni J, Zong B, Chen H, Chawla NV (2019) A deep neural network for unsupervised anomaly detection and diagnosis in multivariate time series data. Proceedings of the AAAI Conference on Artificial Intelligence 33:1409–1416. https://doi.org/10.1609/aaai.v33i01.33011409
Zhou B, Liu S, Hooi B, Cheng X, Ye J (2019) Beatgan: Anomalous rhythm detection using adversarially generated time series. In: IJCAI, vol. 2019, pp. 4433–4439. https://doi.org/10.24963/ijcai.2019/616
Audibert J, Michiardi P, Guyard F, Marti S, Zuluaga MA (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. https://doi.org/10.1145/3394486.3403392
Li, Z., Zhao, Y., Han, J., Su, Y., Jiao, R., Wen, X., Pei, D.: Multivariate time series anomaly detection and interpretation using hierarchical inter-metric and temporal embedding. In: Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery & Data Mining, pp. 3220–3230 (2021). https://doi.org/10.1145/3447548.3467075
Tuli S, Casale G, Jennings N (2022) Tranad: deep transformer networks for anomaly detection in multivariate time series data. Proceedings of the VLDB Endowment 15:1201–1214. https://doi.org/10.14778/3514061.3514067
Xu J, Wu H, Wang J, Long M (2022) Anomaly Transformer: Time Series Anomaly Detection with Association Discrepancy. In: International Conference on Learning Representations. https://doi.org/10.48550/arXiv.2110.02642
Yang X, Zhang Z, Cui R (2022) Timeclr: A self-supervised contrastive learning framework for univariate time series representation. Knowledge-Based Systems 245:108606. https://doi.org/10.1016/j.knosys.2022.108606
Gao H, Qiu B, Barroso RJD, Hussain W, Xu Y, Wang X (2022) Tsmae: a novel anomaly detection approach for internet of things time series data using memoryaugmented autoencoder. IEEE Transactions on network science and engineering. https://doi.org/10.1109/TNSE.2022.3163144
Zhou H, Yu K, Zhang X, Wu G, Yazidi A (2022) Contrastive autoencoder for anomaly detection in multivariate time series. Information Sciences 610:266–280. https://doi.org/10.1016/j.ins.2022.07.179
Eldele E, Ragab M, Chen Z, Wu M, Kwoh C, Li X, Guan C (2021) Time-Series Representation Learning via Temporal and Contextual Contrasting. In: International Joint Conference on Artificial Intelligence. https://doi.org/10.48550/arXiv.2106.14112
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. https://doi.org/10.1145/3292500.3330672
Ouyang L, Wu J, Jiang X, Almeida D, Wainwright C, Mishkin P, Zhang C, Agarwal S, Slama K, Ray A et al (2022) Training language models to follow instructions with human feedback. Advances in Neural Information Processing Systems 35:27730–27744. https://doi.org/10.48550/arXiv.2203.02155
Wang J (2022) A novel metal futures forecasting system based on wavelet packet decomposition and stochastic deep learning model. Applied Intelligence 52(8):9334–9352. https://doi.org/10.1007/s10489-021-03083-x
Wang J, Wang J (2021) A new hybrid forecasting model based on SW-LSTM and wavelet packet decomposition: a case study of oil futures prices. Computational Intelligence and Neuroscience 2021. https://doi.org/10.1155/2021/7653091
Sun C, He Z, Lin H, Cai L, Cai H, Gao M (2023) Anomaly detection of power battery pack using gated recurrent units based variational autoencoder. Applied Soft Computing 132:109903. https://doi.org/10.1016/j.asoc.2022.109903
Grill JB, Strub F, Altché F, Tallec C, Richemond P, Buchatskaya E, Doersch C, Avila Pires B, Guo Z, Gheshlaghi Azar M et al (2020) Bootstrap your own latent-a new approach to self-supervised learning. Advances in neural information processing systems 33:21271–21284. arXiv:2006.07733
Garg A, Zhang W, Samaran J, Savitha R, Foo CS (2021) An evaluation of anomaly detection and diagnosis in multivariate time series. IEEE Transactions on Neural Networks and Learning Systems 33(6):2508–2517. https://doi.org/10.1109/TNNLS.2021.3105827
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. https://doi.org/10.1145/3219819.3219845
Abdulaal A, Liu Z, Lancewicki T (2021) Practical approach to asynchronous multivariate time series anomaly detection and localization. In: Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery & Data Mining, pp 2485–2494. https://doi.org/10.1145/3447548.3467174
Shen L, Li Z, Kwok J (2020) Timeseries anomaly detection using temporal hierarchical one-class network. Advances in Neural Information Processing Systems 33:13016–13026. https://doi.org/10.5555/3495724.3496816
Xu H, Chen W, Zhao N, Li Z, Bu J, Li Z, Liu Y, Zhao Y, Pei D, Feng Y et al (2018) Unsupervised anomaly detection via variational auto-encoder for seasonal kpis in web applications. In: Proceedings of the 2018 World Wide Web Conference, pp 187–196. https://doi.org/10.1145/3178876.3185996
Kim S, Choi K, Choi HS, Lee B, Yoon S (2022) Towards a rigorous evaluation of time-series anomaly detection. Proceedings of the AAAI Conference on Artificial Intelligence 36:7194–7201. https://doi.org/10.1609/aaai.v36i7.20680
Liu FT, Ting KM, Zhou ZH (2008) Isolation forest. In: 2008 Eighth Ieee International Conference on Data Mining, pp 413–422. https://doi.org/10.1109/ICDM.2008.17
You D, Shen X, Liu G, Wang G (2021) Signal anomaly identification strategy based on Bayesian inference for nuclear power machinery. Mechanical Systems and Signal Processing 161:107967. https://doi.org/10.1016/j.ymssp.2021.107967
Abdar M, Pourpanah F, Hussain S, Rezazadegan D, Liu L, Ghavamzadeh M, Fieguth P, Cao X, Khosravi A, Acharya UR et al (2021) A review of uncertainty quantification in deep learning: Techniques, applications and challenges. Information fusion 76:243–297. https://doi.org/10.1016/j.inffus.2021.05.008
Abdar M, Mehrzadi A, Goudarzi M, Masoudkabir F, Rundo L, Mamouei M, Sala E, Khosravi A, Makarenkov V, Acharya UR et al (2023) Binarized multi-gate mixture of Bayesian experts for cardiac syndrome X diagnosis: A clinician- in-the-loop scenario with a belief-uncertainty fusion paradigm. Information Fusion 97:101813. https://doi.org/10.1016/j.inffus.2023.101813
Abdar M, Khosravi A, Islam SMS, Acharya UR, Vasilakos AV (2022) The need for quantification of uncertainty in artificial intelligence for clinical data analysis: increasing the level of trust in the decision-making process. IEEE Systems, Man, and Cybernetics Magazine 8(3):28–40. https://doi.org/10.1109/MSMC.2022.3150144
Acknowledgements
The authors would like to thank their colleagues from the machine learning group for discussions on this paper. This work was supported by the Science & Technology Project of State Grid Corporation of China (No.5400-202355230A-1-1-ZN)
Author information
Authors and Affiliations
Contributions
Bing Xue: Methodology, Software, Writing - Original Draft, Writing - Review & Editing. Xin Gao: Conceptualization, Methodology, Supervision, Writing - Original Draft, Writing - Review & Editing. Feng Zhai: Conceptualization, Resources, Funding acquisition. Baofeng Li: Software, Validation, Funding acquisition. Jiahao Yu: Software, Validation. Shiyuan Fu: Software, Writing - Review & Editing. Lingli Chen: Writing - Review & Editing. Zhihang Meng: Writing - Review & Editing.
Corresponding author
Ethics declarations
Competing interests
The authors have no competing interests to declare that are relevant to the content of this article.
Ethics approval
Not applicable.
Consent to participate
Not applicable.
Consent for publication
Not applicable.
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.
About this article
Cite this article
Xue, B., Gao, X., Zhai, F. et al. A contrastive autoencoder with multi-resolution segment-consistency discrimination for multivariate time series anomaly detection. Appl Intell 53, 28655–28674 (2023). https://doi.org/10.1007/s10489-023-04985-8
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10489-023-04985-8