Next Article in Journal
Assessment of AquaCrop Inputs from ERA5-Land and Sentinel-2 for Soil Water Content Estimation and Durum Wheat Yield Prediction: A Case Study in a Tunisian Field
Previous Article in Journal
A Theoretical Model for Pipe Roof Support in Shallow Buried Tunnels Considering Changes in Water Content
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Enhancing Surface Water Quality Parameter Prediction Using Deep Learning and Feature Augmentation Methods

1
School of Computer Science, Zhuhai College of Science and Technology, Zhuhai 519041, China
2
Department of Industrial Electronics, School of Engineering, University of Minho, 4704-553 Braga, Portugal
3
School of Life Sciences, Zhuhai College of Science and Technology, Zhuhai 519041, China
*
Author to whom correspondence should be addressed.
Water 2025, 17(24), 3523; https://doi.org/10.3390/w17243523
Submission received: 1 November 2025 / Revised: 30 November 2025 / Accepted: 10 December 2025 / Published: 12 December 2025

Abstract

Water quality monitoring is crucial for public health and environmental protection, but traditional methods lack real-time accuracy. This study addresses this gap by combining feature augmentation methods (e.g., sliding window) with Principal Component Analysis (PCA) and a tailored Two-Layer Regularized Gated Recurrent Unit (TLR-GRU) model for efficient water quality prediction. Results demonstrate that the proposed framework significantly improves prediction accuracy, with R2 increased by 7.78%, RMSE decreased by 27.36%, MAE by 36.71%, and MAPE by 45.08%. This approach offers a novel technical pathway for real-time environmental monitoring and water resource management.

1. Introduction

Water quality monitoring is a critical practice for safeguarding public health, protecting the environment, and ensuring sustainable water resource management. Globally, water pollution is an escalating concern, and the deterioration of water quality poses serious threats to ecosystem stability and human well-being [1]. Real-time and accurate monitoring and prediction of water quality are therefore essential. Effective monitoring systems not only facilitate the timely detection of and response to contamination events but also supply scientific data to support water resource management and policy-making [2]. With increasing industrialization and climate change impacts worldwide, the significance of robust water quality monitoring continues to grow [3].
In recent years, water quality prediction has emerged as a vital research focus, with growing emphasis on leveraging advanced computational approaches particularly deep learning to enhance predictive accuracy and operational efficiency. For instance, Lee et al. utilized Long Short-Term Memory (LSTM) models to improve early warnings for harmful algal blooms in major South Korean rivers [4]. Similarly, Liu et al. demonstrated the feasibility of LSTM-based deep neural networks for water quality prediction in IoT contexts, stressing the importance of high-quality input data [5]. Hu et al. introduced a deep LSTM approach to predict pH and temperature in smart mariculture, overcoming limitations of traditional forecasting techniques [6]. Other studies have explored soft sensing of 5-day biochemical oxygen demand (BOD) in urban waters using deep learning [7], compared multiple machine learning models for surface water quality prediction using large datasets [8], and developed real-time probabilistic forecasting frameworks combining deep learning with post-processing [9]. Hybrid architectures, such as CNN-LSTM models, have also shown promise for short-term water quality forecasting [10], while AI-driven index prediction and classification aid water management decisions. Beyond water quality, deep reinforcement learning has been applied in related areas such as agricultural yield prediction [11], and comparative analyzes confirm the superiority of deep learning over conventional machine learning in groundwater quality prediction [12]. Collectively, these studies underscore the potential of deep learning in this domain.
However, existing research has two key limitations: (1) a predominant focus on individual model architectures without systematic integration of feature augmentation strategies, leading to suboptimal handling of temporal dependencies; and (2) limited attention to computational efficiency and data redundancy reduction in high-dimensional water quality datasets. These gaps restrict the practical deployment of real-time prediction systems.
Conventional water quality monitoring typically depends on field sampling and subsequent laboratory analysis. Although accurate, these approaches are time-consuming, labor-intensive, and inadequate for real-time monitoring requirements [13]. Recent advances in sensor technologies and information systems have promoted the adoption of online monitoring and automated data acquisition [14]. Nevertheless, challenges such as data instability and limited spatial coverage persist.
In terms of prediction, classical statistical techniques—including regression analysis and time series models—are frequently applied to water quality data, yet they often struggle to capture complex nonlinear dynamics [15]. The emergence of artificial intelligence and machine learning has opened new avenues for improving predictive performance. Methods such as Support Vector Machines (SVMs), Random Forests (RF), and Artificial Neural Networks (ANNs) have demonstrated improved results [16]. However, these techniques generally depend on multi-dimensional datasets, which can be difficult to obtain; they often entail considerable model complexity, extended training times, and limited prediction accuracy [17].
To address these challenges, this study introduces a novel framework that combines multiple feature augmentation techniques with Principal Component Analysis (PCA) and a tailored deep learning model for efficient water quality parameter prediction, as illustrated in Figure 1 [18]. The TLR-GRU model was selected for its superior ability to handle long-term dependencies with lower computational complexity than LSTM, while integrated dropout and batch normalization layers mitigate overfitting. We expect the proposed framework to improve predictive accuracy significantly, with preliminary analyses indicating potential gains of over 5% in R2 and 30% reduction in MAPE.
The key innovations are:
  • Systematic integration of five feature augmentation methods (time-based, periodic, differenced, lagged, and sliding-window) with PCA for dimensionality reduction, enhancing temporal pattern capture while reducing redundancy.
  • Development of a Two-Layer Regularized GRU (TLR-GRU) model optimized for water quality time series data, balancing computational efficiency and generalization performance.
  • Comprehensive evaluation of feature augmentation and model configurations, validating accuracy improvements and operational cost reductions through multi-fidelity validation.
