# MFFNet: A Building Extraction Network for Multi-Source High-Resolution Remote Sensing Data
## 3 Model and Evaluation Metrics
### Evaluation Metrics  
For a comprehensive evaluation of model performance, we employed six commonly used metrics in semantic segmentation: MIOU (mean intersection over union), PA (pixel accuracy), precision, recall, F1-score, and kappa. The calculation of these six metrics is aided by the binary confusion matrix (Figure 7). First, we consider buildings as positive and the background as negative. TP (true positive) represents samples predicted to be positive and labeled as positive. FN (false negative) represents samples predicted as negative but labeled positive. FP (false positive) represents samples predicted as positive but labeled as negative. TN (true negative) represents samples predicted as negative and labeled as negative. In the metric calculation process, both buildings and backgrounds are considered  
Figure 6: ASPP module structure.  
positive instances and negative instances, respectively, and their average values are used to determine MIOU, precision, recall, and F1-score. However, for the accuracy and kappa metrics, the results remain consistent regardless of whether a particular target is considered a positive or negative instance, as determined via the inherent calculation equation.  
The detailed evaluation index is described as follows:  
\[IoU=\frac{TP}{TP+FN+FP} \tag{3}\]  
\[MIoU=\frac{1}{N}{\sum(IoU_{class})} \tag{4}\]  
\[Accuracy=\frac{TP+TN}{TP+TN+FP+FN} \tag{5}\]  
\[Precision=\frac{TP}{TP+FP} \tag{6}\]  
\[Recall=\frac{TP}{TP+FN} \tag{7}\]  
\[F1-score=\frac{2\times Precision\times Recall}{Precision+Recall} \tag{8}\]  
\[Po=\frac{TP+TN}{TP+TN+FP+FN} \tag{9}\]  
\[Pe=\frac{(TP+FN)\times(TP+FP)+(FN+TN)\times(FP+TN)}{\left(TP+TN+FP+FN\right)^ {2}} \tag{10}\]  
\[Kappa=\frac{Po-Pe}{1-Pe} \tag{11}\]  
where \(TP\) represents samples predicted as positive and labeled as positive, \(FN\) represents samples predicted as negative but labeled as positive, \(FP\) represents samples predicted as positive but labeled as negative, and \(TN\) represents samples predicted as negative and labeled as negative. \(IoU_{class}\) represents the \(IoU\) of each type.  
Figure 7: Confusion matrix (with buildings considered as positive instances).  
MIoU reflects the ratio of the pixel intersection to the union between the predicted results and the actual annotations, indicating the degree of pixel overlap between the predictions and the ground truth. Accuracy measures the proportion of pixels correctly classified by the model in pixel-level classification tasks; precision quantifies the number of samples correctly classified into the positive category in pixel-level classification tasks; and recall assesses the model's capability to identify positive category samples in pixel-level classification tasks. To provide a comprehensive evaluation of both precision and recall, the F1-score is employed to harmonize the significance of precision and recall; and kappa is a metric used to evaluate the consistency of pixel-level classification tasks. Considering the influence of random allocation, besides the mentioned evaluation using the above metrics, the final imaging results of the output images are also considered. Given that there might be a small number of mislabeled pixels during sample annotation, the display of imaging results can help us to evaluate a model's ability to resist noise.