# Robust Damage Estimation of Typhoon Goni on Coconut Crops with Sentinel-2 Imagery
## 4 Methods
### Robust Density Change Detection  
After the model has been trained with the actively selected samples, we apply it to our entire area of interest. More robust change estimates can be obtained by using only predictions with reasonably low uncertainty. In general, predictions are affected by two types of uncertainties: epistemic uncertainty, i.e., the model's lack of knowledge due to unseen patterns not encountered during training, which was already used to select the training samples; and the aleatoric uncertainty, which is the uncertainty inherent in the data, where the input data does not contain the information needed to unambiguously determine the correct output, even if perfect model parameters were known. Unobserved conditions that give rise to epistemic uncertainty could include a vegetation type not encountered in the training set or, more relevant to our case, situations that are normally not encountered except after a typhoon, such as destroyed buildings or defoliated forest. This uncertainty can be modelled by running an ensemble of (density) prediction networks on the same input image, in the same way as during active learning. The aleatoric uncertainty in optical remote sensing can largely be attributed to cloud cover. For Sentinel-2, cloud probability masks are available. To reduce the overall effect of clouds on our predictions, we discard pixels with cloud probability \(>\)50% during training, and predict only for pixels with a low chance of dense cloud cover (cloud probability \(<\)10%). This however does not completely remove the uncertainty, as some part of it stems from other sources, for instance imperfect cloud masks or not density-related changes on the ground. Rather than using only a single input image per location, we run the prediction for multiple different (cloud-free) images within a time window and average the estimates. A natural approach to model the uncertainty in such a scenario is to compute the standard deviation over the \(N_{lat,lon}\) predictions at a given location. This is especially important for the _after_-map, where only 4 months of Sentinel-2 data were available at the time of our study. We are interested in computing the overall uncertainty, to filter out unreliable estimates. To that end we evaluate the standard deviation both over \(M\) different models and over \(N\) different samples at each location. The combined epistemic and aleatoric uncertainty of the predicted density is equal to:  
\[\sigma_{\hat{y}}=\sqrt{\frac{1}{(M-1)(N-1)}\sum_{i=1}^{M}\sum_{i=1}^{N}(\hat{y }_{i,j}-\hat{y})^{2}}. \tag{3}\]  
The combined standard deviation is transformed to a quantity similar in nature to the coefficient of variation (\(CV\)), but adjusted depending on the distribution of \(\hat{y}\):  
\[CV=\frac{\sigma_{\hat{y}}}{\epsilon+\hat{y}}, \tag{4}\]where \(\epsilon\) acts as a regulariser for very low values of \(\hat{y}\) that could otherwise affect the \(CV\). The \(CV\) quantifies the relative standard deviation measure with respect to the predicted density. Depending on the desired recall ( i.e. the percentage of predictions that we want to keep), we can select predictions according to a confidence threshold, \(CV<\tau\), and discard predictions with too high uncertainty. Furthermore, we also remove predictions at pixels that never had clear visibility within the considered time window (i.e., always cloud probability >10% or cloud shadow). Changes are only computed for pixels that have low uncertainty both before and after the typhoon. Using only the reliable density estimates, we create a change image \(\Delta=\hat{y}_{before}-\hat{y}_{after}\). Based on the values \(\Delta\) and \(\hat{y}_{before}\), pixels are classified according to the rule:  
\[\text{Change}(\Delta,\hat{y}_{before})= \begin{cases}\text{Damaged},&\text{if }\hat{y}_{before}\geq 0. 4\text{ and }\Delta\geq 0.4\\ \text{New},&\text{if }\hat{y}_{before}<0.4\text{ and }\Delta\leq-0.4\\ \text{Unchanged},&\text{if }\hat{y}_{before}\geq 0.4\text{ and }|\Delta|<0.4\\ \text{Non-coconut},&\text{otherwise}\end{cases}