Application of the Two-Layer Regularized Gated Recurrent Unit (TLR-GRU) Model Enhanced by Sliding Window Features in Water Quality Parameter Prediction
Abstract
1. Introduction
2. Materials and Methods
2.1. Study Area
2.2. Dataset
- Samples with a missing value proportion > 10% were removed to avoid biased results;
- Remaining missing data were imputed using linear interpolation, which is suitable for this dataset for three reasons: (1) the 4 h sampling interval ensures strong temporal continuity of data, and linear interpolation can effectively retain the overall trend without introducing false fluctuations; (2) comparative analysis shows that the SampEn of data before and after interpolation changes by less than 3%, indicating no significant impact on data complexity; (3) spline interpolation may introduce artificial nonlinear features, while nearest-neighbor interpolation cannot reflect continuous changes, making linear interpolation a balanced choice. Model performance verification (Section 4.2) shows that this method does not negatively affect prediction accuracy;
- Data were standardized using the min-max normalization method to eliminate scale-induced biases, mapping values to the [0, 1] interval;
- Anomalies (defined as values outside , where is the mean and is the standard deviation) were replaced with the nearest valid value or deleted if irrecoverable.
2.3. Sliding Window Feature Enhancement Method
- Sliding Window Size Selection: Based on the 4 h sampling interval and research needs, four window sizes were initially tested: 4 h (1 sample), 8 h (2 samples), 12 h (3 samples), and 24 h (6 samples). The window step size was set to half the window size (e.g., 2 h for a 4 h window) to balance contextual overlap and computational efficiency. The 4 h window was ultimately excluded because a single sample (N = 1) cannot calculate a valid standard deviation (Equation (2)), and its mean equals the raw data value—providing no additional statistical information. Thus, the final window sizes were 8 h, 12 h, and 24 h (N ≥ 2), ensuring meaningful feature enhancement.
- Statistical Metric Calculation: For each water quality parameter X, the mean () and standard deviation () within each window ending at time t were computed using Equations (1) and (2), respectively.
2.4. Principal Component Analysis (PCA)
- Data Standardization: The sliding window-enhanced feature set was standardized to a mean of 0 and standard deviation of 1, ensuring all features contributed equally to PCA.
- Covariance Matrix Calculation: The covariance matrix of the standardized data was computed to quantify linear correlations between features.
- Eigenvalue Decomposition: Eigenvalues and eigenvectors of the covariance matrix were extracted. Eigenvalues represent the variance explained by each PC, and eigenvectors indicate the direction of each PC [41].
- PC Selection: Top PCs with a cumulative variance explanation ratio of at least 85% were selected. This threshold is justified as follows: (1) Calculations have shown that that the first four principal components have eigenvalues > 1 (Kaiser criterion), and the cumulative variance reaches 85.3% at the 4th component, with a significant inflection point—subsequent components contribute less than 3% each to the total variance; (2) Sensitivity analysis indicates that increasing the threshold to 90% increases the number of PCs to 5, but extends model training time by 23% while improving prediction by only 0.4% (average across parameters), resulting in low cost-effectiveness; (3) This threshold is widely adopted in similar water quality time series studies [39,41], balancing dimensionality reduction efficiency and information retention.
- Data Projection: The original feature set was projected onto the selected PCs to form a low-dimensional feature space for subsequent model training.
2.5. Model Structure
2.5.1. TLR-GRU Architecture Details
- Input Layer: Accepts low-dimensional features from PCA (dimension determined by PC selection, typically 3–5 PCs).
- First GRU Layer: Contains 128 GRU units, with L2 regularization (coefficient = 0.001) to suppress parameter overfitting. Batch normalization is applied to accelerate training convergence, and a dropout rate of 0.3 is used to prevent neuron co-adaptation. The parameter “return_sequences = True” is set to pass the output sequence to the second GRU layer.
- Second GRU Layer: Identical to the first layer (128 units, L2 regularization, batch normalization, dropout = 0.3), ensuring deep capture of temporal dependencies [44].
- Fully Connected Layer: Contains 64 neurons with a ReLU activation function, extracting high-level nonlinear features from GRU outputs.
- Output Layer: A single neuron without an activation function, suitable for regression tasks (water quality parameter prediction), where the output is a continuous real number representing the predicted parameter value.
2.5.2. Training Configuration
- Optimizer: Adam optimizer with an initial learning rate of 0.0001 (adaptive learning rate adjustment for stable convergence).
- Loss Function: mean squared error (MSE), which penalizes large prediction errors and is widely used for regression tasks.
- Early Stopping: Triggered when the test loss does not decrease for 10 consecutive epochs, preventing overfitting and reducing training time.
- Dataset Splitting: 70% of the data as the training set, 15% as the test set, and 15% as the test set (stratified by time to avoid data leakage).
- Visualization: TensorBoard was used to monitor training/test loss curves and feature importance, facilitating model debugging.
2.6. Evaluation Metrics
2.7. Experiment
2.7.1. Hardware and Software Environment
- Processor: Intel(R) Core(TM) i7-10700F 2.90 GHz (8 cores, 16 threads);
- Graphics Card: NVIDIA RTX 2060 (6 GB VRAM), enabling GPU-accelerated training;
- Software: Python 3.8, TensorFlow-GPU 2.9 (deep learning framework), Pandas 1.4.2 (data processing), Matplotlib 3.5.1 (visualization), Scikit-learn 1.0.2 (PCA and preprocessing).
2.7.2. Experimental Design and Reproducibility
- Model Comparison: The TLR-GRU model was compared with six state-of-the-art deep learning models: TLD-LSTM, TLD-Transformer, DeepAR, Bi TLD-LSTM, WaveNet, and CNN. All models used the same training configuration (optimizer, loss function, dataset splitting) to ensure fair comparison.
- Feature Sets: Two feature sets were tested for each model: (1) base dataset (raw preprocessed data); (2) sliding window-enhanced dataset (after PCA).
- Reproducibility: Each experiment was repeated 10 times with different random seeds (1–10) to account for stochasticity in weight initialization and data splitting. The average of the 10 runs was reported as the final result, ensuring consistency and reliability [23].
3. Sample Entropy-Based Complexity Quantification
3.1. Feature Complexity Analysis via Sample Entropy and Sliding Window Enhancement Mechanism
3.1.1. Definition and Calculation of Sample Entropy
- -
- m = embedding dimension (set to 2 in this study, to capture intra-series pattern repetition of a single water quality parameter over two consecutive time steps, e.g., the variation trend of TN concentration between adjacent 4 h intervals);
- -
- r = similarity tolerance (set to , balancing noise filtration and pattern preservation to avoid misclassifying valid hydrological fluctuations as noise);
- -
- = proportion of m-dimensional vector pairs whose element-wise absolute differences are all less than r;
- -
- N = length of the time series (derived from 4970 water quality records spanning January 2020 to December 2023, with a 4 h sampling interval (Section 2.2).
3.1.2. Global Comparison of Data Complexity
3.1.3. Parameter-Specific Differentiation of Complexity
3.1.4. Multi-Scale Complexity Regulation by Sliding Windows
3.2. Correlation Between SampEn and TLR-GRU Layer Outputs
4. Results and Discussion
4.1. Improvement of Model Performance with Sliding Window Features Enhancement Method
4.2. Analysis of TLR-GRU Model’s Performance in Predicting Water Quality Parameters
4.3. Comparison of Predictive Performance of Different Models
4.4. Analysis of Fluctuations Between Predicted and Observed Values
4.5. Water Quality Status Evaluation and Spatial Transferability Analysis
4.5.1. Actual Water Quality Status
4.5.2. Spatial Transferability and Local Hydrodynamic Effects
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Zhu, M.; Wang, J.; Yang, X.; Zhang, Y.; Zhang, L.; Ren, H.; Wu, B.; Ye, L. A review of the application of machine learning in water quality evaluation. Eco-Environ. Health 2022, 1, 107–116. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Zhi, W.; Feng, D.; Tsai, W.P.; Sterle, G.; Harpold, A.; Shen, C.; Li, L. From hydrometeorology to river water quality: Can a deep learning model predict dissolved oxygen at the continental scale? Environ. Sci. Technol. 2021, 55, 2357–2368. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- 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]
- Zainurin, S.N.; Wan Ismail, W.Z.; Mahamud, S.N.I.; Ismail, I.; Jamaludin, J.; Ariffin, K.N.Z.; Wan Ahmad Kamil, W.M. Advancements in monitoring water quality based on various sensing methods: A systematic review. Int. J. Environ. Res. Public Health 2022, 19, 14080. [Google Scholar] [CrossRef] [Scilit]
- Jung, W.S.; Kim, S.E.; Kim, Y.D. Prediction of surface water quality by artificial neural network model using probabilistic weather forecasting. Water 2021, 13, 2392. [Google Scholar] [CrossRef] [Scilit]
- Omambia, A.; Maake, B.; Wambua, A. Water quality monitoring using IoT & machine learning. In 2022 IST-Africa Conference (IST-Africa); IEEE: Piscataway, NJ, USA, 2022; pp. 1–8. [Google Scholar]
- Bai, X.; Wang, J.; Chen, R.; Kang, Y.; Ding, Y.; Lv, Z.; Ding, D.; Feng, H. Research progress of inland river water quality monitoring technology based on unmanned aerial vehicle hyperspectral imaging technology. Environ. Res. 2024, 257, 119254. [Google Scholar] [CrossRef] [Scilit]
- Sun, Y.; Wang, D.; Li, L.; Ning, R.; Yu, S.; Gao, N. Application of remote sensing technology in water quality monitoring: From traditional approaches to artificial intelligence. Water Res. 2024, 267, 122546. [Google Scholar] [CrossRef] [Scilit]
- De Lacerda, M.; Batista, G.; De Souza, A.; Aragão, D.; de Araújo, M.C.; Cunha, P. Predicting the presence of total coliforms and Escherichia coli in water supply reservoirs using machine learning models. J. Water Process Eng. 2025, 76, 108146. [Google Scholar] [CrossRef] [Scilit]
- Chen, Y.; Song, L.; Liu, Y.; Yang, L.; Li, D. A review of the artificial neural network models for water quality prediction. Appl. Sci. 2020, 10, 5776. [Google Scholar] [CrossRef] [Scilit]
- Yan, X.; Zhang, T.; Du, W.; Meng, Q.; Xu, X.; Zhao, X. A comprehensive review of machine learning for water quality prediction over the past five years. J. Mar. Sci. Eng. 2024, 12, 159. [Google Scholar] [CrossRef] [Scilit]
- 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] [PubMed]
- Mohammed, H.; Hameed, I.A.; Seidu, R. Comparison of adaptive neuro-fuzzy inference system (ANFIS) and Gaussian process for machine learning (GPML) algorithms for the prediction of norovirus concentration in drinking water supply. In Transactions on Large-Scale Data-and Knowledge-Centered Systems XXXV; Springer: Berlin/Heidelberg, Germany, 2017; pp. 74–95. [Google Scholar]
- Brentan, B.M.; Luvizotto, E., Jr.; Herrera, M.; Izquierdo, J.; Pérez-García, R. Hybrid regression model for near real-time urban water demand forecasting. J. Comput. Appl. Math. 2017, 309, 532–541. [Google Scholar] [CrossRef] [Scilit]
- Chou, J.S.; Ho, C.C.; Hoang, H.S. Determining quality of water in reservoir using machine learning. Ecol. Inform. 2018, 44, 57–75. [Google Scholar] [CrossRef] [Scilit]
- Acharya, T.D.; Subedi, A.; Lee, D.H. Evaluation of machine learning algorithms for surface water extraction in a Landsat 8 scene of Nepal. Sensors 2019, 19, 2769. [Google Scholar] [CrossRef] [Scilit]
- Emrullah, A.; Ozerdem, M.S.; Ustundag, B.B. Machine learning based regression model for prediction of soil surface humidity over moderately vegetated fields. In 2019 8th International Conference on Agro-Geoinformatics (Agro-Geoinformatics); IEEE: Piscataway, NJ, USA, 2019; pp. 1–4. [Google Scholar]
- Richman, J.S.; Moorman, J.R. Physiological time-series analysis using approximate entropy and sample entropy. Am. J. Physiol.-Heart Circ. Physiol. 2000, 278, H2039–H2049. [Google Scholar] [CrossRef] [Scilit]
- Deng, C.; Liu, L.; Li, H.; Peng, D.; Wu, Y.; Xia, H.; Zhang, Z.; Zhu, Q. A data-driven framework for spatiotemporal characteristics, complexity dynamics, and environmental risk evaluation of river water quality. Sci. Total Environ. 2021, 785, 147134. [Google Scholar] [CrossRef] [Scilit]
- Yang, H.; Liu, S. A prediction model of aquaculture water quality based on multiscale decomposition. Math. Biosci. Eng. 2021, 18, 7561–7579. [Google Scholar] [CrossRef] [Scilit]
- Farhi, N.; Kohen, E.; Mamane, H.; Shavitt, Y. Prediction of wastewater treatment quality using LSTM neural network. Environ. Technol. Innov. 2021, 23, 101632. [Google Scholar] [CrossRef] [Scilit]
- Malakar, P.; Sarkar, S.; Mukherjee, A.; Bhanja, S.; Sun, A.Y. Use of machine learning and deep learning methods in groundwater. In Global Groundwater; Elsevier: Amsterdam, The Netherlands, 2021; pp. 545–557. [Google Scholar]
- Li, Y.; Kong, B.; Yu, W.; Zhu, X. An attention-based CNN-LSTM method for effluent wastewater quality prediction. Appl. Sci. 2023, 13, 7011. [Google Scholar] [CrossRef] [Scilit]
- Zhao, S.; Liu, R.; Liu, Y.; Zeng, T.; Chen, C.; Xu, L. A water quality prediction model based on modal decomposition and hybrid deep learning models. Water 2025, 17, 184. [Google Scholar] [CrossRef] [Scilit]
- Bai, Y.; Peng, M.; Wang, M. A River Water Quality Prediction Method Based on Dual Signal Decomposition and Deep Learning. Water 2024, 16, 3099. [Google Scholar] [CrossRef] [Scilit]
- Wei, G.; Duan, Z.; Li, S.; Yu, X.; Yang, G. LFEformer: Local feature enhancement using sliding window with deformability for automatic speech recognition. IEEE Signal Process. Lett. 2023, 30, 180–184. [Google Scholar] [CrossRef] [Scilit]
- Gaur, P.; Gupta, H.; Chowdhury, A.; McCreadie, K.; Pachori, R.B.; Wang, H. A sliding window common spatial pattern for enhancing motor imagery classification in EEG-BCI. IEEE Trans. Instrum. Meas. 2021, 70, 1–9. [Google Scholar] [CrossRef] [Scilit]
- Kulanuwat, L.; Chantrapornchai, C.; Maleewong, M.; Wongchaisuwat, P.; Wimala, S.; Sarinnapakorn, K.; Boonya-Aroonnet, S. Anomaly detection using a sliding window technique and data imputation with machine learning for hydrological time series. Water 2021, 13, 1862. [Google Scholar] [CrossRef] [Scilit]
- Du, Z.; Qi, J.; Wu, S.; Zhang, F.; Liu, R. A spatially weighted neural network based water quality assessment method for large-scale coastal areas. Environ. Sci. Technol. 2021, 55, 2553–2563. [Google Scholar] [CrossRef] [Scilit]
- 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]
- Menghani, G. Efficient deep learning: A survey on making deep learning models smaller, faster, and better. ACM Comput. Surv. 2023, 55, 1–37. [Google Scholar] [CrossRef] [Scilit]
- Guo, H.; Zhu, X.; Huang, J.J.; Zhang, Z.; Tian, S.; Chen, Y. An enhanced deep learning approach to assessing inland lake water quality and its response to climate and anthropogenic factors. J. Hydrol. 2023, 620, 129466. [Google Scholar] [CrossRef] [Scilit]
- Wang, L.; Han, G.; Zhang, L. Experimental Analysis of Sluice Operation in Qianshan River Basin in Zhuhai City. Pearl River 2016, 37, 20–23. [Google Scholar]
- Wang, Y.; Zhang, Y.; Guo, Q.; Kang, W.; Sun, H.; Liu, F.; Li, T. Design of Qianshan Wastewater Treatment Plant with Underground MBR Process in Zhuhai City. China Water Wastewater 2018, 34, 59–62. [Google Scholar]
- 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]
- Wang, X.; Qiao, M.; Li, Y.; Tavares, A.; Qiao, Q.; Liang, Y. Deep-learning-based water quality monitoring and early warning methods: A case study of ammonia nitrogen prediction in rivers. Electronics 2023, 12, 4645. [Google Scholar] [CrossRef] [Scilit]
- Zhang, Y.; Li, C.; Jiang, Y.; Sun, L.; Zhao, R.; Yan, K.; Wang, W. Accurate prediction of water quality in urban drainage network with integrated EMD-LSTM model. J. Clean. Prod. 2022, 354, 131724. [Google Scholar] [CrossRef] [Scilit]
- Bhattarai, A.; Qadir, D.; Sunusi, A.M.; Getachew, B.; Mallah, A.R. Dynamic sliding window-based long short-term memory model development for pan evaporation forecasting. Knowl.-Based Eng. Sci. 2023, 4, 37–54. [Google Scholar]
- Greenacre, M.; Groenen, P.J.; Hastie, T.; d’Enza, A.I.; Markos, A.; Tuzhilina, E. Principal component analysis. Nat. Rev. Methods Prim. 2022, 2, 100. [Google Scholar] [CrossRef] [Scilit]
- 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]
- Kherif, F.; Latypova, A. Principal component analysis. In Machine Learning; Elsevier: Amsterdam, The Netherlands, 2020; pp. 209–225. [Google Scholar]
- Karpagalakshmi, R.C.; Selvam, P.; Sakthivel, S.; Kalaivanan, K.; Rajesh, S.R.; Sungheetha, A.; Mahapatra, S. Analysis of Water Quality in Cauvery River by Using PCA with Various Classifications Technique. Procedia Comput. Sci. 2025, 258, 1391–1403. [Google Scholar] [CrossRef] [Scilit]
- Roy, B.N.; Roy, H.; Rahman, K.S.; Mahmud, F.; Bhuiyan, M.M.K.; Hasan, M.; Bhuiyan, A.A.K.; Hasan, M.; Mahbub, M.S.; Jahedi, R.M. Principal component analysis incorporated water quality index modeling for Dhaka-based rivers. City Environ. Interact. 2024, 23, 100150. [Google Scholar]
- Yang, S.; Yu, X.; Zhou, Y. Lstm and gru neural network performance comparison study: Taking yelp review dataset as an example. In 2020 International Workshop on Electronic Communication and Artificial Intelligence (IWECAI); IEEE: Piscataway, NJ, USA, 2020; pp. 98–101. [Google Scholar]
- Wan, H.; Qi, H.; Shang, S. Estimating soil water and salt contents from field measurements with time domain reflectometry using machine learning algorithms. Agric. Water Manag. 2023, 285, 108364. [Google Scholar] [CrossRef] [Scilit]
- 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]
- Smith, R.X.; Yan, L.; Wang, D.J. Multiple time scale complexity analysis of resting state FMRI. Brain Imaging Behav. 2014, 8, 284–291. [Google Scholar] [CrossRef] [Scilit]
- Olbryś, J.; Majewska, E. Regularity in stock market indices within turbulence periods: The sample entropy approach. Entropy 2022, 24, 921. [Google Scholar] [CrossRef] [Scilit]
- GB 11607-89; Water Quality Standard for Fisheries. Ministry of Environmental Protection of the People’s Republic of China: Beijing, China, 1989.
- GB 3838-2002; Environmental Quality Standards for Surface Water. Ministry of Environmental Protection of the People’s Republic of China: Beijing, China, 2002.













