This project implements a two-stage deep learning pipeline to segment clouds and shadows from satellite imagery using TOA reflectance and metadata. The models are trained on LISS-IV data.
βββ inference_code.ipynbβββββββΒ # Main inference pipeline
βββ Requirements.txtββββββββΒ # Dependencies
βββ Training_Files/ββββββββΒ Β Β Β Β Β # Labelling of cloud mask and training scripts for ResUNet and U-Net
βββ masks/βββββββββββΒ Β Β Β Β Β Β # Predicted masks on test dataset
βββ Report.pdfββββββββββΒ Β Β # Methodology and analysis
βββ NRCC251050_Inference_Training_Results.csvΒ Β # Training log (losses, metrics)
βββ Earth_Sun_Distance.xlsx βββββββββΒ Β Β # Earth-Sun distance values for TOA reflectance computation βββββββββββββ
βββ Training_labeled_data/ββββΒ Β Β Β Β # Dataset used to train models
| Task | Model | Input Channels | Output Classes |
|---|---|---|---|
| Cloud Segmentation | ResUNet (ResNet34 encoder) | TOA Bands (B2, B3, B4) | 2 (Clear, Cloud) |
| Shadow Segmentation | Custom U-Net | TOA Bands + Cloud Mask + Sun Elevation | 2 (Clear, Shadow) |
You can download the trained models (ResUNet for cloud segmentation and U-Net for shadow segmentation) from the link below:
π Download Trained Models from Google Drive
Create a new python environment(python=3.10). Navigate to the downloaded folder where requirements.txt is present.
Install dependencies using:
pip install -r requirements.txt
- Place your test folder containing B2, B3, B4 bands and metadata file.
- Update paths inside
inference_code.ipynb:- Band paths (e.g., B2.tif, B3.tif, B4.tif)
- Metadata text file path
- Cloud model path (
.pth) - Shadow model path (
.pth)
- Run all cells in the notebook to get:
- Georeferenced mask.tif with values:
0 = clear,1 = cloud,2 = shadow - Optional: cloud and shadow shapefiles
- Georeferenced mask.tif with values: