# Application of the Two-Layer Regularized Gated Recurrent Unit (TLR-GRU) Model Enhanced by Sliding Window Features in Water Quality Parameter Prediction

**Authors:** Xianhe Wang, Meiqi Liu, Ying Li, Adriano Tavares, Weidong Huang, Yanchun Liang

PMC · DOI: 10.3390/e28020186 · 2026-02-06

## TL;DR

A new deep learning model called TLR-GRU, enhanced with sliding window features, improves real-time water quality predictions for aquaculture and irrigation.

## Contribution

The novel TLR-GRU model integrates sliding window features and regularization to better predict water quality parameters with high precision.

## Key findings

- The TLR-GRU model outperformed six other deep learning models in predicting water quality parameters.
- Sliding window features reduced noise while preserving ecological patterns, improving prediction accuracy.
- DO and TP predictions improved significantly, with R2 scores increasing and RMSE decreasing.

## Abstract

Water quality monitoring is critical for public health, ecology, and economic sustainability, but traditional methods are limited by temporal-spatial coverage and cost, failing to meet real-time assessment needs. Deep learning for water quality prediction is often hindered by high complexity and noise in raw time series. This study aims to address the high complexity and noise of hydrological time series by proposing a prediction framework integrating sliding window feature enhancement, principal component analysis (PCA), and a two-layer regularized gated recurrent unit (TLR-GRU). The core goal is to achieve high-precision real-time prediction of four key water quality parameters (dissolved oxygen (DO), ammonia nitrogen (NH3-N), total phosphorus (TP), and total nitrogen (TN)) for aquaculture and irrigation. Sample entropy (SampEn, m=2, r=0.2 × std(X)), a univariate complexity metric capturing intra-series pattern repetition, quantifies time series regularity, showing sliding windows reduce SampEn by filtering transient noise while retaining ecological patterns. This optimization synergizes with TLR-GRU’s regularization (L2, Dropout) to avoid overfitting. A total of 4970 water quality records (2020–2023, 4 h sampling interval) were collected from a monitoring station in a typical aquaculture-irrigated water body. After dimensionality reduction via PCA, experimental results demonstrate that the TLR-GRU model outperforms six state-of-the-art deep learning models (e.g., TLD-LSTM, WaveNet) on both the base dataset and the sliding window-enhanced dataset. On the latter, DO and TP test set R2 rise from 0.82 to 0.93 and 0.81 to 0.92, with RMSE decreasing by 49.4% and 55.6%, respectively. This framework supports water resource management, applicable to rivers and lakes beyond aquaculture. Future work will optimize the model and integrate multi-source data.

## Linked entities

- **Chemicals:** TP (PubChem CID 9834371)

## Full-text entities

- **Genes:** CLEC3B (C-type lectin domain family 3 member B) [NCBI Gene 7123] {aka MCDR4, TN, TNA}
- **Diseases:** PCA (MESH:C566443), DO (MESH:D000860), injury to (MESH:D014947), TN (MESH:D007222)
- **Chemicals:** Ammonia Nitrogen (-), Water (MESH:D014867), Oxygen (MESH:D010100), NH3 (MESH:D000641), Phosphorus (MESH:D010758), N (MESH:D009584)
- **Species:** Norovirus (genus) [taxon 142786], Tilapia (genus) [taxon 8126], Homo sapiens (human, species) [taxon 9606]

## Figures

13 figures with captions in the complete paper: https://tomesphere.com/paper/PMC12940077/full.md

---
Source: https://tomesphere.com/paper/PMC12940077