Skip to content
ModelListedExternal
Download

FloodSense

> Physics-informed satellite flood segmentation with cross-modal SAR/optical fusion, > built on the IBM/NASA Prithvi-EO-1.0-100M geospatial foundation model.

KindOtherBase modelibm-nasa-geospatial/Prithvi-EO-1.0-100MVersionRevision 5e66b34

Model source

Kind
Other
File size
1.03 GB
Base model
ibm-nasa-geospatial/Prithvi-EO-1.0-100M
Version
vRevision 5e66b34
Updated
Sep 15, 2026
Downloads
0
Tasks
Image segmentation
Source
Hugging Face

Source description

Model Card — FloodDetNet-Prithvi v5

Physics-informed satellite flood segmentation with cross-modal SAR/optical fusion, built on the IBM/NASA Prithvi-EO-1.0-100M geospatial foundation model.

Model Details

Model Description

FloodDetNet-Prithvi v5 is a pixel-level flood segmentation model for 12-channel satellite patches (6 optical + 5 SAR-derived + 1 JRC permanent-water prior). It fine-tunes the Prithvi-EO-1.0-100M temporal Vision Transformer as the optical backbone, augmented by a parallel SAR encoder, cross-modal attention, and a physics-informed water-body gate that uses the 37-year JRC Global Surface Water dataset to suppress false positives over historically wet areas.

The model outputs binary flood masks (flood / no-flood) at full input resolution via sliding-window inference with optional 4-flip test-time augmentation. At evaluation time, waterbody pixels are reconstructed from the binary prediction using the JRC prior, enabling 3-class IoU reporting (no-flood / flood / waterbody) against the original 3-class ground truth.

  • Developed by: AI-Hackers
  • Funded by: ANRF (Anusandhan National Research Foundation) AISEHack Programme
  • Model type: Semantic segmentation — geospatial / Earth observation
  • Input modalities: Optical (HLS-style 6-band) + SAR (HH, HV, SAR_diff, log_HH, log_HV) + JRC binary water prior
  • Output: Binary flood mask (0 = no-flood, 1 = flood), 2-channel softmax probability map
  • License: MIT (see checkpoint/LICENSE)
  • Fine-tuned from: ibm-nasa-geospatial/Prithvi-EO-1.0-100M

Model Sources

  • Model weights: prithvi_best-v7.ckpt — epoch 125, val flood IoU 0.368 (Google Drive / Zenodo link)

Uses

Direct Use

Run flood segmentation inference on any 512×512 (or larger) satellite patch with 6 optical bands (Green, Red, NIR, SWIR, and two additional) + SAR (HH, HV). The model handles arbitrary patch sizes via sliding-window inference (window 224×224, stride 112).

Intended users:

  • NDRF field commanders — real-time flood extent maps for route passability decisions
  • District agriculture officers — pixel-level flood vs. water-body proof for PMFBY crop insurance claims
  • State Emergency Operations Centre analysts — multi-event flood extent tracking
  • Remote sensing researchers — flood segmentation benchmark and foundation model fine-tuning reference

Downstream Use

The model is integrated into the FloodSense web application as the inference backend:

  • Served via AWS SageMaker endpoint (primary) or HuggingFace Inference API (fallback)
  • Results feed a MapLibre GL JS flood overlay, Gemini AI chatbot, and automated PDF report generation
  • Outputs can be exported as RLE masks (competition format), GeoTIFF, or village-level CSV statistics

Out-of-Scope Use

  • Single-modality optical-only input: The model expects SAR channels 6–10; optical-only patches will produce degraded results
  • Non-flood water detection: The model is trained to detect transient flood water, not permanent water bodies, rivers, or ocean
  • Sub-metre resolution imagery: Trained on 30 m HLS-resolution patches; very high resolution imagery (< 5 m) is out of distribution
  • Real-time video or streaming: Designed for batch patch inference, not streaming
  • Regions with no JRC coverage: The JRCGate falls back to zeros outside the downloaded tile footprint, reducing waterbody suppression accuracy