By integrating these components, this work provides a new technical pathway for water quality parameter prediction and offers scientific support for environmental monitoring. The results demonstrate that the proposed methodology enhances predictive performance while maintaining practical viability, underscoring its theoretical and practical relevance.

2. Materials and Methods

2.1. Dataset

The water quality dataset utilized in this study was systematically collected from China’s National Surface Water Quality Automatic Monitoring Real-Time Data Release System from January 2020 to December 2023. The dataset encompasses comprehensive monitoring records with a precisely controlled 4 h sampling frequency across 5 strategically distributed monitoring stations. This longitudinal sampling strategy resulted in a substantial dataset of 25,000 samples, providing robust statistical power for analysis.
The monitored parameters include temperature (Temp), pH, dissolved oxygen (DO), permanganate index (CODMn), ammonia nitrogen (NH3-N), total phosphorus (TP), total nitrogen (TN), conductivity (Cond), and turbidity (Turb). These parameters provide comprehensive characterization of the physical, chemical, and biological properties of water bodies, serving as critical indicators for water quality assessment [19]. The summary statistics of water quality parameters is shown in Table 1.
Data quality assurance was implemented through a rigorous multi-stage preprocessing pipeline. Missing values were systematically detected using threshold-based methods, with records containing more than 20% missing data automatically removed to ensure data integrity. The remaining missing values were meticulously addressed using linear interpolation, which preserves temporal continuity while minimizing artificial bias. Anomalous values were identified through statistical outlier detection methods and appropriately handled through deletion strategies. To mitigate potential scale effects and ensure numerical stability during model training, all parameters were normalized to the [0, 1] range using MinMaxScaler. These comprehensive preprocessing procedures guaranteed data reliability and consistency for subsequent feature engineering and model training processes [20].

2.2. Feature Augmentation

Feature augmentation enhances the feature space by generating derived variables, thereby improving the predictive performance and robustness of machine learning models [21]. In water quality prediction, feature augmentation helps capture complex temporal dependencies, periodic patterns, and nonlinear relationships, ultimately enhancing model accuracy [22]. This study systematically evaluates five feature augmentation techniques: differenced features, sliding window features, lag features, time-related features, and periodic features.

2.2.1. Differenced Features

Differenced features capture temporal variations by computing differences between current values and previous observations. This approach helps eliminate trends and seasonal components while enhancing sensitivity to short-term fluctuations [23]. For each water quality parameter “X”, differences were calculated at lags of 1, 6, 42, and 180 time steps:
X diff _ n = X t − X t − n
where “n” represents the lag interval. This method effectively highlights short-term variations and anomalous patterns in the data.

2.2.2. Sliding Window Features

Sliding window features capture the local change trends of data by calculating statistical measures (such as mean and standard deviation) within a moving window [24]. The sliding window provides statistical information over specific time intervals, helping the model better understand the local dynamic changes in the data [25]. Select the size of the sliding window, such as 1 h, 3 h, 6 h, 12 h, and 24 h. For each water quality parameter X, we compute the mean and standard deviation within the sliding window:
X r o l l i n g _ m e a n _ w i n d o w = m e a n ( X t − w i n d o w + 1 , . . . , X t )
X r o l l i n g _ s t d _ w i n d o w = s t d ( X t − w i n d o w + 1 , . . . , X t )
The advantage of this method is that it provides dynamic change information over different time periods, helping the model capture the local trends and fluctuation characteristics of the data [26].

2.2.3. Lag Features

Lag features incorporate historical observations as predictor variables, enabling the model to capture temporal dependencies. Both short-term and long-term relationships can be revealed through appropriate lag selection [27]. Lags of 1, 3, 6, 12, and 24 time steps were used:
X lag _ n = X t − n
This method effectively preserves temporal dependencies and trend information, facilitating better modeling of time series patterns [28].

2.2.4. Time-Related Features

Time-related features extract temporal information from timestamps to capture periodic and seasonal patterns. These features help model diurnal, weekly, and annual cycles in water quality parameters [29]. The following features were extracted: year, month, day, hour, minute, and day of the week:
{ Year , Month , Day , Hour , Minute , Weekday }
For example, the hour feature is extracted as:
Hour = timestamp . hour
These features enhance the model’s ability to identify temporal patterns and seasonal variations [30].

2.2.5. Periodic Features

