Skip to content

Repository files navigation

PyTorchFire: A GPU-Accelerated Wildfire Simulator with Differentiable Cellular Automata

Hatch project PyPI - Version Read the Docs

Paper doi Paper license

Code DOI Dataset DOI

About The Project

Accurate and rapid prediction of wildfire trends is crucial for effective management and mitigation. However, the stochastic nature of fire propagation poses significant challenges in developing reliable simulators. In this paper, we introduce PyTorchFire, an open-access, PyTorch-based software that leverages GPU acceleration. With our redesigned differentiable wildfire Cellular Automata (CA) model, we achieve millisecond-level computational efficiency, significantly outperforming traditional CPU-based wildfire simulators on real-world-scale fires at high resolution. Real-time parameter calibration is made possible through gradient descent on our model, aligning simulations closely with observed wildfire behavior both temporally and spatially, thereby enhancing the realism of the simulations. Our PyTorchFire simulator, combined with real-world environmental data, demonstrates superior generalizability compared to supervised learning surrogate models. Its ability to predict and calibrate wildfire behavior in real-time ensures accuracy, stability, and efficiency. PyTorchFire has the potential to revolutionize wildfire simulation, serving as a powerful tool for wildfire prediction and management.


πŸš€ New Companion Tool: FireDataForge

Paper DOI Green OA GitHub Repo

Tired of manually downloading and aligning wildfire data? We are excited to introduce FireDataForge, a unified data pipeline that perfectly complements PyTorchFire.

FireDataForge solves the preprocessing bottleneck in wildfire research. Simply provide an MTBS Event ID, and it will automatically retrieve, harmonize, and align 11 distinct data sources (including fire behavior, weather, land cover, elevation, and satellite imagery) into analysis-ready NumPy arrays with embedded metadata.

It is the perfect upstream data provider for your PyTorchFire machine learning models and fire behavior simulations.

πŸ“– Read the Paper:

FireDataForge: A Unified Framework for Multi-Source Wildfire Data Retrieval and Integration
Zeyu Xia, Lexie Chen, Ye Liu, Huilin Huang
In 2026 IEEE International Conference on Information Reuse and Integration for Data Science (IEEE IRI 2026), pp. 528–531.
Published version: doi:10.1109/IRI69576.2026.00103
Open-access version (Green OA): arXiv:2606.21198

πŸ‘‰ Get started with FireDataForge here!


Getting Started

Notebook Examples

Installation

Install with minimal dependencies:

pip install pytorchfire

Install with dependencies for examples:

pip install 'pytorchfire[examples]'

Install together with the FireDataForge data pipeline:

pip install 'pytorchfire[firedataforge]'

Quick Start

To perform wildfire prediction:

from pytorchfire import WildfireModel

model = WildfireModel() # Create a model with default parameters and environment data
model = model.cuda() # Move the model to GPU
# model.reset(seed=seed) # Reset the model with a seed
for _ in range(100): # Run the model for 100 steps
    model.compute() # Compute the next state

To perform parameter calibration:

import torch
from pytorchfire import WildfireModel, BaseTrainer

model = WildfireModel()

trainer = BaseTrainer(model)

trainer.train()
trainer.evaluate()

Run on Real Fires from FireDataForge

Point PyTorchFire straight at a FireDataForge event directory. The harmonized terrain, fuel, wind, and observed-ignition layers are mapped onto a WildfireModel for you β€” no manual preprocessing:

import torch
from pytorchfire import load_event

# An event folder produced by FireDataForge (output/<MTBS event id>)
event = load_event('output/CA3432611848120191010')

model = event.build_model()   # WildfireModel seeded with the real fire
model = model.to('cuda' if torch.cuda.is_available() else 'cpu')
for _ in range(100):
    model.compute()

# The observed final perimeter ships with the event β€” use it as a calibration target
target = event.target()       # [H, W] bool tensor

The reader only needs numpy and torch, so you can consume FireDataForge outputs without installing the (heavyweight) firedataforge package itself.

Runnable scripts:

python examples/firedataforge_simulate.py /path/to/output/CA3432611848120191010
python examples/firedataforge_calibration.py /path/to/output/CA3432611848120191010 --device cuda:0

API Documents

See at Our Read the Docs.

Dataset

See at Our Dataset.

Reference

@article{xia2025pytorchfire,
 author = {Zeyu Xia and Sibo Cheng},
 copyright = {CC BY 4.0},
 doi = {10.1016/j.envsoft.2025.106401},
 issn = {1364-8152},
 journal = {Environmental Modelling & Software},
 keywords = {Wildfire simulation, Differentiable Cellular Automata, PyTorch-based software, Parallel computing techniques, GPU-acceleration},
 language = {English},
 month = {4},
 pages = {106401},
 title = {PyTorchFire: A GPU-accelerated wildfire simulator with Differentiable Cellular Automata},
 url = {https://www.sciencedirect.com/science/article/pii/S1364815225000854},
 volume = {188},
 year = {2025}
}

If you use the FireDataForge integration (pytorchfire.firedataforge), please also cite FireDataForge (doi:10.1109/IRI69576.2026.00103; open-access version (Green OA): arXiv:2606.21198):

@inproceedings{xia2026firedataforge,
    address = {Seattle, WA, USA},
    archiveprefix = {arXiv},
    author = {Zeyu Xia and Lexie Chen and Ye Liu and Huilin Huang},
    booktitle = {2026 IEEE International Conference on Information Reuse and Integration for Data Science (IEEE IRI 2026)},
    doi = {10.1109/IRI69576.2026.00103},
    eprint = {2606.21198},
    keywords = {Wildfire research, Geospatial data fusion, Fire behavior simulation, Data reuse, Information retrieval},
    language = {English},
    month = jul,
    pages = {528--531},
    primaryclass = {cs.CE},
    publisher = {IEEE},
    title = {FireDataForge: A Unified Framework for Multi-Source Wildfire Data Retrieval and Integration},
    year = {2026}
}

License

MIT License. More information see LICENSE

Contact

Zeyu Xia - zeyu.xia@virginia.edu

Sibo Cheng - sibo.cheng@enpc.fr

About

GPU-accelerated wildfire simulator with differentiable cellular automata in PyTorch, supporting real-time parameter calibration via gradient descent

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages