Fire & Smoke Detection

Real-time fire and smoke detection in camera/CCTV imagery using YOLO11. The project focuses on a recurring difficulty in this task: separating real fire/smoke from visual confusers such as clouds, fog, sunset glare, warm lighting, and red/industrial structures.

Client

Personal Project

Category

Computer Vision

Stack

YOLO11, Object Detection, Real-Time Inference, Gradio

Year

2026

Status

Completed

Live Demo

Demo hosted on Hugging Face Spaces. If it shows "sleeping", give it a moment to wake up, or open it in a new tab .

Fire and smoke detection examples

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)BaselineFinal (YOLO11s)
all classes0.7470.799
smoke0.8130.858
fire0.6810.739

Final run, additional detail:

ClassPrecisionRecallmAP@0.5mAP@0.5:0.95
all0.7770.7350.7990.468
smoke0.8390.7990.8580.536
fire0.7150.6710.7390.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 and validation losses and metrics over epochs

Training / validation losses and metrics over epochs.

Precision-Recall curve

Precision–Recall curve.

Confusion matrix

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.

DatasetRole in this project
D-FireMain dataset (fire & smoke)
HPWREN / AI for MankindCloud vs. smoke distinction
BoWFireNegative samples (fire / not-fire)
DetectionFireBackground / 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

  1. 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.
  2. AI for Mankind & HPWREN. Wildfire Smoke Dataset. github.com/aiformankind/wildfire-smoke-dataset
  3. Chino et al. “BoWFire: Detection of Fire in Still Images by Integrating Pixel Color and Texture Analysis.” SIBGRAPI, 2015. arxiv.org/abs/1506.03495
  4. Liu et al. “DetectionFire: A Comprehensive Multi-modal Dataset.” 2025.
All Projects

Oral Yalcinpinar © 2026 All Rights Reserved