Periodic features transform temporal variables into cyclic representations using trigonometric functions, effectively capturing recurring patterns. This transformation ensures continuity at period boundaries, improving modeling of cyclical phenomena [31]. Sine and cosine transformations were applied to hour, weekday, and month features:
T sin = sin 2 π T P , T cos = cos 2 π T P
where “P” denotes the period (24 for hour, 7 for weekday, 12 for month). This approach enhances the model’s capacity to recognize cyclical patterns in water quality data [32].

2.3. Principal Component Analysis

Principal Component Analysis (PCA) was employed for dimensionality reduction and feature extraction. PCA projects the original data onto orthogonal principal components, retaining maximal variance while reducing redundancy [33]. This improves computational efficiency and model stability in water quality prediction tasks [34].
The PCA procedure involved: (1) standardizing the augmented feature set to zero mean and unit variance; (2) computing the covariance matrix; (3) performing eigenvalue decomposition to obtain eigenvectors and eigenvalues; (4) selecting principal components capturing 95% cumulative variance; and (5) projecting the original data onto the selected components. This process reduced the feature dimensionality from 90 to 30 principal components, achieving a 67% reduction while preserving 95% of the original variance. This yielded a reduced-dimensionality dataset preserving essential information while minimizing redundancy [35]. The retained components were validated to ensure they effectively represented the original feature space [36].

2.4. Prediction Models

This study evaluates seven deep learning architectures for water quality prediction, categorized into recurrent networks, attention mechanisms, and convolutional approaches. The comprehensive model specifications are summarized in Table 2.

2.4.1. Two-Layer Regularized GRU (TLR-GRU)

The TLR-GRU architecture, as illustrated in Figure 2, employs a sophisticated gated recurrent unit design with comprehensive regularization. The model consists of two GRU layers (128 units each) with sequential processing through batch normalization and dropout (30%) after each recurrent layer. A dense layer with 64 ReLU-activated units processes the temporal features before final regression output. This architecture effectively balances model capacity with regularization strategies, ensuring robust temporal pattern capture while maintaining generalization performance.

2.4.2. Comparative Model Architectures

The remaining six models implement distinct architectural paradigms for temporal data processing. Recurrent-based approaches include: TLD-LSTM (two-layer LSTM with 64 units and 20% dropout), DeepAR (probabilistic forecasting with distributional outputs), and Bi-TLD-LSTM (bidirectional processing with 64 units per layer). Attention mechanisms are represented by TLD-Transformer, employing two multi-head attention layers (4 heads each) with layer normalization. Convolutional architectures comprise WaveNet, using dilated causal convolutions with 8 residual blocks, and a standard CNN with two 1D convolutional layers (64 → 128 filters).
All models were trained using consistent experimental protocols: Adam optimization (learning rate 0.0001, except DeepAR at 0.001), batch size 32, and early stopping (patience = 20) based on validation loss. The dataset was temporally split (70% training, 15% validation, 15% testing) with comprehensive resource monitoring during training.

2.5. Performance Evaluation

Model performance was assessed using multiple metrics to comprehensively evaluate prediction accuracy and error characteristics as shown in Table 3:
Among all the above formulas, the y i represents the i-th observed value, the y ^ i represents the i-th predicted value, and the y ¯ represents the mean of the observed values.
Computational efficiency was evaluated by monitoring training duration (seconds), memory utilization (GB), CPU usage (%), and GPU consumption (%) at 1-s intervals. This comprehensive assessment enables balanced consideration of prediction accuracy and resource requirements.
All experiments were conducted on a system equipped with an Intel(R) Core(TM) i7-10700F processor and NVIDIA RTX 2060 GPU, using TensorFlow-GPU 2.9 and Python 3.8. To ensure statistical reliability, each configuration was executed 10 times with different random seeds (1–10), with results reported as averages across repetitions.

3. Results and Discussion

This section presents a comprehensive evaluation of the proposed deep learning models for water quality prediction. The analysis compares model performance across different feature augmentation methods, examines computational efficiency, and identifies the optimal configuration based on both accuracy and resource utilization metrics.

3.1. Performance Comparison of Models Under Different Feature Augmentation Methods

Table 4 presents a comprehensive comparison of three deep learning architectures with six feature augmentation methods. The TLR-GRU model with sliding window features demonstrates superior performance, achieving the highest test R2 (0.941) and lowest error metrics. This configuration reduces RMSE by 27.36% and MAE by 36.71% compared to basic data processing.
The sliding window approach consistently outperforms other feature augmentation methods across all models due to its ability to capture local temporal dynamics and short-term fluctuations in water quality data. By maintaining a moving window of historical observations, this method effectively preserves temporal dependencies while reducing noise and outliers that can negatively impact prediction accuracy.
Analysis of training versus test performance reveals important insights about model generalization. The TLR-GRU model shows minimal overfitting, with only a 1.05% decrease in R2 from training to test sets. In contrast, the TLD-Transformer exhibits significant overfitting, with a 18.9% performance drop, indicating poor generalization capability. This suggests that the regularization strategies in TLR-GRU (batch normalization and dropout) effectively prevent overfitting while maintaining model capacity.
Computational efficiency analysis (Table 5) shows that the sliding window method imposes moderate resource demands. The TLR-GRU implementation requires 663.451 s training time with 70.331 MB memory utilization, representing a favorable balance between computational cost and predictive performance.
Visual analysis of model performance (Figure 3) confirms the superiority of the sliding window approach across all evaluation dimensions. The consistency of improvements across accuracy metrics (R2 improvement: 6.70–8.79%) and error reduction (RMSE reduction: 8.55–27.36%; MAE reduction: 0.79–36.71%; MAPE reduction: 19.15–45.08%) demonstrates the robustness of this feature augmentation method.

