## 4 Experiment and Analysis
### Comparative Analysis of NDWI and Machine Learning Algorithms  
The model established by 2019/10/20 training data is used for water extraction in three areas of 2019/10/20. Statistical results of AUC indicators of each algorithm are shown in Figure 3 (For more details, see Tables A1-A4 in the Appendix A). In general, the XGBoost algorithm has the best accuracy, with an average AUC of 0.966, and the AUC indicators in the three regions are 0.985, 0.972, and 0.941 respectively, which is followed by the random forest algorithm with an average AUC of 0.964, and the AUC indicators in the three regions are 0.985, 0.973, and 0.935; the SVM algorithm has the worst accuracy, the average AUC is 0.898 and the AUC indicators in the three regions are 0.982, 0.789, and  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline  & & **Accuracy** & **Recall** & **AUC** \\ \hline \multirow{3}{*}{SVM} & Water & 1.000 & 0.949 & \multirow{3}{*}{0.983} \\  & Other & 0.968 & 1.000 & \\  & Water & 0.975 & 0.975 & \\ \multirow{3}{*}{Random Forest} & Other & 0.983 & 0.983 & \multirow{3}{*}{0.979} \\  & Water & 1.000 & 0.911 & \\ \multirow{3}{*}{Decision Tree} & Other & 0.945 & 1.000 & \\  & Water & 1.000 & 0.962 & \\ \multirow{3}{*}{Neural Network} & Other & 0.976 & 1.000 & \\  & Water & 1.000 & 0.975 & \\ \multirow{3}{*}{Logistic Regression} & Other & 0.984 & 1.000 & \\  & Water & 1.000 & 0.975 & \\ \multirow{3}{*}{XGBoost} & Other & 0.984 & 1.000 & 0.987 \\ \cline{1-1} \cline{2-5}  & Water & 1.000 & 0.975 & \\ \cline{1-1} \cline{2-5}  & Other & 0.984 & 1.000 & \\ \hline \hline \end{tabular}
\end{table}
Table 3: Analysis of performance indices of each algorithm.  
Figure 2: Effects of the sample number on performance of each algorithm.  
0.923, respectively. When each machine learning algorithm is applied to three different local regions, the average range of AUC index is 0.898-0.966 (for more details, see Table A1 in Appendix A), and the descending order of each machine learning algorithm is XGBoost, random forest, decision tree, logistic regression, neural network, and SVM according to the value of the AUC index. However, this is inconsistent with the conclusion of Section 4.2. In Section 4.2, there is little difference in the accuracy of each machine learning algorithm on the test set, and the AUC index ranges from 0.956 to 0.987. The machine learning algorithms are XGBoost, LR, SVM, NN, RF, and DT in descending order according to the value of the AUC index. It further explains that the evaluation on the test set cannot represent the effect of each algorithm applied in a local area. Among the threshold classification methods, the Otsu threshold algorithm is the best, with an average AUC of 0.957, and the AUC indicators in the three regions are 0.985, 0.922, and 0.964, respectively, followed by the custom threshold algorithm, and the worst performance among all algorithms is adaptive threshold algorithm: the average AUC is only 0.764.  
The image water extraction results of each algorithm were placed in the supplementary materials, as shown in Figure S1: Classification results of each algorithm in Area1 on October 20; Figure S2: Classification results of each algorithm in Area2 on October 20; Figure S3: Classification results of each algorithm in Area3 on October 20. As can be seen from the results graph, compared with other algorithms, the salt and pepper phenomenon for the adaptive threshold and custom threshold is very serious, there is a large number of non-water body \"noise\", other algorithms basically have the same visual interpretation effect, and there is no obvious difference, but the edge part is slightly different due to the influence of adjacent features.