## 2 Materials and Methods
### Software Development and Image Analysis
First, a baseline image composite is created over a user-defined reference period. The composite is then classified into a land cover baseline map. For the change detection, a sequence of more recent single Sentinel-2 images is downloaded and classified into single-date land cover maps using the same model. A post-classification change detection process then compares the land cover class of the baseline composite to those of each change detection image to detect land cover changes. To provide robustness to the effect of clouds, the PyEO forest alerts algorithm masks out clouds and cloud shadows based on the Scene Classification Layer (SCL) provided as part of the Sentinel-2 product. The cloud mask can optionally be dilated by applying a morphological filter to mask out the fringes of clouds and cloud shadows in neighbouring pixels. To support this revised machine learning approach, a standardised set of land cover classes were defined (Table 1) and used as the basis for training the machine learning model using manually defined polygons of known land cover types. In the evaluation of the forest cover loss detections from the post-classification change detection with the random forest model, under certain circumstances, forest cover loss was confused with spectrally similar landscape features. An example is a case of hillsides illuminated by the sun. To improve the quality of the forest cover loss detections, an optional additional classification test was introduced to the change detection process. When a change between a single-date Sentinel-2 image and the baseline image composite is detected, the difference in their Normalised Difference Vegetation Index (dNDVI) is calculated for each pixel. dNDVI is a measure of the decrease in vegetation greenness, \begin{table}
\begin{tabular}{c c} \hline \hline
**Class Number** & **Description** \\ \hline
1 & Primary forest \\
2 & _Plantation forest_ \\
3 & Bare soil \\
4 & Crops \\
5 & Grassland \\
6 & _Open water_ \\
7 & _Burn scar_ \\
8 & _Cloud_ \\
9 & _Cloud shadow_ \\
10 & _Haze_ \\
11 & Sparse woodland \\
12 & Dense woodland \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Generic specification of land cover classes that can be used in the change detection algorithm. Classes shown in italics were not used in the model training for this specific application and are only shown for completeness. which is often related to the loss of vegetation cover. The resulting dNDVI image can then be classified into two classes based on a simple threshold to create a map of areas where forest loss is likely to have occurred. Based on visual histogram analysis of dNDVI images of forest and non-forest areas, a dNDVI threshold of \(-0.2\) was adopted as a default for generating this map. The output from this step is a hybrid change detection. Switching on this hybrid change detection option combines the change detections from dNDVI with the machine learning outputs through a logical AND operation with the aim to produce fewer false positive forest loss detections and a higher-quality change map. Once the hybrid post-classification change detection has been performed for each Sentinel-2 change detection image relative to the baseline composite, a time-series analysis of the resulting sequence of binary change images (forest loss/no forest loss) is performed to build the analyst report as a multi-layered GeoTIFF file. The analyst report layers are updated when a new monitoring image is processed by the pipeline and contain aggregated information for each pixel, including the date of the earliest change detection, the number of confirmed subsequent change detections, the consistency of any change detection over time, and, derived from these, a binarised output layer that can quickly guide the analyst to the most likely areas of forest loss.