ResGRU-UNet: 16-hour PM2.5 forecasting over India
Five ResGRU-UNet networks (seeds 42, 1337, 1, 2 and 3), their 16 calibration factors and the normalization statistics. Together they form the best model of the study "Pipeline Over Backbone: A Controlled Study of Deep Networks for PM2.5 Forecasting Over India".
These are the leak-free networks. A leak audit found that two inputs of the original runs read validation hours (the STL residual spread channel and the training episode masks), so all five seeds were retrained with STL on training hours only; they score slightly higher than the originals, and the test set was never affected. The same weights are version 3 of the Kaggle model imvetri0/resgru-unet-pm25, which reproduces the submitted test forecast exactly.
- Paper and code: https://github.com/Vetri-78640/pm2.5-backbone-study-pipeline-over-backbone
- Demo: https://huggingface.co/spaces/imvetri/pm25-forecast-india
Task
Forecast surface PM2.5 for the next 16 hours from the last 10 hours, at every cell of a 140 x 124 grid (about 25 km; 7.06 to 38.00 N, 67.79 to 97.93 E). The model was trained on hourly WRF-Chem simulation fields released for the ANRF AISEHack 2026, Phase 2, Theme 2 challenge (IIT Delhi). The challenge data are not included.
Files
| File | Contents |
|---|---|
resgru_s42.safetensors, resgru_s1337.safetensors, resgru_s1.safetensors, resgru_s2.safetensors, resgru_s3.safetensors | weight-averaged (EMA) weights at the best validation epoch, 7,122,113 parameters each |
horizon_scales.npy | 16 calibration factors, one per lead hour, fitted on validation for the five-seed ensemble |
stats.npz | normalization statistics, hourly PM2.5 climatology and the hourly sunlight and temperature profiles used to estimate the hour of day |
static.npy | the 4 static input channels: latitude, longitude, PM2.5 climatology and STL residual spread (both from training hours only) |
model.py | the network, the input features and a Forecaster that averages the five networks |
example_input.npz | a climatological example input built from stats.npz (training-period means), not a real day |
onnx/ | the same model for the browser demo: features.onnx (the input features above), one resgru_s*.onnx per network (weights stored in float16 to halve the download, computed in float32) and meta.json; forecasts are within 0.05 ug/m3 of model.py (relative 1e-4) |
Usage
import numpy as np
from huggingface_hub import snapshot_download
import sys
folder = snapshot_download("imvetri/resgru-unet-pm25")
sys.path.insert(0, folder)
from model import Forecaster
fc = Forecaster(folder) # CPU by default; Forecaster(folder, "cuda") for a GPU
raw = dict(np.load(f"{folder}/example_input.npz"))
forecast, start_hour = fc(raw) # (16, 140, 124) in ug/m3
uncalibrated, _ = fc(raw, calibrate=False) # better for MAE, RMSE and R2
Input format
A dict (or .npz) with 9 arrays, each of shape (10, 140, 124): the last 10 hours, oldest first, in the units of the challenge data.
| Key | Field | Unit |
|---|---|---|
cpm25 | surface PM2.5 | ug/m3 |
q2 | 2-m specific humidity | kg/kg |
t2 | 2-m temperature | K |
u10, v10 | 10-m wind | m/s |
pblh | boundary-layer height | m |
psfc | surface pressure | Pa |
swdown | downward shortwave radiation | W/m2 |
rain | rain in the hour | mm |
From these, the model builds its 20 input channels: the 9 fields, wind speed, ventilation, advection, PM2.5 tendency, the hour of day (sin, cos), the diurnal anomaly and the 4 static channels. The hour of day is estimated from sunlight and temperature, as for the challenge test windows; pass start_hour= to set it.
Architecture
- Input (20 channels, 10 hours) stacked as 200 channels.
- Encoder: residual convolution blocks with 64, 128 and 256 channels, down to a 256-channel bottleneck at 18 x 16.
- A convolutional GRU steps 16 times from the bottleneck, one step per lead hour; each step is decoded by a U-Net decoder (128, 64, 32 channels) with skips from the encoder.
- Output: the last observed log(1 + PM2.5) plus the predicted change for each lead hour. The forecast is max(exp(output) - 1, 0).
- The five networks are averaged in concentration space, then each lead hour is multiplied by its calibration factor.
Training
- Data: April, July, October and December 2016. Validation is the last 18% of each month, after a 12-hour gap (214 windows); training uses 2,257 windows.
- Loss: 0.40 Huber in log space + 0.25 global SMAPE + 0.15 episode SMAPE + 0.20 (1 - episode correlation).
- AdamW (learning rate 2.5e-4, weight decay 1e-4), one-cycle schedule, 16 epochs, batch 4, EMA 0.999; about 53 minutes per seed on one NVIDIA T4. Normalization statistics, climatology, the STL spread and the training episode masks use training hours only.
Results
Benchmark score: the mean of (1 - global SMAPE / 2), (1 + episode correlation) / 2 and (1 - episode SMAPE / 2), with equal weights on validation. Test: the challenge's hidden 2017 test set (218 windows), scored by its evaluation server after the deadline.
| Forecast | Val score | Test (private) | Test (public) |
|---|---|---|---|
| seed 42 | 0.9178 | 0.8806 | 0.8941 |
| seed 1337 | 0.9155 | 0.8799 | 0.8946 |
| seed 1 | 0.9170 | 0.8811 | 0.8936 |
| seed 2 | 0.9177 | 0.8801 | 0.8945 |
| seed 3 | 0.9169 | 0.8795 | 0.8936 |
| five-seed ensemble | 0.9200 | 0.8840 | 0.8972 |
| five-seed ensemble + calibration | 0.9220 (in sample) | 0.8915 | 0.9051 |
On validation the five-seed ensemble has MAE 6.34, RMSE 18.20 ug/m3 and R2 0.890. Calibration raises the benchmark score but worsens MAE, RMSE and R2; use calibrate=False when absolute or squared error matters.
Limits
- Trained and tested on simulation fields, not station observations, for one region and one year of training data.
- Inputs must be on the same 140 x 124 grid and in the same units as the challenge data.
- The hour of day is estimated from the inputs.
Licence
MIT, as the code repository. The challenge data are not included and are subject to the challenge's own terms.