A hybrid FE–TCN–transformer framework for water quality prediction in a large urban river system

Lei Huang , Zhihao Wang , Qiannan Duan , Zenghui Li , Fan Liu , Zihao Li , Chen Ma , Xiaowei Lu , Gang Wang , Peng Wang , Ming Chen

ENG. Environ. ›› 2027, Vol. 21 ›› Issue (2) : 25

PDF (22329KB)
ENG. Environ. ›› 2027, Vol. 21 ›› Issue (2) :25 DOI: 10.1007/s11783-027-2325-y
RESEARCH ARTICLE
A hybrid FE–TCN–transformer framework for water quality prediction in a large urban river system
Author information +
History +
PDF (22329KB)

Abstract

High-frequency online water quality monitoring in large urban river systems is critical for fine-scale pollution control, early warning, and intelligent watershed management. However, non-stationary background variation and short-term fluctuations make reliable forecasting difficult. We developed a hybrid Fourier–EMA (FE)–TCN–Transformer framework to separate and model these dynamics. The FE module extracts multi-scale trend and seasonal background components through strictly forward feature engineering, while the TCN–Transformer captures short-term residual dynamics through local convolution and self-attention. Using the Huangpu River as a representative case, we constructed 20 forecasting tasks from high-frequency observations collected at four national monitoring sections during 2020–2024. The model produced single-step, 4-h-ahead forecasts for TN, TP, NH3-N, CODMn, and DO. Under identical chronological data splits and evaluation procedures, the framework achieved the highest NSE and lowest RMSE in all 20 tasks among seven external baselines and three internal variants. Its mean NSE and RMSE were 0.839 and 0.181 mg/L, respectively, compared with 0.570 and 0.372 mg/L for PatchTST, the strongest external baseline by mean NSE. Relative to the internal Transformer baseline, mean NSE increased from 0.613 to 0.839 and mean RMSE decreased from 0.307 to 0.181 mg/L. These results show consistent performance across the evaluated sites and indicators. Integration into a prototype platform further demonstrated compatibility with continuous monitoring pipelines and fixed-cycle inference using pretrained parameters, supporting operational high-frequency water quality forecasting.

Graphical abstract

Keywords

Environmental monitoring / Water quality prediction / Deep learning / Feature engineering / TCN-Transformer

Highlight

● Efficient hybrid FE–TCN–Transformer reaches NSE 0.839 and cuts RMSE by 41%.

● Forward Fourier–EMA extracts multi-scale features without future leakage.

● Multi-source environmental inputs enable multi-indicator water quality forecasts.

● An intelligent early-warning platform supports smart river management.

Cite this article

Download citation ▾
Lei Huang, Zhihao Wang, Qiannan Duan, Zenghui Li, Fan Liu, Zihao Li, Chen Ma, Xiaowei Lu, Gang Wang, Peng Wang, Ming Chen. A hybrid FE–TCN–transformer framework for water quality prediction in a large urban river system. ENG. Environ., 2027, 21 (2) : 25 DOI:10.1007/s11783-027-2325-y

登录浏览全文

4963

注册一个新账户 忘记密码

References

[1]

Bakhtavar E , Hosseini S , Mian H R , Hewage K , Sadiq R . (2025). Robust prediction of water arsenic levels downstream of gold mines affected by acid mine drainage using hybrid ensemble machine learning and soft computing. Journal of Hazardous Materials, 489: 137665

[2]

Barzegar R , Aalami M T , Adamowski J . (2020). Short-term water quality variable prediction using a hybrid CNN–LSTM deep learning model. Stochastic Environmental Research and Risk Assessment, 34(2): 415–433

[3]

Bowes M J , Jarvie H P , Halliday S J , Skeffington R A , Wade A J , Loewenthal M , Gozzard E , Newman J R , Palmer-Felgate E J . (2015). Characterising phosphorus and nitrate inputs to a rural river using high-frequency concentration–flow relationships. Science of the Total Environment, 511: 608–620

[4]

Box G E P, Jenkins G M, Reinsel G C (2008). Time Series Analysis: Forecasting and Control. 4th ed. Hoboken: Wiley

[5]

Chen L B , Yang Z F , Liu H F . (2016). Assessing the eutrophication risk of the Danjiangkou Reservoir based on the EFDC model. Ecological Engineering, 96: 117–127

[6]

Chen X D , Zhao C Y , Chen J Y , Jiang H , Li D , Zhang J , Han B , Chen S S , Wang C Y . (2025). Water quality parameters-based prediction of dissolved oxygen in estuaries using advanced explainable ensemble machine learning. Journal of Environ-mental Management, 380: 125146

