# Efficient Argan Tree Deforestation Detection Using Sentinel-2 Time Series and Machine Learning
## 4 Discussion

Table 14: The average overall accuracy for each season during 2017/2018 and 2022/2023 periods. Figure 12: Monthly precipitation (mm) in the study area during the 2017–2023 period [128]. interpolation method used minimized data distortion, preserved spatial patterns, and enabled the effective use of certain indices (e.g., ARVI and SCI), which combine bands of different native resolutions (10 m, 20 m, and 60 m). Standardizing spatial resolution across all input features benefits machine learning models, as they tend to perform better when all variables share the same resolution, reducing potential biases during training and classification. While resampling inherently has limitations, in this study, it proved advantageous by enhancing model consistency, improving classification performance, and enabling a more effective integration of spectral information. In this study, OA was assessed using tabular test data and image-based test data, which provide a more realistic representation of real-world complexities. This resulted in a clear gap between the OA achieved with tabular data (100%) and that obtained with image-based data (85%). This discrepancy is primarily due to key classification challenges inherent in image data, including tree edge overlap, which leads to multiple land cover types within a single pixel, the loss of spatial contextual information when data are represented in tabular form, and the impact of mixed pixels, which complicates classification. Nevertheless, achieving perfect accuracy with tabular data does not imply that the task was easy or unreliable; rather, it reflects the quality of data preprocessing and the selection of relevant features. Since the models were trained on tabular data, it is natural for them to perform better on this format than on image-based data. Furthermore, applying the model to an entire scene--characterized by its vastness, class diversity, and factors such as terrain and spatial context--naturally leads to a decrease in accuracy compared to the training phase. This is expected in binary classification, where Argan tree samples were carefully selected to simulate their spectral characteristics. Pixel-based classification has significant limitations in organ tree detection, leading to errors in deforestation mapping. Factors already discussed, such as the 10-m resolution of Sentinel-2, the presence of mixed pixels, and daily spectral variations, contributed to the classification uncertainties. In an attempt to resolve these problems, a patch-based approach was applied. Since the study area is located in the plain of Souss organ orchards, which has an average density of 10 trees/ha [6], and that the organ tree may be shrubby or reach up to 10 m, occasionally 20 m [130], we conclude that an organ pixel can be located in a window larger than 3 \(\times\) 3 pixels (such as a 5, 7, or 9 pixels square). In this case, the most appropriate patch size would be 7 \(\times\) 7 or even 9 \(\times\) 9 (close to one hectare) for a sure probability of organ presence. However, determining that optimal patch size (for deforestation detection) was particularly challenging due to the lack of reference data for 2017/2018, which prevented direct numerical validation. Therefore, the two criteria described in Section 2.8 were adopted to evaluate patch performance. The visual assessment (first criterion) revealed that 1 \(\times\) 1 and 3 \(\times\) 3 were the least effective patch sizes. They produced excessive noise and classification errors, making it unreliable. In Figure 13 (Study area--Region 1), which shows a newly constructed road in 2022/2023 that did not exist in 2017/2018, the 1 \(\times\) 1 and 3 \(\times\) 3 patches captured this change most clearly. However, in Figure 14 (Study area--Region 2), a zone with no significant changes between 2017/2018 and 2022/2023, the 7 \(\times\) 7 and 9 \(\times\) 9 patches best preserved this stability, with 9 \(\times\) 9 maintaining more relevant spatial details.