A Using the Canny Method with Deep Learning for Detect and Predict River Water Level


  • Nisreen Tawfeeq Mustansiriyah University College of Science /Computer Department Iraq/ Baghdad
  • Jameelah Harbi Mustansiriyah University College of Science /Computer Department Iraq/ Baghdad




Age Invariant Face recognition, deep learning, biometric, convolutional neural network CNN


Recent years have witnessed a significant rise in global river water levels, driven by heavy rainfall events linked to climate change, resulting in severe flood incidents and highlighting the need for effective mitigation strategies. To address this critical issue, this article introduces a detection and prediction system for monitoring rising river water levels utilizing advanced computer vision techniques. The system is based on deep learning models are VGG16and 2D convolutional neural networks (CNNs) that are trained on river image datasets. It starts with heavy image preprocessing are normalization, resizing, Canny Edge Detection to improve edge quality. This is used to produce very exact water level measurements. The models use transfer learning and hyperparameter tuning over a wide grid to maximize monitoring accuracy over a large number of river conditions. The system performance is then thoroughly evaluated by performing extensive testing, and the VGG16 model is proven to exhibit high classification ability with the overall accuracy and precision scores no less than 98.3 % of all classes of river water level. The performance of the CNN model reaches 99.99% on testing data as well, which emphasizes its stability in real-world conditions. This novel combination of deep learning and optimized edge detection algorithms represents a powerful new capability for water level detection and flood control.


Download data is not yet available.


P. Do¨ll, B. Jime´nez-Cisneros, T. Oki, N. Arnell, G. Benito, J. Cogley, T. Jiang, Z. Kundzewicz, S. Mwakalila, and A. Nishijima, “Integrating risks of climate change into water management,” Hydrological Sciences Journal, vol. 60, no. 1, pp. 4–13, 2015.

Y. Zhen, S. Liu, G. Zhong, Z. Zhou, J. Liang, W. Zheng, and Q. Fang, “Risk assessment of flash flood to buildings using an indicator-based methodology: A case study of mountainous rural settlements in south- west china,” Frontiers in Environmental Science, vol. 10, p. 931029, 2022.

I. Vieira, V. Barreto, C. Figueira, S. Lousada, and S. Prada, “The use of detention basins to reduce flash flood hazard in small and steep volcanic watersheds–a simulation from madeira island,” Journal of Flood Risk Management, vol. 11, pp. S930–S942, 2018.

A. H. Group, C. Vo¨ro¨smarty, A. Askew, W. Grabs, R. Barry, C. Birkett, P. Do¨ll, B. Goodison, A. Hall, R. Jenne et al., “Global water data: A newly endangered species,” Eos, Transactions American Geophysical Union, vol. 82, no. 5, pp. 54–58, 2001.

A. K. Mishra and P. Coulibaly, “Developments in hydrometric network design: A review,” Reviews of Geophysics, vol. 47, no. 2, 2009.

A. A. Bradley, A. Kruger, E. A. Meselhe, and M. V. Muste, “Flow mea- surement in streams using video imagery,” Water Resources Research, vol. 38, no. 12, pp. 51–1, 2002.

K. Loizou and E. Koutroulis, “Water level sensing: State of the art review and performance evaluation of a low-cost measurement system,” Measurement, vol. 89, pp. 204–214, 2016.

“Global Runoff Database Center—River Discharge Data,” https://www.bafg.de/GRDC, accessed: 28-February-2024.

J. Riegger, M. Tourian, B. Devaraju, and N. Sneeuw, “Analysis of grace uncertainties by hydrological and hydro-meteorological observations,” Journal of Geodynamics, vol. 59, pp. 16–27, 2012.

G. Strassberg, B. R. Scanlon, and M. Rodell, “Comparison of seasonal terrestrial water storage variations from grace with groundwater-level measurements from the high plains aquifer (usa),” Geophysical Research Letters, vol. 34, no. 14, 2007.

F. Papa and F. Frappart, “Surface water storage in rivers and wetlands derived from satellite observations: a review of current advances and future opportunities for hydrological sciences,” Remote Sensing, vol. 13, no. 20, p. 4162, 2021.

S. Grimaldi, Y. Li, V. R. Pauwels, and J. P. Walker, “Remote sensing- derived water extent and level to constrain hydraulic flood forecasting models: Opportunities and challenges,” Surveys in Geophysics, vol. 37, pp. 977–1034, 2016.

K. Yan, G. Di Baldassarre, D. P. Solomatine, and G. J.-P. Schumann, “A review of low-cost space-borne data for flood modelling: topography, flood extent and water level,” Hydrological processes, vol. 29, no. 15, pp. 3368–3387, 2015.

D. Mason, G.-P. Schumann, J. Neal, J. Garcia-Pintado, and P. Bates, “Automatic near real-time selection of flood water levels from high resolution synthetic aperture radar images for assimilation into hydraulic models: A case study,” Remote Sensing of Environment, vol. 124, pp. 705–716, 2012.

L. Giustarini, R. Hostache, D. Kavetski, M. Chini, G. Corato, S. Schlaf- fer, and P. Matgen, “Probabilistic flood mapping using synthetic aperture radar data,” IEEE Transactions on Geoscience and Remote Sensing, vol. 54, no. 12, pp. 6958–6969, 2016.

D. C. Mason, S. L. Dance, S. Vetra-Carvalho, and H. L. Cloke, “Robust algorithm for detecting floodwater in urban areas using synthetic aperture radar images,” Journal of Applied Remote Sensing, vol. 12, no. 4, pp. 045 011–045 011, 2018.

M. Tanguy, K. Chokmani, M. Bernier, J. Poulin, and S. Raymond, “River flood mapping in urban areas combining radarsat-2 data and flood return period data,” Remote Sensing of Environment, vol. 198, pp. 442–459, 2017.

F. Tauro, J. Selker, N. Van De Giesen, T. Abrate, R. Uijlenhoet, M. Porfiri, S. Manfreda, K. Caylor, T. Moramarco, J. Benveniste et al., “Measurements and observations in the xxi century (moxxi): Innovation and multi-disciplinarity to sense the hydrological cycle,” Hydrological sciences journal, vol. 63, no. 2, pp. 169–196, 2018.

M. T. Perks, A. J. Russell, and A. R. Large, “Advances in flash flood monitoring using unmanned aerial vehicles (uavs),” Hydrology and Earth System Sciences, vol. 20, no. 10, pp. 4005–4015, 2016.

M. T. Perks, S. F. Dal Sasso, A. Hauet, J. Le Coz, S. Pearce, S. Pen˜a- Haro, F. Tauro, S. Grimaldi, B. Hortoba´gyi, M. Jodeau et al., “Towards harmonization of image velocimetry techniques for river surface velocity observations,” Earth System Science Data Discussions, vol. 2019, pp. 1– 20, 2019.

R. Le Boursicaud, L. Pe´nard, A. Hauet, F. Thollet, and J. Le Coz, “Gaug- ing extreme floods on youtube: Application of lspiv to home movies for the post-event determination of stream discharges,” Hydrological Processes, vol. 30, no. 1, pp. 90–105, 2016.

G. Schoener, “Time-lapse photography: Low-cost, low-tech alternative for monitoring flow depth,” Journal of Hydrologic Engineering, vol. 23, no. 2, p. 06017007, 2018.

S. Etter, B. Strobl, I. van Meerveld, and J. Seibert, “Quality and timing of crowd-based water level class observations,” Hydrological processes, vol. 34, no. 22, pp. 4365–4378, 2020.

A. Eltner, M. Elias, H. Sardemann, and D. Spieler, “Automatic image- based water stage measurement for long-term observations in ungauged catchments,” Water Resources Research, vol. 54, no. 12, pp. 10–362, 2018.

M. Zounemat-Kermani, E. Matta, A. Cominola, X. Xia, Q. Zhang, Q. Liang, and R. Hinkelmann, “Neurocomputing in surface water hydrology and hydraulics: A review of two decades retrospective, current status and future prospects,” Journal of Hydrology, vol. 588, p. 125085, 2020.

T. Rajaee, H. Ebrahimi, and V. Nourani, “A review of the artificial intel- ligence methods in groundwater level modeling,” Journal of hydrology, vol. 572, pp. 336–351, 2019.

M. F. Allawi, O. Jaafar, F. Mohamad Hamzah, S. M. S. Abdullah, and A. El-Shafie, “Review on applications of artificial intelligence methods for dam and reservoir-hydro-environment models,” Environmental Sci- ence and Pollution Research, vol. 25, pp. 13 446–13 469, 2018.

T. Rajaee and H. Jafari, “Two decades on the artificial intelligence models advancement for modeling river sediment concentration: State- of-the- art,” Journal of Hydrology, vol. 588, p. 125011, 2020.

S. Zhu and A. P. Piotrowski, “River/stream water temperature forecasting using artificial intelligence models: a systematic review,” Acta Geophys- ica, vol. 68, pp. 1433–1442, 2020.

F. Zhou, B. Liu, and K. Duan, “Coupling wavelet transform and artificial neural network for forecasting estuarine salinity,” Journal of Hydrology, vol. 588, p. 125127, 2020.

Z. M. Yaseen, A. El-Shafie, O. Jaafar, H. A. Afan, and K. N. Sayl, “Artificial intelligence based models for stream-flow forecasting: 2000– 2015,” Journal of Hydrology, vol. 530, pp. 829–844, 2015.

Z. Zhang, Q. Zhang, V. P. Singh, and P. Shi, “River flow modelling: com- parison of performance and evaluation of uncertainty using data-driven models and conceptual hydrological model,” Stochastic environmental research and risk assessment, vol. 32, pp. 2667–2682, 2018.

F. B. Hamzah, F. Mohd Hamzah, S. F. Mohd Razali, O. Jaafar, and N. Abdul Jamil, “Imputation methods for recovering streamflow observation: A methodological review,” Cogent Environmental Science, vol. 6, no. 1, p. 1745133, 2020.

