GlacierCastAI
July 4, 2026 · View on GitHub
GlacierCastAI predicts glacier retreat acceleration before it becomes visible in satellite imagery. By fusing Landsat time series, ERA5 climate signals, and Copernicus DEM terrain features in a multi-modal deep learning model, it forecasts glacier boundary changes at 1, 3, and 5-year horizons - and uses SHAP attribution to identify which climate drivers are responsible, making predictions interpretable and trustworthy.
Research Question
Can climate signals predict glacier retreat acceleration before it becomes detectable in satellite imagery?
Study Glaciers
| Glacier | Region | Climate Regime |
|---|---|---|
| Aletsch | Swiss Alps | Alpine |
| Gangotri | Himalayas | Monsoon |
| Grey | Patagonia | Maritime |
| Columbia | Alaska | Maritime/Subarctic |
| Athabasca | Canadian Rockies | Continental |
Model Architecture
- Backbone: ResNet50 (pretrained, ImageNet)
- Temporal: ConvLSTM (3 layers, hidden_dim=256, T=4 timesteps)
- Climate encoder: Cross-attention transformer (16-dim ERA5 features × 4 seasons)
- Decoder: UNet-style with skip connections
- Heads: Boundary mask, retreat rate, risk score
- Parameters: 56.1M total
Data
| Source | Variables | Resolution |
|---|---|---|
| Landsat 5/7/8/9 Collection 2 | Green, SWIR1, NDSI | 30m |
| Copernicus DEM GLO-30 | Elevation, slope, aspect | 30m |
| ERA5 Monthly Means | T2m, precipitation, snowfall, solar radiation | ~31km |
- 64 Landsat scenes across 5 glaciers (2000–2023)
- 29,810 patches (256×256px, 64px overlap)
- 40,476 sequences (T=4 input timesteps, horizons 1/2/3yr)
- Train/Val/Test split: 27,725 / 5,861 / 6,890
Experiment Results
| Model | Params | test/IoU | test/BF1 | Notes |
|---|---|---|---|---|
| B1: Persistence | — | 0.160 | 0.128 | Traditional baseline |
| B2: Linear trend | — | 0.169 | 0.147 | Traditional baseline |
| exp001: Image only | 56.1M | 0.326 | 0.158 | Deep learning baseline |
| exp002: Image + Climate | 56.1M | 0.337 | 0.145 | Best overall |
| exp003: Image + Climate + DEM | 56.1M | 0.331 | 0.123 | Full multimodal |
| exp005: Climate only (MLP) | 0.66M | 0.320 | 0.135 | Lightweight baseline |
Key findings:
- All deep learning models outperform traditional baselines by ~89–99% relative IoU improvement
- ERA5 climate signals alone (exp005, 661K params) achieve 98% of image-only performance
- Adding climate to imagery (exp002) yields the best overall result
Per-glacier IoU (exp002):
| Glacier | IoU | n patches |
|---|---|---|
| Columbia | 0.500 ± 0.372 | 200 |
| Grey | 0.250 ± 0.201 | 200 |
| Aletsch | 0.122 ± 0.187 | 200 |
| Athabasca | 0.045 ± 0.110 | 200 |
| Gangotri | — | 0 (no test sequences) |
Full results: results/baselines.json, results/per_glacier_results.json
Setup
conda create -n glaciercastai python=3.12
conda activate glaciercastai
pip install poetry
poetry install
Required API keys (copy .env.example to .env):
WANDB_API_KEY- Weights & Biases- CDS API key in
~/.cdsapirc- ERA5 download - NASA Earthdata credentials - Landsat download
Training
# Train multimodal model (exp001-003)
python scripts/train.py --config configs/model.yaml
# Train climate-only MLP baseline (exp005)
python scripts/train.py --config configs/exp005.yaml
# Resume from checkpoint
python scripts/train.py --config configs/model.yaml --resume experiments/checkpoints/exp002/last.ckpt
# Debug run (2 batches, no W&B logging)
python scripts/train.py --config configs/model.yaml --debug
Analysis Scripts
# Generate figures (ablation bar chart, study area map, qualitative predictions)
python scripts/generate_figures.py --checkpoint experiments/checkpoints/exp002/10-valiou0.2475.ckpt
# Compute persistence and linear trend baselines + per-glacier breakdown
python scripts/compute_baselines.py --checkpoint experiments/checkpoints/exp002/10-valiou0.2475.ckpt
# SHAP climate attribution analysis
python scripts/shap_analysis.py --checkpoint experiments/checkpoints/exp002/10-valiou0.2475.ckpt
Repository Structure
GlacierCastAI/
├── configs/
│ ├── model.yaml # Multimodal model config (exp001-003)
│ └── exp005.yaml # Climate-only MLP config (exp005)
├── scripts/ # Training, preprocessing, analysis scripts
├── src/
│ ├── models/
│ │ ├── glaciercastai.py # Full multimodal model
│ │ ├── climate_mlp.py # Climate-only MLP baseline
│ │ ├── backbones/ # ResNet50 encoder
│ │ ├── temporal/ # ConvLSTM, Transformer
│ │ ├── heads/ # Regression, segmentation heads
│ │ └── losses/ # Combined loss function
│ └── training/
│ ├── datamodule.py # Lightning DataModule
│ └── trainer.py # Lightning training module
├── experiments/
│ └── checkpoints/ # Per-experiment results (gitignored except JSON)
│ ├── exp001/exp001_test_results.json
│ ├── exp002/exp002_test_results.json
│ ├── exp003/exp003_test_results.json
│ └── exp005/exp005_test_results.json
├── results/ # Baseline and analysis results
│ ├── baselines.json # Persistence and linear trend IoU/BF1
│ ├── per_glacier_results.json
│ └── bootstrap_ci.json
└── data/ # Raw and processed data (gitignored)