Inspiration
Every year, catastrophic megafires incinerate millions of hectares of tropical peatlands and ancient forests—from Kalimantan and Australia's Black Summer to Lahaina, Maui and the Mediterranean. These blazes release gigatons of unverified greenhouse gases, blanket entire nations in choking toxic haze, and threaten human lives.
When combating megafires, emergency response teams and environmental auditors face two crippling bottlenecks:
- The Toxic Smoke Curtain: Standard visible-spectrum cameras and optical satellites (RGB) are completely blinded by thick white smoke plumes, making it impossible to detect where the actual flame fronts are advancing.
- Overconfident "Black-Box" AI: Conventional deep learning models output deterministic predictions with zero confidence bounds. Blinded by heavy smoke or cloud shadows, they hallucinate false alarms or miss active fires entirely—leading to fatal errors in firefighting deployment and millions of dollars in miscalculated carbon credit auditing.
We built WATCHTOWER (Wildfire Attention & Transformer Calibration with Hybrid Tversky Optimization for Woodland Emission Reporting)—an uncertainty-calibrated, smoke-penetrating Earth Observation AI and automated IPCC Tier-3 carbon accounting platform that knows what is burning, where it is spreading, and how confident it is under dense smoke.
What it does
WATCHTOWER is an end-to-end, uncertainty-aware satellite intelligence system operating on 10-meter Sentinel-2 and Sentinel-5P telemetry:
- Smoke-Penetrating 16/17-Channel Multispectral AI: Fuses 12 Sentinel-2 L2A spectral bands with Sentinel-5P UV Aerosol Index and 4 biophysical indices (NBR, AF_SWIR, NDVI, NDWI). It leverages Short-Wave Infrared (SWIR B12 at 2190nm) with asymmetric radiometric clipping to penetrate dense smoke plumes and isolate active flame fronts from peatland burn scars.
- Bayesian Uncertainty Quantification (BALD UQ): Executes Isolated Monte Carlo Dropout (T=20) and Post-Hoc Temperature Scaling to decouple:
- Predictive Total Entropy:
H(E[p])capturing overall decision boundaries. - Epistemic Mutual Information (BALD):
I[y; w | x, D] = H(E[p]) - E[H(p)], directly spotlighting pixels obscured by thick smoke where human/drone verification is required.
- Predictive Total Entropy:
- Automated IPCC Tier-3 Carbon Accounting: Vectorizes detected burn scars into geospatial polygons and intersects them with Global Forest Watch (GFW) Aboveground Biomass (AGB) and Peat Soil Organic Carbon (SOC) layers. It outputs audit-ready carbon release metrics across three confidence bounds: Conservative Lower Bound, Nominal Mean, and Upper Bound 95% CI.
- Captum Explainable AI (XAI): Computes Integrated Gradients across all 16 input channels to generate spectral feature attribution bars, providing mathematical proof of how SWIR and NBR bands cut through smoke.
- Interactive Atlus-Style Web HUD: A full-stack web application featuring an interactive Leaflet GIS globe, real-time satellite coordinate selection, and a progressive 8-Panel Multi-Spectral Diagnostic HUD with animated contour tracing and carbon emission counters.
How we built it
We implemented the complete pipeline modularly from scratch using Python, PyTorch, TorchGeo, FastAPI, Rasterio, Shapely, and Leaflet:
- Multispectral Data Ingestion & Spatial Harmonization: Built dynamic spatial resampling using
rasterio.warp.reproject—applying cubic interpolation for 20m SWIR and Red-Edge bands, bilinear for atmospheric fields, and nearest-neighbor for categorical active fire masks. - SSL4EO First-Layer Weight Surgery: Adapted foundation models pretrained on Landsat (7-ch) or Sentinel-2 (13-ch) to our target channels by interpolating Red-Edge channels, initializing spectral indices from symmetric differences, and applying variance-preserving weight scaling:
W_target = W_pre × (C_pre / C_target) - Dual Architectures (< 1.8 GB VRAM Edge Budget):
- Attention U-Net ResNet-50 (~26.25M params) with lateral 1×1 bottleneck projections (
[2048, 1024, 512, 256, 64] → [256, 192, 128, 64, 32]) and additive soft-attention gates. - Compact ViT-S/16 Seg (~24.32M params) with 2D bicubic positional embedding interpolation (14×14 → 16×16) and a 4-stage progressive
ConvTranspose2ddecoder.
- Attention U-Net ResNet-50 (~26.25M params) with lateral 1×1 bottleneck projections (
- FP32 Wildfire Hybrid Loss: Formulated Multi-Class Focal Loss (γ = 2.0), Multi-Class Focal Tversky Loss (α_FP = 0.30, β_FN = 0.70, γ = 1.3333), and submodular Lovász-Softmax Loss, computed in strict float32 to eliminate numerical underflow.
- Interactive Full-Stack Web Dashboard: Built with FastAPI and Leaflet GIS, connecting live Sentinel-2 / NASA VIIRS satellite feeds with browser-based SVG contour tracing and dynamic multi-spectral diagnostic visualizers.
- CodeCarbon Tracking: Embedded compute energy footprint tracking (
Watchtower_UQ_Seg) to ensure all model training and inference emissions remain transparent.
Challenges we ran into
- Smoke Occlusion vs. False Positives: Translucent smoke plumes scattering blue light easily confuse standard optical models. We solved this by formulating radiometric constraints combining B2 Blue, S5P Aerosol, and SWIR Normalized Burn Ratios (NBR).
- Batch Normalization Corruption during Stochastic UQ: Calling
model.train()during Monte Carlo Dropout inference corruptsBatchNorm2drunning mean and variance statistics. We engineeredenable_mc_dropout_onlyto freeze all BatchNorm layers in.eval()mode while selectively activatingDropout2dlayers. - Hardware & Edge Constraints: Running 17-channel tensors through deep ensembles usually requires server-grade GPUs. By redesigning lateral bottleneck projections and utilizing FP16 mixed-precision inference, we capped peak GPU VRAM to < 1.8 GB, enabling real-time deployment on edge workstations and field laptops.
- FP16 Underflow in Lovász Loss: Sorting gradients in half-precision caused gradient NaN/Inf spikes. We enforced strict FP32 tensor casting for all loss and entropy calculations.
Accomplishments that we're proud of
- Proven on Real Satellite Megafires: Validated directly on real Cloud-Optimized GeoTIFFs (COGs) from Sentinel-2B during the September 2019 Kalimantan Peatland Crisis, the August 2023 Lahaina Wildfire, and the 2019–2020 NSW Australian Bushfires.
- Piercing the Peatland Smoke Curtain: While true-color RGB imagery showed an impenetrable sheet of yellow-brown haze, Watchtower's SWIR bands and Attention U-Net successfully pierced through the smoke, accurately delineating 245.4 hectares of peatland burn scars.
- Instant Verified Carbon Audit: Automated calculations showed that this single 2.5 km × 2.5 km patch released 111,900 tonnes of CO₂e (95% CI: 90,707 to 129,858 tCO₂e) into the atmosphere within seconds.
- State-of-the-Art Calibration: Achieved an Expected Calibration Error (ECE) of 0.0080, a Brier Score of 0.0142, and an AUSE of 0.0290 using post-hoc Temperature Scaling.
- Production-Ready & 100% Tested: Built a working interactive web dashboard and a comprehensive test suite (22 unit tests passing in pytest) covering data ingestion, weight surgery, loss stability, UQ isolation, and GFW carbon accounting.
What we learned
- Geospatial Physics & Atmospheric Windows: Why Short-Wave Infrared (1610nm & 2190nm) penetrates dense aerosols due to Rayleigh/Mie scattering dynamics, whereas visible optical light is severely scattered.
- Epistemic vs. Aleatoric Decomposition: How Monte Carlo Dropout variance (Mutual Information) naturally serves as an objective detector for smoke occlusion and distribution shifts without requiring hand-crafted smoke annotations.
- IPCC Tier-3 Carbon Accounting: Vectorizing raster masks into GeoJSON polygons and applying IPCC combustion completeness factors (45% for crown canopy, 65% for active flaming front, 10% for smoldering peat soil) multiplied by the 44/12 (≈ 3.6667) CO₂ molecular conversion ratio.
What's next for Watchtower
- Near-Real-Time (NRT) Stream Processing: Connecting directly to Copernicus Data Space Ecosystem (CDSE) webhooks to automatically trigger inference within 15 minutes of a new Sentinel-2 satellite downlink.
- Sentinel-1 SAR Radar Fusion: Integrating Synthetic Aperture Radar (SAR C-Band) for 100% all-weather, cloud-penetrating monitoring during heavy rain and monsoon cloud cover.
- Autoregressive Wildfire Spread Forecasting: Extending our WildfireSpreadTS (WSTS+) 5-day sequential architecture to forecast wildfire boundary expansion 24 to 48 hours into the future based on ERA5 wind velocity.
- Field First-Responder Integration: Partnering with disaster mitigation agencies (BPBD / Manggala Agni / Cal Fire) to export tactical perimeter geo-packages directly to mobile ATAK (Android Tactical Assault Kit) devices.
Built With
- attention-unet
- captum
- carbon-accounting
- codecarbon
- computer-vision
- copernicus
- deep-learning
- earth-observing-system
- explanable-ai
- geopandas
- global-forest-watch
- monte-carlo-dropout
- python
- pytorch
- rasterio
- remote-sensing
- semantic-segmentation
- sentinel-2
- sentinel-5p
- shapely
- timm
- torchgeo
- uncertainty-quantification
- vision-transformer