Home

Awesome

Leveraging Vision Transformers for Enhanced Wildfire Detection and Characterization

<img src="https://img.shields.io/github/stars/amanbasu/wildfire-detection?color=0088ff"/> <img src="https://img.shields.io/github/forks/amanbasu/wildfire-detection?color=ff8800"/> <img src="https://img.shields.io/badge/torch-1.9.0+cu111-green?logo=pytorch"/> <img src="https://img.shields.io/badge/python-3.9.6-blue?logo=python"/>

In this project, we use the active fire dataset from https://github.com/pereira-gha/activefire (data link) and try to improve over their results. We use two Vision Transformer networks: Swin-Unet and TransUnet, and one CNN-based UNet network. We show that ViT can outperform well-trained and specialized CNNs to detect wildfires on a previously published dataset of LandSat-8 imagery (Pereira et al.). One of our ViTs outperforms the baseline CNN comparison by 0.92%. However, we find our own implementation of CNN-based UNet to perform best in every category, showing their sustained utility in image tasks. Overall, ViTs are comparably capable in detecting wildfires as CNNs, though well-tuned CNNs are still the best technique for detecting wildfire with our UNet providing an IoU of 93.58%, better than the baseline UNet by some 4.58%.

File description

Commands

# Train
python train.py <model-name>
## Example
python train.py unet

# Evaluate
python evaluate.py <model-name>
## Example
python evaluate.py unet

# Save predictions
python predict.py <model-name> <image-path>
## Example
python predict.py unet predictions/unet/

Results

MethodPrecisionRecallF-scoreIoU
U-Net (10c)92.9095.5094.2089.00
U-Net (3c)91.9095.3093.6087.90
U-Net-Light (3c)90.2096.5093.2087.30
TransUNet88.4686.8887.6687.49
Swin-Unet88.2892.3090.2489.93
Our UNet93.3793.9693.6793.58