Construction Site Safety Hazards β€” PPE & Heavy-Plant Detection (YOLOv8)

Keywords: construction site safety detection Β· PPE detection (hard hats / safety helmets and hi-vis safety vests, worn and missing) Β· missing-PPE detection Β· worker/person detection Β· heavy-equipment detection (excavator, wheel loader, dump truck) Β· YOLOv8 object detection Β· ONNX Β· runs in a browser tab.

A small YOLOv8n object detector (12.2 MB ONNX) for construction-site photos and video that finds workers, hard hats and hi-vis vests β€” worn and missing β€” and heavy plant (excavators, wheel loaders, dump trucks) in one pass, sized to run offline in a browser tab or on the edge. It powers the Job Site mode of BuildVision, where missing-PPE boxes are matched to the worker they belong to and every detected machine gets an operating-radius check.

Formerly published as the "BuildVision site-hazard detector". Same weights, clearer name.

Not a safety system. This is a prompt to look, not a finding. It is not safety-rated, not a substitute for a competent person's inspection, and never a compliance record.

Example detection on a held-out test image

Model output at confidence β‰₯ 0.35 on an image from the PPE detection 1 test split (CC BY 4.0), not seen in training.

At a glance

Task Object detection (bounding boxes)
Architecture YOLOv8n (Ultralytics), fine-tuned from COCO weights
Weights buildvision-hazards-v0.1.onnx (12.2 MB) Β· buildvision-hazards-v0.1.pt
Input RGB 1Γ—3Γ—448Γ—448, float32 in [0, 1], letterboxed with grey (114) padding
Output 1Γ—15Γ—anchors β€” cx, cy, w, h (input pixels) + one score per class; NMS not included
Classes 11 β€” person, hardhat, no-hardhat, safety vest, no-safety vest, no-mask, gloves, safety shoes, excavator, wheel loader, dump truck
Runs on PyTorch / Ultralytics, onnxruntime (CPU), onnxruntime-web (browser, single-threaded WASM)
Licence AGPL-3.0 (weights) Β· CC BY 4.0 (data)
Held-out test mAP@50 0.442 (mAP@50-95 0.241, precision 0.714, recall 0.432)

Files: buildvision-hazards-v0.1.onnx (ONNX, browser/edge), buildvision-hazards-v0.1.pt (PyTorch / Ultralytics), predict_onnx.py (onnxruntime-only example), config.json (classes + input/output spec), metrics.json, example.jpg.

What it detects

11 output classes: person, hardhat, no-hardhat, safety vest, no-safety vest, no-mask, gloves, safety shoes, excavator, wheel loader, dump truck. Of these, no-mask, gloves and safety shoes are not detected in practice (too few training examples) β€” see Limitations.

In practice the useful reads are: people, hard hats worn / not worn, hi-vis vests worn / not worn, and plant (excavator, wheel loader, dump truck).

Results

Held-out test set: the untouched test splits of 4 public construction-safety datasets, 573 images, with near-duplicates of any training or validation image removed. 3 of those sources were not in this model's training data, so their rows measure how it generalises to new sites and camera styles.

mAP50 0.442 Β· mAP50-95 0.241 Β· precision 0.714 Β· recall 0.432

Per class (test)

Class Boxes Precision Recall mAP50 mAP50-95
person 713 0.882 0.732 0.807 0.388
hardhat 547 0.776 0.751 0.795 0.367
no-hardhat 126 0.117 0.191 0.047 0.011
safety vest 382 0.794 0.592 0.708 0.365
no-safety vest 222 0.621 0.266 0.368 0.135
no-mask β€” not detected 2 1.000 0.000 0.000 0.000
gloves β€” not detected 248 1.000 0.000 0.000 0.000
safety shoes β€” not detected 268 1.000 0.000 0.000 0.000
excavator 133 0.550 0.707 0.698 0.366
wheel loader 46 0.497 0.870 0.777 0.540
dump truck 78 0.619 0.646 0.666 0.477

Per source (test)

Source Images mAP50 mAP50-95
Construction Site Safety 34 0.503 0.293
PPE detection 1 (not in training data) 101 0.641 0.315
PPE_Dectection v4 (not in training data) 254 0.375 0.171
excavators-czvg9 (RF100) (not in training data) 184 0.677 0.438

