Skip to content

BurnPro3D/pgml-scil

Repository files navigation

Physics-Guided Prescribed Fire Emulator

This repository contains code for training and evaluating deep learning emulators for prescribed fire simulations. The goal is to predict the spatiotemporal evolution of fuel density (i.e., how fuel is consumed as a fire spreads) given initial environmental conditions. Models are trained on data generated by the QUIC-Fire physics simulator and incorporate physics-informed loss terms to improve physical consistency.

Getting Started

Dependencies

All models are implemented in PyTorch. Install dependencies into a conda environment:

pip install -r requirements.txt

GPU training is strongly recommended (tested on NVIDIA A40).

Installation

git clone <repo-url>
cd pgml-scil
pip install -r hard_requirements.txt

Dataset

Simulation data is generated by the QUIC-Fire grassland fire simulator. Each simulation run captures the two-dimensional evolution of a prescribed fire over time.

Data Characteristics

Property Value
Spatial grid 300 x 300 cells
Cell resolution 2 m x 2 m
Temporal resolution 1 second per time step
Wind speeds 7 distinct values
Wind directions 11 distinct values
Ignition patterns 5 distinct patterns
Fuel density range 0 - 0.7 kg/m2

Input Features (4 channels)

  1. Fuel density (current state)
  2. Wind direction - sin component
  3. Wind direction - cos component
  4. Ignition map / source map

Target

  • Output: 1 channel - predicted fuel density at one or more future time steps

Dataset Splits

The full dataset is split into training, validation, and test sets. A lite dataset (used for quick prototyping) contains 50 training and ~50 test samples with up to 50 time steps each. The full dataset provides longer sequences (600 time steps) with more simulation runs.

Input arrays are preprocessed to 296 x 296 spatial resolution (center-cropped from 300 x 300). Wind data is normalized using min-max scaling; fuel density is not rescaled.

Experimental Setup

Simulation runs span 5 ignition patterns x 7 wind speeds x 11 wind directions, giving a diverse set of environmental conditions. Data is split into training, validation, and test subsets. Each model is trained using the Adam optimizer with a cosine annealing learning rate schedule. Hyperparameters (learning rate, physics loss weights) are tuned via random grid search. Mixed-precision training (bfloat16) is used to reduce memory usage and improve throughput.

Key training hyperparameters (defaults from config files):

Parameter Value
Learning rate (max) 1e-3
Learning rate (min) 1e-5
Batch size 8-16
Optimizer Adam
Scheduler Cosine annealing
Physics loss weights 0.01-0.1 (per term)

Models

Three model architectures are implemented and share the same training infrastructure in common_utils/:

1. ConvLSTM (convlstm_new/)

A recurrent convolutional architecture for spatiotemporal sequence prediction. Includes a standard ConvLSTMModel and a physics-enhanced variant PhysicsEnhancedConvLSTM.

  • Train: convlstm_new/trainer_new.py
  • Configs: convlstm_new/config_full_data.yaml, convlstm_new/config_lite_data.yaml

2. FourCastNet / AFNO (FourCastNet/)

An Adaptive Fourier Neural Operator (AFNO) transformer adapted for wildfire sequence-to-sequence prediction. Implements AFNONet_Seq2Seq and AFNONet_Residual.

  • Train: FourCastNet/src/trainer.py
  • Network: FourCastNet/networks/afnonet_wf.py
  • Configs: FourCastNet/configs/config_full_data.yaml, FourCastNet/configs/config_lite_data.yaml

3. ViViT (ViViT/)

A Video Vision Transformer that processes spatiotemporal tubelets. Uses a TubeletReconstruction head to project transformer embeddings back to the spatial fuel density grid.

  • Train: ViViT/src/trainer_vivit.py
  • Network: ViViT/src/model.py
  • Configs: ViViT/configs/config_full_data.yaml, ViViT/configs/config_lite_data.yaml

Physics-Guided Loss

All models support an optional physics-informed composite loss (common_utils/loss.py):

Term Description
MSE Standard mean squared error on predicted fuel density
Fuel Transport Penalizes predicted fuel density increases over time (conservation of mass)
Burned Region Extra penalty for errors in cells where fuel has been consumed (density <= 0.1)
Unburned Region Extra penalty for errors in intact fuel cells (density >= 0.65)
Fire Metrics Rate-of-spread (ROS) based loss computed from the evolving fire front

Evaluation Metrics

Models are evaluated on the test set using common_utils/metrics.py:

  • MSE - mean squared error on fuel density
  • MAE - mean absolute error
  • Burned Area MSE - MSE restricted to burned cells
  • Unburned Area MSE - MSE restricted to unburned cells
  • Dynamic MSE (DMSE) - error weighted by the magnitude of fuel density change between time steps; larger changes are penalized more heavily
  • Physical constraint metrics - fraction of predictions that violate fuel transport, burned-cell, or unburned-cell constraints

Repository Structure

pgml-scil/
|-- common_utils/         # Shared utilities: config, dataloader, loss, metrics, visualization
|-- convlstm_new/         # ConvLSTM model, trainer, and configs
|-- FourCastNet/          # AFNO transformer model, trainer, and configs
|-- ViViT/                # Video Vision Transformer model, trainer, and configs
|-- data/                 # Cached lite dataset (numpy arrays) and sample FIRETEC-HIGRAD files
|-- notebooks/            # Exploratory data analysis notebooks
|-- scripts/              # Utility scripts (benchmarking, data preprocessing, MLflow management)
|-- nautilus/             # Kubernetes job configs for cluster deployment
|-- requirements.txt      # Python dependencies
|-- README.md

Experiment Tracking

Experiments are logged via MLflow (configured per run via logging_framework in the config). See docs/mlflow/README.md for MLflow setup instructions.

References

T. Caglar, J. Jaiswal, S. Azim, Y. Gala, M. Nguyen, & I. Altintas, (2026). Physics-guided spatiotemporal neural models for fuel density prediction. Accepted at IGARSS2026

Linn, R. R., Goodrick, S. L., Brambilla, S., Brown, M. J., Middleton, R. S., O'Brien, J. J., & Hiers, J. K. (2020). QUIC-fire: A fast-running simulation tool for prescribed fire planning. Environmental Modelling & Software, 125, 104616.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages