Flood Inference Tool — model weights
Model weights used by the GEOHUM Flood Inference Tool, a desktop and command-line tool that produces flood/water masks from Sentinel-1, Sentinel-2 or PlanetScope imagery.
The tool downloads these files automatically the first time each model is used, so tool users don't need to download anything from here by hand. The files are plain PyTorch checkpoints and can also be used outside the tool; the model code is in the tool's src/models.py and the preprocessing in src/inference.py.
Models
| File | Sensor | Architecture | Input | Classes |
|---|---|---|---|---|
UNet-S1.pt |
Sentinel-1 | UNet | VV, VH backscatter (dB) | 3 |
DistanceMap.pt |
Sentinel-1 | UNet | VV, VH + terrain slope + water distance map | 2 |
UNet-S2.pt |
Sentinel-2 | UNet with input batch norm | blue, green, red, NIR, SWIR 1.6 µm, SWIR 2.2 µm | 3 |
dofa_v2_base_seg_upernet_s2.pt |
Sentinel-2 | DOFA v2 Base + UPerNet | blue, green, red, NIR (B2, B3, B4, B8) | 2 |
UNet-PlanetScope.pt |
PlanetScope | UNet | blue, green, red, NIR | 2 |
dofa_v2_base_seg_upernet_PS.pt |
PlanetScope | DOFA v2 Base + UPerNet | blue, green, red, NIR | 2 |
All models output per-pixel softmax probabilities. In the tool's output GeoTIFF, 0 = no data, 1 = dry / not water, 2 = water.
Sentinel-1
UNet-S1.pt— UNet (base width 32) on VV and VH backscatter in dB, each band standardised with fixed per-band statistics (normalizepreprocessing). Applied on 512 × 512 tiles, keeping the central area (94-pixel border).- Training data: SenForFlood
DistanceMap.pt— the same UNet, with two extra input channels: terrain slope (computed by the tool from the Copernicus 30 m DEM, downloaded automatically) and a distance map built from confident water pixels in the SAR image. Uses min–max scaling (scalepreprocessing). 512 × 512 tiles, 94-pixel border.- Training data: SenForFlood
Sentinel-2
UNet-S2.pt— UNet (base width 64) with a learnable batch-norm layer on the input, so it takes raw Sentinel-2 reflectance × 10000 (bands B2, B3, B4, B8, B11, B12 in that order). 256 × 256 tiles, 94-pixel border.- Training data: Sen1Floods11 + Cloud2Street
dofa_v2_base_seg_upernet_s2.pt— DOFA v2 Base encoder (wavelength-conditioned ViT-B/14) with a Feature2Pyramid neck and UPerNet decoder, as in PANGAEA. The encoder was fully fine-tuned, starting from the DOFA v2 pretrained weights (dofav2_vit_base_e150.pth), on Sen1Floods11: 100 epochs on its weakly labelled chips, then 25 epochs on its hand-labelled chips.- Input: B2, B3, B4, B8 (reflectance × 10000), with wavelengths 0.49 / 0.56 / 0.665 / 0.832 µm. Each band is standardised with the Sen1Floods11 statistics: mean 1396.03 / 1364.06 / 1218.23 / 2622.96, std 739.09 / 735.25 / 864.94 / 1022.63.
- Tiles: 224 × 224 (the training crop size), 32-pixel border.
- Note: Sen1Floods11 is Sentinel-2 Level-1C (top of atmosphere); the tool applies the model to Level-2A as well.
PlanetScope
UNet-PlanetScope.pt— UNet (base width 32) on blue, green, red and NIR, each band standardised with the scene's own mean and standard deviation. 512 × 512 tiles, 94-pixel border.- Training data: FloodPlanet
dofa_v2_base_seg_upernet_PS.pt—dofa_v2_base_seg_upernet_s2.ptfurther fine-tuned for 25 epochs on the FloodPlanet PlanetScope tiles (train split, ~3 m), encoder fully fine-tuned.- Input: blue, green, red, NIR, with wavelengths 0.485 / 0.545 / 0.63 / 0.82 µm.
- Preprocessing: FloodPlanet's PlanetScope is a "modified 8-bit" version, contrast-stretched scene by scene. To match it, the tool first stretches any PlanetScope image to 0–255 between the 1st and 99th percentiles of its valid pixels, using one range shared by all four bands. It then standardises each band with FloodPlanet statistics: mean 40.80 / 54.78 / 49.78 / 85.13, std 43.80 / 53.61 / 50.29 / 50.60. Per-band normalisation instead removes the NIR-vs-visible contrast and performs worse.
- Tiles: 224 × 224, 32-pixel border.
Evaluation
Results for the DOFA models, from their training reports. FloodPlanet results are on the held-out test events (Bangladesh, Ghana, US-Oklahoma, US-Texas), which were never used for training, checkpoint selection or normalisation statistics.
| Model | Data | Water IoU | Water precision | Water recall | mIoU |
|---|---|---|---|---|---|
dofa_v2_base_seg_upernet_s2.pt |
Sen1Floods11 test, S2 B2/B3/B4/B8 | 82.7 | 93.3 | 88.0 | 90.1 |
dofa_v2_base_seg_upernet_s2.pt |
FloodPlanet test, S2 B2/B3/B4/B8 | 39.0 | 99.1 | 39.2 | 53.2 |
dofa_v2_base_seg_upernet_PS.pt |
FloodPlanet test, PlanetScope | 67.3 | 86.6 | 75.2 | 71.2 |
On FloodPlanet, the Sentinel-2 model is very precise but misses part of the water, which reflects the domain shift from Sen1Floods11.
Limitations
- These are water/flood segmentation models; they do not separate floodwater from permanent water bodies.
- Clouds and cloud shadows are not detected by these models. The tool masks them using Sentinel-2's SCL band or PlanetScope's UDM2 mask when available.
- The PlanetScope DOFA model's percentile stretch depends on scene content: scenes that are almost entirely water, or with large unmasked bright areas such as clouds, can give less reliable results.
- The DOFA models are large (~145 M parameters, ~580 MB) and run much faster on a GPU.
Usage outside the tool
Each file is a dictionary loadable with torch.load(path, weights_only=True): the weights are under model_state_dict, and most files also store the tiling settings (chip_size, chip_border) and preprocessing type. UNet-S2.pt additionally stores its training loss curves as numpy scalars, which need allowlisting for safe loading:
import numpy as np, torch
with torch.serialization.safe_globals([np._core.multiarray.scalar, np.dtype, np.dtypes.Float64DType]):
checkpoint = torch.load("UNet-S2.pt", map_location="cpu", weights_only=True)
Citation
TODO