FloodML-Geo

Flood susceptibility mapping inside QGIS, checked with spatial cross-validation. These are example results.

Flood susceptibility classes map

Workflow

Each tool reads the output of the one before it. The flood raster is an input of the first tool, so no label field is needed on your points or grid.

01Build the table

Flood raster and predictor rasters, read at your points or grid cells, written to a CSV.

02Check the table

Class balance, leakage hints, correlation and a suggested block size.

03Train and validate

Nested spatial cross-validation, confidence intervals, SHAP, residual maps.

04Map

Susceptibility raster, classes, styles and an extrapolation warning raster.

05Independent test

Scores on data the models never saw, with an overlap check.

06Self-test

Runs the whole chain on synthetic data and says whether it works.

Susceptibility map

Five classes from the ensemble prediction. With quantile classes each class holds about the same number of cells by design, so the map ranks places against each other. It is not a probability of flooding.

Susceptibility classes from RF and XGBoost. The river channel falls in the lowest class because permanent water was not excluded from the training table in this run.
Susceptibility classes from RF and XGBoost. The river channel falls in the lowest class because permanent water was not excluded from the training table in this run.

Data check

Tool 02 inspects the CSV before any model is trained.

Class balance and sample locations.
Class balance and sample locations.
Single-predictor separability.
Single-predictor separability.
Spearman correlation between predictors.
Spearman correlation between predictors.
Predictor distributions by class.
Predictor distributions by class.
Missing values.
Missing values.

Variance inflation

featurevif
distance_to_river11.225
distance_to_road11.221
elevation_srtm_30m_clipped1.162
ndvi_s2_10m1.114
slope_degree_30m_clipped1.050

Spatial validation

Every record is predicted by a model that did not see it or its neighbourhood. Intervals come from a cluster bootstrap over the spatial blocks.

ModelROC-AUC [95 % CI]PR-AUC [95 % CI]TSS [95 % CI]Balanced acc.KappaBrier [95 % CI]ECEFold AUC mean±SD
RF0.956 [0.935–0.971]0.989 [0.980–0.996]0.749 [0.697–0.801]0.8750.7110.064 [0.044–0.083]0.0520.958 ± 0.026
XGBoost0.956 [0.936–0.974]0.990 [0.980–0.997]0.771 [0.718–0.824]0.8860.7130.065 [0.044–0.086]0.0510.957 ± 0.028
Model comparison: pooled ROC and precision–recall curves, and fold-to-fold AUC variability.
Model comparison: pooled ROC and precision–recall curves, and fold-to-fold AUC variability.
Spatial layout of the cross-validation folds.
Spatial layout of the cross-validation folds.
Autocorrelation range of predictors and label (block-size advisor).
Autocorrelation range of predictors and label (block-size advisor).

One model at a time

Receiver operating characteristic: pooled out-of-fold curve and individual folds.
Receiver operating characteristic: pooled out-of-fold curve and individual folds.
Precision–recall curve (useful when classes are imbalanced).
Precision–recall curve (useful when classes are imbalanced).
Out-of-fold confusion matrix.
Out-of-fold confusion matrix.
Reliability diagram with 95 % Wilson intervals and score histogram.
Reliability diagram with 95 % Wilson intervals and score histogram.
Score distribution per class and threshold sensitivity.
Score distribution per class and threshold sensitivity.
Metric variability across the spatial folds.
Metric variability across the spatial folds.
Receiver operating characteristic: pooled out-of-fold curve and individual folds.
Receiver operating characteristic: pooled out-of-fold curve and individual folds.
Precision–recall curve (useful when classes are imbalanced).
Precision–recall curve (useful when classes are imbalanced).
Out-of-fold confusion matrix.
Out-of-fold confusion matrix.
Reliability diagram with 95 % Wilson intervals and score histogram.
Reliability diagram with 95 % Wilson intervals and score histogram.
Score distribution per class and threshold sensitivity.
Score distribution per class and threshold sensitivity.
Metric variability across the spatial folds.
Metric variability across the spatial folds.

What drives the prediction

Permutation importance drops each predictor on held-out folds. SHAP shows how each value moves the prediction. Both describe the model, not cause and effect.

Permutation importance on held-out folds (and SHAP when enabled).
Permutation importance on held-out folds (and SHAP when enabled).
SHAP summary of the deployment model.
SHAP summary of the deployment model.
SHAP dependence on the original predictor values.
SHAP dependence on the original predictor values.
Spatial structure of the out-of-fold residuals.
Spatial structure of the out-of-fold residuals.
Permutation importance on held-out folds (and SHAP when enabled).
Permutation importance on held-out folds (and SHAP when enabled).
SHAP summary of the deployment model.
SHAP summary of the deployment model.
SHAP dependence on the original predictor values.
SHAP dependence on the original predictor values.
Spatial structure of the out-of-fold residuals.
Spatial structure of the out-of-fold residuals.
Notes from the run
  • Predictor 'distance_to_river1': 7 missing value(s) (median-imputed inside every fold).
  • Predictor 'distance_to_road1': 7 missing value(s) (median-imputed inside every fold).
  • Predictor 'elevation_srtm_30m_clipped': 3 missing value(s) (median-imputed inside every fold).
  • Predictor 'slope_degree_30m_clipped': 3 missing value(s) (median-imputed inside every fold).
  • RF: residuals are still spatially clustered (Moran I = 0.35, p = 0.002); important spatial structure may be missing from the predictors.
  • XGBoost: residuals are still spatially clustered (Moran I = 0.32, p = 0.002); important spatial structure may be missing from the predictors.

Independent test

Flagged by the safeguard.

In this example the test table is the training table, so the scores below measure memory, not generalisation. The plugin detects this and refuses to call the result valid. For a real test, use another area, event or year.

ModelROC-AUC [95 % CI]PR-AUC [95 % CI]TSSBalanced acc.KappaBrierECECV ROC-AUC
XGBoost0.997 [0.996–0.998]0.999 [0.999–1.000]0.9540.9770.8850.0260.0430.956
RF0.990 [0.988–0.992]0.998 [0.997–0.998]0.8950.9470.8180.0410.0620.956
ROC curve
ROC curve
Confusion matrix
Confusion matrix
Calibration
Calibration

Reading these results

This page shows one run of the plugin on 3,908 grid cells of 100 m around 24.40° N, 91.05° E. The flood label comes from a flood record raster, and the predictors are distance to river, distance to road, elevation, slope and NDVI.

The numbers are a demonstration of what the reports look like, not a finished flood study. Two limits of this run are worth knowing. Permanent water was not excluded from the training table, so the river channel is scored as a non-flood area. And the independent test used the training table, which the plugin flags as not valid. Rebuild the table with the water-exclusion option of tool 01 before you use a map for decisions.

Always true of susceptibility maps
  • A predictor must be known before the flood. A layer made from the flood image leaks the answer.
  • Scores are susceptibility ranks, not flood depth, return period or risk.
  • Tree models do not enforce the direction you give a predictor; the direction only changes scaling.
  • Check the extrapolation raster before trusting cells outside the training range.

Full reports

The complete files written by the plugin, with every figure and table.

Data check Training and validation Independent test User guide