[7]

De Livera A M , Hyndman R J , Snyder R D . (2011). Forecasting time series with complex seasonal patterns using exponential smoothing. Journal of the American Statistical Association, 106(496): 1513–1527

[8]

Del Castillo A F , Garibay M V , Díaz-Vázquez D , Yebra-Montes C , Brown L E , Johnson A , Garcia-Gonzalez A , Gradilla-Hernández M S . (2024). Improving river water quality prediction with hybrid machine learning and temporal analysis. Ecological Informatics, 82: 102655

[9]

Demšar J . (2006). Statistical comparisons of classifiers over multiple data sets. The Journal of Machine Learning Research, 7: 1–30

[10]

Diamantini E , Lutz S R , Mallucci S , Majone B , Merz R , Bellin A . (2018). Driver detection of water quality trends in three large European river basins. Science of the Total Environment, 612: 49–62

[11]

Fang S B , Deitch M J , Gebremicael T G , Angelini C , Ortals C J . (2024). Identifying critical source areas of non-point source pollution to enhance water quality: Integrated SWAT modeling and multi-variable statistical analysis to reveal key variables and thresholds. Water Research, 253: 121286

[12]

Fang Y , Huang R T , Zhang Y Y , Zhang J , Xi W N , Shi X Y . (2025). Utilizing machine learning models to grasp water quality dynamic changes in lake eutrophication through phytoplankton parameters. Frontiers of Environmental Science & Engineering, 19(2): 14

[13]

Gardner E S . (2006). Exponential smoothing: The state of the art—Part II. International Journal of Forecasting, 22(4): 637–666

[14]

Gómez J A , Patiño J E , Duque J C , Passos S . (2019). Spatiotemporal modeling of urban growth using machine learning. Remote Sensing, 12(1): 109

[15]

Hampel F R . (1974). The influence curve and its role in robust estimation. Journal of the American Statistical Association, 69(346): 383–393

[16]

Han F , Tian Q , Chen N W , Hu Z P , Wang Y , Xiong R , Xu P , Liu W , Stehr A , Barra R O . et al. (2024). Assessing ammonium pollution and mitigation measures through a modified watershed non-point source model. Water Research, 254: 121372

[17]

He M Q , Yu G , Yang C , Han L . (2023). Dynamic soft sensor modeling of matte grade in copper oxygen-rich side blow bath smelting process. Measurement, 223: 113792

[18]

Hou C L , Wang W M , Li Y S , Wang X Y , Zhang H , Hu Z T . (2024). A predicting method for the mechanical property response of the marine riser based on the simulation and data-driven models. Ocean Engineering, 293: 116612

[19]

Hu J Z , Li Y , Jiang D W , Zhang D R , Lu C H , Zhi W . (2026). Multiscale decomposition and fuzzy-rule attention: a transferable cross-basin framework for long-term water quality forecasting. Water Research, 295: 125593

[20]

Hu T H , Chen S L , Zhong X J , Sang W X , Li P . (2025). Sea-level rise, ENSO, and coastal flood exposure in Hainan Island: Insights from Delft3D modeling for urban adaptation. Journal of Hydrology: Regional Studies, 62: 102871

[21]

Huang B , Qi H Q , Zhou S F , Liu S Q , Chen L J , Wu J X , Xu H H , Zhou Z T , Shen Y T . (2025). Spatial and temporal variations and driving factors of surface water quality of tidal river network areas in estuarine megacity: a case study of Shanghai. Water, Air, & Soil Pollution, 236(11): 733

[22]

Islam M S , Yin H L , Rahman M . (2024). Long-term trend prediction of surface water quality of two main river basins of China using Machine Learning Method. Procedia Computer Science, 236: 257–264

[23]

Jia Y B , Su X L , Zhang T , Wu H J , Jia Y Y , Wang Q Y . (2026). Enhancing streamflow forecasting using an LSTM hybrid model with lightweight frequency-domain feature learning. Expert Systems with Applications, 297: 129418

[24]

Kang T , Yu N , Shin M , Na K , Lim K J , Kim J . (2024). Design of non-structural practices for sustainable water quality improvement in an Urban River: a case study of South Korea. Sustainability, 16: 2298

[25]

Kirchner J W , Feng X H , Neal C , Robson A J . (2004). The fine structure of water-quality dynamics: the (high-frequency) wave of the future. Hydrological Processes, 18(7): 1353–1359

