🦺 YOLOv8 PPE Detection – End-to-End Safety Vision Model

Author: Hansung Cho
Model: YOLOv8n fine-tuned for PPE (Personal Protective Equipment) detection on construction-like scenes.

이 λͺ¨λΈμ€ 건섀 ν˜„μž₯ λ“±μ˜ 이미지/μ˜μƒμ—μ„œ μ•ˆμ „λͺ¨(Hardhat), 마슀크, μ•ˆμ „μ‘°λΌ(Safety Vest), μ‚¬λžŒ(Person) λ“± PPE 착용 μ—¬λΆ€λ₯Ό νƒμ§€ν•˜κΈ° μœ„ν•΄ ν•™μŠ΅λœ YOLOv8 기반 객체 탐지 λͺ¨λΈμž…λ‹ˆλ‹€.

  • Custom PPE dataset 기반 fine-tuning
  • Web / FastAPI / WebcamκΉŒμ§€ μ—°λ™λœ End-to-End ν”„λ‘œμ νŠΈμ˜ 핡심 λͺ¨λΈ
  • Hugging Face Hubμ—μ„œ λ°”λ‘œ λ‹€μš΄λ‘œλ“œ 및 μ‚¬μš© κ°€λŠ₯

🧠 Model Description

  • Base model: YOLOv8n (Ultralytics)
  • Task: Object Detection (Bounding Box)
  • Domain: Construction site & industrial safety PPE detection
  • Classes (μ˜ˆμ‹œ):
    • Person
    • Hardhat
    • No-Hardhat
    • Safety Vest
    • No-Safety Vest
    • Mask
    • No-Mask
      • 기타 PPE κ΄€λ ¨ 클래슀 (총 μ•½ 10개)

λ³Έ λͺ¨λΈμ€ μ‚¬λžŒ + PPE 착용 μ—¬λΆ€λ₯Ό λ™μ‹œμ— νƒμ§€ν•˜μ—¬
Web UI / Webcam / FastAPI μ„œλ²„μ—μ„œ μ‹€μ‹œκ°„ κ²½κ³  μ‹œμŠ€ν…œ ꡬ좕에 ν™œμš©λ  수 μžˆμŠ΅λ‹ˆλ‹€.


πŸ“Š Training & Evaluation

Validation μ„±λŠ₯ (YOLOv8n Fine-tuning, Validation Set κΈ°μ€€)

Metric Score
mAP@0.50 0.744
mAP@0.50:0.95 0.436
Precision 0.831
Recall 0.685

πŸ“ Training Data

  • Public PPE / construction-related datasets (Kaggle λ“±)
  • RGB 이미지
  • Bounding box + class label
  • Hardhat / No-Hardhat / Mask / No-Mask / Safety Vest / No-Safety Vest / Person λ“±

데이터셋 μžμ²΄λŠ” ν¬ν•¨ν•˜μ§€ μ•ŠμœΌλ©°,
λΌμ΄μ„ μŠ€λŠ” 데이터 제곡처λ₯Ό λ”°λ¦…λ‹ˆλ‹€.


βš™οΈ How to Use

Ultralytics YOLO + Hugging Face Hub

from huggingface_hub import hf_hub_download
from ultralytics import YOLO

ckpt_path = hf_hub_download(
    repo_id="Hansung-Cho/yolov8-ppe-detection",
    filename="best.pt"
)

model = YOLO(ckpt_path)
results = model("your_image.jpg")
results[0].plot()

Command Line (CLI)

yolo task=detect mode=predict \
    model="https://huggingface.co/Hansung-Cho/yolov8-ppe-detection/resolve/main/best.pt" \
    source="your_image_or_video.mp4" \
    conf=0.25

🎯 Intended Uses & Use Cases

Intended

  • 건섀 ν˜„μž₯ CCTV / Webcam λͺ¨λ‹ˆν„°λ§
  • PPE 착용 μ—¬λΆ€ μžλ™ 점검
  • μ•ˆμ „ ꡐ윑 PoC / 데λͺ¨
  • FastAPI + Web UI μ‹€μ‹œκ°„ κ²½κ³  μ‹œμŠ€ν…œ

Not Intended

  • 법적 제재/μ§•κ³„μ˜ μœ μΌν•œ κ·Όκ±°
  • 의료/생λͺ… μ•ˆμ „μ˜ 단독 νŒλ‹¨ κΈ°μ€€
  • μ™„μ „νžˆ λ‹€λ₯Έ 도메인(일상사진/슀포츠 λ“±)μ—μ„œ μ‚¬μš©

⚠️ Limitations & Ethical Considerations

  • 도메인 편ν–₯: μ‹€λ‚΄Β·μ•Όκ°„Β·νŠΉμˆ˜λ³΅μž₯ ν™˜κ²½μ—μ„œ μ„±λŠ₯ μ €ν•˜ κ°€λŠ₯
  • Occlusion: κ°€λ €μ§„ 경우 μ˜€νƒ/미탐 κ°€λŠ₯
  • Low Resolution: 멀리 μžˆλŠ” 인물 탐지 어렀움
  • Ethical Use:
    • 보쑰적 검사 λ„κ΅¬λ‘œλ§Œ μ‚¬μš©ν•΄μ•Ό 함
    • μΈκΆŒΒ·κ°œμΈμ •λ³΄ 보호λ₯Ό λ°˜λ“œμ‹œ κ³ λ €ν•΄μ•Ό 함

πŸ§ͺ Evaluation & Reproducibility

  • Framework: Ultralytics YOLOv8 / PyTorch
  • Hardware: Colab GPU / 단일 GPU
  • Notebook: training/YOLO_PPE.ipynb

Visualization Assets

  • Training curves (results.png)
  • Confusion matrix (confusion_matrix.png)
  • PR Curve (BoxPR_curve.png)
  • F1 Curve (BoxF1_curve.png)
  • Prediction example (example.png)

🧩 Integration Example (FastAPI + Web)

Backend

  • FastAPI server (backend/app.py)
  • /predict β†’ 이미지 μ—…λ‘œλ“œ ν›„ YOLO μΆ”λ‘ 
  • bounding boxκ°€ ν¬ν•¨λœ κ²°κ³Όλ₯Ό base64둜 λ°˜ν™˜

Frontend

  • HTML / JavaScript (index.html, webcam.html)
  • 이미지 μ—…λ‘œλ“œ / μ‹€μ‹œκ°„ Webcam 슀트림
  • NO-Hardhat, NO-Mask λ“± μœ„ν—˜ μš”μ†Œ 감지

Local

  • local/webcam_ppe.py β†’ 둜컬 μ›ΉμΊ  μ‹€μ‹œκ°„ 감지

전체 μ‹œμŠ€ν…œ κ΅¬ν˜„μ€ GitHub λ ˆν¬μ§€ν† λ¦¬μ—μ„œ 확인할 수 μžˆμŠ΅λ‹ˆλ‹€.


πŸ“š Citation

Cho, Hansung. "YOLOv8 PPE Detection – End-to-End AI System for Safety Monitoring."
Hugging Face Model Hub, 2025.

πŸ“¬ Contact & References

Feel free to open an issue or reach out for questions, collaboration, or improvements.

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