《计算机应用》唯一官方网站 ›› 2023, Vol. 43 ›› Issue (12): 3799-3805.DOI: 10.11772/j.issn.1001-9081.2022111796
所属专题: 网络空间安全
收稿日期:
2022-12-06
修回日期:
2023-03-16
接受日期:
2023-03-23
发布日期:
2023-04-10
出版日期:
2023-12-10
通讯作者:
王小慧
作者简介:
张安勤(1974—),女,安徽六安人,副教授,博士,主要研究方向:数据挖掘、普适计算;
基金资助:
Anqin ZHANG1,2, Xiaohui WANG1()
Received:
2022-12-06
Revised:
2023-03-16
Accepted:
2023-03-23
Online:
2023-04-10
Published:
2023-12-10
Contact:
Xiaohui WANG
About author:
ZHANG Anqin, born in 1974, Ph. D., associate professor. Her research interests include data mining, ubiquitous computing.
Supported by:
摘要:
电动汽车由于电池内部异常情况无法得到及时预测与预警,易导致事故发生,给驾驶员和乘客的生命和财产安全带来严重威胁。针对上述问题,提出基于Transformer和对比学习的编码器解码器(CT-ED)模型用于多元时间序列异常检测。首先,通过数据增强构造一个实例的不同视图,并利用对比学习捕获数据的局部不变特征;其次,基于Transformer对数据从时间依赖和特征依赖两方面进行编码;最后,通过解码器重构数据,计算重构误差作为异常得分,对实际工况下的机器进行异常检测。在SWaT、SMAP和MSL这3个公开数据集和电动汽车动力电池(EV)数据集上的实验结果表明,所提模型的F1值对比次优模型分别提升6.5%、1.8%、0.9%和7.1%。以上结果表明CT-ED适用于不同实际工况下的异常检测,平衡了异常检测的精确率和召回率。
中图分类号:
张安勤, 王小慧. 基于时序异常检测的动力电池安全预警[J]. 计算机应用, 2023, 43(12): 3799-3805.
Anqin ZHANG, Xiaohui WANG. Power battery safety warning based on time series anomaly detection[J]. Journal of Computer Applications, 2023, 43(12): 3799-3805.
数据集 | 训练集样本数 | 测试集样本数 | 维度 | 异常率/% |
---|---|---|---|---|
SWaT | 496 800 | 449 919 | 51 | 11.98 |
SMAP | 135 183 | 427 617 | 55 | 10.72 |
MSL | 58 317 | 73 729 | 25 | 13.13 |
EV | 343 626 | 33 811 | 22 | 9.17 |
表1 数据集统计信息
Tab.1 Statistics of datasets
数据集 | 训练集样本数 | 测试集样本数 | 维度 | 异常率/% |
---|---|---|---|---|
SWaT | 496 800 | 449 919 | 51 | 11.98 |
SMAP | 135 183 | 427 617 | 55 | 10.72 |
MSL | 58 317 | 73 729 | 25 | 13.13 |
EV | 343 626 | 33 811 | 22 | 9.17 |
模型 | SWaT | EV | SMAP | MSL | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
P | R | F1 | P | R | F1 | P | R | F1 | P | R | F1 | |
MAD-GAN | 0.913 2 | 0.689 2 | 0.785 5 | 0.324 5 | 0.753 3 | 0.453 6 | 0.752 8 | 0.894 1 | 0.817 4 | 0.852 2 | 1.000 0 | 0.920 2 |
OmniAnomaly | 0.868 3 | 0.832 3 | 0.854 5 | 0.892 2 | ||||||||
USAD | 0.996 1 | 0.702 1 | 0.823 7 | 0.319 9 | 0.461 4 | 0.862 5 | 1.000 0 | 0.926 2 | 0.856 4 | 1.000 0 | 0.922 6 | |
GDN | 0.681 2 | 0.808 2 | 0.478 3 | 0.258 9 | 0.336 0 | 0.876 2 | 0.931 4 | 0.841 8 | 1.000 0 | 0.914 1 | ||
TranAD | 0.976 0 | 0.699 7 | 0.815 1 | 0.445 9 | 0.316 3 | 0.370 1 | 0.849 7 | 1.000 0 | 0.918 7 | 0.951 4 | ||
CT-ED | 0.846 7 | 0.941 2 | 0.891 4 | 0.712 9 | 0.775 2 | 0.742 8 | 0.911 3 | 0.950 9 | 1.000 0 | 0.951 1 |
表2 CT-ED在不同数据集上的实验结果
Tab.2 Experimental results of CT-ED on different datasets
模型 | SWaT | EV | SMAP | MSL | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
P | R | F1 | P | R | F1 | P | R | F1 | P | R | F1 | |
MAD-GAN | 0.913 2 | 0.689 2 | 0.785 5 | 0.324 5 | 0.753 3 | 0.453 6 | 0.752 8 | 0.894 1 | 0.817 4 | 0.852 2 | 1.000 0 | 0.920 2 |
OmniAnomaly | 0.868 3 | 0.832 3 | 0.854 5 | 0.892 2 | ||||||||
USAD | 0.996 1 | 0.702 1 | 0.823 7 | 0.319 9 | 0.461 4 | 0.862 5 | 1.000 0 | 0.926 2 | 0.856 4 | 1.000 0 | 0.922 6 | |
GDN | 0.681 2 | 0.808 2 | 0.478 3 | 0.258 9 | 0.336 0 | 0.876 2 | 0.931 4 | 0.841 8 | 1.000 0 | 0.914 1 | ||
TranAD | 0.976 0 | 0.699 7 | 0.815 1 | 0.445 9 | 0.316 3 | 0.370 1 | 0.849 7 | 1.000 0 | 0.918 7 | 0.951 4 | ||
CT-ED | 0.846 7 | 0.941 2 | 0.891 4 | 0.712 9 | 0.775 2 | 0.742 8 | 0.911 3 | 0.950 9 | 1.000 0 | 0.951 1 |
方法 | F1 | P | R |
---|---|---|---|
POT | 0.733 5 | 0.705 1 | 0.764 3 |
均方 | 0.525 1 | 0.381 7 | 0.841 0 |
EWMA | 0.127 6 | 0.091 7 | 0.209 6 |
NDT | 0.754 8 | 0.838 2 | 0.686 6 |
POT+剪枝 | 0.741 5 | 0.721 5 | 0.762 7 |
表3 相同模型在不同阈值选择方法下的实验结果
Tab.3 Experimental results of same model with different threshold selection methods
方法 | F1 | P | R |
---|---|---|---|
POT | 0.733 5 | 0.705 1 | 0.764 3 |
均方 | 0.525 1 | 0.381 7 | 0.841 0 |
EWMA | 0.127 6 | 0.091 7 | 0.209 6 |
NDT | 0.754 8 | 0.838 2 | 0.686 6 |
POT+剪枝 | 0.741 5 | 0.721 5 | 0.762 7 |
变量类型 | 变量 | F1 | P | R |
---|---|---|---|---|
多元变量 | 多元变量 | 0.742 8 | 0.712 9 | 0.775 2 |
单变量 | 电压 | 0.572 4 | 0.902 2 | 0.419 2 |
电流 | 0.695 4 | 0.723 3 | 0.669 5 | |
绝缘电阻 | 0.168 2 | 0.091 8 | 1.000 0 |
表4 CT-ED的变量实验结果
Tab.4 Variate experimental results of CT-ED
变量类型 | 变量 | F1 | P | R |
---|---|---|---|---|
多元变量 | 多元变量 | 0.742 8 | 0.712 9 | 0.775 2 |
单变量 | 电压 | 0.572 4 | 0.902 2 | 0.419 2 |
电流 | 0.695 4 | 0.723 3 | 0.669 5 | |
绝缘电阻 | 0.168 2 | 0.091 8 | 1.000 0 |
模型 | F1 | P | R |
---|---|---|---|
TranAD | 0.746 9 | 0.916 9 | 0.630 1 |
USAD | 0.672 2 | 0.550 6 | 0.862 6 |
MAD-GAN | 0.401 2 | 0.952 8 | 0.254 1 |
OmniAnomaly | 0.756 9 | 0.928 7 | 0.638 8 |
表5 不同模型在电流单变量时间序列上的实验结果
Tab.5 Experimental results of different models on current univariate time series
模型 | F1 | P | R |
---|---|---|---|
TranAD | 0.746 9 | 0.916 9 | 0.630 1 |
USAD | 0.672 2 | 0.550 6 | 0.862 6 |
MAD-GAN | 0.401 2 | 0.952 8 | 0.254 1 |
OmniAnomaly | 0.756 9 | 0.928 7 | 0.638 8 |
模型 | P | R | F1 |
---|---|---|---|
CT-ED | 0.712 9 | 0.775 2 | 0.742 8 |
CT-ED-WO-Conv | 0.616 1 | 0.808 4 | 0.699 3 |
CT-ED-WO-Feature | 0.667 8 | 0.765 6 | 0.713 3 |
CT-ED-WO-Time | 0.586 7 | 0.762 7 | 0.663 2 |
CT-ED-WO-Contrastive | 0.636 3 | 0.766 2 | 0.695 2 |
表6 CT-ED在EV数据集上的消融实验结果
Tab. 6 Results of ablation experiment of CT-ED on EV dataset
模型 | P | R | F1 |
---|---|---|---|
CT-ED | 0.712 9 | 0.775 2 | 0.742 8 |
CT-ED-WO-Conv | 0.616 1 | 0.808 4 | 0.699 3 |
CT-ED-WO-Feature | 0.667 8 | 0.765 6 | 0.713 3 |
CT-ED-WO-Time | 0.586 7 | 0.762 7 | 0.663 2 |
CT-ED-WO-Contrastive | 0.636 3 | 0.766 2 | 0.695 2 |
数据增强方式 | F1 | P | R |
---|---|---|---|
FFT | 0.777 7 | 0.823 7 | 0.736 5 |
移动窗口 | 0.773 0 | 0.811 6 | 0.737 8 |
噪声 | 0.774 3 | 0.815 3 | 0.737 2 |
表7 不同数据增强方式的结果对比
Tab. 7 Results comparison of different data augmentation methods
数据增强方式 | F1 | P | R |
---|---|---|---|
FFT | 0.777 7 | 0.823 7 | 0.736 5 |
移动窗口 | 0.773 0 | 0.811 6 | 0.737 8 |
噪声 | 0.774 3 | 0.815 3 | 0.737 2 |
1 | 王震坡,李晓宇,袁昌贵,等. 大数据下电动汽车动力电池故障诊断技术挑战与发展趋势[J]. 机械工程学报, 2021, 57(14):52-63. 10.3901/jme.2021.14.052 |
WANG Z P, LI X Y, YUAN G C, et al. Challenge and prospects for fault diagnosis of power battery system for electrical vehicles based on big-data[J]. Journal of Mechanical Engineering, 2021, 57(14):52-63. 10.3901/jme.2021.14.052 | |
2 | TULI S, CASALE G, JENNINGS N R. TranAD: deep transformer networks for anomaly detection in multivariate time series data[J]. Proceedings of the VLDB Endowment, 2022, 5(16):1201-1214. |
3 | 毛文涛,施华东,张艳娜,等. 轴承在线早期故障检测的无监督张量深度迁移学习方法[J/OL]. 控制与决策 (2022-11-27) [2023-03-04].. |
MAO W T, SHI H D, ZHANG Y N, et al. Research on unsupervised tensor-based deep transfer learning for online early fault detection of bearing[J/OL]. Control and Decision (2022-11-27) [2023-03-04].. | |
4 | HUNDMAN K, CONSTANTINOU V, LAPORTE C, et al. Detecting spacecraft anomalies using LSTMs and nonparametric dynamic thresholding [C]// Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining. New York: ACM, 2018: 387-395. 10.1145/3219819.3219845 |
5 | ZHOU H, YU K, ZHANG X, et al. Contrastive autoencoder for anomaly detection in multivariate time series[J]. Information Sciences, 2022, 610: 266-280. 10.1016/j.ins.2022.07.179 |
6 | VASWANI A, SHAZEER N, PARMAR N, et al. Attention is all you need [C]// Proceedings of the 31st International Conference on Neural Information Processing Systems. Red Hook, NY: Curran Associates Inc., 2017: 6000-6010. |
7 | CHEN T, KORNBLITH S, NOROUZI M, et al. A simple framework for contrastive learning of visual representations[C]// Proceedings of the 37th International Conference on Machine Learning. New York: JMLR.org, 2020: 1597-1607. |
8 | HU J, SHEN L, SUN G. Squeeze-and-excitation networks[C]// Proceedings of the 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE, 2018: 7132-7141. 10.1109/cvpr.2018.00745 |
9 | LIN S, CLARK R, BIRKE R, et al. Anomaly detection for time series using VAE-LSTM hybrid model [C]// Proceedings of the 2020 IEEE International Conference on Acoustics, Speech, and Signal Processing. Piscataway: IEEE, 2020: 4322-4326. 10.1109/icassp40776.2020.9053558 |
10 | XU H, CHEN W, ZHAO N, et al. Unsupervised anomaly detection via variational auto-encoder for seasonal KPIs in Web applications[C]// Proceedings of the 2018 World Wide Web Conference. Republic and Canton of Geneva: International World Wide Web Conferences Steering Committee, 2018: 187-196. 10.1145/3178876.3185996 |
11 | PARK D, HOSHI Y, KEMP C C. A multimodal anomaly detector for robot-assisted feeding using an LSTM-based variational autoencoder[J]. IEEE Robotics and Automation Letters, 2018, 3(3): 1544-1551. 10.1109/lra.2018.2801475 |
12 | LI D, CHEN D, JIN B, et al. MAD-GAN: multivariate anomaly detection for time series data with generative adversarial networks[C]// Proceedings of the 2019 International Conference on Artificial Neural Networks, LNCS 11730. Cham: Springer, 2019: 703-716. |
13 | SU Y, ZHAO Y, NIU C, et al. Robust anomaly detection for multivariate time series through stochastic recurrent neural network[C]// Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining. New York: ACM, 2019: 2828-2837. 10.1145/3292500.3330672 |
14 | ZHANG C, SONG D, CHEN Y, et al. A deep neural network for unsupervised anomaly detection and diagnosis in multivariate time series data[C]// Proceedings of the 33rd AAAI Conference on Artificial Intelligence. Palo Alto, CA: AAAI Press, 2019: 1409-1416. 10.1609/aaai.v33i01.33011409 |
15 | DENG A, HOOI B. Graph neural network-based anomaly detection in multivariate time series [C]// Proceedings of the 35th AAAI Conference on Artificial Intelligence. Palo Alto, CA: AAAI Press, 2021: 44027-4035. 10.1609/aaai.v35i5.16523 |
16 | ZHAO H, WANG Y, DUAN J, et al. Multivariate time-series anomaly detection via graph attention network [C]// Proceedings of the 2020 IEEE International Conference on Data Mining. Piscataway: IEEE, 2020: 841-850. 10.1109/icdm50108.2020.00093 |
17 | AUDIBERT J, MICHIARDI P, GUYARD F, et al. USAD: unsupervised anomaly detection on multivariate time series[C]// Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining. New York: ACM, 2020: 3395-3404. 10.1145/3394486.3403392 |
18 | WANG X, PI D, ZHANG X, et al. Variational Transformer-based anomaly detection approach for multivariate time series[J]. Measurement, 2022, 191: No.110791. 10.1016/j.measurement.2022.110791 |
19 | ZHOU H, ZHANG S, PENG J, et al. Informer: beyond efficient transformer for long sequence time-series forecasting[C]// Proceedings of the 35th AAAI Conference on Artificial Intelligence. Palo Alto, CA: AAAI Press, 2021: 11106-11115. 10.1609/aaai.v35i12.17325 |
20 | SIFFER A, FOUQUE P A, TERMIER A, et al. Anomaly detection in streams with extreme value theory [C]// Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining. New York: ACM, 2017: 1067-1075. 10.1145/3097983.3098144 |
21 | MATHUR A P, TIPPENHAUER N O. SWaT: a water treatment testbed for research and training on ICS security [C]// Proceedings of the 2016 International Workshop on Cyber-Physical Systems for Smart Water Networks. Piscataway: IEEE, 2016: 31-36. 10.1109/cyswater.2016.7469060 |
22 | AHMED C M, ZHOU J, MATHUR A P. Noise matters: using sensor and process noise fingerprint to detect stealthy cyber attacks and authenticate sensors in CPS[C]// Proceedings of the 34th Annual Computer Security Applications Conference. New York: ACM, 2018: 566-581. 10.1145/3274694.3274748 |
[1] | 赵秦壮, 谭红叶. 基于自适应阈值学习的时序因果推断方法[J]. 《计算机应用》唯一官方网站, 2024, 44(9): 2660-2666. |
[2] | 范黎林, 曹富康, 王琬婷, 杨凯, 宋钊瑜. 基于需求模式自适应匹配的间歇性需求预测方法[J]. 《计算机应用》唯一官方网站, 2024, 44(9): 2747-2755. |
[3] | 陈廷伟, 张嘉诚, 王俊陆. 面向联邦学习的随机验证区块链构建[J]. 《计算机应用》唯一官方网站, 2024, 44(9): 2770-2776. |
[4] | 杨兴耀, 陈羽, 于炯, 张祖莲, 陈嘉颖, 王东晓. 结合自我特征和对比学习的推荐模型[J]. 《计算机应用》唯一官方网站, 2024, 44(9): 2704-2710. |
[5] | 任烈弘, 黄铝文, 田旭, 段飞. 基于DFT的频率敏感双分支Transformer多变量长时间序列预测方法[J]. 《计算机应用》唯一官方网站, 2024, 44(9): 2739-2746. |
[6] | 高鹏淇, 黄鹤鸣, 樊永红. 融合坐标与多头注意力机制的交互语音情感识别[J]. 《计算机应用》唯一官方网站, 2024, 44(8): 2400-2406. |
[7] | 汪才钦, 周渝皓, 张顺香, 王琰慧, 王小龙. 基于语境增强的新能源汽车投诉文本方面-观点对抽取[J]. 《计算机应用》唯一官方网站, 2024, 44(8): 2430-2436. |
[8] | 刘禹含, 吉根林, 张红苹. 基于骨架图与混合注意力的视频行人异常检测方法[J]. 《计算机应用》唯一官方网站, 2024, 44(8): 2551-2557. |
[9] | 陈虹, 齐兵, 金海波, 武聪, 张立昂. 融合1D-CNN与BiGRU的类不平衡流量异常检测[J]. 《计算机应用》唯一官方网站, 2024, 44(8): 2493-2499. |
[10] | 徐松, 张文博, 王一帆. 基于时空信息的轻量视频显著性目标检测网络[J]. 《计算机应用》唯一官方网站, 2024, 44(7): 2192-2199. |
[11] | 晁浩, 封舒琪, 刘永利. 脑电情感识别中多上下文向量优化的卷积递归神经网络[J]. 《计算机应用》唯一官方网站, 2024, 44(7): 2041-2046. |
[12] | 林欣蕊, 王晓菲, 朱焱. 基于局部扩展社区发现的学术异常引用群体检测[J]. 《计算机应用》唯一官方网站, 2024, 44(6): 1855-1861. |
[13] | 徐泽鑫, 杨磊, 李康顺. 较短的长序列时间序列预测模型[J]. 《计算机应用》唯一官方网站, 2024, 44(6): 1824-1831. |
[14] | 蒋小霞, 黄瑞章, 白瑞娜, 任丽娜, 陈艳平. 基于事件表示和对比学习的深度事件聚类方法[J]. 《计算机应用》唯一官方网站, 2024, 44(6): 1734-1742. |
[15] | 王美, 苏雪松, 刘佳, 殷若南, 黄珊. 时频域多尺度交叉注意力融合的时间序列分类方法[J]. 《计算机应用》唯一官方网站, 2024, 44(6): 1842-1847. |
阅读次数 | ||||||
全文 |
|
|||||
摘要 |
|
|||||