HydraNet is a terrain-aware flood mapping framework that combines Synthetic Aperture Radar (SAR) satellite imagery with terrain-inspired spatial priors to perform automated flood segmentation. The project aims to improve flood detection by integrating geospatial reasoning into deep learning-based computer vision models.
Traditional flood segmentation models rely solely on image appearance. HydraNet extends this approach by incorporating terrain-aware information such as pseudo-elevation and pseudo-slope maps, allowing the model to learn not only how floods look but also how they behave spatially.
The framework is built using PyTorch and employs a U-Net architecture with a ResNet34 encoder for pixel-wise flood segmentation.
Floods are among the most destructive natural disasters worldwide, causing significant loss of life, infrastructure damage, and economic disruption.
Rapid identification of flooded regions is essential for:
- Disaster response
- Emergency planning
- Resource allocation
- Damage assessment
- Risk management
Optical satellite imagery is often obstructed by clouds during extreme weather events. Sentinel-1 SAR imagery can penetrate clouds and operate day and night, making it highly suitable for flood monitoring.
HydraNet leverages Sentinel-1 SAR data and terrain-aware learning to improve flood segmentation performance.
The primary objectives of HydraNet are:
- Develop an end-to-end flood segmentation pipeline using Sentinel-1 SAR imagery.
- Introduce terrain-aware learning into a computer vision framework.
- Explore multimodal geospatial feature fusion.
- Generate pixel-level flood predictions.
- Investigate how terrain priors influence flood segmentation performance.
HydraNet uses the Sen1Floods11 dataset, one of the most widely used benchmark datasets for flood segmentation research.
Dataset characteristics:
- Sentinel-1 SAR imagery
- Hand-labeled flood masks
- Diverse geographical regions
- Multiple flood events
- Pixel-wise annotations
Dataset structure:
images/
│
├── Bolivia_xxx_S1Hand.tif
├── Ghana_xxx_S1Hand.tif
├── Sri-Lanka_xxx_S1Hand.tif
└── ...
masks/
│
├── Bolivia_xxx_LabelHand.tif
├── Ghana_xxx_LabelHand.tif
├── Sri-Lanka_xxx_LabelHand.tif
└── ...
SAR Image
│
▼
U-Net
(ResNet34 Encoder)
│
▼
Flood Segmentation Mask
SAR Image
+
Pseudo-Elevation
+
Pseudo-Slope
│
▼
Multimodal U-Net
│
▼
Flood Probability Map
│
▼
Flood Segmentation
A key contribution of HydraNet is the incorporation of terrain-inspired spatial priors.
Pseudo-elevation is generated using Gaussian smoothing on SAR imagery.
Purpose:
- Capture large-scale terrain continuity
- Introduce topographic context
- Encourage spatially coherent predictions
Pseudo-slope is generated using Sobel gradients on the pseudo-elevation map.
Purpose:
- Capture terrain gradients
- Provide spatial structure information
- Simulate topographic changes
The final input consists of three channels:
Channel 1 → SAR Image
Channel 2 → Pseudo-Elevation
Channel 3 → Pseudo-Slope
These channels are fused and passed into a modified U-Net architecture.
- ResNet34
- ImageNet pre-trained weights
- U-Net Decoder
- Skip connections
- Pixel-wise segmentation output
3 Channels
(256 × 256)
1 Channel Flood Probability Map
HydraNet uses a hybrid loss function:
Measures pixel-wise classification error.
Measures segmentation overlap quality.
Loss = BCE Loss + Dice Loss
This combination improves learning on highly imbalanced flood segmentation datasets.
- RasterIO
- GeoTIFF support
- NaN handling
- Infinite value removal
- Mean normalization
- Standard deviation scaling
Mask labels:
0 → Non-Flood
1 → Flood
255 → Ignore Region
The training pipeline includes:
- Dataset Loader
- DataLoader
- GPU acceleration
- Gradient clipping
- Validation monitoring
- Best model checkpointing
IMAGE_SIZE = 256
BATCH_SIZE = 4
LEARNING_RATE = 5e-5
EPOCHS = 15HydraNet performs:
- Image loading
- Terrain feature generation
- Multimodal fusion
- Forward pass
- Probability estimation
- Thresholding
- Flood mask generation
Outputs include:
- SAR Image
- Ground Truth Mask
- Flood Probability Map
- Predicted Flood Mask
The model demonstrates:
- Successful flood segmentation
- Terrain-aware spatial consistency
- Improved validation performance
- Meaningful flood probability estimation
Example training progression:
Epoch 1:
Train Loss: 1.4185
Val Loss: 1.3484
Epoch 15:
Train Loss: 0.5200
Val Loss: 0.6391
This indicates successful learning and convergence.
- PyTorch
- segmentation-models-pytorch
- RasterIO
- NumPy
- OpenCV
- Matplotlib
- Google Colab
- PyCharm
HydraNet/
│
├── data/
│
├── models/
│ └── unet_model.py
│
├── utils/
│ ├── dataset.py
│ └── losses.py
│
├── scripts/
│ ├── test_dataset.py
│ └── test_model.py
│
├── train.py
├── inference.py
│
└── README.md
The current implementation serves as a proof-of-concept terrain-aware flood segmentation framework.
Future extensions include:
- SRTM DEM
- Elevation alignment
- Terrain reprojection
- Precipitation datasets
- Temporal accumulation
- Weather-aware flood forecasting
- ConvLSTM
- Transformer architectures
- Multi-temporal flood evolution modeling
- Grad-CAM
- Attention visualization
- Model interpretability
- Hydrological constraints
- Flow accumulation
- Watershed-aware prediction
HydraNet explores the intersection of:
- Computer Vision
- Geospatial Artificial Intelligence (GeoAI)
- Remote Sensing
- Hydrometeorology
- Deep Learning
The project demonstrates how terrain-aware multimodal learning can enhance flood segmentation and serves as a foundation for future research in physics-aware geospatial intelligence systems.
Chetan Singh Kaurav
Computer Science & Engineering Student
Interests:
- Artificial Intelligence
- Computer Vision
- Geospatial AI
- Remote Sensing
- Hydrometeorology
- Deep Learning Research
HydraNet is an ongoing research project exploring terrain-aware multimodal learning for automated flood mapping and geospatial intelligence.