For workers in high-level risk industries such as construction,steel manufacturing,and coal mining,safety protection is a top priority,and wearing a safety helmet is also one of the effective ways to avoid injury.However,in order to detect the wearing of workers'safety helmets more accurately,a safety helmet detection method based on YOLOv5 is proposed to improve the accuracy of safety helmet detection models,reduce some detection errors or insufficient detection accuracy,and thus avoid some safety accidents more effectively.