3.2. Comparison of Other Models

Evaluation of seven deep learning architectures (Table 6) reveals significant performance variations. The TLR-GRU model achieves superior generalization with the highest test R2 (0.941) and lowest error metrics. The WaveNet architecture, while exhibiting excellent training performance (R2: 0.975), shows reduced test effectiveness (R2: 0.870), indicating potential overfitting.
Computational efficiency analysis (Table 7) shows substantial variation in resource requirements. The TLD-Transformer achieves the shortest training time (116.975 s), while the TLR-GRU model occupies an intermediate position with 663.451 s, representing an optimal balance between computational overhead and predictive performance.
Detailed examination of CODMn and TN predictions (Figure 4 and Figure 5) reveals that the TLR-GRU model maintains excellent agreement between predicted and observed values. The model achieves R2 values of 0.92 (training) and 0.88 (validation) for CODMn, and 0.95/0.90 for TN, demonstrating robust generalization across different water quality parameters.
The convergence behavior (Figure 6) confirms the TLR-GRU’s training stability, with smooth loss reduction observed across iterations. Comparative prediction curves (Figure 7) further validate the model’s capacity to accurately capture temporal dynamics, particularly in tracking sudden changes and trend variations.

3.3. Summary of Optimal Model

Based on the comprehensive evaluation, the TLR-GRU model with sliding window feature augmentation emerges as the optimal configuration for water quality prediction. This combination achieves the best balance between predictive accuracy (test R2: 0.941) and computational efficiency (training time: 663.451 s). The model’s superior performance stems from its effective handling of temporal dependencies through GRU mechanisms, combined with robust regularization strategies that prevent overfitting while maintaining generalization capability across different water quality parameters.

4. Conclusions

This study develops an integrated framework combining feature augmentation strategies with deep learning to address critical limitations in water quality prediction. The proposed methodology demonstrates significant improvements in predictive accuracy while maintaining computational efficiency, offering a practical solution for real-time environmental monitoring.
The key innovation lies in the synergistic integration of multiple feature augmentation methods—particularly the sliding window approach—with PCA dimensionality reduction and a tailored TLR-GRU architecture. This comprehensive approach effectively captures complex temporal patterns while mitigating overfitting through sophisticated regularization techniques. Experimental results confirm substantial performance enhancements, with the optimal configuration achieving a 7.78% increase in R2 and simultaneous error reductions of 27.36% in RMSE, 36.71% in MAE, and 45.08% in MAPE compared to conventional methods.
For practical applications, this research provides water resource managers with an efficient tool for real-time quality monitoring and early warning systems. The framework’s ability to accurately predict key parameters enables proactive intervention and supports data-driven decision-making for sustainable water management. The methodology is readily deployable in existing monitoring infrastructure without substantial additional costs.
Future work will explore extending the framework to incorporate meteorological and hydrological data, developing adaptive feature selection mechanisms, and implementing transfer learning approaches for enhanced generalization across diverse conditions. These advancements will further strengthen the framework’s applicability in real-world environmental monitoring scenarios.

Author Contributions

Conceptualization, X.W., Y.L. (Yanchun Liang) and A.T.; methodology, Q.Q.; software, X.W. and Y.L. (Ying Li); validation, A.T., X.W. and Y.L. (Yanchun Liang); formal analysis, X.W. and A.T.; investigation, X.W.; resources, Q.Q.; data curation, X.W. and Y.L. (Ying Li); writing—original draft preparation, X.W.; writing—review and editing, Q.Q., A.T., W.H. and Y.L. (Yanchun Liang); visualization, X.W. and W.H.; supervision, Y.L. (Yanchun Liang); project administration, Y.L. (Ying Li). All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded in part by the National Natural Science Foundation of China (62372494), National Key S&T Special Projects (2025ZD0551200) of China, Guangdong Specialized Talent Training Program (2024001), Guangdong Engineering Centre (2024GCZX001), 2023 Zhuhai College of Science and Technology Campus Teaching Quality Engineering Construction Project (ZLGC20230213).

Data Availability Statement

