Skip to content
Bao Nam Do
Projects
AI & Machine Learning · Research2025

PCCC-YOLO — Real-time Fire & Smoke Detection

AI that watches for fire in the places most likely to burn.

PCCC-YOLO detecting fire and smoke in real time

My Role

Sole developer. I built the whole pipeline: curating and cleaning the fire-and-smoke dataset, training the YOLOv8s model on a Colab T4, and wiring real-time inference to a laptop webcam and CCTV feed through OpenCV — packaged to run with a single command, with a public demo on Hugging Face.

Technology

Python · YOLOv8 (Ultralytics) · OpenCV · PyTorch · Google Colab (T4)

Measurable Impact

  • Training images131,945
  • Detection classesFire + Smoke
  • Real-time on a laptopOne command

The Problem

In Vietnamese cities, mini-apartments and rented rooms have multiplied faster than anyone's ability to keep them safe — narrow stairwells, a single exit, no sprinklers — and after a string of deadly fires in Hanoi the risk stopped being abstract for me. These are exactly the buildings that will never install a certified fire-alarm system. Yet most of them already have a phone or a cheap CCTV camera pointed at the hallway.

Why I Took It On

I was doing self-directed research in computer vision at HUST's Applied Mathematics & Informatics lab, and I did not want a toy dataset. I wanted the model to earn its keep on a problem that actually kills people. Fire detection was the honest test: no leaderboard, no clean benchmark — just one question, would this catch a fire early enough to matter?

My Role

I built it alone, end to end: I collected and cleaned the data, trained the detector, wrote the real-time inference loop, and packaged the whole thing so someone else could run it with one command. Nobody handed me a pipeline; the mistakes and the fixes were all mine.

The Dataset Was the Hard Part

131,945 images sounds like plenty until you look at what fire actually does to a camera. Sunsets, brake lights, orange jackets and desk lamps all read as fire to a naive model; thin early smoke barely reads at all. Most of my time went not into the network but into the data — balancing fire against smoke and feeding the model hard negatives so it would stop crying wolf.

Model & Real-time Pipeline

I trained YOLOv8s for 50 epochs on a single Colab T4 — a deliberately small model, because the point is to run on a cheap machine, not a server. Detection streams from a webcam or CCTV feed through OpenCV; press a key and it saves the frame it flagged. The repository installs and runs with one command, and a public Hugging Face demo lets anyone test it on their own images.

Honest Limits

This is a research prototype, not a certified fire-safety device, and I say so plainly. It can still be fooled by steam or strong warm light, night footage is harder, and I have not yet validated it on real deployment video — so I make no accuracy claim I cannot back up. For a safety system a missed fire and a false alarm are not equal mistakes, and getting that balance right is work I have started, not finished.

Why It Matters & What's Next

The idea is simple and cheap: turn a camera someone already owns into an early warning, instead of asking the people at highest risk to buy hardware they never will. Next, I want to validate it on real footage, tune the threshold around the cost of a miss, and run it on a small edge device that can text a landlord the moment it sees smoke.

Technology

PPython
YYOLOv8 (Ultralytics)
OOpenCV
PPyTorch
GGoogle Colab (T4)

What I Learned

  • The dataset, not the architecture, decided everything — an afternoon spent cleaning images beat a week of tuning the model.
  • In a safety system a false alarm and a missed alarm are not the same size of mistake, and the model has to be tuned around that.
  • A demo that works is not the finish line; earning enough trust to run in the real world is — and I'm honest that it isn't there yet.

What comes next

  • Validate on real deployment footage and tune the alarm threshold around the true cost of a missed fire.
  • Run on a cheap edge device with phone alerting, so a landlord could actually install it.

Last updated: 2026-08-15