Comparative Analysis of LSTM and GRU for River Water Level Prediction
DOI:
https://doi.org/10.52436/1.jutif.2025.6.5.5054Keywords:
Deep Learning, GRU, LSTM, Water Level PredictionAbstract
Accurate river water level prediction is essential for flood management, especially in tropical areas like Palembang. This study systematically analyzes the performance of two deep learning models, Long Short-Term Memory (LSTM) and Gated Recurrent Unit (GRU), for real-time water level forecasting using hourly rainfall and water level data collected from automatic sensors. A series of experiments were conducted by varying window sizes (10, 20, 30) and the number of layers (1, 2, 3) for both models, with model performance assessed using RMSE, MAE, MAPE, and NSE. The results demonstrate that both window size and network depth significantly influence prediction accuracy and computational efficiency. The LSTM model achieved its highest accuracy with a window size of 30 and a single layer, while the GRU model performed best with a window size of 20 and two layers. This work contributes by systematically analyzing hyperparameter configurations of LSTM and GRU models on hourly rainfall and water level time series for flood-prone regions, offering empirical insight into parameter tuning in recurrent neural architectures for hydrological forecasting. These findings highlight the importance of careful parameter selection in developing reliable early warning systems for flood risk management.
Downloads
References
B. Wang, B. Wang, W. Wu, C. Xi, and J. Wang, “Sea-water-level prediction via combined wavelet decomposition, neuro-fuzzy and neural networks using SLA and wind information,” Acta Oceanologica Sinica, vol. 39, no. 5, pp. 157–167, May 2020, doi: 10.1007/s13131-020-1569-1.
M. Gan, S. Pan, Y. Chen, C. Cheng, H. Pan, and X. Zhu, “Application of the machine learning lightgbm model to the prediction of the water levels of the lower columbia river,” J Mar Sci Eng, vol. 9, no. 5, May 2021, doi: 10.3390/jmse9050496.
R. Tur, E. Tas, A. T. Haghighi, and A. D. Mehr, “Sea level prediction using machine learning,” Water (Switzerland), vol. 13, no. 24, Dec. 2021, doi: 10.3390/w13243566.
A. M. Mihel, J. Lerga, and N. Krvavica, “Estimating water levels and discharges in tidal rivers and estuaries: Review of machine learning approaches,” May 01, 2024, Elsevier Ltd. doi: 10.1016/j.envsoft.2024.106033.
H. Li, L. Zhang, Y. Zhang, Y. Yao, R. Wang, and Y. Dai, “Water-Level Prediction Analysis for the Three Gorges Reservoir Area Based on a Hybrid Model of LSTM and Its Variants,” Water (Switzerland), vol. 16, no. 9, May 2024, doi: 10.3390/w16091227.
M. Li et al., “Prediction of water level at Huayuankou station based on rating curve,” Sci Rep, vol. 14, no. 1, Dec. 2024, doi: 10.1038/s41598-024-71510-3.
Q. Wang and S. Wang, “Machine learning-based water level prediction in lake erie,” Water (Switzerland), vol. 12, no. 10, pp. 1–14, Oct. 2020, doi: 10.3390/w12102654.
V. H. Nhu et al., “Daily water level prediction of zrebar lake (Iran): A comparison between m5p, random forest, random tree and reduced error pruning trees algorithms,” ISPRS Int J Geoinf, vol. 9, no. 8, Aug. 2020, doi: 10.3390/ijgi9080479.
Y. Ding, Y. Zhu, J. Feng, P. Zhang, and Z. Cheng, “Interpretable spatio-temporal attention LSTM model for flood forecasting,” Neurocomputing, vol. 403, pp. 348–359, Aug. 2020, doi: 10.1016/j.neucom.2020.04.110.
M. Cho, C. Kim, K. Jung, and H. Jung, “Water Level Prediction Model Applying a Long Short-Term Memory (LSTM)–Gated Recurrent Unit (GRU) Method for Flood Prediction,” Water (Switzerland), vol. 14, no. 14, Jul. 2022, doi: 10.3390/w14142221.
B. Li, G. Yang, R. Wan, X. Dai, and Y. Zhang, “Comparison of random forests and other statistical methods for the prediction of lake water level: A case study of the Poyang Lake in China,” Hydrology Research, vol. 47, pp. 69–83, Dec. 2016, doi: 10.2166/nh.2016.264.
M. Pan et al., “Water Level Prediction Model Based on GRU and CNN,” IEEE Access, vol. 8, pp. 60090–60100, 2020, doi: 10.1109/ACCESS.2020.2982433.
C. S. Kim, C. R. Kim, K. H. Kok, and J. M. Lee, “Water Level Prediction and Forecasting Using a Long Short-Term Memory Model for Nam Ngum River Basin in Lao PDR,” Water (Switzerland), vol. 16, no. 13, Jul. 2024, doi: 10.3390/w16131777.
K. Park, Y. Seong, Y. Jung, I. Youn, and C. K. Choi, “Development of Water Level Prediction Improvement Method Using Multivariate Time Series Data by GRU Model,” Water (Switzerland), vol. 15, no. 3, Feb. 2023, doi: 10.3390/w15030587.
V. Atashi, H. T. Gorji, S. M. Shahabi, R. Kardan, and Y. H. Lim, “Water Level Forecasting Using Deep Learning Time‐Series Analysis: A Case Study of Red River of the North,” Water (Switzerland), vol. 14, no. 12, Jun. 2022, doi: 10.3390/w14121971.
Y. Liu, H. Wang, W. Feng, and H. Huang, “Short term real-time rolling forecast of urban river water levels based on lstm: A case study in Fuzhou city, China,” Int J Environ Res Public Health, vol. 18, no. 17, Sep. 2021, doi: 10.3390/ijerph18179287.
V. Gude, S. Corns, and S. Long, “Flood Prediction and Uncertainty Estimation Using Deep Learning,” Water (Switzerland), vol. 12, no. 3, Mar. 2020, doi: 10.3390/w12030884.
M. M. Ahsan, M. A. P. Mahmud, P. K. Saha, K. D. Gupta, and Z. Siddique, “Effect of Data Scaling Methods on Machine Learning Algorithms and Model Performance,” Technologies (Basel), vol. 9, no. 3, Sep. 2021, doi: 10.3390/technologies9030052.
A. Kumar Dubey, A. Kumar, V. García-Díaz, A. Kumar Sharma, and K. Kanhaiya, “Study and analysis of SARIMA and LSTM in forecasting time series data,” Sustainable Energy Technologies and Assessments, vol. 47, Oct. 2021, doi: 10.1016/j.seta.2021.101474.
S. Hochreiter and J. Schmidhuber, “Long Short-Term Memory,” Neural Comput, vol. 9, no. 8, pp. 1735–1780, Nov. 1997, doi: 10.1162/neco.1997.9.8.1735.
T. Y. Kim and S. B. Cho, “Predicting residential energy consumption using CNN-LSTM neural networks,” Energy, vol. 182, pp. 72–81, Sep. 2019, doi: 10.1016/j.energy.2019.05.230.
K. Singh and J. Malhotra, “Two-layer LSTM network-based prediction of epileptic seizures using EEG spectral features,” Complex and Intelligent Systems, vol. 8, no. 3, pp. 2405–2418, Jun. 2022, doi: 10.1007/s40747-021-00627-z.
P. Oliveira, B. Fernandes, C. Analide, and P. Novais, “Forecasting energy consumption of wastewater treatment plants with a transfer learning approach for sustainable cities,” Electronics (Switzerland), vol. 10, no. 10, May 2021, doi: 10.3390/electronics10101149.
W. Li, H. Wu, N. Zhu, Y. Jiang, J. Tan, and Y. Guo, “Prediction of dissolved oxygen in a fishery pond based on gated recurrent unit (GRU),” Information Processing in Agriculture, vol. 8, no. 1, pp. 185–193, Mar. 2021, doi: 10.1016/j.inpa.2020.02.002.
A. H. Kamel, H. A. Afan, M. Sherif, A. N. Ahmed, and A. El-Shafie, “RBFNN versus GRNN modeling approach for sub-surface evaporation rate prediction in arid region,” Sustainable Computing: Informatics and Systems, vol. 30, Jun. 2021, doi: 10.1016/j.suscom.2021.100514.
V. Someetheram, M. F. Marsani, M. S. M. Kasihmuddin, S. Z. M. Jamaludin, M. A. Mansor, and N. E. Zamri, “Hybrid double ensemble empirical mode decomposition and K-Nearest Neighbors model with improved particle swarm optimization for water level forecasting,” Alexandria Engineering Journal, vol. 115, pp. 423–433, Mar. 2025, doi: 10.1016/j.aej.2024.12.035.
A. I. Pathan et al., “Comparative assessment of rainfall-based water level prediction using machine learning (ML) techniques,” Ain Shams Engineering Journal, vol. 15, no. 7, Jul. 2024, doi: 10.1016/j.asej.2024.102854.
J. F. Ruma, M. S. G. Adnan, A. Dewan, and R. M. Rahman, “Particle swarm optimization based LSTM networks for water level forecasting: A case study on Bangladesh river network,” Results in Engineering, vol. 17, Mar. 2023, doi: 10.1016/j.rineng.2023.100951.
L. Dong et al., “Prediction of streamflow based on dynamic sliding window lstm,” Water (Switzerland), vol. 12, no. 11, pp. 1–11, Nov. 2020, doi: 10.3390/w12113032.
D. Tomar, P. Tomar, A. Bhardwaj, and G. R. Sinha, “Deep Learning Neural Network Prediction System Enhanced with Best Window Size in Sliding Window Algorithm for Predicting Domestic Power Consumption in a Residential Building,” Comput Intell Neurosci, vol. 2022, 2022, doi: 10.1155/2022/7216959.
A. G. Salman, Y. Heryadi, E. Abdurahman, and W. Suparta, “Single Layer & Multi-layer Long Short-Term Memory (LSTM) Model with Intermediate Variables for Weather Forecasting,” in Procedia Computer Science, Elsevier B.V., 2018, pp. 89–98. doi: 10.1016/j.procs.2018.08.153.
B. S. Kwon, R. J. Park, and K. Bin Song, “Short-Term Load Forecasting Based on Deep Neural Networks Using LSTM Layer,” Journal of Electrical Engineering and Technology, vol. 15, no. 4, pp. 1501–1509, Jul. 2020, doi: 10.1007/s42835-020-00424-7.
Additional Files
Published
How to Cite
Issue
Section
License
Copyright (c) 2025 Fakhri Al Faris, Ahmad Taqwa, Ade Silvia Handayani, Nyayu Latifah Husni, Wahyu Caesarendra, Asriyadi, Leni Novianti, M. Arief Rahman

This work is licensed under a Creative Commons Attribution 4.0 International License.