Ensuring the safety of workers at workplaces is a crucial task for every company. The usage of personal protective equipment represents the basic form of protection. Hard hats are very useful in protecting head from injuries. However, workers often neglect the importance of wearing safety helmets and do not wear them. Systems for monitoring and detecting unsafe behaviors can be very helpful for maintaining security. For that purpose, this research examines the success of the application of the latest YOLO algorithm for detecting the presence of safety helmets on workers that can be applied in those systems. Two models with different numbers of parameters are trained for this purpose-YOLOv9c and YOLOv9e. The results showed that YOLOv9c model achieved mean average precision of 97.2%, 93%, and 92.9% in training, validation, and testing, respectively, while YOLOv9e reached slightly higher mean average precisions of 97.5% in training, 93.4% in validation and 93.4% in testing.