Skip to content

xiazeyu/PyTorchFire

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

Conference arXiv Paper DOI GitHub Repo Code DOI

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 (Links Coming Soon!):

FireDataForge: A Unified Framework for Multi-Source Wildfire Data Retrieval and Integration > Zeyu Xia, Lexie Chen, Ye Liu, Huilin Huang > Accepted to the 2026 IEEE International Conference on Information Reuse and Integration for Data Science (IEEE IRI 2026). [arXiv preprint and official IEEE DOI will be updated here upon release]

👉 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]'

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()

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}
}

License

MIT License. More information see LICENSE

Contact

Zeyu Xia - zeyu.xia@virginia.edu

Sibo Cheng - sibo.cheng@enpc.fr

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages