Tailings dams, which are primarily utilized for the storage of tailings or industrial waste produced by mining activities, represent significant sources of high potential energy and pose considerable risks.A failure of such a dam could result in immeasurable losses.Consequently, online monitoring of tailings dams is essential for real-time analysis and risk mitigation.This monitoring is critical for promptly assessing the safety status of tailings dams, preventing dam failures, and safeguarding human lives and property. Therefore, anomaly detec-tion in time series data derived from tailings dam monitoring systems is of paramount importance. In response to the frequent occurrence of anomalies within multi-sensor monitoring systems for tailings dams, which severely affect safety assessments, this paper proposes an enhanced TCN-Transformer hybrid anomaly detection model.This model incorporates a temporal convolutional network (TCN) component into the traditional Transformer model, replacing the absolute position encoding mechanism.This approach effectively captures complex long-term dependencies in time series data, thoroughly integrates global temporal information, and enhances the model’s accuracy in anomaly detection.Moreover, the model’s self-attention mechanism has been optimized through the implementation of a branching structure design and the integration of maximum and minimum strategies.This enhancement enables the extraction of spatial features from tailings dam time series data, allowing reconstruction errors and correlation differences to reinforce each other during detection. Consequently, the model’s anomaly detection performance is improved. By employing a self-supervised training paradigm, the model reduces its dependence on large-scale supervised datasets, thereby enhancing its practicality and generalization capabilities.Experimental results demonstrate that the proposed TCN-Trans-former anomaly detection model achieves an average F1 score of 0.9486, marking a significant improvement in detection accuracy and performance over traditional models.This model holds substantial importance for anomaly detection and safety management in the context of tailings dam time series data.
尾矿坝作为矿业活动的重要基础设施,其稳定性监测是确保环境安全与人员生命财产安全的关键环节(王昆等,2018;石勇等,2021;戴剑勇等,2022)。尾矿库溃坝是一种从累积量变到事故质变的复杂过程,是矿山生产中的重大危险源和重大安全责任风险之一(Hui et al,2018)。近年来,随着智能传感器技术的快速发展,通过多维度传感器阵列实现对尾矿坝的全面、实时监测已成为常态。然而,由于受天气变化、电子元件故障和人为操作失误等多种因素的影响,监测数据常常夹杂异常值,严重影响了尾矿坝安全预警系统的有效性和准确性。因此,如何在无监督学习框架下实现多维时序数据中的异常值精准识别是一项关键挑战,也是该领域迫切需要解决的重要问题(Dong et al,2022)。
在实时监测时序数据的异常检测方面,已有学者开展了相关研究。通过采用基于阈值的近邻差值跳跃检测方法(高鹏飞,2019)、基于距离和聚类的无监督学习方法(王鑫磊,2022)、孤立森林算法(易思成等,2022)和引入云模型(Dong et al,2022)等,实现了对尾矿库监测异常值的识别,提升了异常识别的稳健性。此外,也有学者利用箱型图方法(李伟华,2019)和k-Shape聚类方法(何黎等,2023),开展了水库监测数据的异常检测和城市排水管网连续液位数据的异常识别,取得了良好效果。上述研究表明,融合统计理论与机器学习技术是提升尾矿坝监测异常值识别精度的关键方向。
当前,时序异常检测方法主要划分为基于阈值、统计和机器学习3类。基于阈值的方法通常依赖监测点的历史记录进行人工分析,适用性有限,故不再进行深入探讨。统计方法将偏离预设统计模型的数据视为异常,但其有效性建立在数据符合特定分布的前提上,然而,尾矿库监测数据的分布形态往往难以预先界定(Wang et al,2019)。机器学习方法主要包括无监督、有监督和半监督学习(Sarker,2021)。有监督方法需依赖大量标注数据以训练模型,但在尾矿库监测场景中,数据规模庞大,存在人工标注成本高及实施难度大的问题。无监督方法虽然无需标注数据,更易于部署,但当异常样本较多时,其检测性能可能会显著下降。半监督方法包括单类支持向量机(OC-SVM)(Manevitz et al,2001)和支持向量数据描述(SVDD)(Tax et al,2004)等,仅使用正常数据训练即可识别异常,避免了标注需求。尽管如此,目前在尾矿库异常监测数据识别中仍以阈值、统计和无监督方法为主,半监督学习方法的应用相对较少。其原因是异常检测任务本身面临数据极端不平衡,异常形态多样且模糊,以及对标注噪声敏感等挑战,而半监督方法所依赖的平滑性假设(如低密度分离或一致性约束)难以有效捕捉离散、稀疏的异常模式,导致其与实际应用需求之间存在根本性冲突。
在使用Transformer模型进行尾矿坝时序数据异常检测时,传统的绝对位置编码机制在表达序列信息上存在局限性。该机制容易将相似的数据模式错误地映射到不同的时间窗口,忽视了尾矿坝多元传感器时间序列数据的复杂性和动态性。这种不匹配不仅削弱了模型捕捉时间依赖关系的能力,还限制了模型对数据内在结构与变化规律的深入理解,进而影响异常检测的精准度和可靠性(Bai et al,2018)。
通过堆叠多个扩张因果卷积层,时间卷积网络可充分捕获时间序列数据中的长期依赖性。然而,更深层的网络结构在训练过程中易出现梯度消失或爆炸的病态问题,这增加了模型的优化难度,最终导致其表征能力劣化。残差连接是避免网络深度增加时梯度消失的有效解决方案。在TCN组件中,该架构(Bai et al,2018)可表示为
此外,当遇到各种意外事件(如极端天气条件等)时,时间序列中的模式会随着时间发生显著变化。这些产生突变的时间模式异常性判定,主要取决于数据的上下文信息。在Transformer模型的自注意力组件中,查询向量、键向量和值向量的计算是在时间序列数据的单个时间步上执行的。这种计算方法无法利用数据的上下文信息(Li et al,2019a),因此,Transformer模型无法分辨当前观察到的变化点是否是异常或正常时间模式的一部分。本文提出的自回归TCN组件堆叠了多个扩张因果卷积层,使得Transformer模型能够获得长期数据依赖性,同时增强模型的局部敏感性。堆叠多个扩张的因果卷积层通过不同大小的扩张因子为模型捕获不同时间尺度的数据特征。当前时间点的重构是在融合数据所有尺度特征的前提下进行的。TCN组件充分利用了数据的上下文信息,因此能够更好地区分时间序列数据中的变化点和异常点,如图4所示。
使用高斯核函数处理和分析时间序列数据在应对自相关性和季节性方面具有优势。通过计算不同时间点之间的相似度,高斯核能够有效减弱自相关性的影响,并通过比较不同季节的相似度,降低季节性对数据的干扰。本研究引入一个可学习的高斯核函数,用以建模具有相对时间距离的先验分布。借助高斯核的单峰特性,模型能够更专注于相邻时间点的关联。为了增强模型对不同时间序列模式的适应性,本研究为高斯核引入可学习的尺度参数,使其能够灵活处理不同长度的异常片段。此外,序列关联分支通过从原始序列中学习关联,能够自适应地找到最有效的关联结构,实现更精准的异常检测。计算公式(Xu et al,2021)表示为
式中:分别代表自注意力机制中的查询向量、键向量和值向量和可学习的尺度参数。分别为第i层的参数矩阵。
尾矿坝时序数据中异常位置的关联应集中在相邻的时间点上,这些时间点由于具有连续性,所以更可能包含类似的异常模式。占主导地位的正常时间点与整个系列的信息关联,而不限于相邻区域。基于此,使用关联差异来表示每个时间点的先验关联与序列关联距离的量化。形式化为先验关联与系列关联之间的KL散度。KL散度的值越大,表示用一个分布近似另一个分布时引入的信息损失或误差越大。这使得KL散度在度量模型的误差或信息损失方面非常直观。计算公式(Xu et al,2021)表示为
本方法以无监督重建任务为核心,通过最小化重建误差优化模型。该损失函数能够有效驱动多尺度特征关联网络,学习最具代表性的关联模式。为进一步增强正常与异常时间点之间的区分度,本文引入额外的损失项,以增大其依赖特征之间的差异。由于预先设定的关联形式具有基于高斯先验的局部聚焦特性,所加入的对比正则化项能够促使时序关联关注更长时间范围的非相邻区域,从而使得异常表现更显著且易于检测,提升了尾矿坝时序数据异常识别精度。输入序列的损失函数形式化(Xu et al,2021)表示为
如表1所示,将本模型与近年来主流的多变量时间序列异常检测模型进行对比试验,包括LSTM_ADD(Hundman et al,2018)、MAD_GAN(Li et al,2019b)、Omni Anomaly(Su et al,2019)、Anomaly BERT(Jeong et al,2023)、Tran AD(Tuli et al,2022)和Transformer(Xu et al,2021)。具体而言,从综合性能来看,本文提出的方法在全部数据集上均表现出较优的异常检测能力,尤其在JRX数据集上,其准确率和召回率均显著高于其他对比模型。TCN-Transformer在JRX数据集上的F1分数达到95.99%,在GTD数据集上的F1分数达到90.43%,在WWS数据集上的F1分数达到98.18%。如图9所示,本研究模型的性能均高于其他现有模型的性能。此外,绘制了ROC曲线(图10)进行比较。TCN-Transformer在所有5个数据集上具有最高的AUC值。模型在各种预选阈值下的假阳性率和真阳性率上表现良好,进一步验证了模型的可靠性。
BaiS, KolterJ Z, KoltunV,2018.An empirical evaluation of generic convolutional and recurrent networks for sequence modeling[J].arXiv:
[2]
DongK, YangD W, YanJ H,et al,2022.Anomaly identification of monitoring data and safety evaluation method of tailings dam[J].Frontiers in Earth Science,10:1016458.
[3]
HuiS R, CharleboisL, SunC,2018.Real-time monitoring for structural health,public safety,and risk management of mine tailings dams[J].Canadian Journal of Earth Sciences,55(3):221-229.
[4]
HundmanK, ConstantinouV, LaporteC,et al,2018.Detecting spacecraft anomalies using LSTMs and nonparametric dynamic thresholding[C]//Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining.New York:ACM.
[5]
JeongY, YangE, RyuJ H,et al,2023.Anomalybert:self-supervised transformer for time series anomaly detection using data degradation scheme[J].arXiv:
[6]
LiS, JinX, XuanY,et al,2019a.Enhancing the locality and breaking the memory bottleneck of transformer on time series forecasting[J].Advances in Neural Information Processing Systems,32(7):8-14.
[7]
LiD, ChenD C, JinB H,et al,2019b. MAD-GAN: multivaria-te anomaly detection for time series data with generative adversarial networks[C]//Artificial Neural Networks and Machine Learning-ICANN 2019:Text and Time Series.Cham:Springer.
[8]
ManevitzL M, YousefM,2001.One-class SVMs for document classification[J].Journal of Machine Learning Research,2:139-154.
[9]
Sarker I H,2021 Machine learning: algorithms, real-world applications and research directions[J]. SN Computer Science,2(3):160.
[10]
SuY, ZhaoY J, NiuC H,et al,2019.Robust anomaly detection for multivariate time series through stochastic recurrent neural network[C]//Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining.New York:ACM.
[11]
TaxD M J, DuinR P W,2004.Support vector data description[J].Machine Learning,54(1):45-66.
[12]
TuliS, CasaleG, JenningsN R,2022.Tranad:deep transformer networks for anomaly detection in multivariate time series data[J].arXiv:
DaiJianyong, WangWenwen, HuangXiaoqing,2022.Safety assessment of tailings reservoir dam break based on network cloud model[J].Journal of Safety and Environment,22(1):1-7.
[17]
高鹏飞,2019.数据清洗技术在尾矿库监测系统中的应用研究[D].西安:西安工业大学.Gao Pengfei,2019.Research on the application of data cleaning technology in tailings pond monitoring system[D].Xi’an:Xi’an Technological University.
HeLi, ChenLei, JiShasha,et al,2023.Abnormal detection of continuous water level monitoring data based on K-shape clustering[J].China Water & Wastewater,39(11):56-61.
[20]
李伟华,2019.水库健康监测大数据清洗方法研究[D].泰安:山东农业大学. Li Weihua, 2019.Research on cleaning method of big data for reservoir health monitoring[D].Tai’an:Shandong Agricultural University.
RuanShunling, HanSimiao, ZhangNingning,et al,2023.Prediction method of saturation line of tailings dam based on CNN-aGRU fusion model[J].China Safety Science Journal,33():119-127.
ShiYong, ShiXiuzhi, DingWenzhi,2021.Comprehensive safety evaluation of Huangjindong tailing pond based on improved entropy weight method-unascertained measure model[J].Gold Science and Technology,29(1):155-163.
WangKun, YangPeng, Hudson-EdwardsK,et al,2018.Status and development for the prevention and management of tailings dam failure accidents[J].Chinese Journal of Engineering,40(5):526-539.
[27]
王鑫磊,2022.考虑相关性的尾矿库监测时间序列数据清洗方法研究[D].阜新:辽宁工程技术大学.Wang Xinlei,2022.Research on time series data cleaning method for tailings pond monitoring considering correlation[D].Fuxin:Liaoning Technical University.
YiSicheng, KangXiming, WuHao,et al,2022.Outlier diagnosis of tailings dam displacement monitoring data based on IF-CM-LOF[J].Metal Mine,51(11):208-215.