Improved power construction worker safety tool wearing detection method of yolov5
By improving the backbone network and Neck module of the YOLOv5 network, and combining dilated convolution, multi-scale spatial feature pyramid, cross-scale feature bridging, and CIoU loss function, the accuracy and speed of safety equipment detection at power construction sites have been improved, solving the problem of detecting small targets and occluded targets.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SICHUAN UNIVERSITY OF SCIENCE AND ENGINEERING
- Filing Date
- 2022-11-28
- Publication Date
- 2026-04-24
AI Technical Summary
Existing target detection algorithms have low accuracy in detecting small and occluded targets at power construction sites, failing to meet real-time and accuracy requirements, and are particularly difficult to effectively extract features in complex background environments.
The backbone and Neck modules of the YOLOv5 network are improved by introducing dilated convolution, multi-scale spatial feature pyramids, cross-scale feature bridging, and CARAFE operators, combined with the CIoU loss function, to optimize the network's loss function and improve detection accuracy.
It improves the detection accuracy of small targets and occluded targets, meets the real-time and accuracy requirements of wearable detection in power operation sites, and achieves a detection speed of 44fps and an mAP value of 82.3%.
Smart Images

Figure CN115731577B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of wearable testing technology, and in particular relates to an improved YOLOv5 method for testing the safety equipment worn by power construction workers. Background Technology
[0002] In recent years, construction sites have frequently witnessed accidents resulting in injuries and fatalities caused by workers failing to wear safety equipment as required. With the rapid advancement of the new generation of power technology revolution, and facing the complex and ever-changing power construction sites, improving the intelligent safety management level of substations, especially the timely detection of worker violations, is of paramount importance for reducing the probability of safety accidents and protecting personal and property safety.
[0003] To improve engineering safety supervision, intelligent monitoring methods are gradually replacing the previous manual inspection methods. Many universities and research institutions in China have conducted in-depth research on this topic and proposed real-time monitoring technologies for the wearing of safety and protective equipment at construction sites. In recent years, deep learning-based target detection technology has become a mainstream research direction. Currently, target detection algorithms mainly fall into two categories: one is the two-stage detection algorithm, such as R-CNN, Fast R-CNN, and Faster R-CNN. Xu Shoukun et al. improved the Faster R-CNN network and fused it with multiple components to detect safety helmets, aiming to solve problems such as partial occlusion and inconsistent sizes in current safety helmets. However, Faster R-CNN has a relatively slow detection speed and cannot meet the needs of real-time detection. The second type is single-stage object detection algorithms, mainly represented by SSD, YOLOv2, RetinaNet, YOLOv3, and YOLOv4. To ensure construction safety as much as possible, Liu Yunbo et al. determined the color and wearing status of workers' safety helmets by detecting the distribution of pixels in the video, thus warning workers not wearing helmets. However, this network is significantly affected by lighting and video shooting angle. Redmon et al. proposed a faster YOLO algorithm model in 2016; although its accuracy is not the best, it is more suitable for real-time detection. Xiao Tigang et al. proposed the YOLOv3-WH wearing detection algorithm by improving the YOLOv3 network. Compared with YOLOv3, it improved FPS by 64% and mAP by 6.5%, significantly improving both detection speed and accuracy. However, when the target is in a complex background environment, this algorithm struggles to effectively extract features. Most existing algorithms only detect safety helmets, but at power construction sites, safety belts, gloves, and safety clothing are also crucial for worker safety. Summary of the Invention
[0004] To address the aforementioned technical problems, this invention proposes an improved YOLOv5 method for detecting the wearing of safety equipment by power construction workers. This method effectively enhances the detection accuracy of small targets and obstructed targets, meeting the real-time and accuracy requirements for wear detection at power work sites.
[0005] To achieve the above objectives, this invention provides an improved YOLOv5 method for detecting the wearing of safety equipment by power construction workers, comprising:
[0006] Annotate images of protective gear worn at power work sites to obtain a dataset;
[0007] Construct a safety device wearing detection model based on the improved YOLOv5;
[0008] The safety equipment wearing detection model was trained using the dataset.
[0009] The images of the safety equipment worn at the power operation site are input into the trained safety equipment wearing detection model to obtain the wearing detection results.
[0010] Optionally, annotating the power operation site wearable image includes marking the target area and category in the power operation site wearable image.
[0011] Optionally, the categories of images of clothing worn at the power operation site include: wearing gloves correctly, not wearing gloves, wearing a safety belt correctly, not wearing a safety belt, wearing work clothes correctly, not wearing work clothes, wearing a safety helmet correctly, and not wearing a safety helmet.
[0012] Optionally, improving YOLOv5 includes improving the SPP submodule and Neck module in the backbone network module of YOLOv5.
[0013] Optionally, the improvement of the SPP submodule includes:
[0014] A 3×3 pooling kernel is added to the pooling layer of the SPP submodule to form several pooling kernels of different sizes.
[0015] A 1×1 convolution is added after the Concat layer connected to the pooling layer to consolidate the number of channels;
[0016] Replace the max pooling operation of the pooling layer with dilated convolution;
[0017] An MHSA self-attention mechanism is embedded at the tail of the SPP submodule.
[0018] Optionally, the dilated convolution is to add holes to a standard convolution to form a dilated convolution kernel;
[0019] The formula for calculating the size of the dilated convolution kernel is:
[0020]
[0021] in, k To expand the size of the pre-convolution kernel, The size of the expanded convolutional kernel. r This represents the expansion rate.
[0022] Optionally, the improvements to the Neck module include:
[0023] A cross-scale feature bridging operation is introduced on the PANet structure of the Neck module, and a lightweight upsampling operator CARAFE is introduced for upsampling.
[0024] The introduction of cross-scale feature bridging operations includes: introducing upper, middle and lower scale feature bridging in the PANet structure, and achieving feature compensation while introducing a small amount of complexity through tensor concatenation operations; the introduction of the lightweight upsampling operator CARAFE includes: fusing the corresponding feature map in the Neck module with the feature map processed by the lightweight upsampling operator CARAFE, and then obtaining the next output feature map through a 3×3 conv.
[0025] Optionally, training the safety equipment wearing detection model includes: setting a loss function for the safety equipment wearing detection model;
[0026] The loss function is:
[0027]
[0028]
[0029]
[0030] in, The loss function for the safety equipment wearing detection model. The Euclidean distance between the two center points. The center point of the prediction box, The center point of the true bounding box. For the similarity of aspect ratio, For weight parameters, The width of the prediction box. The height of the predicted bounding box, The width of the actual bounding box. The actual height of the bounding box. c The diagonal distance of the minimum bounding matrix area between the predicted bounding box and the ground truth bounding box. IoUIt equals the intersection of the predicted bounding box and the ground truth bounding box divided by their union.
[0031] Compared with the prior art, the present invention has the following advantages and technical effects:
[0032] This invention improves the YOLOv5 model to construct a safety equipment wearing detection model. By inputting images of safety equipment worn at the power operation site into the model, the detection results are obtained. This invention can effectively improve the detection accuracy of small targets and occluded targets, and meet the real-time and accuracy requirements of safety equipment wearing detection at power operation sites. Attached Figure Description
[0033] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0034] Figure 1 This is a schematic diagram of the process for detecting the wearing of safety equipment by power construction workers according to an embodiment of the present invention;
[0035] Figure 2 This is a schematic diagram of the original YOLOv5 algorithm network structure in an embodiment of the present invention;
[0036] Figure 3 This is a schematic diagram of the main module structure of the original YOLOv5 algorithm in an embodiment of the present invention;
[0037] Figure 4 This is a schematic diagram of the new SPP module structure after the improvement of YOLOv5 in an embodiment of the present invention;
[0038] Figure 5 This is a schematic diagram of the multi-scale spatial feature pyramid module structure according to an embodiment of the present invention;
[0039] Figure 6 This is a comparative diagram of the PANet structure and the BiFPN structure according to an embodiment of the present invention;
[0040] Figure 7 This is a schematic diagram of the Neck network based on cross-scale feature bridging and CARAFE according to an embodiment of the present invention;
[0041] Figure 8 This is a schematic diagram of the original detection image in an embodiment of the present invention;
[0042] Figure 9 This is a schematic diagram of the Faster RCNN detection results according to an embodiment of the present invention;
[0043] Figure 10 This is a schematic diagram of the YOLOv4 detection results in an embodiment of the present invention;
[0044] Figure 11 This is a schematic diagram of the YOLOv5 detection results in an embodiment of the present invention;
[0045] Figure 12 This is a schematic diagram of the detection results of the wearing of safety equipment by power construction workers using the improved YOLOv5 according to an embodiment of the present invention. Detailed Implementation
[0046] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0047] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0048] Example
[0049] like Figure 1 As shown, this embodiment provides an improved YOLOv5 method for detecting the wearing of safety equipment by power construction workers, including:
[0050] Annotate images of protective gear worn at power work sites to obtain a dataset;
[0051] Construct a safety device wearing detection model based on the improved YOLOv5;
[0052] The safety equipment wearing detection model was trained using the dataset.
[0053] The images of the safety equipment worn at the power operation site are input into the trained safety equipment wearing detection model to obtain the wearing detection results.
[0054] Furthermore, the annotation of the images of clothing worn at the power work site includes: using Make Sense (an online annotation tool) to annotate the target areas and categories in the images of clothing worn at the power work site.
[0055] Furthermore, the categories of images of clothing worn at the power operation site include: wearing gloves correctly, not wearing gloves, wearing a safety belt correctly, not wearing a safety belt, wearing work clothes correctly, not wearing work clothes, wearing a safety helmet correctly, and not wearing a safety helmet.
[0056] Furthermore, improvements to YOLOv5 include improvements to the SPP submodule and Neck module in the backbone network module of YOLOv5.
[0057] Furthermore, the improvements to the SPP submodule include:
[0058] Add a 3×3 pooling kernel to the pooling layer of the SPP submodule to form four pooling kernels of different sizes: 3×3, 5×5, 9×9 and 13×13.
[0059] A 1×1 convolution is added after the Concat layer connected to the pooling layer to consolidate the number of channels;
[0060] Replace the max pooling operation of the pooling layer with dilated convolution;
[0061] An MHSA self-attention mechanism is embedded at the tail of the SPP submodule.
[0062] Furthermore, improvements to the Neck module include:
[0063] A cross-scale feature bridging operation is introduced on the PANet structure of the Neck module, and a lightweight upsampling operator CARAFE is introduced for upsampling.
[0064] The introduction of cross-scale feature bridging operations includes: introducing upper, middle and lower scale feature bridging in the PANet structure, and achieving feature compensation while introducing a small amount of complexity through tensor concatenation operations; the introduction of the lightweight upsampling operator CARAFE includes: fusing the corresponding feature map in the Neck module with the feature map processed by the lightweight upsampling operator CARAFE, and then obtaining the next output feature map through a 3×3 conv.
[0065] This embodiment addresses the issue of low detection accuracy for small and occluded targets in power field operations by proposing a novel wearable detection method, SBC_YOLOv5, which improves upon YOLOv5. First, this method improves the spatial pyramid pooling layer by employing dilated convolutions, multi-scale pooling operations, and an MHSA self-attention module, resulting in a richer receptive field. Second, it enhances the Neck network using feature bridging operations and the CARAFE operator to improve the network's ability to extract and compensate for semantic features. Finally, it optimizes the network's loss function using CIoU to improve the model's regression ability. Results show that the wearable detection method SBC_YOLOv5 established in this embodiment achieves an average precision (mAP) of 82.3%, a recall of 81.5%, and a detection speed (FPS) of 44. Compared to YOLOv5, YOLOv4, and Faster R-CNN, the mAP values are improved by 1.5%, 10.27%, and 25.21%, respectively. This effectively improves the detection accuracy for small and occluded targets, meeting the real-time and accuracy requirements for wearable detection in power field operations.
[0066] YOLOv5 is a single-stage detection algorithm that offers significant improvements in flexibility, speed, and accuracy compared to YOLOv4. It is faster and has a simpler structure. Therefore, this embodiment uses an improved YOLOv5m network to detect wearable protective equipment in power field applications. The original YOLOv5 algorithm will be described in detail below.
[0067] The YOLOv5m model consists of four parts: input, backbone, neck, and output. The backbone utilizes multiple convolution and pooling operations to obtain feature maps of different sizes from the image, primarily composed of modules such as Conv, C3, and SPP. Conv is the basic convolutional unit of the YOLOv5 network, performing two-dimensional convolution, regularization, and activation operations on the input image. C3 consists of several classic residual structure modules (Bottleneck). The SPP module is a spatial pyramid pooling layer, performing pooling operations on the input image at three different sizes, and concatenating the output with Concat while maintaining the depth. The neck processes the extracted feature information from the different sized images, reducing the images to the same size, and then performing feature fusion to generate feature maps of three scales. The neck is the feature fusion part, composed of a feature pyramid (FPN) and a path aggregation network (PAN) structure. The FPN structure passes the category features of large targets at higher levels to lower levels, while the PAN structure passes the position features of large targets at lower levels and the category and position features of small targets to higher levels. These two structures complement each other and overcome their respective limitations, achieving a fusion and complementarity between high-level and low-level features, thereby enhancing the model's feature extraction capabilities. PAN requires upsampling of high-level features before passing them down. The YOLOv5 backbone network uses nearest neighbor interpolation for upsampling, which, although computationally inexpensive, has low accuracy. During target detection, YOLOv5 uses weighted NMS (Non-Maximum Suppression) to detect and filter multiple anchor boxes. The original YOLOv5 algorithm network structure and main modules are as follows: Figure 2 , Figure 3 As shown.
[0068] The following details the steps involved in implementing the improved YOLOv5 method for detecting the wearing of safety equipment by power construction workers:
[0069] 1. Improve the YOLOv5 safety equipment wearing detection method.
[0070] 1.1. Multi-scale spatial feature pyramid combining dilated convolution and MHSA
[0071] YOLOv5, based on the SPPNet architecture, uses the SPP spatial pyramid pooling module in the backbone network. It performs max pooling operations on the feature maps with kernel sizes of 5×5, 9×9, and 13×13, and then concatenates the max pooling results with the feature maps using the Concat operation.
[0072] Considering the presence of small targets such as gloves and safety helmets, this embodiment adds a 3×3 branch to obtain a relatively small receptive field and reduce the differences between receptive fields, thus obtaining more comprehensive receptive field information. Four pooling kernels of different sizes (3×3, 5×5, 9×9, and 13×13) are used for operation. Finally, a 1×1 convolution is applied to integrate the channels after the concat operation, thereby obtaining feature information at different scales and making the feature map more expressive. The new SPP module structure diagram is shown below. Figure 4 As shown.
[0073] While the SPP spatial pyramid pooling module can obtain rich receptive field information, the location information of some targets is easily lost when performing max pooling on the feature map. Therefore, this embodiment uses dilated convolution to replace max pooling, ensuring the receptive field remains unchanged while maintaining the integrity of the target location information. Dilated convolution essentially adds holes to a standard convolution. The formula for calculating the size of the dilated convolution kernel is:
[0074] (1)
[0075] Where k is the size of the convolutional kernel before dilation, with a minimum value of 3, and r is the dilation rate. Choosing an appropriate dilation rate can obtain a receptive field similar to that of max pooling. Therefore, this embodiment uses 3×3 dilated convolutions with dilation rates r of 1, 2, 4, and 6 to replace the max pooling operation, ensuring that the receptive field information is the same as in the original SPP module and without causing the loss of target location information. Furthermore, to improve the network's ability to process global information, an MHSA self-attention mechanism is embedded at the end of the SPP module, working in conjunction with the information extraction of the convolutional neural network to achieve the network's ability to process global information. The structure diagram of the multi-scale spatial feature pyramid module integrating dilated convolution and MHSA is shown below. Figure 5 As shown.
[0076] 1.2. Neck Network Based on Cross-Scale Feature Bridging and CARAFE
[0077] The YOLOv5 network uses a PANet structure for feature fusion in the Neck region. PANet leverages low-level localization signals, enhancing them through a bottom-up path to strengthen the entire feature hierarchy, significantly shortening the information path between lower and higher level features. In 2020, the EfficientDet object detection network proposed by Google Brain first applied the BiFPN multi-scale feature fusion network. Compared to PANet, BiFPN reduces some nodes, increases skip connections, and forms a fusion module. Figure 6 The diagram shows the PANet and BiFPN architectures.
[0078] The Neck section is mainly used to fuse semantic features at three different scales to identify wearable targets of different sizes. In order to improve its feature fusion capability, this embodiment introduces a cross-scale feature bridging operation on the basis of PANet based on the structure of BiFPN. By concatenating tensors, the complexity is improved while the feature compensation capability is better enhanced, which is conducive to improving the accuracy of small target and occluded target detection.
[0079] Meanwhile, while introducing cross-scale feature bridging operations improves algorithm accuracy, it also significantly increases the number of parameters. Therefore, this embodiment introduces the lightweight upsampling operator CARAFE into the Neck network for upsampling. Through content awareness and feature reorganization, it enhances the network's ability to acquire the receptive field of the image, effectively improving algorithm accuracy while reducing the increase in parameters caused by bridging operations. In the CARAFE implementation, the corresponding feature maps in the Neck network are fused with the feature maps after the CARAFE upsampling operator. Then, a 3×3 convolution is used to obtain the output feature map for the next step, preparing for subsequent model classification and prediction operations.
[0080] Neck networks based on cross-scale feature bridging and CARAFE, such as Figure 7 As shown.
[0081] 1.3. Loss Function Optimization
[0082] The YOLOv5 loss function is calculated as shown in equation (2), and consists of three parts: the target confidence loss function, the target confidence loss function, and the target confidence loss function. Classification loss function and the position loss function of the target box and the predicted box. .
[0083] (2)
[0084] The original YOLOv5 model uses GIoU_loss as the regression loss function for bounding boxes. GIoU is an extension of IoU. However, if the predicted box is inside the target box and the size is the same, the difference between the predicted box and the target box is the same, which GIoU_loss cannot solve.
[0085] CIoU takes into account aspect ratio, overlap area, and center point distance. Compared to GIoU, it finds a more suitable position when selecting a target and locates the target better. Therefore, in this embodiment, the regression loss function GIoU_loss is replaced with CIoU_loss, and the calculation formulas are shown in equations (3), (4), and (5).
[0086] (3)
[0087] (4)
[0088] (5)
[0089] in, The loss function for the safety equipment wearing detection model. The Euclidean distance between the two center points. The center point of the prediction box, The center point of the true bounding box. For the similarity of aspect ratio, For weight parameters, The width of the prediction box. The height of the predicted bounding box, The width of the actual bounding box. The actual height of the bounding box. c The diagonal distance of the minimum bounding matrix area between the predicted bounding box and the ground truth bounding box. IoU It equals the intersection of the predicted bounding box and the ground truth bounding box divided by their union.
[0090] CIoU_loss can overcome the phenomenon in the original model's loss function where the loss value is the same when the predicted box and the target box completely overlap in different regions, thus making the model's position in the regression box more accurate and effectively improving the model's detection performance.
[0091] 2. Model Training and Experimental Results
[0092] 2.1. Model Training
[0093] 2.1.1. Experimental Environment and Dataset Preparation
[0094] In deep learning object detection, the dataset used in the experiment is always an essential component. Most power work sites are located in suburban areas, and due to the unpredictable working hours and significant changes in lighting, the quality of the collected images varies considerably. Currently, there are no standard open-source datasets for power work sites, which do not meet the detection needs of real-world production environments. To address this issue, this embodiment collected 5015 images of a wearable detection dataset for power work sites using web crawling. Based on the dataset, eight label categories were defined (see Table 1), and MakeSense (an online annotation tool) was used to label the target regions and categories of all images.
[0095] Table 1
[0096]
[0097] 2.1.2. Network Training and Experimental Environment
[0098] In this embodiment, to achieve the best model performance, the number of iterations was set to 200, the initial learning rate was 0.01, the learning rate decay weight was set to 0.0005, and the learning rate momentum was set to 0.937 during training to prevent overfitting. The training batch size was set to 32 to fully utilize the GPU. The specific server configuration and environment used in the experiment are shown in Table 2.
[0099] Table 2
[0100]
[0101] 2.2. Experimental Results
[0102] 2.2.1. Evaluation Indicators
[0103] This embodiment uses the average accuracy (AP) and mAP, commonly used evaluation metrics in the field of target detection, to evaluate the model.
[0104] Precision (P) and recall (R) can intuitively measure the degree of false positives and false negatives of the model, and are calculated as shown in formulas (6) and (7):
[0105] (6)
[0106] (7)
[0107] mAP@0.5 is the average AP of all classes. mAP@0.5 reflects the trend of model precision as recall changes. The higher the value, the easier it is for the model to maintain high precision under high recall. The calculation is as shown in formulas (8) and (9):
[0108] (8)
[0109] (9)
[0110] 2.2.2. Ablation Experiment
[0111] To analyze the impact of various improved methods in the detection algorithm presented in this paper on the detection results of power field workers' protective clothing, an ablation experiment was designed to evaluate the detection effect of the corresponding algorithms. Specific experimental content and detection results are shown in Table 3, where "√" indicates that the corresponding method was used, and "×" indicates that the corresponding method was not used in the network model.
[0112] Table 3
[0113]
[0114] As shown in Table 3, after Algorithm 1 improved the spatial feature pyramid, the average detection accuracy increased by 0.8 percentage points. This indicates that introducing a multi-scale spatial feature pyramid based on dilated convolution and MHSA can effectively improve the network's ability to acquire receptive field information. Algorithm 2 introduced a Neck network based on cross-scale feature bridging and CARAFE, which improved the mAP value by 1.2 percentage points, indicating that this improvement can effectively enhance the network's feature extraction and feature compensation capabilities. Algorithm 3 used CIoU to optimize the network's loss function, which improved the detection accuracy by 0.5%, indicating that this optimization can improve the model's regression ability. Finally, by combining all the improvements, SBC_YOLOv5 was trained. Compared with the unimproved YOLOv5 algorithm, its mAP value increased by 1.5%, reaching 82.3%, and the detection speed was 44fps. This shows that the improved YOLOv5 wearable detection method established in this embodiment is truly effective and can improve the detection accuracy of safety protective equipment.
[0115] 2.2.3. Comparison Experiment of Different Detection Algorithms
[0116] This embodiment uses the YOLOv5 algorithm to detect the wearing status of safety equipment by power construction workers. To demonstrate the superiority of the improved algorithm in this embodiment, it was compared with the current mainstream object detection models Faster RCNN, YOLOv4, and YOLOv5 under the same configuration and dataset. The comparative experimental results are shown in Table 4, which compares the mAP values ( / %) of each type of object.
[0117] Table 4
[0118]
[0119] As shown in Table 4, the algorithm in this embodiment can effectively improve the detection accuracy of safety equipment worn by power construction workers. The mAP value of this algorithm for detecting improper wearing of safety equipment by workers is 82.3%, significantly higher than the mAP of Faster R-CNN (57.09%). Compared with YOLOv4 and the original YOLOv5, this algorithm shows improvements in mAP values for all categories of detection. This indicates that the algorithm in this embodiment performs well in terms of accuracy in detecting safety equipment worn at power work sites and can meet the accuracy requirements for detecting safety equipment worn in complex power work environments.
[0120] 2.2.4. Analysis of Test Results
[0121] In addition, to more intuitively illustrate the detection differences between the various algorithms, some test results are shown in the following figures. Figures 8-12 As shown, where, Figure 8 This is the original detection image. Figure 9 For Faster R-CNN detection, Figure 10 YOLOv4 detection, Figure 11 YOLOv5 detection, Figure 12 To improve the detection of safety equipment worn by power construction workers in YOLOv5. From Figure 10 The results show that YOLOv4 performs well in detection, able to detect most safety equipment, but it has some missed detections of small targets such as gloves; while Faster R-CNN performs poorly in test images of different scenarios, with more serious missed and false detections. Figure 9 As shown, small targets like gloves were not detected, and a black car was incorrectly detected as a safety vest and seatbelt. Duplicate detections occurred in obscured areas. YOLOv5's detection performance is second only to this embodiment, capable of detecting most wearable targets, but it exhibits a small number of false detections in complex scenarios, such as... Figure 11 As shown, a white car was mistakenly detected as a helmet. The method in this embodiment can address... Figure 8 The accurate detection of all small and occluded targets demonstrates that the wearable detection method proposed in this embodiment can better integrate high-level and low-level semantic feature information, thereby effectively improving the accuracy of detecting small and occluded targets. A comparison of the detection results from various networks shows that the improved YOLOv5 network model performs better in detecting the wearing of safety equipment in complex power operation environments.
[0122] This embodiment addresses the problem of traditional target detection techniques struggling to detect small and occluded targets in complex power operation scenarios, resulting in high false negative rates. It proposes an improved YOLOv5 method for detecting safety equipment worn by power construction workers, called SBC_YOLOv5. Based on the YOLOv5 network, a multi-scale spatial feature pyramid fusing dilated convolutions and MHSA, along with a Neck network combining cross-scale feature bridging and CARAFE, is introduced. CIoU is used to optimize the loss function, effectively improving the network's detection accuracy. Experimental results show that the proposed method SBC_YOLOv5 achieves an mAP of 82.3% and a detection speed of 44fps, effectively improving the detection accuracy of small and occluded targets. It basically meets the accuracy and real-time requirements for wearable equipment detection in complex power operation scenarios and exhibits good generalization ability.
[0123] The above are merely preferred embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. An improved method for detecting the wearing of safety equipment by power construction workers using YOLOv5, characterized in that... include: Annotate images of protective gear worn at power work sites to obtain a dataset; Construct a safety device wearing detection model based on the improved YOLOv5; The improvements to YOLOv5 include: improvements to the SPP submodule and Neck module in the backbone network module of YOLOv5; The improvements to the SPP submodule include: A 3×3 pooling kernel is added to the pooling layer of the SPP submodule to form several pooling kernels of different sizes. A 1×1 convolution is added after the Concat layer connected to the pooling layer to consolidate the number of channels; Replace the max pooling operation of the pooling layer with dilated convolution; An MHSA self-attention mechanism is embedded at the tail of the SPP submodule; The dilated convolution is formed by adding holes to a standard convolution to create a dilated convolution kernel; The formula for calculating the size of the dilated convolution kernel is: in, k To expand the size of the pre-convolution kernel, The size of the expanded convolutional kernel. r Expansion rate; The improvements to the Neck module include: A cross-scale feature bridging operation is introduced on the PANet structure of the Neck module, and a lightweight upsampling operator CARAFE is introduced for upsampling. The introduction of cross-scale feature bridging operations includes: introducing feature bridging of the upper, middle and lower scales in the PANet structure, and achieving feature compensation while introducing a small amount of complexity through tensor concatenation operations; the introduction of the lightweight upsampling operator CARAFE includes: fusing the corresponding feature map in the Neck module with the feature map processed by the lightweight upsampling operator CARAFE, and then obtaining the next output feature map through a 3×3 conv. The safety equipment wearing detection model was trained using the dataset. The images of the safety equipment worn at the power operation site are input into the trained safety equipment wearing detection model to obtain the wearing detection results.
2. The improved YOLOv5 method for detecting the wearing of safety equipment by power construction workers according to claim 1, characterized in that, Annotating the images of clothing worn at the power work site includes marking the target areas and categories in the images.
3. The improved YOLOv5 method for detecting the wearing of safety equipment by power construction workers according to claim 2, characterized in that, The categories of images of clothing worn at the power operation site include: wearing gloves correctly, not wearing gloves, wearing a safety belt correctly, not wearing a safety belt, wearing work clothes correctly, not wearing work clothes, wearing a safety helmet correctly, and not wearing a safety helmet.
4. The improved YOLOv5 method for detecting the wearing of safety equipment by power construction workers according to claim 1, characterized in that, Training the safety equipment wearing detection model includes setting the loss function of the safety equipment wearing detection model; The loss function is: in, The loss function for the safety equipment wearing detection model. Let be the Euclidean distance between the two center points. The center point of the prediction box, The center point of the true bounding box. For the similarity of aspect ratio, For weight parameters, The width of the prediction box. The height of the predicted bounding box, The width of the actual bounding box. The actual height of the bounding box. c The diagonal distance of the minimum bounding matrix area between the predicted bounding box and the ground truth bounding box. IoU It equals the intersection of the predicted bounding box and the ground truth bounding box divided by their union.
Citation Information
Patent Citations
Human body security check image detection method and system based on improved YOLOv5s
CN114862837A
Construction worker dangerous area intrusion detection method based on improved Yolov5 model
CN114997279A
Safety protection product wearing detection method in chemical production process based on improved YOLOv5
CN115205604A