| Model Layer | Pearson Correlation Coefficient (r) | p-Value | Significance |
|---|---|---|---|
| Input Layer | 0.82 | ||
| First Hidden Layer | 0.56 | ||
| Second Hidden Layer | 0.31 | ||
| Output Layer | 0.12 | 0.18 | Non-significant |
| Parameter | Unit | Min | Max | Mean | Median | Std Dev |
|---|---|---|---|---|---|---|
| Temp | °C | 2.75 | 29.05 | 18.63 | 18.82 | 6.37 |
| pH | N/A | 6.56 | 8.69 | 7.57 | 7.58 | 0.24 |
| DO | mg/L | 2.01 | 12.34 | 8.14 | 8.20 | 1.61 |
| CODMn | mg/L | 0.56 | 8.12 | 3.14 | 3.05 | 1.38 |
| -N | mg/L | 0.01 | 1.25 | 0.23 | 0.20 | 0.18 |
| TP | mg/L | 0.01 | 0.45 | 0.11 | 0.10 | 0.07 |
| TN | mg/L | 0.31 | 4.57 | 1.68 | 1.57 | 0.74 |
| Cond | 56 | 13,856 | 2042 | 1790 | 1367 | |
| Turb | NTU | 0.1 | 133 | 11.78 | 6.10 | 15.45 |
| Parameter | Standard Source | Class | Limit (mg/L) | Note |
|---|---|---|---|---|
| DO | Fishery (GB 11607-89) [49] | — | ≥5.0 | Mandatory for aquaculture. |
| Surface Water (GB 3838-2002) [50] | II | ≥6.0 | Reference for irrigation. | |
| NH3-N | Fishery (GB 11607-89) | — | ≤0.5 | Mandatory for aquaculture. |
| Surface Water (GB 3838-2002) | II | ≤0.5 | Reference for irrigation. | |
| TP | Surface Water-Lake (GB 3838-2002) | II | ≤0.025 | For aquaculture. & high-sensitivity irrigation. |
| Surface Water-Lake (GB 3838-2002) | III | ≤0.05 | Baseline for general irrigation. | |
| TN | Surface Water-Lake (GB 3838-2002) | II | ≤0.5 | For aquaculture. & high-sensitivity irrigation. |
| Surface Water-Lake (GB 3838-2002) | III | ≤1.0 | Baseline for general irrigation. |
| Models | WQP | Training Set | Test Set | ||||||
|---|---|---|---|---|---|---|---|---|---|
| RMSE | MAE | MAPE | RMSE | MAE | MAPE | ||||
| TLR-GRU | DO | 0.933 | 0.311 | 0.240 | 3.236 | 0.826 | 0.414 | 0.328 | 4.779 |
| NH3-N | 0.957 | 0.020 | 0.015 | 17.293 | 0.962 | 0.023 | 0.018 | 19.203 | |
| TN | 0.940 | 0.062 | 0.046 | 2.278 | 0.906 | 0.072 | 0.057 | 2.496 | |
| TP | 0.777 | 0.009 | 0.007 | 11.902 | 0.810 | 0.010 | 0.007 | 9.438 | |
| TLD-LSTM | DO | 0.928 | 0.319 | 0.237 | 3.186 | 0.830 | 0.408 | 0.320 | 4.685 |
| NH3-N | 0.948 | 0.022 | 0.016 | 21.572 | 0.947 | 0.028 | 0.021 | 18.398 | |
| TN | 0.947 | 0.058 | 0.042 | 2.042 | 0.915 | 0.069 | 0.053 | 2.357 | |
| TP | 0.796 | 0.009 | 0.006 | 10.120 | 0.749 | 0.011 | 0.008 | 10.345 | |
| TLD-Transformer | DO | 0.854 | 0.457 | 0.346 | 4.682 | 0.733 | 0.511 | 0.401 | 5.890 |
| NH3-N | 0.859 | 0.036 | 0.027 | 36.572 | 0.794 | 0.054 | 0.041 | 41.970 | |
| TN | 0.908 | 0.076 | 0.058 | 2.887 | 0.715 | 0.125 | 0.094 | 4.090 | |
| TP | 0.696 | 0.011 | 0.008 | 11.718 | 0.459 | 0.017 | 0.011 | 12.238 | |
| DeepAR | DO | 0.836 | 0.484 | 0.370 | 4.984 | 0.710 | 0.534 | 0.424 | 6.109 |
| NH3-N | 0.904 | 0.030 | 0.023 | 29.347 | 0.906 | 0.037 | 0.028 | 29.162 | |
| TN | 0.940 | 0.062 | 0.047 | 2.317 | 0.902 | 0.074 | 0.058 | 2.573 | |
| TP | 0.680 | 0.011 | 0.008 | 11.753 | 0.703 | 0.012 | 0.009 | 11.505 | |
| Bi_TLD-LSTM | DO | 0.928 | 0.340 | 0.252 | 3.393 | 0.852 | 0.382 | 0.304 | 4.421 |
| NH3-N | 0.936 | 0.026 | 0.019 | 22.356 | 0.923 | 0.033 | 0.025 | 22.478 | |
| TN | 0.943 | 0.062 | 0.045 | 2.196 | 0.890 | 0.078 | 0.061 | 2.687 | |
| TP | 0.810 | 0.009 | 0.006 | 9.929 | 0.698 | 0.013 | 0.009 | 11.644 | |
| WaveNet | DO | 0.958 | 0.286 | 0.219 | 2.943 | 0.814 | 0.428 | 0.341 | 4.961 |
| NH3-N | 0.968 | 0.018 | 0.014 | 19.373 | 0.951 | 0.027 | 0.020 | 20.251 | |
| TN | 0.969 | 0.046 | 0.035 | 1.758 | 0.920 | 0.067 | 0.053 | 2.326 | |
| TP | 0.867 | 0.008 | 0.006 | 9.152 | 0.742 | 0.012 | 0.008 | 10.306 | |
| CNN | DO | 0.948 | 0.272 | 0.205 | 2.716 | 0.817 | 0.422 | 0.328 | 4.749 |
| NH3-N | 0.961 | 0.019 | 0.014 | 14.042 | 0.907 | 0.037 | 0.026 | 21.354 | |
| TN | 0.952 | 0.055 | 0.043 | 2.119 | 0.834 | 0.096 | 0.075 | 3.242 | |
| TP | 0.911 | 0.006 | 0.004 | 7.156 | 0.487 | 0.016 | 0.010 | 11.981 | |
| Models | WQP | Training Set | Test Set | ||||||
|---|---|---|---|---|---|---|---|---|---|
| RMSE | MAE | MAPE | RMSE | MAE | MAPE | ||||
| TLR-GRU | DO | 0.962 | 0.232 | 0.165 | 2.171 | 0.955 | 0.210 | 0.166 | 2.331 |
| NH3-N | 0.966 | 0.018 | 0.013 | 15.917 | 0.960 | 0.024 | 0.018 | 17.361 | |
| TN | 0.946 | 0.059 | 0.044 | 2.189 | 0.913 | 0.069 | 0.055 | 2.441 | |
| TP | 0.919 | 0.005 | 0.004 | 5.546 | 0.948 | 0.005 | 0.004 | 4.350 | |
| TLD-LSTM | DO | 0.949 | 0.269 | 0.194 | 2.593 | 0.893 | 0.323 | 0.254 | 3.640 |
| NH3-N | 0.944 | 0.023 | 0.016 | 20.114 | 0.799 | 0.054 | 0.040 | 31.001 | |
| TN | 0.932 | 0.066 | 0.049 | 2.438 | 0.762 | 0.114 | 0.088 | 3.847 | |
| TP | 0.915 | 0.006 | 0.004 | 6.039 | 0.834 | 0.009 | 0.006 | 6.659 | |
| TLD-Transformer | DO | 0.953 | 0.259 | 0.197 | 2.669 | 0.845 | 0.390 | 0.306 | 4.335 |
| NH3-N | 0.975 | 0.015 | 0.011 | 15.964 | 0.739 | 0.061 | 0.044 | 40.420 | |
| TN | 0.936 | 0.064 | 0.049 | 2.469 | 0.704 | 0.128 | 0.098 | 4.359 | |
| TP | 0.925 | 0.005 | 0.004 | 6.312 | 0.714 | 0.012 | 0.008 | 9.163 | |
| DeepAR | DO | 0.968 | 0.214 | 0.151 | 1.995 | 0.970 | 0.172 | 0.134 | 1.891 |
| NH3-N | 0.952 | 0.021 | 0.015 | 17.356 | 0.946 | 0.028 | 0.020 | 18.173 | |
| TN | 0.949 | 0.057 | 0.044 | 2.164 | 0.911 | 0.070 | 0.055 | 2.440 | |
| TP | 0.915 | 0.006 | 0.004 | 5.630 | 0.925 | 0.006 | 0.004 | 5.348 | |
| Bi_TLD-LSTM | DO | 0.955 | 0.255 | 0.181 | 2.420 | 0.923 | 0.274 | 0.212 | 2.984 |
| NH3-N | 0.948 | 0.022 | 0.016 | 17.889 | 0.856 | 0.046 | 0.034 | 27.964 | |
| TN | 0.930 | 0.067 | 0.050 | 2.469 | 0.728 | 0.123 | 0.094 | 4.093 | |
| TP | 0.902 | 0.006 | 0.004 | 6.415 | 0.752 | 0.011 | 0.007 | 7.660 | |
| WaveNet | DO | 0.977 | 0.180 | 0.137 | 1.860 | 0.905 | 0.302 | 0.237 | 3.357 |
| NH3-N | 0.989 | 0.010 | 0.008 | 10.723 | 0.923 | 0.033 | 0.025 | 23.949 | |
| TN | 0.979 | 0.036 | 0.028 | 1.408 | 0.829 | 0.097 | 0.074 | 3.277 | |
| TP | 0.967 | 0.003 | 0.003 | 4.217 | 0.850 | 0.009 | 0.006 | 6.706 | |
| CNN | DO | 0.949 | 0.269 | 0.208 | 2.739 | 0.854 | 0.377 | 0.295 | 4.144 |
| NH3-N | 0.958 | 0.020 | 0.015 | 17.276 | 0.860 | 0.045 | 0.034 | 31.483 | |
| TN | 0.928 | 0.067 | 0.053 | 2.627 | 0.660 | 0.137 | 0.107 | 4.616 | |
| TP | 0.936 | 0.005 | 0.004 | 6.155 | 0.745 | 0.012 | 0.007 | 8.026 | |
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. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Wang, X.; Liu, M.; Li, Y.; Tavares, A.; Huang, W.; Liang, Y. Application of the Two-Layer Regularized Gated Recurrent Unit (TLR-GRU) Model Enhanced by Sliding Window Features in Water Quality Parameter Prediction. Entropy 2026, 28, 186. https://doi.org/10.3390/e28020186
Wang X, Liu M, Li Y, Tavares A, Huang W, Liang Y. Application of the Two-Layer Regularized Gated Recurrent Unit (TLR-GRU) Model Enhanced by Sliding Window Features in Water Quality Parameter Prediction. Entropy. 2026; 28(2):186. https://doi.org/10.3390/e28020186
Chicago/Turabian StyleWang, Xianhe, Meiqi Liu, Ying Li, Adriano Tavares, Weidong Huang, and Yanchun Liang. 2026. "Application of the Two-Layer Regularized Gated Recurrent Unit (TLR-GRU) Model Enhanced by Sliding Window Features in Water Quality Parameter Prediction" Entropy 28, no. 2: 186. https://doi.org/10.3390/e28020186
APA StyleWang, X., Liu, M., Li, Y., Tavares, A., Huang, W., & Liang, Y. (2026). Application of the Two-Layer Regularized Gated Recurrent Unit (TLR-GRU) Model Enhanced by Sliding Window Features in Water Quality Parameter Prediction. Entropy, 28(2), 186. https://doi.org/10.3390/e28020186

