Safety gear
Safety Gear Check RF-DETR Small
Finds workers in site photos who aren't wearing a helmet or safety vest. For each worker, it reports whether each item is on, off, or impossible to judge from the photo.
How it checks a photo
- 1
Person, head and vest detection
The detector picks out candidate people, heads and safety vests in the image. Heads that overlap heavily are merged into one, and if no head is found for a person, one is added at the top center of their box.
- 2
Helmet check
A crop around each head goes to the classifier, which decides whether that head has a helmet on.
- 3
Assignment to workers
Working from the tallest person down, each person gets the head near the top of their box and the vest around their torso. No head means the helmet is "unknown". No vest means the vest is "off" if the person is at least 64 pixels tall and a head was found, and "unknown" otherwise.
Input and output
- Detects
- Three classes: person, head and safety vest (a high-visibility vest with reflective strips). Heads are detected with or without a helmet, and a separate classifier decides whether each one has a helmet on. Full-body harnesses and safety belts are not checked.
- Base model
- Detection uses RF-DETR Small (public weights pretrained on COCO, Apache-2.0), fine-tuned on public datasets and Wikimedia Commons photos of work sites. For the helmet check, head features are taken from DINOv2-small (Apache-2.0, weights used as is) and sorted by an SVM (support vector machine).
- Input
- Detector: a 512 × 512 pixel color image (RGB). Classifier: a 224 × 224 pixel square cropped around each head.
- Output
- The position of each worker, with the helmet and the safety vest each marked "on", "off" or "unknown". Behind this, the detector returns 300 candidates per image, each with a position, score and class. No duplicate suppression (NMS) is needed.
- Formats
- ONNX (both the detector and the classifier) and PyTorch (detector only). The code that turns detections into per-worker results is included, as plain Python that needs only numpy.
- Threshold
- Person 0.4, head and safety vest 0.3, helmet 0.5. All three were set on validation images before anyone looked at the evaluation images.
- License
- Apache-2.0
Evaluation
| Metric | Evaluation set (58 images, 128 workers) | Target |
|---|---|---|
| No-helmet recall (share of workers without a helmet who were caught) | 0.857 (48 of 56) | 0.90 or higher (not met) |
| No-helmet precision (share of "off" calls that were right) | 0.906 | 0.85 or higher |
| No-vest recall | 0.876 (92 of 105) | 0.85 or higher |
| No-vest precision | 0.958 | 0.80 or higher |
| Missed workers | 8.6% (11 of 128) | 10% or lower |
No-helmet recall falls short of the 0.90 target. The figures come from running the two published ONNX models and the post-processing on a CPU, and only workers at least 64 pixels tall are counted. The evaluation images are Wikimedia Commons photos that were not used in training, with no photographer in common with the training photos, and they were used just this once. Only 56 workers in the set have no helmet, so a single worker shifts the figure by about 1.8 points (the 95% interval for 0.857 is roughly 0.74 to 0.93). On another set, used several times to compare settings (102 images, 327 workers), the figure was 0.873. The ground-truth boxes and helmet and vest labels were made by an AI and reviewed by a second AI. No person checked them one by one.
Notes on use
- Caps, knit hats, hoods, head scarves and welding masks are sometimes mistaken for helmets. This is behind most of the missed "no helmet" cases.
- Workers who are small and far away, overlapping other people, or behind scaffolding or machinery get missed (14.0% on another evaluation set). A missed worker gets no helmet or vest result at all.
- Results are less reliable when the head is small, blurred, turned away or hidden, and for people who are crouching or lying down.
- A vest marked "off" only means no vest was found. Vests seen only from the back, vests worn open, and fluorescent jackets or coveralls are more likely to be judged wrongly.
- It can't tell workers from anyone else, so passers-by are counted as workers too.
- The training data is public datasets (two from Roboflow Universe, plus Open Images V7) and Wikimedia Commons photos, mostly of sites outside Japan. Very few images come from Japanese sites.
- It hasn't been tested at night, in rain or on fixed-camera footage. Before using it, compare its output with a person's judgment on images from the site in question.
- Do not make safety decisions, such as whether someone may enter a site, based on this model's output alone.
Start by describing your situation
Whether it is a MICHIKARTE trial or an AI app, your plans do not need to be final. The contact form is in Japanese, but you are welcome to write in English.
