CCTV + AI: enforcing kitchen safety without a human watching
Back to Blog
AI & Vision

CCTV + AI: enforcing kitchen safety without a human watching

Mohtashim HusnainJuly 15, 20266 min read

## The enforcement problem

Every commercial kitchen has the same two rules on the wall: no phones on the line, no smoking or vaping. Everyone agrees with them. Almost nobody enforces them, because enforcement means a manager standing in the kitchen or staring at a CCTV feed all shift.

That was the situation at Ashwheelz Group. The cameras were already there. The footage was already being recorded. But nobody had time to watch it, and when a manager did catch something after the fact, there was no timestamped evidence to point to. Conversations turned into "I saw you" versus "no you didn't".

We were asked to make the cameras do the watching.

Detector design

We built two detectors, because the two violations look nothing alike on camera.

Phones: the 10-second rule

Phone detection uses YOLOv8, an object-detection model that runs frame by frame and draws a box around anything it recognises as a phone. That part is straightforward. The hard part is deciding what counts as a violation.

A phone visible for one frame is not a violation. Someone might be checking the time, or a phone might be sitting on a shelf. So the detector tracks continuous handling and only flags a violation after 10 seconds of a phone being held. Below that threshold nothing happens. Above it, the event is logged and a snapshot is captured.

That single rule removed most of the noise before we did anything else.

Smoke and vape: person-gated detection

Smoke and vapour clouds are a poor fit for an object detector. They have no fixed shape, they are translucent, and a busy kitchen produces steam all day long. So we did not use a neural network here. We built a purpose-built classical computer-vision detector that looks for the visual signature of a smoke or vape cloud.

On its own, that would fire on every pot of boiling water. So we gated it: the smoke detector only runs when a person is present in the frame. Steam rising from an empty stove is ignored. A cloud appearing next to a person's head is not.

Killing false alarms

A monitoring system that cries wolf gets switched off within a week. We spent more time on false-alarm suppression than on detection itself, and two mechanisms did most of the work.

**Sustained detection plus a 30-second cooldown.** A violation must be sustained, not momentary, before it is reported. Once it is reported, the detector enters a 30-second cooldown for that event. Without the cooldown, one person on a phone for a minute would generate dozens of alerts. With it, they generate one.

**Peak-confidence frame buffer.** When the detector is tracking a possible violation, it keeps a rolling buffer of recent frames and records the model's confidence for each. When the event is confirmed, it saves the frame where confidence peaked, not the frame where the threshold was crossed. In practice that means the snapshot is the clearest view of the phone in the hand, or the cloud next to the face, rather than a blurry frame from the edge of the event.

Together these took false alarms to near zero. Managers stopped ignoring the alerts because the alerts stopped being wrong.

Evidence managers can act on

The output of the system is deliberately boring: a timestamped photo, the camera it came from, and the type of violation. That is all a manager needs.

It changes the conversation. Instead of "I think I saw you on your phone", it is "here is a photo from 14:32 on the grill camera". The discussion moves from whether something happened to what to do about it. Staff know the cameras are watching consistently, not just when a manager happens to look up, so behaviour changes on its own.

And because the system runs continuously, the coverage is objective. It does not get tired, does not have favourites, and does not look away during the lunch rush.

Lessons

A few things we would carry into any similar project:

  • **Detection is the easy part.** Off-the-shelf models find phones well. The engineering is in deciding when a detection becomes a violation.
  • **Use the right tool for each target.** A neural network for solid objects, classical CV for smoke. Forcing one approach onto both would have been worse at both.
  • **Context beats accuracy.** Gating smoke detection on the presence of a person did more to cut false positives than any tuning of the detector itself.
  • **Save the best frame, not the first.** The peak-confidence buffer is a small idea with a big effect on how usable the evidence is.
  • **Design for the person receiving the alert.** One clear photo beats ten grainy ones.

If you have cameras already, you have most of what you need. The rest is software.

Want this for your business? Message us on WhatsApp +92 320 0496154.

yolov8opencvcomputer visionsafety