π¦Ί 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 (μμ):
PersonHardhatNo-HardhatSafety VestNo-Safety VestMaskNo-Mask- κΈ°ν PPE κ΄λ ¨ ν΄λμ€ (μ΄ μ½ 10κ°)
λ³Έ λͺ¨λΈμ μ¬λ + PPE μ°©μ© μ¬λΆλ₯Ό λμμ νμ§νμ¬
Web UI / Webcam / FastAPI μλ²μμ μ€μκ° κ²½κ³ μμ€ν
ꡬμΆμ νμ©λ μ μμ΅λλ€.
π Training & Evaluation
Validation μ±λ₯ (YOLOv8n Fine-tuning, Validation Set κΈ°μ€)
π 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
- GitHub Project Repository: https://github.com/Hansung-Cho/YOLO_PPE
- GitHub Profile: https://github.com/Hansung-Cho
- Model Page: https://huggingface.co/Hansung-Cho/yolov8-ppe-detection
- Ultralytics YOLOv8 Source: https://github.com/ultralytics/ultralytics
Feel free to open an issue or reach out for questions, collaboration, or improvements.
- Downloads last month
- 42