## 4 Training and Detection Using Deep Learning
### Test after Training  
To test the model after training, the K1-K5 area was selected as the test area (Figure 3), and a confusion matrix [28] was used for evaluation. In the confusion matrix, the detection accuracy of each pixel was calculated separately. The result is shown in Table 4. The unit of the value is in pixels. In this study, the pixel statistics of three detection targets were conducted. This is because the three detection target pixels always overlap. For example, blue tarps always lay on the roof, thus, the pixels on the roof always include pixels of blue tarps. Each row of Table 4 represents the results of each detection target, and the total number of each row is \(10^{8}\).  
In addition, according to the value of the confused matrix, five indices: accuracy, precision, recall, specification prefecture, and F value, were selected, which are expressed in Equations (8)-(12), respectively. Evaluation results of the test results are shown in Table 5.  
\[Accuracy=\frac{TP+TN}{(TP+TN+FP+FN)} \tag{8}\]  
\[Precision=\frac{TP}{(TP+FP)} \tag{9}\]  
\[Recall=\frac{TP}{(TP+FN)} \tag{10}\]  
\[Specificity=\frac{TN}{(TN+FP)} \tag{11}\]  
\[F=\frac{2\times Precision\times Recall}{Precision+Recall} \tag{12}\]  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Detected Object** & **TP** & **FN** & **FP** & **TN** \\ \hline Roof outline & 10,312,006 & 1,274,517 & 1,390,382 & 87,023,095 \\ \hline Blue tarps & 257,733 & 22,909 & 28,637 & 99,690,721 \\ \hline Roofs completely destroyed & 213,646 & 60,259 & 21,912 & 99,704,183 \\ \hline \hline \end{tabular}
\end{table}
Table 4: Results of each detection target.  
Figure 10: The validation in the training.  
Blue taps have the highest F value, reaching 0.90 because of the large number of samples of blue taps that were labeled in Section 4.1. The characteristics of blue taps themselves are simple, there are almost no changes other than shape and angle, resulting in easy detection. The F value of roof outline was 0.89 with an accuracy of 0.97. This is considered to be because the use of the COCO dataset as a pre-trained model excluded many other interfering objects. Finally, the F value of roofs completely destroyed was 0.84, which is relatively low. This is because the number of samples of roofs completely destroyed was small. Following the occurrence of the typhoon disaster, the number of roofs found to be completely destroyed was lower than the roofs covered with blue taps. This study used the data augmentation method in Figure 5 to increase the 384 samples of roofs completely destroyed to 2304. However, in the actual detection, the error rate was still very high. For example, four houses were missed during the inspection while five houses were mistakenly inspected (four agricultural greenhouses and one abandoned house). Owing to the large area of forest and sea in the study area in this research, there are many pixels that are not objects, and the value of TN of each detection target was very large. Therefore, the accuracy is determined to be higher than the actual perceived value. It is appropriate to use the F value for the final evaluation.