This repository provides two PyTorch-based models to predict daily Fire Radiative Power (FRP) from MODIS satellite data over Australia:
- DeepFRPNet (MLP): a deep feed-forward regression network
- ImprovedFireModel (LSTM + CNN + Self-Attention): a sequence model with 30-day sliding windows
It also includes scripts for training, inference and summarising performance.
Bushfire-prediction/
├── datasets/ # MODIS CSV files: modis_YYYY_Australia.csv
├── LSTM.py # Train ImprovedFireModel (CNN + biLSTM + attention)
├── MLP.py # Train DeepFRPNet MLP model
├── apply_lstm_modis1.py # Inference script for LSTM model
├── apply_mlp_modis1.py # Inference script for MLP model
├── apply_summary1.py # Compute & save combined metrics
├── best_model.pth # Checkpoint of best LSTM model
├── best_frp_model.pt # Checkpoint of best MLP model
├── LICENSE # MIT License
└── proj.code-workspace # VS Code workspace settings
-
Clone the repo
git clone https://github.com/ErrorChen/Bushfire-prediction.git cd Bushfire-prediction -
(Optional) Create a virtual environment
python3 -m venv venv source venv/bin/activate # Windows: venv\Scripts\activate
-
Install dependencies
pip install numpy pandas scikit-learn matplotlib pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu126
Place your daily MODIS data CSVs in the datasets/ folder, named exactly as:
datasets/modis_YYYY_Australia.csv
where YYYY is a four-digit year.
- LSTM.py aggregates these files via
glob('datasets/modis_????_Australia.csv') - MLP.py uses
glob('datasets/modis_*.csv')
Each CSV must include at least:
acq_date, acq_time, latitude, longitude,
brightness, bright_t31, scan, track,
confidence, frp, satellite, instrument,
daynight, type, version
python MLP.py- Loads & preprocesses all
datasets/modis_*.csv - Splits into train/val/test
- Trains with mixed precision & early stopping
- Saves best weights to
best_frp_model.pt
python LSTM.py- Aggregates daily summaries with a 30-day lookback window
- Trains CNN→biLSTM→Self-Attention network
- Saves best weights to
best_model.pth
python apply_mlp_modis1.py- Loads
best_frp_model.ptand alldatasets/modis_*.csv - Outputs
modis_mlp_frp_results.csvwith true vs predicted FRP
python apply_lstm_modis1.py- Loads
best_model.pthand alldatasets/modis_YYYY_Australia.csv - Outputs
modis_lstm_frp_results.csvwith true vs predicted FRP
- Fork this repo
- Create a feature branch:
git checkout -b feature/your-feature
- Commit your changes:
git commit -m "Add awesome feature" - Push and open a Pull Request
Please include tests and update this README as needed.
This project is licensed under the MIT License. See LICENSE for details.