Satellite instance segmentation via watershed trickery
A competition-hardened PyTorch model that teases apart overlapping building footprints from 11-channel satellite imagery by predicting where objects touch.

What it does
TernausNetV2 performs instance segmentation on satellite imagery to extract individual building footprints. It takes 11-channel input—RGB plus eight multispectral bands—and outputs two binary masks: one for building vs. non-building pixels, another highlighting boundaries where buildings touch or nearly touch. These masks feed into a watershed transform to separate overlapping structures. The authors placed second in the CVPR 2018 DeepGlobe Building Extraction Challenge.
The interesting bit
The watershed-from-touching-boundaries idea isn’t new, but applying it to satellite imagery with a WideResNet-38 encoder chewing on 11 channels is a pragmatic mashup. The In-Place Activated BatchNorm keeps memory sane while the network juggles high-resolution panchromatic and low-resolution multispectral data simultaneously.
Key highlights
- Pre-trained weights and a
demo.ipynbnotebook provided for inference - Trained on SpaceNet data: 30 cm resolution, 650×650 pixel tiles from Vegas, Paris, Shanghai, and Khartoum
- Public/private leaderboard scores: 0.739 / 0.736 average across cities (Vegas strongest at ~0.89, Khartoum weakest at ~0.60)
- Dependencies frozen to Python 3.6 and PyTorch 0.4—archaeological by current standards
- Network diagram and teaser visualization included in repo
Caveats
- PyTorch 0.4 dependency means you’ll likely need container archaeology or careful environment reconstruction to run this today
- README states code is “sufficient for inference”—training scripts not provided
- Performance varies sharply by geography; Khartoum scores suggest the model struggles with different building morphologies or image quality
Verdict
Worth a look if you’re researching satellite instance segmentation or need a proven watershed-based baseline for building extraction. Skip it if you need a modern, maintained training pipeline or plug-and-play compatibility with current PyTorch.