CloudMask AI
Real-time 4-band 16-bit Landsat 8 cloud segmentation workbench powered by a custom PyTorch U-Net (RGB + Near-Infrared) served through a zero-disk FastAPI engine and an interactive React + Three.js mission-control UI.
Problem Space
Over 65% of Earth is cloud-covered at any moment, and standard 3-channel RGB vision models mistake bright snow and ice for clouds—corrupting downstream satellite analytics.
Production Architecture
Ingests 4 synchronized 16-bit Landsat 8 spectral bands (Red, Green, Blue, Near-Infrared) strictly in memory, runs a trained 4-channel PyTorch U-Net, and renders 4 visual artifacts into a split-curtain React + Three.js workbench.
Execution Pipeline
- STAGE 01
4-Band Spectral Ingestion
Auto-matches dropped 16-bit GeoTIFF files (B04 Red, B03 Green, B02 Blue, B05 NIR) or loads 3 bundled 38-Cloud patches in 1 click.
- STAGE 02
In-Memory Radiometric Prep
Decodes and normalizes raw 16-bit bands into a [1, 4, 384, 384] tensor completely in RAM with zero temporary disk writes.
- STAGE 03
4-Channel PyTorch U-Net
Executes Epoch 11 checkpoint (weights_only=True, CPU wheel) using B05 Near-Infrared reflectance to separate snow/ice from true clouds.
- STAGE 04
Multi-Artifact Inspection
Returns RGB composite, Cyan Overlay, Binary Mask, and Magma Probability Heatmap with live confidence threshold (10–90%) and split-curtain comparison.
Key Engineering Trade-Offs & Decisions
- Verified NIR snow-rejection on 38-Cloud patch_291 (0.38% predicted cloud vs ~0% ground truth), partial cloud patch_113 (57.06% vs ~56%), and heavy overcast patch_157 (94.24% vs ~90%).
- Bundled 3 real Landsat 8 patches (~3.5 MB) with a 1-click Live Demo and 3-step guided coachbar so anyone can reproduce benchmarks immediately.
- Hardened container runtime with CPU-only PyTorch, weights_only=True checkpoint loading, non-root appuser, and /api/ready probes.
- Backed by pytest backend tests, oxlint frontend checks, and GitHub Actions CI.
Tech Stack
Live at cloud-mask-ai.vercel.app; FastAPI + PyTorch U-Net container (ghcr.io/tusharsingh-sde/cloudmask-backend:v1) deployed scale-to-zero on Azure Container Apps.
Open-source repo: PRs, issues, and feature collabs are always welcome on GitHub.