S. Zhu, M. Ptak, Z. M. Yaseen, J. Dai, and B. Sivakumar, “Forecasting surface water temperature in lakes: A comparison of approaches,” Journal of hydrology, vol. 585, p. 124809, 2020.

K. S. M. H. Ibrahim, Y. F. Huang, A. N. Ahmed, C. H. Koo, and A. El- Shafie, “A review of the hybrid artificial intelligence and optimization modelling of hydrological streamflow forecasting,” Alexandria Engineer- ing Journal, vol. 61, no. 1, pp. 279–303, 2022.

A. K. Reyes, J. C. Caicedo, and J. E. Camargo, “Fine-tuning deep convolutional networks for plant recognition.” CLEF (Working Notes), vol. 1391,

pp. 467–475, 2015.

M. Sabatelli, M. Kestemont, W. Daelemans, and P. Geurts, “Deep transfer learning for art classification problems,” in Proceedings Of The European conference on computer vision (ECCV) workshops, 2018, pp. 0–0.

M. Talib and J. H. Saud, “A multi-weapon detection using deep learning,” Iraqi Journal of Information and Communication Technology, vol. 7, no. 1, pp. 11–22, 2024.

S. A. Tuama, J. H. Saud, and Z. A. Alobaidy, “Using an accurate mul- timodal biometric for human identification system via deep learning,” Al- Mansour Journal, vol. 37, no. 1, pp. 69–90, 2022.

G. Chen, K. Bai, Z. Lin, X. Liao, S. Liu, Z. Lin, Q. Zhang, and X. Jia, “Method on water level ruler reading recognition based on image processing,” Signal, Image and Video Processing, vol. 15, pp. 33–41, 2021.

G. Qiao, M. Yang, and H. Wang, “A water level measurement approach based on yolov5s,” Sensors, vol. 22, no. 10, p. 3714, 2022.

A. Eltner, P. O. Bressan, T. Akiyama, W. N. Gonc¸alves, and J. Mar- cato Junior, “Using deep learning for automatic water stage measure- ments,” Water Resources Research, vol. 57, no. 3, p. e2020WR027608, 2021.

J. Zhang, A. Xiang, Y. Cheng, Q. Yang, and L. Wang, “Research on detection of floating objects in river and lake based on ai intelligent image recognition,” arXiv preprint arXiv:2404.06883, 2024.

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, p. 100951, 2023.

K. Fei, H. Du, and L. Gao, “Accurate water level predictions in a tidal reach: Integration of physics-based and machine learning approaches,” Journal of Hydrology, vol. 622, p. 129705, 2023.

Z. Cai, L. Sun, B. An, X. Zhong, W. Yang, Z. Wang, Y. Zhou, F. Zhan, and X. Wang, “Automatic monitoring alarm method of dammed lake based on hybrid segmentation algorithm,” Sensors, vol. 23, no. 10, p. 4714, 2023.

J.-F. Chen, Y.-T. Liao, and P.-C. Wang, “Development and deployment of a virtual water gauge system utilizing the resnet-50 convolutional neural network for real-time river water level monitoring: A case study of the keelung river in taiwan,” Water, vol. 16, no. 1, p. 158, 2024.

Y. Xu, C. He, Z. Guo, Y. Chen, Y. Sun, and Y. Dong, “Simulation of water level and flow of catastrophic flood based on the cnn-lstm coupling network,” Water, vol. 15, no. 13, p. 2329, 2023.

Z. Li, F. Liu, W. Yang, S. Peng, and J. Zhou, “A survey of convolutional neural networks: analysis, applications, and prospects,” IEEE transactions on neural networks and learning systems, vol. 33, no. 12, pp. 6999–7019, 2021.

S. Mascarenhas and M. Agarwal, “A comparison between vgg16, vgg19 and resnet50 architecture frameworks for image classification,” in 2021 International conference on disruptive technologies for multi- disciplinary research and applications (CENTCON), vol. 1. IEEE, 2021, pp. 96–99.

W. Rong, Z. Li, W. Zhang, and L. Sun, “An improved canny edge detection algorithm,” in 2014 IEEE international conference on mechatronics and automation. IEEE, 2014, pp. 577–582.

W. Lu, B. Xie, and Z. Ding, “[retracted] edge detection algorithm-based lung ultrasound in evaluation of efficacy of high-flow oxygen therapy on critical lung injury,” Computational and Mathematical Methods in Medicine, vol. 2022, no. 1, p. 3604012, 2022.

J. Canny, “A computational approach to edge detection,” IEEE Transactions on pattern analysis and machine intelligence, no. 6, pp. 679–698,1986.

Y. Song, C. Li, S. Xiao, Q. Zhou, and H. Xiao, “A parallel canny edge detection algorithm based on opencl acceleration,” Plos one, vol. 19, no. 1, p. e0292345, 2024.




How to Cite

Tawfeeq, N., & Harbi, J. (2024). A Using the Canny Method with Deep Learning for Detect and Predict River Water Level. Journal of Al-Qadisiyah for Computer Science and Mathematics, 16(2), Comp Page 135–150. https://doi.org/10.29304/jqcsm.2024.16.21565



Computer Articles