# Efficient Argan Tree Deforestation Detection Using Sentinel-2 Time Series and Machine Learning
## 3 Results  
### Statistics and Analysis  
#### 3.1.1 Optimizing Models and S2 Data Level to Identify the Best Time for Argan Tree Detection  
In the initial phase, all selected machine learning models were trained on Sentinel-2 bands (both Levels 1C and 2A) and remote sensing indices (single-temporal data). Tables 9 and 10 display the results obtained. The first observation noted is that the OA and kappa rise and fall simultaneously, making it sufficient to rely on one of them. The results clearly demonstrate the superiority of DT, RF, LightGBM, and XGBoost over the other models. LightGBM, in particular, showed outstanding results, with an OA of approximately 98.0% for both levels in 2017/2018 and of 98.0% for Level 2A and 99.3% for Level 1C in 2022/2023. The Gaussian Naive Bayes model yielded the lowest OA. Based on those results, LightGBM will be the primary model used for organ tree detection. Regarding Levels 1C and 2A, the results are very close. Specifically, for LightGBM, the results are equal for 2017/2018, with a slight advantage for Level 1C over Level 2A in 2022/2023. Consequently, Level 1C data will be used in the remaining stages of this study. Having selected the most suitable machine learning model and data level, the focus now shifts to determining the time that yields the best results. Figure 7 presents the classification outcomes for organ detection, assessed using OA, with the LightGBM model and single-temporal Level 1C data. The results demonstrate notable variability in performance across different dates, highlighting the importance of selecting the optimal time for organ tree detection. For the 2017/2018 period, the best results were achieved in early October, early November, and late February, whereas for 2022/2023, the highest OA was observed in late December. To ensure consistency, the selected detection time for both years had to fall within a period that yielded strong results for each. Based on this criterion, late July was chosen, specifically 24 July 2018 and 18 July 2023. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Algorithm** & **Data Level** & \
\begin{tabular}{c} **Overall** \\ **Accuracy** \\ \end{tabular} & **Argan Precision** &
\begin{tabular}{c} **Non-Argan** \\ **Precision** \\ \end{tabular} & **Kappa** \\ \hline \multirow{2}{*}{Support Vector Machine} & 1C & 0.964 & 0.97 & 0.96 & 0.928 \\ \cline{2-6}  & 2A & 0.971 & 0.97 & 0.97 & 0.942 \\ \hline \multirow{2}{*}{Decision Tree} & 1C & 0.986 & 0.97 & 1.00 & 0.971 \\ \cline{2-6}  & 2A & 0.986 & 0.97 & 1.00 & 0.971 \\ \hline \multirow{2}{*}{Random Forest} & 1C & 0.986 & 0.97 & 1.00 & 0.971 \\ \cline{2-6}  & 2A & 0.986 & 0.97 & 1.00 & 0.971 \\ \hline \multirow{2}{*}{**LightGBM**} & **1C** & **0.993** & **0.99** & **1.00** & **0.986** \\ \cline{2-6}  & 2A & 0.986 & 0.97 & 1.00 & 0.971 \\ \hline \multirow{2}{*}{XGBoost} & 1C & 0.986 & 0.97 & 1.00 & 0.971 \\ \cline{2-6}  & 2A & 0.986 & 0.97 & 1.00 & 0.971 \\ \hline \multirow{2}{*}{Gaussian Naive Bayes} & **1C** & **0.993** & **0.99** & **1.00** & **0.986** \\ \cline{2-6}  & 2A & 0.986 & 0.97 & 1.00 & 0.971 \\ \hline \multirow{2}{*}{K-Nearest Neighbors} & 1C & 0.986 & 0.97 & 1.00 & 0.971 \\ \cline{2-6}  & 2A & 0.986 & 0.97 & 1.00 & 0.971 \\ \hline \multirow{2}{*}{Random Forest} & 1C & 0.986 & 0.97 & 1.00 & 0.971 \\ \cline{2-6}  & 2A & 0.986 & 0.97 & 1.00 & 0.971 \\ \hline \multirow{2}{*}{**LightGBM**} & **1C** & **0.993** & **0.99** & **1.00** & **0.986** \\ \cline{2-6}  & 2A & 0.986 & 0.97 & 1.00 & 0.971 \\ \hline \multirow{2}{*}{XGBoost} & 1C & 0.986 & 0.97 & 1.00 & 0.971 \\ \cline{2-6}  & 2A & 0.986 & 0.97 & 1.00 & 0.971 \\ \hline \multirow{2}{*}{Gaussian Naive Bayes} & 1C & 0.884 & 0.92 & 0.85 & 0.768 \\ \cline{2-6}  & 2A & 0.884 & 0.91 & 0.86 & 0.768 \\ \hline \multirow{2}{*}{K-Nearest Neighbors} & 1C & 0.971 & 0.96 & 0.99 & 0.942 \\ \cline{2-6}  & 2A & 0.971 & 0.97 & 0.97 & 0.942 \\ \hline \multirow{2}{*}{Artificial Neural Network} & 1C & 0.971 & 0.96 & 0.99 & 0.942 \\ \cline{2-6}  & 2A & 0.964 & 0.96 & 0.97 & 0.928 \\ \hline \hline \end{tabular}
\end{table}