## 3 Materials and Methods
### Sentinel-1 and Sentinel-2 Layers
#### 3.1.1 Optical Data: Sentinel-2  
S2 satellites carry a wide-swath, high-resolution Multispectral Instrument (MSI) with 13 spectral bands spanning from the visible to the short-wave infrared. The spatial resolution varies from 10 m to 60 m depending on the spectral band. The swath is 290 km. The temporal resolution of the S2A satellite is 10 days [38]. The S2A satellite was launched on the 23 June 2015. A revisitation period of five days at the equator is ensured by the launch of the S2B twin satellite on the 7 March 2017.  
All of the available S2 Level 1C (L1C) top of atmosphere (TOA) reflectance scenes on the GEE platform for 2018 over Tanzania were used. The year 2018 is the first year with a complete coverage from S2A and S2B. The top of canopy reflectance products (Level-2A) were only in the process of being ingested into the GEE system for the year 2018 at the time of the processing. While surface reflectance is preferred across the literature, atmospheric correction is not always a prerequisite for classification applications [39]. Furthermore, the classification was based on the vegetation indices (VI) that reduce the atmospheric effects.  
A custom cloud and shadow masking was applied to the L1C single images. The cloud masking was an adaptation of the cloud-score that was developed by [40] for Landsat 8 and used by [41]. A higher cloud-score was assigned to pixels with (i) higher brightness in the blue and cirrus bands (S2 bands 1, 2 and 10); (ii) higher brightness in all of the visible bands (bands 2 to 4) and (iii) higher normalized difference water index (NDWI) value. The NDWI was calculated with S2 bands 8 and 11 [42]. Any pixel with a cloud-score that was higher than 40 was considered to be cloud-contaminated.  
Figure 2: Workflow diagram of the main methodological steps.  
Two VIs were selected, the normalized difference vegetation index (NDVI) and the shadow index (SI) [43]. The NDVI highlights the seasonal behavior of the vegetation while the SI was used as a proxy for the forest canopy's density.  
NDVI Bi-Monthly Time Series  
NDVI is commonly used as an indicator of the status of vegetation due to its sensitivity to photosynthetically active biomass and the phenological dynamics that are present in the vegetation [44]. The seasonal variation of the vegetation is captured following the yearly evolution of the NDVI. However, a trade-off between the length of the compositing period and the availability of non-cloudy data had to be found. Despite a 5 day acquisition scheme, it was difficult to build S2 composites at a country level that were shorter than two months since the cloud coverage was too impactful during the rainy season. Figure 3 shows the number of cloud-free observations for each bi-monthly period.  
First, the NDVI was calculated for each single image using Equation (1). Second, the maximum value was retained for a two-month period.  
\[\text{NDVI}=(\text{NIR}-\text{RED})/(\text{NIR}+\text{RED}) \tag{1}\]  
where NIR is band 8 and RED is band 4 of S2.  
All of the layers were exported in the scale of 8-bits, adding +1 to the NDVI continuous value and multiplying by 100, which resulted in values from 0 to 200.