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

GlacierRegionClimate Regime
AletschSwiss AlpsAlpine
GangotriHimalayasMonsoon
GreyPatagoniaMaritime
ColumbiaAlaskaMaritime/Subarctic
AthabascaCanadian RockiesContinental

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

SourceVariablesResolution
Landsat 5/7/8/9 Collection 2Green, SWIR1, NDSI30m
Copernicus DEM GLO-30Elevation, slope, aspect30m
ERA5 Monthly MeansT2m, 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

ModelParamstest/IoUtest/BF1Notes
B1: Persistence0.1600.128Traditional baseline
B2: Linear trend0.1690.147Traditional baseline
exp001: Image only56.1M0.3260.158Deep learning baseline
exp002: Image + Climate56.1M0.3370.145Best overall
exp003: Image + Climate + DEM56.1M0.3310.123Full multimodal
exp005: Climate only (MLP)0.66M0.3200.135Lightweight 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):

GlacierIoUn patches
Columbia0.500 ± 0.372200
Grey0.250 ± 0.201200
Aletsch0.122 ± 0.187200
Athabasca0.045 ± 0.110200
Gangotri0 (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)