Bias, Risks, and Limitations

Geographic bias: The model was trained exclusively on a single flood event in West Bengal / Bangladesh (May 2024, patches 001–079). Performance on other geographies, flood types (flash floods, coastal inundation, urban flooding), or seasons is unknown and likely degraded.

Class imbalance: Flood pixels constitute only ~12% of the training data. The model is tuned for high recall (Tversky α=0.90) at the cost of precision — it will over-predict flood in ambiguous boundary regions.

JRC tile dependency: Waterbody suppression accuracy depends on the JRC Global Surface Water tile covering the inference region. Images outside the occurrence_80E_30N tile footprint receive no permanent-water prior, causing elevated false-positive rates in water-body regions (test WB FP rate without JRC: ~0.34).

Train/val generalisation gap: Flood IoU drops from 0.34 (train) to 0.15 (val/test), indicating overfitting on the 59-image training set. The model should be fine-tuned on local data before operational deployment in a new region.

No temporal context: Despite Prithvi's native multi-temporal capability, this model uses single-frame input (T=1). Pre-flood / post-flood change detection would significantly improve accuracy.

Recommendations

  • Always validate on locally labelled data before operational use
  • Use the JRC waterbody mask as a post-processing filter in addition to the JRCGate
  • Set the flood threshold (default 0.45) based on local precision/recall requirements — lower for higher recall (emergency response), higher for higher precision (insurance claims)
  • Do not use model outputs as sole evidence for legal or financial decisions without human expert review

How to Get Started with the Model

import torch
import numpy as np
from pathlib import Path

# Clone repo and install dependencies
# pip install torch lightning timm rasterio scipy

from best import (
    _load_model_from_checkpoint, cfg,
    read_tif, normalise_optical, normalise_sar,
    compute_sar_features, load_jrc_channel,
    sliding_window_predict, postprocess_mask,
)

# Point JRC dir to your pre-generated masks
cfg.JRC_DIR = Path("data/jrc_masks")

device = "cuda" if torch.cuda.is_available() else "cpu"

# Load model
model = _load_model_from_checkpoint("prithvi_best-v7.ckpt", device)
model.to(device).eval()

# Prepare input (6-band GeoTIFF)
img_path = Path("data/image/20240529_EO4_RES2_fl_pid_002_image.tif")
raw = read_tif(img_path)                                    # (6, H, W)
opt = normalise_optical(raw)                                # (6, H, W)
sar = normalise_sar(compute_sar_features(raw))              # (5, H, W)
jrc = load_jrc_channel(img_path, raw.shape[1:])             # (1, H, W)
img_t = torch.from_numpy(np.concatenate([opt, sar, jrc], axis=0)).float()

# Inference
with torch.no_grad():
    prob = sliding_window_predict(model, img_t, crop=224, stride=112, device=device)
    # prob: (2, H, W) — channel 1 is flood probability

# Post-process
flood_mask = postprocess_mask(prob[1].numpy(), threshold=0.45)
# flood_mask: (H, W) binary uint8 — 1 = flood, 0 = no-flood

print(f"Flood pixels: {flood_mask.sum()} ({100*flood_mask.mean():.1f}%)")

For 4-flip TTA (recommended for submission):

from best import tta_predict
prob = tta_predict(model, img_t, device=device)

Training Details

Training Data

  • Competition dataset: 79 labelled 512×512 satellite patches, West Bengal / Bangladesh flood event, May 2024. 6-band float32 GeoTIFF (HH, HV, Green, Red, NIR, SWIR). 3-class labels: 0 = no-flood, 1 = flood, 2 = waterbody. Provided by ANRF AISEHack organisers.
  • Split: Stratified 59 train / 10 val / 10 test by flood pixel percentage
  • Class distribution: flood ~12%, waterbody ~55%, no-flood ~33%
  • External — JRC Global Surface Water v1.4 (Pekel et al., 2016): 37-year occurrence layer, tile occurrence_80E_30N, reprojected per-image to match patch CRS/resolution. Used as binary permanent-water prior (channel 12, threshold ≥ 75% occurrence).
  • External — Prithvi-EO-1.0-100M pretrained weights: IBM/NASA-IMPACT, pretrained on 1M+ HLS (Harmonized Landsat Sentinel-2) scenes at 30 m resolution.

