YOLO-based PPE Detection with Weighted Loss for Class Imbalance in Construction Safety Monitoring
Abstract
This paper presents a comprehensive study on deep learning-based personal protective equipment (PPE) detection for real-time construction safety monitoring by applying four recent YOLO-based object detection architectures on a unified dataset with 43,986 images and 14 PPE-related classes. The investigate the detection of not only PPE-compliance classes (Hardhat, Safety Vest, Gloves, Mask, Goggles) but also PPE-violation classes (NO-Hardhat, NO-Safety Vest, NO-Gloves, NO-Mask, NO-Goggles). Experimental results showed that minority PPE-violation classes such as NO-Safety Vest are consistently under-detected, owing to severe class imbalance and high visual resemblance to compliance classes. A class-specific weighted Binary Cross-Entropy (BCE) loss function is then proposed and applied under identical training conditions across the four evaluated architectures. Models are evaluated using precision, recall, mAP@0.50, mAP@0.50:0.95, F1-Score and inference latency. Our experiments show the weighted loss improved NO-Safety Vest performance by up to 35.5% (YOLO26-W: 0.6485 vs. YOLO26 baseline: 0.4787). The overall mAP decreased marginally. Among all considered models, YOLO11m exhibited the best trade-off between detection performance and inference speed. The results demonstrate that the proposed class-specific weighted loss strategy consistently improved minority-class detection performance across multiple YOLO architectures to improve minority PPE violation detection without the need for new data annotation and model redesign.