[26]

Li Y , Mi W J , Ji L , He Q S , Yang P H , Xie S L , Bi Y H . (2023). Urbanization and agriculture intensification jointly enlarge the spatial inequality of river water quality. Science of the Total Environment, 878: 162559

[27]

Li Y T , Li R Y . (2023). Predicting ammonia nitrogen in surface water by a new attention-based deep learning hybrid model. Environmental Research, 216: 114723

[28]

Li Z H , Li X P , Wang Z H , Li Z H , Wang P , Ren F T , Duan Q N , Lu X W , Huang L . (2025). Dual-model LSTM-Transformer framework with hydrodynamic adaptability for TN/TP predictions in tidal reaches. Journal of Hydrology, 663: 134231

[29]

Lu Q O , Chang W H , Chu H J , Lee C C . (2024). Enhancing indoor PM2.5 predictions based on land use and indoor environmental factors by applying machine learning and spatial modeling approaches. Environmental Pollution, 363: 125093

[30]

Lundberg S, Lee S I (2017). A unified approach to interpreting model predictions. In: Proceedings of the 31st International Conference on Neural Information Processing Systems. Long Beach: Curran Associates Inc., 4768–4777

[31]

Mai W , Chen Z G , Li X Y , Yi X H , Zhao Y Z , He X Z , Xu X , Huang M Z . (2024). Online soft measurement for wastewater treatment system based on hybrid deep learning. Frontiers of Environmental Science & Engineering, 18(2): 20

[32]

Nearing G , Cohen D , Dube V , Gauch M , Gilon O , Harrigan S , Hassidim A , Klotz D , Kratzert F , Metzger A . et al. (2024). Global prediction of extreme floods in ungauged watersheds. Nature, 627(8004): 559–563

[33]

Pham H T H , Bui L T . (2023). Mechanism of erosion zone formation based on hydrodynamic factor analysis in the Mekong Delta coast, Vietnam. Environmental Technology & Innovation, 30: 103094

[34]

Rode M , Halbedel Née Angelstein S , Anis M R , Borchardt D , Weitere M . (2016). Continuous in-stream assimilatory nitrate uptake from high-frequency sensor measurements. Environ-mental Science & Technology, 50(11): 5685–5694

[35]

Seitzinger S , Harrison J A , Böhlke J K , Bouwman A F , Lowrance R , Peterson B , Tobias C , Drecht G V . (2006). Denitrification across landscapes and waterscapes: a synthesis. Ecological Applications, 16(6): 2064–2090

[36]

Shi J H , Ni L X , Liu J M , Chen H , Ma Y S , Zhang Y , Lin Q W , Zhang Z , Xu H , Li Y P . (2025). Water quality prediction at large-Scale: Systematic assessment of decomposition-deep learning models. Journal of Cleaner Production, 519: 145995

[37]

Sun M Z , Xu C Q , Jia Q M , Jia H F . (2026). Aquaformer: Multi-source transfer learning model based on Transformer and phase space reconstruction for long sequence water quality forecasting. Journal of Hydrology, 664: 134372

[38]

Sun X Y , Yan D Y , Wu S S , Chen Y J , Qi J , Du Z H . (2024). Enhanced forecasting of chlorophyll-a concentration in coastal waters through integration of Fourier analysis and Transformer networks. Water Research, 263: 122160

[39]

Tiyasha T M , Tung Z M . (2020). A survey on river water quality modelling using artificial intelligence models: 2000–2020. Journal of Hydrology, 585: 124670

[40]

Wang H , Qin H , Liu G J , Huang S Z , Qu Y H , Qi X L , Zhang Y C . (2024a). Hierarchical attention network for short-term runoff forecasting. Journal of Hydrology, 638: 131549

[41]

Wang K F , Liu L , Ben X , Jin D J , Zhu Y , Wang F E . (2024b). Hybrid deep learning based prediction for water quality of plain watershed. Environmental Research, 262: 119911

[42]

Wang Q L , Li Z J , Cai J N , Zhang M S , Liu Z D , Xu Y , Li R R . (2023a). Spatially adaptive machine learning models for predicting water quality in Hong Kong. Journal of Hydrology, 622: 129649

[43]

Wang X , Dong Y , Yang J , Liu Z P , Lu J S . (2024c). A benchmark-based method for evaluating hyperparameter optimization techniques of neural networks for surface water quality prediction. Frontiers of Environmental Science & Engineering, 18(5): 54

