Example detections across confuser-heavy scenes (clouds, glare, warm lighting).
What the model does
A YOLO11s object detector that draws bounding boxes for two classes — fire and smoke — on still images or video frames. It was trained primarily on the D-Fire dataset, then supplemented with additional images targeted at reducing false positives (see Datasets).
Results
The project went through two training runs. The second ran in YOLO11s, trained longer with early stopping, used a higher input resolution, and added hard-negative / confuser images to the data.
| Metric (mAP@0.5) | Baseline | Final (YOLO11s) |
|---|---|---|
| all classes | 0.747 | 0.799 |
| smoke | 0.813 | 0.858 |
| fire | 0.681 | 0.739 |
Final run, additional detail:
| Class | Precision | Recall | mAP@0.5 | mAP@0.5:0.95 |
|---|---|---|---|---|
| all | 0.777 | 0.735 | 0.799 | 0.468 |
| smoke | 0.839 | 0.799 | 0.858 | 0.536 |
| fire | 0.715 | 0.671 | 0.739 | 0.400 |
Training configuration: YOLO11s, imgsz=640, batch=4, epochs=100, patience=30. Best results at epoch 64; training stopped early at epoch 84. Trained on a single RTX 4070 Laptop GPU (8 GB), ~10.4 hours.
Curves and diagnostics
Training / validation losses and metrics over epochs.
Precision–Recall curve.
Confusion matrix.
What improved: longer, properly-completed training (the baseline was cut short) plus the model upgrade and higher resolution lifted overall mAP by ~5 points, with the weaker fire class gaining the most.
Optimal confidence threshold: the F1 curve peaks at conf = 0.36, which is the value used in the demo.
Datasets
The training set is built primarily on D-Fire, then supplemented with partial samples from several other datasets to address specific weaknesses (cloud/smoke confusion, fire-is-not-fire, background false positives). Only D-Fire was used in full; the others were added in part.
| Dataset | Role in this project |
|---|---|
| D-Fire | Main dataset (fire & smoke) |
| HPWREN / AI for Mankind | Cloud vs. smoke distinction |
| BoWFire | Negative samples (fire / not-fire) |
| DetectionFire | Background / confuser samples |
Demo
A simple Gradio app lets you upload an image and see detections. The live demo is embedded above, or run it locally:
python app/app.py
Live demo: huggingface.co/spaces/oralyalcinpinar/fire-detection
Installation & usage
git clone https://github.com/Oralmanke/fire-detection
cd fire-detection
pip install -r requirements.txt
Run inference on an image:
yolo detect predict model=weights/best.pt source=path/to/image.jpg conf=0.36
Export optimised models:
python src/export.py # produces ONNX and TensorRT engine
Model weights
- best.pt — trained PyTorch weights
- best.onnx — portable, runs anywhere on ONNX Runtime
- best.engine — TensorRT FP16, built for and only valid on the same GPU/driver
Known limitations & future work
This is an early-stage model. Honest current weaknesses:
- False positives. The model still predicts fire / smoke on some confuser backgrounds (clouds, glare, industrial scenes). Adding more hard examples is the primary lever to improve performance of the model.
- Fire lags smoke. Fire is smaller and more visually varied; it needs more and more diverse examples (night, distant, small flames).
Project structure
fire-detection/
├── app/ # demo (Gradio)
├── notebooks/ # data exploration
├── src/ # train.py, test.py, export.py
├── weights/ # best.pt + best.onnx + best.engine
├── data.yaml
├── requirements.txt
└── README images, demo gif
License
MIT — see LICENSE in the repository.
References
- Venâncio et al. “An automatic fire detection system based on deep convolutional neural networks for low-power, resource-constrained devices.” Neural Computing and Applications, 2022.
- AI for Mankind & HPWREN. Wildfire Smoke Dataset. github.com/aiformankind/wildfire-smoke-dataset
- Chino et al. “BoWFire: Detection of Fire in Still Images by Integrating Pixel Color and Texture Analysis.” SIBGRAPI, 2015. arxiv.org/abs/1506.03495
- Liu et al. “DetectionFire: A Comprehensive Multi-modal Dataset.” 2025.