Training Procedure

Preprocessing

Optical (channels 0–5):

hls = raw[[2,2,3,4,5,5]] * 0.0001          # scale to reflectance
opt = (hls - PRITHVI_MEANS) / PRITHVI_STDS  # official Prithvi normalisation

Means: [0.0333, 0.0570, 0.0589, 0.2323, 0.1973, 0.1194] Stds: [0.0227, 0.0268, 0.0400, 0.0779, 0.0871, 0.0724]

SAR (channels 6–10): HH, HV, HH−HV, log(HH), log(HV), z-score normalised. Means: [786.83, 357.99, 434.18, 6.47, 5.78] Stds: [373.43, 148.94, 305.09, 0.55, 0.62]

JRC (channel 11): Binary 0/1 (occurrence ≥ 75% → 1).

Label: Waterbody (class 2) remapped to no-flood (class 0) during training. Ignore index: −1 (nodata pixels).

Augmentation: horizontal/vertical flip, rot90, elastic deformation (p=0.3), SAR gamma speckle (looks=4), optical brightness jitter (std=0.25), cutout (48×48), MixUp (α=0.3), 8 random 224×224 crops per image per epoch.

Training Hyperparameters

  • Training regime: fp16 mixed precision (PyTorch Lightning precision="16-mixed")
  • Optimiser: AdamW, weight decay 0.05
  • Learning rate: backbone 5e-5, head/neck/SAR 3e-4 (differential LR)
  • Scheduler: OneCycleLR, cosine annealing, pct_start=0.1, div_factor=10, final_div_factor=1e4
  • Batch size: 4
  • Epochs: 150 (early stopping patience 40 on val/flood_iou)
  • Backbone freeze: epochs 0–9 (backbone frozen, only head trained)
  • Gradient clipping: 1.0
  • Loss: L = 0.15·CE + 0.25·Dice + 0.60·Tversky(α=0.90, β=0.10) + 0.05·SAR_KD + 0.20·FocalFlood(γ=3)
  • Class weights: [0.20, 0.80] (no-flood, flood)

Speeds, Sizes, Times

MetricValue
Training hardwareNVIDIA T4 16 GB (single GPU)
Training time~8 hours (125 epochs to best checkpoint)
Best checkpoint epoch125 (step 14,868)
Checkpoint size (full)1,052 MB
Checkpoint size (inference-only)~400 MB
Inference time — T4 GPU~8 s per 512×512 patch (sliding window + 4-flip TTA)
Inference time — CPU~45 s per 512×512 patch
Total parameters~110M (ViT-Base backbone + heads)

Evaluation

Testing Data, Factors & Metrics

Testing Data

  • Val split: 10 images (pid_060–069), held out during training
  • Test split: 10 images (pid_070–079), never seen during training or hyperparameter tuning
  • Flood-rich subset: Top-10 training images by flood pixel count (pid_002, 010, 011, 015–017, 020, 021, 027, 028)

Factors

Evaluation is disaggregated by:

  • Split (train / val / test) — measures generalisation
  • Per-image — identifies high/low-performing patches
  • JRC coverage — images with JRC tile coverage vs. without (WB IoU = 0 without coverage)
  • Flood prevalence — flood-rich images (> 30% flood pixels) vs. flood-sparse (< 5%)

Metrics

