# Efficient Argan Tree Deforestation Detection Using Sentinel-2 Time Series and Machine Learning
## 2 Materials and Methods
### Data Acquisition and Pre-Processing
#### 2.4.3 Ground Truth Data  
Ground truth data were meticulously collected using tools from the GEE platform. To ensure the accuracy required for a comprehensive analysis, organ trees were precisely geolocated and marked (using a GEE tool) through a detailed examination of high-resolution Google Earth imagery. This identification was based on prior knowledge of the study area and the distinctive characteristics of the organ tree, such as crown size, color, and shadow patterns, which allowed us to distinguish them from other tree species present in the images. Data validation was carried out via field visits to the study area, enhancing the quality and credibility of data (Figure 3). Once the organ trees were identified, the data were downloaded using a custom GEE script. Data collection was conducted in late 2023. It is important to note that we did not have organ data for 2017/2018; therefore, we assumed that the trees present in 2022/2023 were also present in 2017/2018, as no reforestation efforts had occurred between these periods.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**2017/2018** & \multicolumn{3}{c}{**2022/2023**} \\ \hline
**The First Half** & **The Second Half** & **The First Half** & **The Second Half** \\ \hline
02/09/2017 & 19/09/2017 & 08/09/2022 & 28/09/2022 \\
02/10/2017 & 22/10/2017 & 06/10/2022 & 21/10/2022 \\
01/11/2017 & 21/11/2017 & 07/11/2022  
The ground truth data were divided into two categories: the Argan, representing organ trees, and the Non-Argan, representing other objects such as buildings, farms, soil, etc. Since accurate identification of organ trees is crucial for the success of this study, two types of data were used: tabular data and image data.  
The tabular data (data for training and testing) consisted of spectral information for each selected pixel, along with spectral indices. These data were divided into two categories: single-temporal and multi-temporal tabular data. Single-temporal tabular data were used to train machine learning models on data from a single day, whereas multi-temporal tabular data were used to train models on time-series data, with 24 days from each life cycle selected to form the time series. To ensure a balanced representation, an equal number of samples were selected for each category, with 695 pixels chosen for the Argan category and 695 pixels for the Non-Argan. This balanced sample size ensures that both categories receive equal attention during training, preventing bias toward the dominant class. The specific number of pixels was determined by the maximum amount of data that could be collected within the constraints of the available time frame.  
For the imagery data (data for testing only), the aim was to identify the optimal scenario for detecting and mapping organ trees with high accuracy. A small region was completely labeled to create a reference image (Figure 4), enabling the evaluation of different scenarios. The reference image has dimensions of 65 by 90 pixels and includes 688 pixels representing the Argan category and 5162 pixels representing the Non-Argan category, accurately reflecting the 2023 distribution of organ trees.  
Figure 4: The reference image for both 2017/2018 and 2022/2023, including annotations on the 2022/2023 image. The green box highlights a zoomed-in area in the high-resolution Google Earth satellite image.  
Figure 3: The process of labelling pixels.