The original contributions presented in this study are included in the article. Further inquiries can be directed to the corresponding author.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Azrour, M.; Mabrouki, J.; Fattah, G.; Guezzaz, A.; Aziz, F. Machine learning algorithms for efficient water quality prediction. Model. Earth Syst. Environ. 2022, 8, 2793–2801. [Google Scholar] [CrossRef] [Scilit]
  2. Deng, T.; Chau, K.W.; Duan, H.F. Machine learning based marine water quality prediction for coastal hydro-environment management. J. Environ. Manag. 2021, 284, 112051. [Google Scholar] [CrossRef] [Scilit]
  3. Jiang, Y.; Li, C.; Song, H.; Wang, W. Deep learning model based on urban multi-source data for predicting heavy metals (Cu, Zn, Ni, Cr) in industrial sewer networks. J. Hazard. Mater. 2022, 432, 128732. [Google Scholar] [CrossRef] [Scilit]
  4. Lee, S.; Lee, D. Improved prediction of harmful algal blooms in four Major South Korea’s Rivers using deep learning models. Int. J. Environ. Res. Public Health 2018, 15, 1322. [Google Scholar] [CrossRef] [Scilit]
  5. Liu, P.; Wang, J.; Sangaiah, A.K.; Xie, Y.; Yin, X. Analysis and prediction of water quality using LSTM deep neural networks in IoT environment. Sustainability 2019, 11, 2058. [Google Scholar] [CrossRef] [Scilit]
  6. Hu, Z.; Zhang, Y.; Zhao, Y.; Xie, M.; Zhong, J.; Tu, Z.; Liu, J. A water quality prediction method based on the deep LSTM network considering correlation in smart mariculture. Sensors 2019, 19, 1420. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  7. Ma, J.; Ding, Y.; Cheng, J.C.; Jiang, F.; Xu, Z. Soft detection of 5-day BOD with sparse matrix in city harbor water using deep learning techniques. Water Res. 2020, 170, 115350. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  8. Chen, K.; Chen, H.; Zhou, C.; Huang, Y.; Qi, X.; Shen, R.; Liu, F.; Zuo, M.; Zou, X.; Wang, J.; et al. Comparative analysis of surface water quality prediction performance and identification of key water parameters using different machine learning models based on big data. Water Res. 2020, 171, 115454. [Google Scholar] [CrossRef] [Scilit]
  9. Zhou, Y. Real-time probabilistic forecasting of river water quality under data missing situation: Deep learning plus post-processing techniques. J. Hydrol. 2020, 589, 125164. [Google Scholar] [CrossRef] [Scilit]
  10. Barzegar, R.; Aalami, M.T.; Adamowski, J. Short-term water quality variable prediction using a hybrid CNN–LSTM deep learning model. Stoch. Environ. Res. Risk Assess. 2020, 34, 415–433. [Google Scholar] [CrossRef] [Scilit]
  11. Elavarasan, D.; Vincent, P.D. Crop yield prediction using deep reinforcement learning model for sustainable agrarian applications. IEEE Access 2020, 8, 86886–86901. [Google Scholar] [CrossRef] [Scilit]
  12. Singha, S.; Pasupuleti, S.; Singha, S.S.; Singh, R.; Kumar, S. Prediction of groundwater quality using efficient machine learning technique. Chemosphere 2021, 276, 130265. [Google Scholar] [CrossRef] [Scilit]
  13. Wang, S.; Peng, H.; Liang, S. Prediction of estuarine water quality using interpretable machine learning approach. J. Hydrol. 2022, 605, 127320. [Google Scholar] [CrossRef] [Scilit]
  14. Rostam, N.A.P.; Malim, N.H.A.H.; Abdullah, R.; Ahmad, A.L.; Ooi, B.S.; Chan, D.J.C. A complete proposed framework for coastal water quality monitoring system with algae predictive model. IEEE Access 2021, 9, 108249–108265. [Google Scholar] [CrossRef] [Scilit]
  15. Wang, Y.; Shi, W.; Wen, T. Prediction of winter wheat yield and dry matter in North China Plain using machine learning algorithms for optimal water and nitrogen application. Agric. Water Manag. 2023, 277, 108140. [Google Scholar] [CrossRef] [Scilit]
  16. Wang, X.; Li, Y.; Qiao, Q.; Tavares, A.; Liang, Y. Water quality prediction based on machine learning and comprehensive weighting methods. Entropy 2023, 25, 1186. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  17. Kumar, L.; Afzal, M.S.; Ahmad, A. Prediction of water turbidity in a marine environment using machine learning: A case study of Hong Kong. Reg. Stud. Mar. Sci. 2022, 52, 102260. [Google Scholar] [CrossRef] [Scilit]
  18. Cho, K.; Van Merrienboer, B.; Gulcehre, C.; Bahdanau, D.; Bougares, F.; Schwenk, H.; Bengio, Y. Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translation. Comput. Sci. 2014, 3, 17. [Google Scholar]
  19. Wan, H.; Xu, R.; Zhang, M.; Cai, Y.; Li, J.; Shen, X. A novel model for water quality prediction caused by non-point sources pollution based on deep learning and feature extraction methods. J. Hydrol. 2022, 612, 128081. [Google Scholar] [CrossRef] [Scilit]
  20. Aires, U.R.V.; da Silva, D.D.; Fernandes Filho, E.I.; Rodrigues, L.N.; Uliana, E.M.; Amorim, R.S.S.; de Melo Ribeiro, C.B.; Campos, J.A. Machine learning-based modeling of surface sediment concentration in Doce river basin. J. Hydrol. 2023, 619, 129320. [Google Scholar] [CrossRef] [Scilit]
  21. Shen, R.; Bubeck, S.; Gunasekar, S. Data augmentation as feature manipulation. In Proceedings of the International Conference on Machine Learning, Baltimore, MD, USA, 13–19 July 2022; PMLR: Cambridge, MA, USA, 2022; pp. 19773–19808. [Google Scholar]
  22. Harrou, F.; Dairi, A.; Dorbane, A.; Sun, Y. Energy consumption prediction in water treatment plants using deep learning with data augmentation. Results Eng. 2023, 20, 101428. [Google Scholar] [CrossRef] [Scilit]
  23. Shen, J.; Zuo, X.; Yang, W.; Prokhorov, D.; Mei, X.; Ling, H. Differential features for pedestrian detection: A Taylor series perspective. IEEE Trans. Intell. Transp. Syst. 2018, 20, 2913–2922. [Google Scholar] [CrossRef] [Scilit]
  24. An, R.; Shi, X.; Xu, B. Fast Automatic Feature Selection for Multi-period Sliding Window Aggregate in Time Series. In Proceedings of the 2020 IEEE International Conference on Data Mining (ICDM), Sorrento, Italy, 17–20 November 2020; IEEE: New York, NY, USA, 2020; pp. 906–911. [Google Scholar]
  25. Zhang, Q.; Li, S.; Tang, W.; Guo, X. Fast measurement with chemical sensors based on sliding window sampling and mixed-feature extraction. IEEE Sens. J. 2020, 20, 8740–8745. [Google Scholar] [CrossRef] [Scilit]
  26. Yin, C.; Zhang, S.; Wang, J.; Xiong, N.N. Anomaly detection based on convolutional recurrent autoencoder for IoT time series. IEEE Trans. Syst. Man, Cybern. Syst. 2020, 52, 112–122. [Google Scholar] [CrossRef] [Scilit]
  27. Liu, C.; Zhang, X.; Mei, S.; Zhou, Q.; Fan, H. Series-wise attention network for wind power forecasting considering temporal lag of numerical weather prediction. Appl. Energy 2023, 336, 120815. [Google Scholar] [CrossRef] [Scilit]
  28. Blázquez-García, A.; Conde, A.; Mori, U.; Lozano, J.A. A review on outlier/anomaly detection in time series data. Acm Comput. Surv. (CSUR) 2021, 54, 1–33. [Google Scholar] [CrossRef] [Scilit]
  29. Zhao, L.; Mo, C.; Ma, J.; Chen, Z.; Yao, C. LSTM-MFCN: A time series classifier based on multi-scale spatial–temporal features. Comput. Commun. 2022, 182, 52–59. [Google Scholar] [CrossRef] [Scilit]
  30. Zhang, X.; Ma, L.; Zhu, Y.; Lou, W.; Xie, B.; Sheng, L.; Hu, H.; Zheng, K.; Gu, Q. Temporal stability analysis for the evaluation of spatial and temporal patterns of surface water quality. Water Resour. Manag. 2022, 36, 1413–1429. [Google Scholar] [CrossRef] [Scilit]
  31. Jiang, J.; Zheng, Y.; Pang, T.; Wang, B.; Chachan, R.; Tian, Y. A comprehensive study on spectral analysis and anomaly detection of river water quality dynamics with high time resolution measurements. J. Hydrol. 2020, 589, 125175. [Google Scholar] [CrossRef] [Scilit]
  32. Zhou, P.; Wang, G.; Duan, R. Impacts of long-term climate change on the groundwater flow dynamics in a regional groundwater system: Case modeling study in Alashan, China. J. Hydrol. 2020, 590, 125557. [Google Scholar] [CrossRef] [Scilit]
  33. Al-Sulttani, A.O.; Al-Mukhtar, M.; Roomi, A.B.; Farooque, A.A.; Khedher, K.M.; Yaseen, Z.M. Proposition of new ensemble data-intelligence models for surface water quality prediction. IEEE Access 2021, 9, 108527–108541. [Google Scholar] [CrossRef] [Scilit]
  34. Perea, R.G.; García, I.F.; Poyato, E.C.; Díaz, J.R. New memory-based hybrid model for middle-term water demand forecasting in irrigated areas. Agric. Water Manag. 2023, 284, 108367. [Google Scholar] [CrossRef] [Scilit]
  35. Du, B.; Zhou, Q.; Guo, J.; Guo, S.; Wang, L. Deep learning with long short-term memory neural networks combining wavelet transform and principal component analysis for daily urban water demand forecasting. Expert Syst. Appl. 2021, 171, 114571. [Google Scholar] [CrossRef] [Scilit]
  36. Hasan, B.M.S.; Abdulazeez, A.M. A review of principal component analysis algorithm for dimensionality reduction. J. Soft Comput. Data Min. 2021, 2, 20–30. [Google Scholar] [CrossRef] [Scilit]
