PyTorchFire: A GPU-Accelerated Wildfire Simulator with Differentiable Cellular Automata
Project description
PyTorchFire: A GPU-Accelerated Wildfire Simulator with Differentiable Cellular Automata
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.
Getting Started
Notebook Examples
- Wildfire Prediction: examples/prediction.ipynb
- Parameter Calibration: examples/calibration.ipynb
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pytorchfire-1.0.3.post2.tar.gz.
File metadata
- Download URL: pytorchfire-1.0.3.post2.tar.gz
- Upload date:
- Size: 22.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d2334577bc9dc196c075d2957e568fd35f3684ec25973f6f69a9009da0620ca
|
|
| MD5 |
3f9e2cf86fba35130d791fc03a107b30
|
|
| BLAKE2b-256 |
9db8c7a1f469661ef12f2ae371a6ce276054ac89d91a6d8d9ffb9ba33f488a3a
|
File details
Details for the file pytorchfire-1.0.3.post2-py3-none-any.whl.
File metadata
- Download URL: pytorchfire-1.0.3.post2-py3-none-any.whl
- Upload date:
- Size: 13.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f8370c3afeb5ba99f6cb0ebba603684d516073bcf404249573363adde0b755a
|
|
| MD5 |
933fd4366691bc92b4c48861ee0b740f
|
|
| BLAKE2b-256 |
d0a625f09c7736468aedb329bd165ff257cb1898337a45dafe0804685f97ca79
|