## 4 Methodology
### Implementing Gully Erosion Susceptibility Model  
In this work, the k-fold cross-validation technique was applied to test the reliability of the MaxEnt method for mapping the gully erosion susceptibility. The k-fold cross-validation is a statistical validation approach largely used for evaluating predictive models in the field of geo-environmental sciences [26; 64; 65]. The prediction model is trained and validated k times, using a different fold as the testing set each time. Applying the k-fold cross-validation procedure was chosen to decrease the negative effects of a random selection of the training and testing sets on the model's performance [64]. In the k-fold cross-validation, the dataset is uniformly and randomly divided into k folds (f\({}_{1}\), f\({}_{2}\),... f\({}_{k}\)) of analogous size [65]. The advantage of this method is that all samples are used for training and testing the model [26]. Therefore, k \(-\) 1 folds are used for training the model, and the last fold is used for testing. The process is replicated k \(-\) 1 times so that each fold is considered for testing. This research performed the k-fold cross-validation by randomly partitioning the gully erosion inventory (529 gully points) into 10 folds or subsets of approximately equal size (train-to-test ratio 90:10). Then, to calibrate the gully erosion susceptibility model, the MaxEnt algorithm was run 10 times (equal to the number of folds) to consider each subset for the training and testing phase. For each of the 10 built models, in turn, nine folds were used for the calibration phase, while one fold was used for testing the calibrated model. For validating the predictive performance of each generated model, the goodness-of-fit (based on the training set) and prediction capability (based on the testing set) were determined by calculating the confusion matrix parameters (accuracy and kappa coefficient), the receiver operating characteristics (ROC) curve, and related area under curve (AUC) [66; 67]. The confusion matrix consists of the following indexes: true positives (TP), true negatives (TN), false positives (FP), and false negatives (FN), where TP and TN are the pixels correctly classified, while FP and FN are the pixels incorrectly classified. These indexes allow the models' overall accuracy to be determined, which is the number of pixels that the models correctly classified. The accuracy is calculated using the following equation:  
\[\text{Accuracy}\ =\ \frac{\text{TP}+\text{TN}}{\text{TP}+\text{TN}+\text{FP}+ \text{FN}} \tag{4}\]  
The kappa coefficient was determined using the components of the confusion matrix [68]. The kappa coefficient (K) assesses the consistency of the susceptibility model to classify correctly the pixels affected by gullies [20]. K was expressed as the ratio of the observed agreement beyond that occurring by chance and can be determined follows:  
\[\text{Kappa}\ =\ \frac{\text{P}_{\text{obs}}-\text{P}_{\text{exp}}}{1-\text{P}_{ \text{exp}}} \tag{5}\]  
where Pobs is the amount of pixels classified correctly as gullies or non-gullies and Pexp is the amount of pixels for which the agreement is expected by chance [68]. Pobs and Pexp were calculated as follows:  
\[\text{P}_{\text{obs}}\ =\ \frac{\text{TP}+\text{TN}}{\text{n}} \tag{6}\]  
\[\text{P}_{\text{exp}}\ =\ \frac{(\text{TN}+\text{FP})\times(\text{TN}+\text{ FN})+(\text{FN}+\text{TP})\times(\text{FP}+\text{TP})}{\sqrt{\text{N}}} \tag{7}\]  
where n is the number of pixels classified correctly as gullies or not gullies and N is the total number of pixels. According to K values, the performance of the model can be classified as poor (0-0.2), fair (0.2-0.4), moderate (0.4-0.6), substantial (0.6-0.8), and almost perfect (0.8-1) [69]. The ROC curve is a bi-dimensional graph that displays, for different likelihood (susceptibility) threshold values, the TP rate (sensitivity) on the \(Y\)-axis and the FP rate (1-specificity) on the \(X\)-axis [66].