These are numbers on this test set. Other open PPE models report on their own datasets, so a side-by-side number is not a head-to-head comparison. Two sources label people incompletely; in their test images, people a stock COCO YOLOv8s found (confidence β‰₯ 0.5) were added as person boxes so correct detections are not scored as false positives.

Quick start

Ultralytics (PyTorch)

from ultralytics import YOLO
model = YOLO("buildvision-hazards-v0.1.pt")
for box in model("site.jpg", imgsz=448, conf=0.35)[0].boxes:
    print(model.names[int(box.cls)], float(box.conf), box.xyxy.tolist())

ONNX Runtime (no torch)

pip install onnxruntime numpy pillow, then python predict_onnx.py site.jpg --out boxes.jpg. Input is 1Γ—3Γ—448Γ—448 RGB in [0, 1], letterboxed with grey (114) padding; output is 1Γ—15Γ—anchors (cx, cy, w, h, then one score per class), with NMS not included β€” apply your own.

Browser / edge

The same ONNX file runs in onnxruntime-web (single-threaded WASM) with no server β€” that is how it is used in BuildVision's Job Site mode, entirely on-device.

Training

  • Architecture: YOLOv8n from COCO weights. Fine-tuned in two stages: 24 epochs at 512 px on Construction Site Safety alone, then 6 epochs at 448 px on both datasets.
  • Data: Construction Site Safety + construction-safety-gsnvb (RF100) (both CC BY 4.0): 1,304 training and 266 validation images.
  • Classes dropped from the source labels: classes with one to three boxes in the whole corpus (barricade, dumpster, mask, mini-van, truck, safety net) cannot be learned and were removed before training.

Limitations

  • Not detected in practice: too few training examples to learn β€”

    • no-mask: 36 training boxes
    • gloves: 11 training boxes
    • safety shoes: 9 training boxes

    These output channels exist in the model but should be ignored.

  • Missing-PPE classes are the weak spot: no-hardhat and no-safety vest score well below their worn counterparts, especially on sites and camera styles not in the training data. Expect missed violations and false alarms.

  • No fall protection: none of the training data labels harnesses, lanyards or edge protection.

  • Small model: YOLOv8n trades accuracy for running in a browser.

  • Plant operating radius is not in the model: BuildVision's radius rule is a heuristic on the detected box.

Frequently asked questions

Can this model detect hard hats? Yes β€” hardhat (worn) and no-hardhat (missing) are both classes. Worn hats are reliable (mAP50 0.795); missing hats are weak (0.047) and need human review.

Can it detect hi-vis safety vests? Yes β€” safety vest (worn, mAP50 0.708) and no-safety vest (missing, 0.368).

Does it detect workers? Yes β€” person (mAP50 0.807).

Does it detect heavy equipment? Yes β€” excavator (0.698), wheel loader (0.777) and dump truck (0.666).

Does it detect fall hazards (harnesses, lanyards, edge protection)? No. None of the training data labels those, so there is nothing to train on.

Does it run offline / in the browser? Yes β€” ship the ONNX file and run it with onnxruntime-web, no server or network needed.

Can I use it as the safety record / for compliance decisions? No. It is a prompt to look β€” a candidate list for a human β€” not a finding, and not safety-rated.

Licence

  • Weights: AGPL-3.0. They were trained with Ultralytics YOLOv8, whose models and derivatives are AGPL-3.0 unless covered by an Ultralytics Enterprise licence. Using them in a network service means offering that service's source.
  • Data: CC BY 4.0, attribution below.

Attribution

Person pseudo-labels in the test set from Ultralytics YOLOv8s (COCO).

Citation

@misc{constructelligence_construction_site_safety_hazards,
  title  = {Construction Site Safety Hazards: PPE and Heavy-Plant Detection (YOLOv8)},
  author = {Constructelligence},
  year   = {2026},
  note   = {Object detector for hard hats, hi-vis vests, missing PPE and heavy plant on construction sites},
  url    = {https://huggingface.co/constructelligence/construction-site-safety-hazards}
}

Maintained by Constructelligence Β· not safety-rated.

Downloads last month
8
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Evaluation results