# Deep Learning Semantic Segmentation for Water Level Estimation Using Surveillance Camera
## 2 Methodology  
### Data Collection and Preparation  
This paper relied on existing flood-related images from the European Flood 2013 Dataset ([[http://www.inf-cv.uni-jena.de/Research/Datasets/European+Flood+2013.html](http://www.inf-cv.uni-jena.de/Research/Datasets/European+Flood+2013.html)]([http://www.inf-cv.uni-jena.de/Research/Datasets/European+Flood+2013.html](http://www.inf-cv.uni-jena.de/Research/Datasets/European+Flood+2013.html)) (accessed on 15 December 2020)) as well as local images captured from surveillance cameras installed by the Department of Irrigation and Drainage (DID), Malaysia. The European Flood 2013 dataset was developed by the Computer Vision Group of the University of Jena. Most of the images are related to the central European floods that occurred in May and June 2013 and have been collected in July 2017 from the Wikimedia Commons Category \"Central Europe floods, May/June 2013\" and its sub-categories that show flooding images. To ensure the data used in this experiment are reliable, each photo was evaluated manually and only 600 images were used from the complete set of 3710 images. Images that did not meet the criteria, such as blurred photos, non-flood-related photos, and water that was not representative of flooding events such as polluted water, were excluded. In addition, images captured from surveillance cameras collected from 20 different stations in Selangor that were retrieved from the official website of DID Selangor ([[http://infobanijirips.selangor.gov.my](http://infobanijirips.selangor.gov.my)]([http://infobanijirips.selangor.gov.my](http://infobanijirips.selangor.gov.my)) (accessed on 15 December 2020), were also used in this experiment. The cameras were installed nearby the rivers by the DID to monitor the real situation on-site. Around 110 images of the DID surveillance cameras were included in the dataset. The complete dataset is composed of 710 images from both the European Flood 2013 Dataset and the DID surveillance cameras. The images included various water-related scenarios to make the training dataset as representative as possible.  
All pixels in the images were labeled into two classes, namely water, and background as shown in Figure 1. The labels were used to create ground truth data for training and validation of the semantic segmentation algorithm. The labeling process was carried out by using the Image Labeler tool in the MATLAB(r) software. The Image Labeler provides a tool to build image databases for computer vision by marking a region of interest from an image collection. The labeling task could be done manually, semi-automatically as well as automatically using an automation algorithm. This study chose to use semi-automatic labeling to ensure the region of interest is defined correctly. As a result, the dataset consists of 710 original images and 710 labeled ground truth. The dataset was divided into a train, validation, and test set. From this dataset, 60% of the images from the dataset were used for training while the rest of the images were split evenly to 20% and 20% for validation and testing, respectively.