EGU General Assembly 2023
© Author(s) 2023. This work is distributed under
the Creative Commons Attribution 4.0 License.

Machine learning for water detection in ephemeral streams

Salvador Peña-Haro, Daniel Hernandez, and José M. Cecilia
Salvador Peña-Haro et al.
  • photrack ag, Zurich, Switzerland (

Measuring the volumetric water flow in ephemeral streams, typical of semi-arid climates, in which water rarely flows, is challenging since water only flows some days per year and some times it is in the form of flash floods. In this type of conditions it is important to detect when there is water in the stream. For this, we have implemented a machine learning algorithm for water detection and for stream gauge measurement.

Machine learning was used to differentiate pixels of the image that contains water from those those that do not via image segmentation. Different segmentation models have been proposed, but in our case we used an encoder-decoder DNN architecture based on DeepLabV3. To train the model, we used the ArtificiaL And Natural waTer-bodIes dataSet (ATLANTIS) data-set. However not all the images were used since these data-set includes classes that are not representative for our application, hence the total number of images used for training was 685. Additionally the original defined classes were merged to reduce the problem to a semantic binary segmentation problem, since our objective is to simply detect the presence of water on the stream. In addition to those images, we have used other images recorded by fix cameras looking at some ephemeral streams to improve the training.

The trained network was used to analyze 50 images with different water levels or no water. To evaluate its performance and indicator was defined which considered the number of pixels classified as water inside the image area covered by the stream over the total number of potential pixels having water, and a 60% threshold was used to determine if there is water in the stream. From the 50 images analyzed, only 3 were wrongly classified giving promising results.

This work has been supported by the European Union’s Horizon 2020 research and innovation programme under grant agreement No 101017861 and also by projects RTC2019-007159-5 and Ramon y Cajal Grant RYC2018-025580-I, funded by MCIN/AEI/10.13039/501100011033, “FSE invest in your future” and “ERDF A way of making Europe”

How to cite: Peña-Haro, S., Hernandez, D., and Cecilia, J. M.: Machine learning for water detection in ephemeral streams, EGU General Assembly 2023, Vienna, Austria, 24–28 Apr 2023, EGU23-14752,, 2023.