๐ฆบ 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.