[44]

Wang X Y , Yang Y Q , Wan J , Chen Z , Wang N , Guo Y Q , Wang Y G . (2023b). Water quality variation and driving factors quanti-tatively evaluation of urban lakes during quick socioeconomic development. Journal of Environmental Management, 344: 118615

[45]

Wang Z C , Wang Q Y , Liu Z X , Wu T H . (2024d). A deep learning interpretable model for river dissolved oxygen multi-step and interval prediction based on multi-source data fusion. Journal of Hydrology, 629: 130637

[46]

Wu D S , Cao M , Gao W , Cheng G W , Duan Z Z , Hou X K , Zhang Y . (2024). Spatial-temporal source apportionment of nitrogen and phosphorus in a high-flow variable river. Journal of Hydrology: Regional Studies, 53: 101839

[47]

Xie L Z , Zhao Y X , Fang P , Cheng M L , Chen Z , Wang Y G . (2025). A novel operational water quality mobile prediction system with LSTM-Seq2Seq model. Environmental Modelling & Software, 185: 106290

[48]

Xu R , Hu S R , Wan H , Xie Y L , Cai Y P , Wen J H . (2024). A unified deep learning framework for water quality prediction based on time-frequency feature extraction and data feature enhancement. Journal of Environmental Management, 351: 119894

[49]

Xue B L , Zhang H W , Wang Y T , Tan Z X , Zhu Y , Shrestha S . (2021). Modeling water quantity and quality for a typical agricultural plain basin of northern China by a coupled model. Science of the Total Environment, 790: 148139

[50]

Yang H J , Shen Z M , Zhang J P , Wang W H . (2007). Water quality characteristics along the course of the Huangpu River (China). Journal of Environmental Sciences, 19(10): 1193–1198

[51]

Yao D Z , Chen S , Dong S N , Qin J W . (2024a). Modeling abrupt changes in mine water inflow trends: a CEEMDAN-based multi-model prediction approach. Journal of Cleaner Production, 439: 140809

[52]

Yao J F , Chen S , Ruan X H . (2024b). Interpretable CEEMDAN-FE-LSTM-transformer hybrid model for predicting total phosphorus concentrations in surface water. Journal of Hydrology, 629: 130609

[53]

Yoon S , Shin J , Park N S , Kweon M , Kim Y . (2024). A study on a hybrid water quality prediction model using sequence to sequence learning based LSTM And machine learning. Desalination and Water Treatment, 320: 100895

[54]

Yu J W , Kim J S , Li X , Jong Y C , Kim K H , Ryang G I . (2022). Water quality forecasting based on data decomposition, fuzzy clustering and deep learning neural network. Environmental Pollution, 303: 119136

[55]

Yuan X M , Wang T Z , Tian F C , Wang X J . (2025). A novel hybrid SCS-LSTM model for intelligent flood forecasting in data-scarce small mountainous catchments. Journal of Hydrology: Regional Studies, 61: 102611

[56]

Zhang Y Y , Wu J , Gao Y , Wang G S , Wang J , Wen X F . (2025). Estimation of organic carbon source composition and riverine outflow using an integrated watershed hydrological–carbon modelling approach. Water Research, 280: 123545

[57]

Zheng X W , Chen K P , Luo B W , Wu J C , Chen H L , Xiang L . (2025a). A soil erosion-based framework for assessing mercury nonpoint pollution in mining watersheds. Journal of Hydrology, 663: 134309

[58]

Zheng Y , Wei J , Zhang W M , Zhang Y P , Zhang T Q , Zhou Y C . (2024a). An ensemble model for accurate prediction of key water quality parameters in river based on deep learning methods. Journal of Environmental Management, 366: 121932

[59]

Zheng Y , Zhang Q , Zhang X R , Zhou Y C , Zhang Y P , Zhang T Q . (2025b). A spatial-temporal trend-aware neural network model for accurate water quality prediction in river. Water Research, 287: 124389

[60]

Zheng Z Q , Ding H , Weng Z , Wang L X . (2024b). Research on out-of-sample prediction method of water quality parameters based on dual-attention mechanism. Environmental Modelling & Software, 176: 106020

[61]

Zhi W , Appling A P , Golden H E , Podgorski J , Li L . (2024). Deep learning for water quality. Nature Water, 2(3): 228–241

Rights & permissions

Higher Education Press 2027

PDF (22329KB)

Supplementary files

Supplementary materials

0

Accesses

0

Citation

Detail

Sections
Recommended

/

〈 〉