MetricDescription
Flood IoUIntersection-over-Union for class 1 (flood) — primary competition metric
No-Flood IoUIoU for class 0 (no-flood)
WaterBody IoUIoU for class 2 (waterbody), reconstructed via JRC: pred=0 ∧ JRC=1 → class 2
mIoU (3-class)Mean IoU over classes present in ground truth
mIoU (binary)Mean of flood + no-flood IoU (matches training objective)
Overall Pixel AccuracyFraction of correctly classified valid pixels
WB FP RateFraction of waterbody GT pixels predicted as flood

Results

Best Checkpoint (prithvi_best-v7, epoch 125)

By split:

SplitNF IoUFL IoUWB IoUmIoU(3)mIoU(2)Px AccWB FP Rate
Train (59 images)0.7220.3400.5050.5220.5310.8090.173
Val (10 images)0.7390.1530.2640.3850.4460.7600.120
Test (10 images)0.6840.1450.2040.3440.414...

Sources

1 source
Hugging FacePrimaryVersion 5e66b34ea13dbff83762091c8aef5324c7bc4fa2
huggingface.co/RoAr777/FloodSense/tree/5e66b34ea13dbff83762091c8aef5324c7bc4fa2

Verified Sep 15

Model artifacts

1 artifact

prithvi_best-v7.ckpt

ckpt · 1.03 GB · SHA-256 df5cc5f51308…a9e9 · Hugging Face

Download

Source excerpts

2 excerpts

--- license: mit language: - en tags: - flood-detection - remote-sensing - satellite-imagery - semantic-segmentation - SAR - optical - geospatial - earth-observation - vision-transformer - physics-informed - disaster-response datasets: - AISEHack-Theme1-Phase2 - jrc-global-surface-water base_model: ibm-nasa-geospatial/Prithvi-EO-1.0-100M pipeline_tag: image-segmentation --- # Model Card — FloodDetNet-Prithvi v5 > Physics-informed satellite flood segmentation with cross-modal SAR/optical fusion, > built on the IBM/NASA Prithvi-EO-1.0-100M geospatial foundation model. ## Model Details ### Model Description **FloodDetNet-Prithvi v5** is a pixel-level flood segmentation model for 12-channel satellite patches (6 optical + 5 SAR-derived + 1 JRC permanent-water prior). It fine-tunes the [Prithvi-EO-1.0-100M](https://huggingface.co/ibm-nasa-geospatial/Prithvi-EO-1.0-100M) temporal Vision Transformer as the optical backbone, augmented by a parallel SAR encoder, cross-modal attention, and a physics-informed water-body gate that uses the 37-year JRC Global Surface Water dataset to suppress false positives over historically wet areas. The model outputs binary flood masks (flood / no-flood) at full input resolution via sliding-window inference with optional 4-flip test-time augmentation. At evaluation time, waterbody pixels are reconstructed from the binary prediction using the JRC prior, enabling 3-class IoU reporting (no-flood / flood / waterbody) against the original 3-class ground truth. - **Developed by:** AI-Hackers - **Funded by:** ANRF (Anusandhan National Research Foundation) AISEHack Programme - **Model type:** Semantic segmentation — geospatial / Earth observation - **Input modalities:** Optical (HLS-style 6-band) + SAR (HH, HV, SAR_diff, log_HH, log_HV) + JRC binary water prior - **Output:** Binary flood mask (0 = no-flood, 1 = flood), 2-channel softmax probability map - **License:** MIT (see `checkpoint/LICENSE`) - **Fine-tuned from:** [ibm-nasa-geospatial/Prithvi-EO-1.0-100M](https://huggingface.co/ibm-nasa-geospatial/Prithvi-EO-1.0-100M) ### Model Sources - **Model weights:** `prithvi_best-v7.ckpt` — epoch 125, val flood IoU 0.368 *(Google Drive / Zenodo link)* --- ## Uses ### Direct Use Run flood segmentation inference on any 512×512 (or larger) satellite patch with 6 optical bands (Green, Red, NIR, SWIR, and two additional) + SAR (HH, HV)...

Source context: 0 downloads · 0 likes · Pipeline image-segmentation · Repo RoAr777/FloodSense