GitHunt
AT

Athithiyanmr/chennai_urban_climate

Deep learning pipeline (UNet) for built-up area extraction from Sentinel-2 imagery β€” applied to Chennai for urban heat island and climate risk analysis

πŸ™οΈ Chennai Urban Climate

A deep learning pipeline for built-up area extraction from Sentinel-2 imagery using UNet semantic segmentation β€” applied to Chennai for urban climate analysis.

Python
Sentinel-2
Deep Learning
Planetary Computer
MIT License


πŸ“Œ What Is This?

Urban expansion reshapes land surfaces in ways that directly drive climate risk β€” intensifying heat islands, increasing flood vulnerability, and altering carbon balance. Mapping built-up areas accurately and at scale is foundational to climate-informed urban planning.

This project builds a reproducible deep learning pipeline that extracts built-up areas from Sentinel-2 satellite imagery using a multi-spectral UNet segmentation model β€” trained on Chennai and applicable to any Indian city.

It goes beyond traditional ML classifiers by applying convolutional neural networks to learn spatial patterns directly from satellite image patches, achieving pixel-level segmentation at 10m resolution.


🎯 Scientific Objective

To learn pixel-level representations of built-up surfaces from multi-spectral Sentinel-2 imagery, enriched with urban-discriminative spectral indices, using deep convolutional semantic segmentation.


πŸ”„ Full Pipeline Workflow

1. Download lowest-cloud Sentinel-2 scenes (Planetary Computer STAC)
       ↓
2. Mosaic & clip scenes to AOI
       ↓
3. Build 10-band spectral feature stack
       ↓
4. Rasterize OSM / Google Open Buildings as binary labels
       ↓
5. Generate balanced image patches for training
       ↓
6. Train UNet segmentation model (BCE + Dice loss)
       ↓
7. Sliding-window inference over full AOI
       ↓
8. Evaluate segmentation performance (IoU)

πŸ›°οΈ Input Data

Sentinel-2 Level-2A bands:

Band Name Resolution
B02 Blue 10m
B03 Green 10m
B04 Red 10m
B08 Near Infrared 10m
B11 Shortwave Infrared 20m (resampled to 10m)

Spectral indices computed:

Index Purpose
NDVI Vegetation contrast (inverse signal for built-up)
NDBI Built-up surface indicator
NDWI Water body detection
BSI Bare soil detection
IBI Integrated Built-up Index

Final model input: 10-channel feature stack [B02, B03, B04, B08, B11, NDVI, NDBI, NDWI, BSI, IBI]


πŸ€– Model Architecture

UNet Semantic Segmentation

  • Encoder-decoder structure with skip connections
  • 10-channel multi-spectral input
  • Pixel-level binary classification output (built-up / non built-up)
  • Chosen for strong spatial segmentation performance on remote sensing data

Loss Function:

Loss = Binary Cross-Entropy (BCE) + Dice Loss

BCE handles pixel-wise accuracy; Dice Loss handles region-level spatial overlap.


πŸ“ˆ Performance

Primary metric: Intersection over Union (IoU)

IoU = TP / (TP + FP + FN)
IoU Range Interpretation
< 0.40 Weak
0.40 – 0.59 Moderate
0.60 – 0.70 Strong
> 0.70 Research-grade

βœ… Observed validation IoU β‰ˆ 0.60+ at Sentinel-2 10m resolution over Chennai.


πŸ—‚οΈ Project Structure

chennai_urban_climate/
β”‚
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ 00_download_sentinel2_best_per_year.py   # Satellite acquisition
β”‚   β”œβ”€β”€ 01_prepare_aoi_raw.py                    # AOI preprocessing
β”‚   β”œβ”€β”€ 02_build_stack.py                        # Spectral stack builder
β”‚   β”œβ”€β”€ 03_make_builtup_labels_from_osm.py       # Label rasterization
β”‚   └── dl/
β”‚       β”œβ”€β”€ make_patches.py                      # Patch generation
β”‚       β”œβ”€β”€ train_unet.py                        # UNet training
β”‚       └── predict_unet.py                      # Inference
β”‚
β”œβ”€β”€ data/           # Satellite imagery, AOI, labels
β”œβ”€β”€ models/         # Saved model checkpoints
β”œβ”€β”€ outputs/        # Prediction maps and evaluation results
β”œβ”€β”€ run.py          # End-to-end runner script
└── environment.yml

βš™οΈ Setup

conda env create -f environment.yml
conda activate chennai_climate
export PYTHONPATH=$(pwd)
export KMP_DUPLICATE_LIB_OK=TRUE

▢️ Run the Pipeline

# Step 1 β€” Download Sentinel-2 imagery
python scripts/00_download_sentinel2_best_per_year.py

# Step 2 β€” Prepare AOI
python scripts/01_prepare_aoi_raw.py

# Step 3 β€” Build spectral feature stack
python scripts/02_build_stack.py

# Step 4 β€” Generate training labels from OSM
python scripts/03_make_builtup_labels_from_osm.py

# Step 5 β€” Create image patches
python -m scripts.dl.make_patches

# Step 6 β€” Train UNet model
python -m scripts.dl.train_unet

# Step 7 β€” Run inference
python -m scripts.dl.predict_unet

🌍 Applications

  • Urban Heat Island modeling
  • Flood and surface runoff risk assessment
  • Impervious surface area estimation
  • Urban growth monitoring over time
  • Climate resilience and adaptation planning
  • Input layer for city-scale sustainability models

πŸ—ΊοΈ Roadmap

  • Multi-city generalization (Bengaluru, Mumbai, Hyderabad)
  • Temporal change detection (built-up expansion over years)
  • DeepLabV3+ comparison study
  • Web map visualization of predictions

πŸ‘€ Author

Athithiyan M R β€” Geospatial Data Scientist | Remote Sensing | Climate Analytics

LinkedIn
GitHub


πŸ™ Acknowledgements

  • ESA Sentinel-2 Mission
  • Microsoft Planetary Computer & STAC API
  • OpenStreetMap contributors
  • Google Open Buildings Dataset

πŸ“œ License

MIT License Β© 2026 Athithiyan M R

Athithiyanmr/chennai_urban_climate | GitHunt