Figure 1. Flowchart of the water quality prediction framework integrating feature augmentation methods and deep learning.
Figure 1. Flowchart of the water quality prediction framework integrating feature augmentation methods and deep learning.
Water 17 03523 g001
Figure 2. TLR-GRU model architecture illustrating the layered structure with input shape (30, 30), two GRU layers with batch normalization and dropout regularization, and dense layers leading to single-output prediction.
Figure 2. TLR-GRU model architecture illustrating the layered structure with input shape (30, 30), two GRU layers with batch normalization and dropout regularization, and dense layers leading to single-output prediction.
Water 17 03523 g002
Figure 3. Comparison of model performance under different feature augmentation methods: (a) RMSE, (b) MAE, (c) MAPE, (d) R2, (e) Training time, (f) Memory usage.
Figure 3. Comparison of model performance under different feature augmentation methods: (a) RMSE, (b) MAE, (c) MAPE, (d) R2, (e) Training time, (f) Memory usage.
Water 17 03523 g003
Figure 4. Scatter plots of training and validation results for CODMn by different models: (a) BI_TLD-LSTM, (b) CNN, (c) DeepAR, (d) TLD-LSTM, (e) TLD-Transformer, (f) WaveNet.
Figure 4. Scatter plots of training and validation results for CODMn by different models: (a) BI_TLD-LSTM, (b) CNN, (c) DeepAR, (d) TLD-LSTM, (e) TLD-Transformer, (f) WaveNet.
Water 17 03523 g004
Figure 5. Scatter plots of training and validation results for TN by different models: (a) Bi_TLD-LSTM, (b) CNN, (c) DeepAR, (d) TLD-LSTM, (e) TLD-Transformer, (f) WaveNet.
Figure 5. Scatter plots of training and validation results for TN by different models: (a) Bi_TLD-LSTM, (b) CNN, (c) DeepAR, (d) TLD-LSTM, (e) TLD-Transformer, (f) WaveNet.
Water 17 03523 g005
Figure 6. Scatter plot and loss function curve of TLR-GRU model: (a) Scatter plots of training and validation results for CODMn by TLR-GRU model, (b) Scatter plots of training and validation results for TN by TLR-GRU model, (c) The loss function curve of TLR-GRU model for CODMn prediction, (d) The loss function curve of TLR-GRU model for TN prediction.
Figure 6. Scatter plot and loss function curve of TLR-GRU model: (a) Scatter plots of training and validation results for CODMn by TLR-GRU model, (b) Scatter plots of training and validation results for TN by TLR-GRU model, (c) The loss function curve of TLR-GRU model for CODMn prediction, (d) The loss function curve of TLR-GRU model for TN prediction.
Water 17 03523 g006
Figure 7. Prediction curves of different models: (a) Prediction curve of CODMn, (b) Prediction curve of TN.
Figure 7. Prediction curves of different models: (a) Prediction curve of CODMn, (b) Prediction curve of TN.
Water 17 03523 g007
Table 1. Summary statistics of water quality parameters.
Table 1. Summary statistics of water quality parameters.
ParameterUnitMinMaxMeanMedianStd Dev
Temp°C2.7529.0518.6318.826.37
pH–6.568.697.577.580.24
DOmg/L2.0112.348.148.201.61
CODMnmg/L0.568.123.143.051.38
NH3-Nmg/L0.011.250.230.200.18
TPmg/L0.010.450.110.100.07
TNmg/L0.314.571.681.570.74
CondµS/cm5613,856204217901367
TurbNTU0.113311.786.1015.45
Table 2. Architecture specifications of evaluated deep learning models.
Table 2. Architecture specifications of evaluated deep learning models.
ModelArchitectureLayersRegularization
TLR-GRU2-layer GRU128 × 2, Dense(64)L2(0.001) + BN + Drop(0.3)
TLD-LSTM2-layer LSTM64 × 2Dropout(0.2)
TLD-Transformer2-layer Transformer4 heads × 2, Dense(64)Drop(0.3) + LayerNorm
DeepARProbabilistic LSTM64 × 2DistributionLambda
Bi-TLD-LSTMBidirectional LSTM64 × 2Dropout(0.2)
WaveNetDilated CNN8 res blocks, 64 filtersCausal conv
CNN2-layer Conv1D64→128 filters, Dense(64)L2(0.001) + BN + Drop(0.3)
Table 3. Evaluation metrics for model performance assessment.
Table 3. Evaluation metrics for model performance assessment.
MetricFormulaUnits/Scale
Coefficient of Determination ( R 2 ) R 2 = 1 − ∑ i = 1 n ( y i − y ^ i ) 2 ∑ i = 1 n ( y i − y ¯ ) 2 Unitless
Description: Measures the proportion of variance in the dependent variable explained by the model, indicating goodness of fit.
Root Mean Squared Error (RMSE) RMSE = 1 n ∑ i = 1 n ( y i − y ^ i ) 2 mg/L
Description: Sensitive to large errors, giving higher weight to significant deviations; useful for emphasizing prediction outliers.
Mean Absolute Error (MAE) MAE = 1 n ∑ i = 1 n y i − y ^ i mg/L
Description: Measures average magnitude of absolute errors between predicted and actual values, providing straightforward accuracy interpretation.
Mean Absolute Percentage Error (MAPE) MAPE = 1 n ∑ i = 1 n y i − y ^ i y i × 100 %
Description: Expresses error as percentage of actual values, offering insight into relative error size.
Table 4. The average performance evaluation of models with different feature augmentation methods.
Table 4. The average performance evaluation of models with different feature augmentation methods.
ModelMethodTrainingTest
R2RMSEMAEMAPER2RMSEMAEMAPE
TLR-GRUBasic Data0.913115.79385.22812.9910.873148.549108.94814.534
Time Related0.857213.280167.09617.2670.840240.840173.69316.527
Lag0.938101.35469.3659.9250.885122.63081.64812.104
Periodic0.911146.558107.25112.7760.890144.792103.29313.115
Differenced0.888147.560106.40015.4540.848158.227107.60316.776
Sliding Window0.95189.73561.1019.1240.941107.95268.9367.979
TLD-LSTMBasic Data0.913113.36682.99214.4960.849168.109131.36018.478
Time Related0.813152.115110.42217.9320.724202.461148.09421.593
Lag0.870170.577118.93015.8920.691241.940163.43022.327
Periodic0.901132.13292.21814.0220.833224.452158.54717.825
Differenced0.909112.01080.53213.5870.807172.298128.07723.113
Sliding Window0.931129.12590.12712.6460.826214.571142.89016.496
TLD-TransfBasic Data0.814149.007110.86221.8260.598222.514157.93325.007
Time Related0.803162.229124.92025.3400.627254.836189.36328.103
Lag0.882145.314106.40917.4380.559342.915234.96432.347
Periodic0.872155.103118.59021.4710.704282.455196.92824.705
Differenced0.93680.81961.64613.6620.782169.483129.03823.298
Sliding Window0.936117.14587.99314.2860.759262.812183.25622.437
Table 5. Resource usage of models under different feature augmentation methods.
Table 5. Resource usage of models under different feature augmentation methods.
ModelsMethodsTraining Time (s)Memory Usage (MB)CPU Usage (%)GPU Usage (%)
TLR-GRUBasic Data633.75566.49335.91929.850
Time Related538.39365.72934.97730.569
Lag512.19558.09027.57631.615
Periodic696.37971.91655.20526.961
Differenced510.21664.99330.14430.875
Sliding Window663.45170.33134.57129.953
TLD-LSTMBasic Data250.25559.75850.00731.795
Time Related129.58857.66838.88225.475
Lag118.02844.90830.98028.357
Periodic145.43355.97732.45425.941
Differenced111.55755.57332.62024.662
Sliding Window205.59157.22740.87628.784
TLD-TransfBasic Data155.23648.92826.29027.181
Time Related108.37650.17525.51326.825
Lag106.47545.71725.11628.724
Periodic199.64045.26632.11828.931
Differenced115.81547.02523.54126.403
Sliding Window116.97545.64923.46126.372
Table 6. Performance evaluation of different models on training and test sets.
Table 6. Performance evaluation of different models on training and test sets.
ModelsTraining SetTest Set
R2RMSEMAEMAPER2RMSEMAEMAPE
TLR-GRU0.95189.73561.1019.1240.941107.95268.9367.979
TLD-LSTM0.931129.12590.12712.6460.826214.571142.89016.496
TLD-Transformer0.936117.14587.99314.2860.759262.812183.25622.437
DeepAR0.94381.73854.1529.2520.927115.40372.6918.835
Bi_TLD-LSTM0.934104.74772.62811.2270.825212.820137.28514.902
WaveNet0.97559.00744.9788.7930.870157.036107.02413.991
CNN0.95092.60765.5179.6810.792196.517122.68114.577
Table 7. Resource usage of different models.
Table 7. Resource usage of different models.
ModelsTraining Time (s)Memory Usage (MB)CPU Usage (%)GPU Usage (%)
TLR-GRU663.45170.33134.57129.953
TLD-LSTM205.59157.22740.87628.784
TLD-Transformer116.97545.64923.46126.372
DeepAR127.74855.58836.37629.472
Bi_TLD-LSTM201.95758.71536.79526.535
WaveNet599.71457.7848.36123.930
CNN737.95964.6104.04427.405
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Wang, X.; Li, Y.; Qiao, Q.; Tavares, A.; Huang, W.; Liang, Y. Enhancing Surface Water Quality Parameter Prediction Using Deep Learning and Feature Augmentation Methods. Water 2025, 17, 3523. https://doi.org/10.3390/w17243523

AMA Style

Wang X, Li Y, Qiao Q, Tavares A, Huang W, Liang Y. Enhancing Surface Water Quality Parameter Prediction Using Deep Learning and Feature Augmentation Methods. Water. 2025; 17(24):3523. https://doi.org/10.3390/w17243523

Chicago/Turabian Style

Wang, Xianhe, Ying Li, Qian Qiao, Adriano Tavares, Weidong Huang, and Yanchun Liang. 2025. "Enhancing Surface Water Quality Parameter Prediction Using Deep Learning and Feature Augmentation Methods" Water 17, no. 24: 3523. https://doi.org/10.3390/w17243523

APA Style

Wang, X., Li, Y., Qiao, Q., Tavares, A., Huang, W., & Liang, Y. (2025). Enhancing Surface Water Quality Parameter Prediction Using Deep Learning and Feature Augmentation Methods. Water, 17(24), 3523. https://doi.org/10.3390/w17243523

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop