Expert Insights

Training, Evaluating and Keeping Machine Learning Models Honest in Production Safety Monitoring

A safety model is only as good as its worst week. In production, machine learning for PPE, intrusion and hygiene monitoring is a loop, not a release: collect site footage, label with clear rules, fine-tune, evaluate on held-out frames from the same cameras, deploy to the edge, review a random sample of alerts every week, and retrain when precision drops. Precision is the metric that decides adoption, because every false alarm costs a supervisor’s trust.

2 December 202611 min readTanisha Soni

The difference between a vision model that impresses in a demo and one that a plant keeps for years is almost never the architecture. It is the data loop around it. This is how we run that loop for VISTA models at UrSpayce, written for engineers and for the EHS or operations leaders who need to know what to ask of a vendor.

1. Start from the rule, not the model

"Detect PPE" is not a specification. "Alert when a person inside the press-shop zone has no helmet for more than three seconds during a running shift" is. The rule defines the classes the model needs (person, helmet), the context the rules engine handles (zone, dwell, shift) and the error that matters (a missed breach is a safety failure; a false alarm is a trust failure). Writing the rule first prevents training a model to solve a problem the rules engine should solve.

2. Collect data from the cameras that will run the model

Public datasets get a model to a starting point; the customer's own cameras get it to production. The lighting, mounting height, lens distortion and helmet colours at one plant are not those of another. We sample frames across shifts, weather and seasons (a foundry in May and in December look different), and we capture the hard negatives: a yellow bucket that looks like a helmet, a reflection in a glass partition, a poster with a person on it.

3. Label with a written guideline

Two labellers given "mark helmets" will disagree on a helmet carried in the hand, a hood, a turban under a helmet. A one-page guideline with examples resolves these before they become model noise. Every class gets a positive example, a negative example and the edge cases; labellers are measured on agreement, and disagreements go back into the guideline.

4. Train by fine-tuning, evaluate on the right split

Fine-tuning a pretrained detector on a few hundred to a few thousand site frames is usually enough. The evaluation split must come from the same cameras but different days, never from frames adjacent to the training frames, or the metric lies. We report per-class precision and recall at the operating threshold, not only mean average precision, because the threshold is what the site will live with.

5. Choose the operating point deliberately

Use caseCost of a missCost of a false alarmOperating point
Fire or smokeVery highModerateFavour recall; accept more alarms, add a second signal (thermal, sensor) to confirm
PPE complianceModerateHigh (supervisor fatigue)Favour precision; use dwell time and zone masks to recover recall
Restricted-zone intrusionHighModerateBalanced; confirm with permit data from the workforce system
Queue and footfall countsLow (aggregate)LowOptimise for count accuracy over time, not per frame
Hygiene in kitchensModerateHighFavour precision; review alerts in batches rather than live

6. Deploy to the edge with a version

Models are exported (ONNX or the runtime's own format), quantised with calibration frames from the site, and shipped with a version tag that appears on every alert. When a supervisor says "it got worse last week", the first question is which model version and which rule version changed, and the answer must be in the logs.

7. Monitor drift with humans in the loop

Drift is quiet: a camera is nudged, a new vest colour is issued, winter lighting arrives. We measure it three ways. Alert volume per rule per camera against its own baseline flags sudden changes. A weekly random sample of alerts is reviewed by a person and scored, giving live precision. And a monthly sample of non-alert frames is reviewed for misses, giving live recall. Any rule whose live precision falls below its agreed floor goes back to step 2 with the new frames added.

8. Close the loop with the site

The supervisor who dismisses a false alarm in the app is labelling data. Captured properly (with the reason: not a person, correct PPE, outside zone), those dismissals become the next fine-tuning set. This is the cheapest labelled data a vendor will ever get, and it comes from exactly the distribution that matters.

What to ask a vendor

  1. Show per-rule precision and recall on my cameras after a two-week pilot, not a benchmark number.
  2. Which model version is running on each site right now?
  3. How are my supervisors' dismissals used?
  4. What happens to a rule when the camera is moved?
  5. How is site footage used for training, where is it stored, and when is it deleted? (The DPDP checklist applies to training data too.)

Where UrSpayce fits

VISTA runs this loop for every deployment: site-specific fine-tuning, versioned edge models, weekly precision sampling and dismissal capture in the supervisor app. It is live across plants, a 30-branch QSR chain and government sites in India and Oman. See the engineering of the pipeline itself in From RTSP stream to alert, or run the two-week pilot.

Frequently asked questions

How much data is needed to train a PPE detection model for a plant?

A few hundred to a few thousand labelled frames from the plant's own cameras, sampled across shifts and lighting, on top of a pretrained detector; the site-specific frames matter more than the total count.

What metric matters most for a safety model in production?

Precision at the operating threshold, measured on the live cameras, because false alarms erode supervisor trust fastest; recall is tracked monthly by reviewing frames that produced no alert.

What is model drift in video analytics?

A gradual drop in accuracy caused by changes the model never saw: a moved camera, new uniform colours, seasonal lighting. It is detected by alert-volume baselines and weekly human review of sampled alerts.

How often should a vision model be retrained?

When live precision for a rule falls below its agreed floor, typically every few months per site, using the new frames and the supervisors' dismissals as labelled data.

Is customer footage used to train models for other customers?

It should not be without consent and a contract. Ask the vendor where training data is stored, who can access it and when it is deleted; UrSpayce trains site-specific models per customer.

Why does a demo model fail at a real plant?

Because the demo was trained on other environments. Lighting, mounting height, helmet colours and reflections differ per site; fine-tuning on the site's own frames is what moves a model from demo to production.

See UrSpayce in action

One AI-native platform for visitors, spaces, IoT, computer vision, AI agents and procurement — across India, the US and the GCC.

Book a free demo