Zhang Yituo, Wang Jihong, Li Chaolin, Duan Hengpan, Wang Wenhui
School of Ecology and Environment, Harbin Institute of Technology, Shenzhen, 518055, China.
School of Ecology and Environment, Harbin Institute of Technology, Shenzhen, 518055, China; State Key Laboratory of Urban Water Resource and Environment, Harbin Institute of Technology, Harbin, 150090, China.
Water Res. 2025 May 1;275:123192. doi: 10.1016/j.watres.2025.123192. Epub 2025 Jan 23.
Quickly grasping the time-consuming water quality indicators (WQIs) such as total nitrogen (TN) and total phosphorus (TP) of influent is an essential prerequisite for wastewater treatment plants (WWTPs) to prompt respond to sudden shock loads. Soft detection methods based on machine learning models, especially deep learning models, perform well in predicting the normal fluctuations of these time-consuming WQIs but hardly predict their sudden fluctuations mainly due to the lack of extreme fluctuation data for model training. This work employs attention mechanisms to aid deep learning models in learning patterns of anomalous water quality. The lack of interpretability has always hindered deep learning models from optimizing for different application scenarios. Therefore, the local and global sensitivity analyses are performed based on the best-performing attention-based deep learning and ordinary machine learning models, respectively, allowing for reliable feature importance quantification with a small computational burden. In the case study, three types of attention-based deep learning models were developed, including attention-based multilayer perceptron (A-MLP), Transformer composed of stacked A-MLP encoder and A-MLP decoder, and feature-temporal attention-based long short-term memory (FTA-LSTM) neural network with encoder-decoder architecture. These developed attention-based deep learning models consistently outperform the corresponding baseline models in predicting the testing set of TN, TP, and chemical oxygen demand (COD) time series and the anomalous values therein, clearly demonstrating the positive effect of the integrated attention mechanism. Among them, the prediction performance of FTA-LSTM outperforms A-MLP and Transformer (2.01-38.48 % higher R, 0-85.14 % higher F1-score, 0-62.57 % higher F2-score). Predicting anomalous water quality using attention-based deep learning models is a novel attempt that drives the WWTPs' operation towards being safer, cleaner, and more cost-efficient.
快速掌握进水的总氮(TN)和总磷(TP)等耗时水质指标(WQIs)是污水处理厂(WWTPs)快速应对突发冲击负荷的重要前提。基于机器学习模型,尤其是深度学习模型的软检测方法,在预测这些耗时WQIs的正常波动方面表现良好,但由于缺乏用于模型训练的极端波动数据,很难预测其突然波动。这项工作采用注意力机制来帮助深度学习模型学习异常水质的模式。缺乏可解释性一直阻碍着深度学习模型针对不同应用场景进行优化。因此,分别基于性能最佳的基于注意力的深度学习模型和普通机器学习模型进行局部和全局敏感性分析,从而在计算负担较小的情况下实现可靠的特征重要性量化。在案例研究中,开发了三种基于注意力的深度学习模型,包括基于注意力的多层感知器(A-MLP)、由堆叠的A-MLP编码器和A-MLP解码器组成的Transformer,以及具有编码器-解码器架构的基于特征-时间注意力的长短期记忆(FTA-LSTM)神经网络。这些开发的基于注意力的深度学习模型在预测TN、TP和化学需氧量(COD)时间序列的测试集及其异常值方面始终优于相应的基线模型,清楚地证明了集成注意力机制的积极效果。其中,FTA-LSTM的预测性能优于A-MLP和Transformer(R值高2.01-38.48%,F1分数高0-85.14%,F2分数高0-62.57%)。使用基于注意力的深度学习模型预测异常水质是一种新颖的尝试,它推动污水处理厂的运营朝着更安全、更清洁和更具成本效益的方向发展。