基于改进USAD模型的用电数据时序无监督异常检测
Unsupervised Anomaly Detection in Electricity Consumption Time Series Based on an Improved USAD Model
DOI: 10.12677/mos.2025.149582, PDF,    科研立项经费支持
作者: 孙 慧, 智路平:上海理工大学管理学院,上海
关键词: 异常检测无监督AUC尖峰特征Anomaly Detection Unsupervised AUC Spikes Features
摘要: 异常检测在电力行业具有重要意义。然而,在实际应用中往往会出现正常或异常样本标签不足的情况,导致检测能力下降。因此,本文针对用电数据无监督异常检测中缺乏时间上下文信息及异常样本稀缺的问题,提出了一种基于改进USAD模型的用电数据时序无监督异常检测。在模型训练阶段,首先提取多维时序特征包括小时、星期、月份、年内日序和年内周序,结合正余弦函数进行周期性编码,并构造关键滞后特征lag1、lag24、lag168,捕捉用电序列的短期波动和长期变化。其次,设计五种类型的合成异常样本包括尖峰、趋势、模式断裂、水平偏移、方差变点注入用电序列数据中,使模型学习各类异常样本的特征。在模型检测阶段,基于USAD的检测架构引入了一种EMA平滑下的异常分数组合与自适应阈值设定机制,缓解异常分数中的噪声波动,从而提升模型的泛化性和鲁棒性。实验结果显示该模型AUC达到了83.91%,准确率达到98.14%,Recall值为43.34%,F1值为60.13%,继而在十个数据集上进行泛化性能测试,结果表明该检测方法具有较好的检测异常样本的能力。
Abstract: Anomaly detection plays a vital role in the power industry. However, labeled normal or anomalous samples are often scarce in practice, which degrades detection performance. To address the lack of temporal context information and the scarcity of anomalous samples in unsupervised anomaly detection of electricity consumption data, the author proposed an improved USAD-based unsupervised anomaly detection method for electricity consumption time series. In the training stage, the author first extracted multi-dimensional temporal features—including hour, weekday, month, day of year and week of year—encoded periodicity via sine and cosine transformations, and constructed key lag features (lag 1, lag 24 and lag 168) to capture short-term fluctuations and long-term variations of the consumption series. Next, five types of synthetic anomalies—spike, trend, pattern break, level shift and variance change—were injected into the consumption time series, enabling the model to learn the characteristics of various anomaly types. In the detection stage, the author introduced an EMA smoothing approach for combining anomaly scores and an adaptive threshold-setting mechanism into the USAD detection framework to mitigate noise fluctuations in anomaly scores, thereby improving the model’s generalization ability and robustness. Experimental results show that the model achieves an AUC of 83.91%, an accuracy of 98.14%, a recall of 43.34% and an F1 score of 60.13%. Furthermore, generalization performance tests on ten additional datasets demonstrate that this detection method exhibits strong capability in identifying anomalous samples.
文章引用:孙慧, 智路平. 基于改进USAD模型的用电数据时序无监督异常检测[J]. 建模与仿真, 2025, 14(9): 30-44. https://doi.org/10.12677/mos.2025.149582

参考文献

[1] Hu, T., Guo, Q., Shen, X., Sun, H., Wu, R. and Xi, H. (2019) Utilizing Unlabeled Data to Detect Electricity Fraud in AMI: A Semi-Supervised Deep Learning Approach. IEEE Transactions on Neural Networks and Learning Systems, 30, 3287-3299. [Google Scholar] [CrossRef] [PubMed]
[2] 刘钊瑞, 高云鹏, 郭建波, 等. 基于深度自编码器高斯混合模型的窃电行为检测[J]. 电力系统保护与控制, 2022, 50(18): 83-91.
[3] 庄池杰, 张斌, 胡军, 等. 基于无监督学习的电力用户异常用电模式检测[J]. 中国电机工程学报, 2016, 36(2): 379-387.
[4] Jesmeen, M.Z.H., Murthy, G.R., Hossen, J., et al. (2021) Detecting Abnormal Electricity Usage Using Unsupervised Learning Model in Unlabeled Data. International Journal of Advanced and Applied Sciences, 8, 102-111. [Google Scholar] [CrossRef
[5] Kaleta, J., Dubiński, J., Wojdan, K., et al. (2021) Detection of Anomalous Consumers Based on Smart Meter Data. Journal of Power Technologies, 101, 202-212.
[6] 王建元, 张少锋. 基于线性判别分析和密度峰值聚类的异常用电模式检测[J]. 电力系统自动化, 2022, 46(5): 87-98.
[7] 傅世元, 高欣, 张浩, 等. 基于元学习动态选择集成的电力调度数据异常检测方法[J]. 电网技术, 2022, 46(8): 3248-3261.
[8] 华回春, 邓彬, 刘哲, 等. 基于变分自编码高斯混合模型的发电企业串谋智能预警[J]. 电力系统自动化, 2022, 46(4): 188-196.
[9] Lei, L., Wu, B., Fang, X., Chen, L., Wu, H. and Liu, W. (2023) A Dynamic Anomaly Detection Method of Building Energy Consumption Based on Data Mining Technology. Energy, 263, Article ID: 125575. [Google Scholar] [CrossRef
[10] Almalki, A.J. (2024) Unsupervised Learning with Hybrid Models for Detecting Electricity Theft in Smart Grids. IEEE Access, 12, 187027-187040. [Google Scholar] [CrossRef
[11] Mishra, A.K. and Das, B. (2025) A Novel Density Based Clustering Approach for Electricity Theft Detection. IEEE Transactions on Industry Applications, 61, 5537-5548. [Google Scholar] [CrossRef
[12] Vaswani, A., Shazeer, N., Parmar, N., et al. (2017) Attention Is All You Need. Proceedings of the 31st International Conference on Neural Information Processing Systems, Long Beach, 4-9 December 2017, 6000-6010.