# Unsupervised Color-Based Flood Segmentation in UAV Imagery
## 3 Methodology
### Hysteresis Thresholding  
The probability map provides a good indication of the location of flooded areas. This now defines a probability optimization problem. To proceed to the final decision, we preferred two different threshold values to distinguish between actual flood and background. The isocontour evolves starting from the high-confidence areas and gradually grows to segment the flooded area. This technique is known as hysteresis thresholding and was first implemented for edge detection [44]. The main steps of the hysteresis thresholding method are described below:  
* We adapt the process for region growing, where the high threshold \(T_{H}\) is applied to the entire probability map to identify pixels with \(PM(p)>T_{H}\) as flood (strong flood pixels). These regions have high confidence to belong to flood areas, so they can be used as seeds in a region-growing process that is described below. * Next, a connectivity-based approach is used to track the flood. Starting from the pixels identified in the first step, the algorithm looks at neighboring pixels. If a neighboring pixel has a probability value higher than the low threshold \(T_{L}\) (weak flood pixel), it is ultimately considered part of the flood. * This process continues recursively until no more connected pixels above the low threshold are found. The hysteresis effect prevents the algorithm from being too sensitive to small fluctuations in probability. Fixels that fall between the low and high thresholds, but are not directly connected to strong flood pixels, are not considered flood. However, if a weak flood pixel is connected to a strong flood pixel, it is still considered to be part of the flood. In this way, flood continuity is maintained and false detections are reduced, so that flood boundaries are accurately identified. Figure 7: Probability maps (column 4) obtained using potential flood areas of \(M_{Final}\) (column 2), weight maps (column 3), as generated by the distance transform and the corresponding images from the Flood Area dataset (column 1). Potential flood area is shown in cyan, and non-flood area in dim gray color. The weights and probabilities range from 0 (dark blue color) to 1 (red color). We have set the low and high thresholds to be at the 1% and 75% marks, respectively. This means that pixels with a probability greater than 75% are directly classified as flood, while pixels with a probability equal or less than 1% are directly classified as non-flood. The rest of the pixels \(p\) with \(PM(p)\in(0.01,0.75]\) fall into a substantial margin of uncertainty regarding their classification as flood pixels. This uncertainty is ultimately reduced when these pixels are connected to strongly classified flood pixels. Essentially, \(T_{H}\) and \(T_{L}\) are the only parameters which could be defined exclusively by the user. But, as we can observe in Figure 12, any value in the vicinity of \(T_{L}=0.01\) and \(T_{H}=0.75\) does not change the outcome substantially, thus making our methodology robust. In Figure 8, the middle column shows the hysteresis thresholding process for four images of the Flood Area dataset in the second column. For the whole set of potential flood areas, red-colored pixels are those with probability greater than \(T_{H}\) and, therefore, certain to belong to the flood class, while the blue-colored pixels have a probability in the range \(PM(p)\in(T_{L},\,T_{H}]\). For the latter, the flood class inclusion is guaranteed only when they are linked with red pixels. Cyan-colored pixels belong to PFAs but fall below the lower threshold, and, therefore, they will be assigned to the background class. The non-flood areas, according to the \(M_{Final}\) mask, are colored with dim gray pixels. Figure 8: (**a**) Original image from the Flood Area dataset, (**b**) the applied hysteresis thresholding on the decisive probability map of the potential flood area, and (**c**) the final segmentation mask. (**b**) In red and blue are the pixels with \(PM(p)>T_{H}\) and \(T_{L}<PM(p)\leq T_{H}\), respectively.