CoolFace
Modelpublic

giswqs/s2-water-unetplusplus-efficientnet-b4

sourceHugging Facecc-by-4.0updated 7mo agoView on Hugging Face
0likes9.9kdownloads
Model Card

Surface Water Detection — EfficientNet-B4 + UNet++

A semantic segmentation model for detecting surface water from Sentinel-2 multispectral satellite imagery, trained on the Earth Surface Water Dataset.

Model Description

PropertyValue
ArchitectureUNet++
EncoderEfficientNet-B4 (ImageNet pretrained)
Input6-band Sentinel-2 (B2, B3, B4, B8, B11, B12)
Input Size512 × 512 tiles
Output Classes2 (Background, Water)
Parameters~19M
Frameworksegmentation-models-pytorch + PyTorch Lightning

Training Details

ParameterValue
DatasetEarth Surface Water Dataset
Training Tiles1,581 (from 64 scenes, 512×512, stride 128)
Validation Tiles396
Epochs50
Batch Size8
Learning Rate1e-4
Weight Decay1e-4
OptimizerAdam
LossCross-Entropy

Performance

Tile-level Validation (during training)

MetricValue
Best Val IoU0.9863
Best Val Loss0.0112
Train IoU (final)0.989

Full-scene Validation (31 scenes, sliding window 512×512, overlap 256)

MetricValue
IoU0.9635
Dice0.9814

Usage

Installation

bash
pip install geoai-py timm segmentation-models-pytorch

Inference from HuggingFace Hub

python
import geoai

geoai.timm_segmentation_from_hub(
    input_path="sentinel2_scene.tif",
    output_path="water_mask.tif",
    repo_id="giswqs/s2-water-unetplusplus-efficientnet-b4",
    window_size=512,
    overlap=256,
    batch_size=4,
)

Input Format

The model expects 6-band Sentinel-2 L2A GeoTIFF images:

Band IndexSentinel-2 BandWavelength (nm)Resolution
1B2 (Blue)49010m
2B3 (Green)56010m
3B4 (Red)66510m
4B8 (NIR)84210m
5B11 (SWIR1)161020m
6B12 (SWIR2)219020m

Dataset

The Earth Surface Water Dataset contains 95 globally distributed Sentinel-2 scenes with binary water masks:

  • Training: 64 scenes
  • Validation: 31 scenes
  • Source: Zenodo

Citation

bibtex
@ARTICLE{Luo2021-te,
  title     = "{An applicable and automatic method for earth surface water
               mapping based on multispectral images}",
  author    = "Luo, Xin and Tong, Xiaohua and Hu, Zhongwen",
  journal   = "International Journal of Applied Earth Observation and
               Geoinformation",
  publisher = "Elsevier BV",
  volume    =  103,
  pages     =  102472,
  year      =  2021,
  url       = "http://dx.doi.org/10.1016/j.jag.2021.102472",
  doi       = "10.1016/j.jag.2021.102472",
  issn      = "1569-8432,1872-826X",
}

License

This model is released under the CC-BY-4.0 license, consistent with the training dataset license.