Case Study: Computer Vision, an Optense Product

Read the full breakdown
Read the full breakdown

SCM turns a worksite's existing CCTV into a real-time PPE safety monitor. An Optense product, rebuilt from the ground up, solo, in about six weeks.

PPE detection from 23% to 88%, by fixing the dataset, not the model.
SCM detecting workers and their PPE with bounding boxes
About the Project

SCM (Safety Compliance Monitoring) is one of Optense's products, and the one that started it all. It watches a worksite's existing IP cameras and checks, in real time, whether each worker is wearing the right protective equipment, then alerts the safety supervisor the moment someone is not. It began as MS-T, my team's final project at the Apple Developer Academy, sparked by a teammate's father, a safety supervisor who told us that no matter how hard he tried, someone always found a way to skip their gear. The stakes are not abstract. Up to 85 percent of workplace accidents trace back to improper or neglected PPE. Personal Protective Equipment, such as hard hats, vests, gloves, and masksI later rebuilt the whole system from the ground up on my own, and that rebuild is what this case study covers.

Computer VisionML EngineeringEdge SystemsiOS
The SCM iOS app showing a violation with evidence
The Challenge

A supervisor cannot watch every camera, every worker, every minute. The obvious idea, notify someone the instant a violation happens, hides two hard problems. First, it has to run on the cameras a factory already owns and keep working even when the network drops. Second, and harder, it has to reliably tell compliant from not compliant on messy, real-world CCTV, which turned out to be far more about data than about models.

A wall of raw CCTV feeds, more than any supervisor can watch at once
The System

SCM is built edge-first. Each site runs a Raspberry Pi 5 with a Hailo-8L A low-power AI accelerator chip for running vision models on edge devicesaccelerator that pulls up to four camera streams over RTSP Real-Time Streaming Protocol, the standard way IP cameras stream their videoand runs detection on-device, so there is no server bottleneck and no footage leaves the site. On that Pi, a Python inference engine and a Rust runtime talk over a Unix domain socket, which keeps them fault-isolated. If the inference engine crashes, the runtime restarts it, and violations are buffered offline so none are lost during an outage. A Rust server then stores evidence in MongoDB A document database that stores records in a flexible, JSON-like formatand an iOS app pushes real-time alerts to supervisors through APNs. Apple Push Notification service, used to send alerts to iPhones and iPadsThe processor runs perfectly well with no server at all, which is what makes it industry-ready.

The four-layer edge architecture of SCM
The Two-Stage Brain

Deciding whether a person is compliant happens in two stages. First, detection: one model finds every person, body part, and piece of PPE in the frame across eight classes. Then, association: each item is matched to a person by checking whether its box sits inside theirs, and a set of visibility-aware rules turns that into a verdict. A bare hand with no glove is a violation, a covered hand with no glove showing is fine, and a person too small in frame is skipped rather than guessed. Those rules are what keep it from crying wolf.

The two-stage detection and association pipeline
The Model Zoo

The models were the hard part, and the fix is the thing I am proudest of. My first training run was unusable, with PPE accuracy sitting at 23 to 61 percent, because the public dataset I found was badly imbalanced, one class outnumbering another 25 to 1. Balancing it by hand meant labeling thousands of objects at 15 seconds each, dozens of hours of mind-numbing work. So I built a data flywheel instead. I trained a specialized single-class model for each item, then used those models to auto-label fresh images and corrected only what they got wrong. On the first class, it labeled 544 of 600 images for me and cut the work by 95 percent, and a retrain took its accuracy from 72 to 90 percent. I also wrote a greedy-optimization An approach that makes the best choice available at each step to move toward a goalbalancer that decides which images to keep or drop to hit a target class ratio automatically. The weak classes climbed from the low twenties into the seventies and eighties. The lesson stuck with me: data quality matters more than model complexity.

The class distribution and accuracy before balancingThe class distribution and accuracy after balancing
Outcome

I deployed all three layers to real hardware, the processor on the Pi and Hailo, the server on a VPN-connected machine, and the app on an iPhone, then validated each layer at the component level. The two reusable tools that fell out of it, an auto-annotator and the class balancer, work on any object-detection dataset, not just PPE. It is not finished, it still needs measured production testing, more PPE classes, and beefier hardware like a Jetson, NVIDIA's family of compact, GPU-powered computers for edge AIand I am upfront about that. But it does what it set out to do, and the mission behind it still holds. Every worker deserves a tomorrow.