Abstract:Construction sites such as construction, mining, and exploration are very complex and diverse areas. When conducting helmet wearing detection in such scenarios, there are problems such as severe image occlusion and easy loss of small target information. This article proposes a helmet wearing detection algorithm based on improved YOLOv8n. Firstly, the C2f module of the YOLOv8n model is improved by incorporating an improved inverted residual block attention mechanism, enabling the model to efficiently capture global features and fully utilize the key information of safety helmet features; secondly, by combining the SPPF module and LSKA attention mechanism, the SPPFLSKA module is proposed to enhance the network′s attention to key information of safety helmets and avoid the influence of background information on the detection of safety helmet wearing status in practical complex scenarios; finally, the Inner-SIoU loss function is used to optimize the network model and improve the stability of the model in detecting the wearing status of safety helmets. The experimental results show that the algorithm proposed in this paper can effectively detect the wearing status of helmets in complex environments mAP@0.5 has reached 93.7%, compared to the original YOLOv8 algorithm′s P, R, mAP@0.5 and mAP@0.5:0.95 has increased by 2.4%, 4.0%, 3.4%, and 5.3% respectively, the number of parameters has decreased by 6.7%, and the computational workload has decreased by 4.8%, improving the detection of false and missed safety helmet wearing status, facilitating the deployment of practical detection applications.