# Detection of Surface Water and Floods with Multispectral Satellites
## 3 Multispectral Indices for Water Segmentation
### Performance Assessment  
Thematic maps obtained from remote sensing data need to be verified in terms of quality, or accuracy, to check to which extent they correspond to reality. According to [PERSON] and [PERSON] [108], accuracy assessment follows a detailed protocol that includes three main components: (a) design of the reference sample, (b) response design to determine the reference classification, and (c) analysis of the classification accuracy through the estimation of error metrics.  
The most common evaluation technique to perform an accuracy assessment of image classification (component c) of the assessment protocol is the confusion or error matrix, to be chosen as the standard method for checking the accuracy of remote sensing-derived maps [109]. A confusion matrix is the starting point for evaluation purposes in which the classified and reference maps are directly compared in a simple two-by-two table where diagonal values represent the number of correctly classified pixels, either true-positive (TP) or true-negative (TN) data, while off-diagonal values indicate misclassifications (i.e., false-positive (FP) and false-negative (FN) values). The confusion matrix allows several descriptive metrics to be computed, including the overall accuracy (OA), which describes the proportion of correctly classified pixels; the user's accuracy (UA), also called reliability or precision, which describes the number of pixels assigned to class \(i\) that in fact correspond to that class in the reference image; and the producer's accuracy (PA), also called sensitivity, recall, or true-positive rate, which represents the number of pixels corresponding to class \(j\) in the reference map and classified as class \(j\) in the classified image. In addition, the Kappa coefficient, \(\kappa\), can be derived from the confusion matrix considering the overall proportion of agreement, \(p_{0}\), which corresponds to the overall accuracy, and the chance agreement, \(p_{c}\). This coefficient expresses the proportion of agreement between the classified and reference maps after removing the agreement that can occur by chance [110], and it also takes into consideration off-diagonal values. It ranges between \(-1\) and \(1\), respectively indicating no or a perfect agreement, while a value equal to zero indicates agreement occurring by chance.  
In general, surface water and flooded area delineation maps are in the form of binary images, in which pixels are either marked as water/flooded or non-water/non-flooded. Therefore, the confusion matrix is composed of two classes. Assuming that Table 4 is the result of a classification process for surface water detection and that the aim is to assess the accuracy of the derived water delineation map, the aforementioned descriptive statistics for the water class are expressed according to the formula reported in Equations (1)-(5).  
\[OA\ (\%)=p_{0}=\frac{TP+TN}{T}.100, \tag{1}\]  
\[UA\ (\%)=\frac{TP}{C_{NW}}.100, \tag{2}\]  
\[PA\ (\%)=\frac{TP}{R_{W}}.100, \tag{3}\]  
\[p_{c}(\%)=\frac{(R_{W}.C_{W})+(R_{NW}.C_{NW})}{T^{2}}.100, \tag{4}\]  
\[\kappa=\frac{p_{0}-p_{c}}{100-p_{c}}, \tag{5}\]  
where \(T\) is the total number of pixels in the image and \(C_{W}\) and \(C_{NW}\) represent the total number of pixels respectively corresponding to water and non-water classes in the classified map, while \(R_{\text{W}}\) and \(R_{\text{NW}}\) represent the total number of pixels respectively corresponding to water and non-water classes in the reference map.