# Uncovering Vegetation Changes in the Urban-Rural Interface through Semi-Automatic Methods
## 2 Materials and Methods
### Method
Here, we only aim to identify changes that indicate the decrease of the NDVI value and this is associated with the negative values of t. Obeying these criteria, for each date of the analysed image a binary raster is generated where the pixels are classified with the value (1) where changes occur and value (0) in the unchanged areas  
The resulting rasters are stacked to identify the changes between January and September 2020. To ensure that are sufficient images for the good functioning of the model at the beginning and end of the time series, we use images from the previous and subsequent months of the period analysed as a safety margin. The choice for this period is due to two main reasons. First, the data available for validation fits this period and, second, the deadlines for the management of the fuel bands set out in Decree-of-Law 124/2006. To prevent a change from being recorded more than once, we identified the change only on the first date on which a significant difference occurs. To improve the predictive capacity of the model, two levels of significance were tested: \(p\)-value \(\leq\) 0.05 and \(p\)-value \(\leq\) 0.0005. The proposed model was developed in Python language, a free-access programming resource that allows great replicability. The data available to validate the model was obtained within the National Republican Guard (_Guarda Nacional Republicana_--GNR) and consists of a database containing information on the monitoring of fuel management bands. This dataset is not available for the general public and therefore we just use the data made available by GNR. Nonetheless, fires occurrences in mainland Portugal are positively autocorrelated, showing higher prevalence in the north territory of the Tagus River [40]. Therefore, using the municipalities of Cantanhede, Figueiro dos Vinhos, Ilihavo, Miranda do Corvo, and Penela, as validation areas seems adequate. To do the monitoring, GNR visits certain locations to verify whether there has been fuel management actions inside the fuel management bands. From this, the information indicating compliance or non-compliance with the law on management actions is stored. The surveys took place between February and August 2020 and has a total of 293 registries. The validation consists in a 2 \(\times\) 2 confusion matrix. To create it, GNR dataset were intersected with the COSsim 2018 and after that with the change raster generated by the model. This allows checking whether the point is in an area 'with fuel' or 'without fuel' and whether it has changed or not within the analysed period, according to the model generated. The established confusion matrix allows to access four values:  
1. True positive (TP), model records value (1), land cover is 'fuel' and the situation of the point indicates 'compliance'. 2. False positive (FP), model records value (1), land cover is 'fuel' and the situation at the point is different from 'compliance'. 3. True negative (TN), model records value (0), land cover is 'fuel' and the situation of the point is different from 'compliance'. 4. False negative (FN), model records value (0), land cover is 'fuel' and the situation of the point indicates 'compliance'. To verify the quality of model, some metrics were computed, namely overall accuracy, precision, recall, F1-score [31] and the confidence interval associated with these values [41].