《计算机应用》唯一官方网站 ›› 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]. 《计算机应用》唯一官方网站, 2023, 43(9): 2760-2765. |
[2] | 陆辉, 黄瑞章, 薛菁菁, 任丽娜, 林川. 深度动态文本聚类模型DDDC[J]. 《计算机应用》唯一官方网站, 2023, 43(8): 2370-2375. |
[3] | 祁超帅, 何文思, 焦毅, 马英红, 蔡伟, 任素萍. 无人机飞行数据异常检测算法综述[J]. 《计算机应用》唯一官方网站, 2023, 43(6): 1833-1841. |
[4] | 张奕, 王真梅. 图自动编码器上二阶段融合实现的环状RNA-疾病关联预测[J]. 《计算机应用》唯一官方网站, 2023, 43(6): 1979-1986. |
[5] | 邱莲鹏, 宋承云. 噪声鲁棒的动态时间规整算法[J]. 《计算机应用》唯一官方网站, 2023, 43(6): 1855-1860. |
[6] | 雷景生, 剌凯俊, 杨胜英, 吴怡. 基于上下文语义增强的实体关系联合抽取[J]. 《计算机应用》唯一官方网站, 2023, 43(5): 1438-1444. |
[7] | 许喆, 王志宏, 单存宇, 孙亚茹, 杨莹. 基于重构误差的无监督人脸伪造视频检测[J]. 《计算机应用》唯一官方网站, 2023, 43(5): 1571-1577. |
[8] | 张凯, 覃正楚, 刘月, 秦心怡. 多学习行为协同的知识追踪模型[J]. 《计算机应用》唯一官方网站, 2023, 43(5): 1422-1429. |
[9] | 夏进, 王正群, 朱世明. 基于时间序列分解的交通流量预测模型[J]. 《计算机应用》唯一官方网站, 2023, 43(4): 1129-1135. |
[10] | 高榕, 沈加伟, 邵雄凯, 吴歆韵. 基于Fastformer和自监督对比学习的实例分割算法[J]. 《计算机应用》唯一官方网站, 2023, 43(4): 1062-1070. |
[11] | 尹春勇, 周立文. 基于再编码的无监督时间序列异常检测模型[J]. 《计算机应用》唯一官方网站, 2023, 43(3): 804-811. |
[12] | 陈容均, 严宣辉, 杨超城. 面向时间序列的混合图像化循环胶囊分类网络[J]. 《计算机应用》唯一官方网站, 2023, 43(3): 692-699. |
[13] | 贾晴, 王来花, 王伟胜. 基于独立循环神经网络与变分自编码网络的视频帧异常检测[J]. 《计算机应用》唯一官方网站, 2023, 43(2): 507-513. |
[14] | 孟玉飞, 武优西, 王珍, 李艳. 对比保序模式挖掘算法[J]. 《计算机应用》唯一官方网站, 2023, 43(12): 3740-3746. |
[15] | 党伟超, 程炳阳, 高改梅, 刘春霞. 基于对比超图转换器的会话推荐[J]. 《计算机应用》唯一官方网站, 2023, 43(12): 3683-3688. |
阅读次数 | ||||||
全文 |
|
|||||
摘要 |
|
|||||