Construction site safety helmet detection method based on content-guided pyramid structure improvement

The content-guided pyramid structure in the YOLOv10 model enhances small target detection on construction sites by fusing multi-scale features and applying weighted EIOU loss, addressing the limitations of existing algorithms in accuracy and efficiency.

CN119181052APending Publication Date: 2024-12-24HEFEI CEMENT RESEARCH AND DESIGN INSTITUTE CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411196110.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-29
Publication Date
2024-12-24

AI Technical Summary

Technical Problem

Existing YOLOv10 algorithms struggle with poor detection performance on small targets in construction site safety helmet detection due to insufficient attention to low-dimensional detail information, especially when cameras are positioned higher and capture small hard hats.

Method used

A content-guided pyramid structure is introduced into the YOLOv10 model, incorporating a feature fusion module with multi-scale attention and weighted EIOU loss to enhance the detection of small targets by effectively fusing high- and low-dimensional feature information.

Benefits of technology

The improved model achieves better recognition accuracy and efficiency in detecting small safety helmets by leveraging contextual information and scale-aware weight adjustments, improving detection accuracy and reducing the need for post-processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119181052A_ABST
    Figure CN119181052A_ABST
Patent Text Reader

Abstract

The invention discloses a construction site safety helmet detection method based on content-guided pyramid structure improvement, and the method comprises the following steps: 1, constructing a detection model which is obtained by training a YOLOv10 network introducing a content-guided feature fusion module; and step 2, inputting a to-be-identified construction site image into the detection model obtained in the step 1, and detecting and identifying the safety helmet by the detection model. According to the invention, the target can be positioned and identified more accurately, and the detection precision of the small target is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of construction safety detection methods, in particular to a construction site safety helmet detection method based on content-guided pyramid structure improvement. Background Art

[0002] In the construction industry, construction site safety has always been a top priority. As the most basic personal protective equipment, the wearing condition and quality status of hard hats directly affect the life safety of workers. In recent years, with the rapid development of deep learning technology, hard hat detection methods based on computer vision have been widely used. Among them, some methods based on CNN (convolutional neural network) and Faster-RCNN have achieved certain results in hard hat detection and can effectively improve the accuracy of detection algorithms, but their detection speed is often unsatisfactory and difficult to meet the needs of real-time monitoring of construction sites. In order to overcome this problem, the industry has gradually adopted a series of high-precision and fast advanced detection algorithms, such as YOLOv5, YOLOv8 and YOLOv9. These algorithms optimize the network structure and detection mechanism, while maintaining high accuracy, significantly improving the detection speed, making real-time hard hat detection possible. However, in the specific scenario of hard hat detection on construction sites, since the camera is usually installed at a higher position, the hard hat target captured is relatively small, which brings new challenges to the detection algorithm. Although the YOLO series of algorithms perform well in the field of general target detection, their performance is often limited to a certain extent when dealing with small target detection. Recently, the YOLOv10 algorithm proposed by Tsinghua University uses a non-NMS method, which has improved detection accuracy and efficiency, but in the special application of construction site safety helmet detection, it still has the problem of poor detection effect on small targets.

[0003] In view of the above problems, the present invention proposes a construction site safety helmet detection method with improved content-guided pyramid structure, which provides a new and efficient solution for construction site safety helmet detection. Summary of the invention

[0004] The present invention provides a construction site safety helmet detection method based on content-guided pyramid structure improvement to solve the problem that the prior art YOLOv10 algorithm is difficult to apply to construction site safety helmet detection.

[0005] In order to achieve the above object, the technical solution adopted by the present invention is:

[0006] A construction site safety helmet detection method based on content-guided pyramid structure improvement includes the following steps:

[0007] Step 1: Build a detection model. The process is as follows:

[0008] Generate a YOLOv10 model, replace the twelfth Concat layer, the fifteenth Concat layer, and the twenty-first Concat layer in the YOLOv10 network with content-guided feature fusion modules, and obtain an improved YOLOv10 model;

[0009] Then, the YOLOv10 model is trained based on the training set data, and the detection model is obtained after the training is completed;

[0010] Step 2: Input the construction site image to be identified into the detection model obtained in step 1, and use the detection model to detect and identify the safety helmet.

[0011] Furthermore, in step 1, the content-guided feature fusion module includes a multi-scale attention module and a feature cross-fusion module, and its data processing process is as follows:

[0012] First, the module receives the features and processes them through the Concat function to obtain the concatenated features. Then, the multi-scale attention module calculates the attention weights. After that, the feature cross-fusion module is used to multiply and sum the obtained attention weights with the original two features to obtain two features with attention weights. Finally, the two features are concatenated through the Concat function to obtain the final output.

[0013] Furthermore, in step 1, weighted EIOU is used as the loss function during training.

[0014] Based on Yolov10, the present invention proposes a feature fusion module (ContextGuide Fusion) based on content guidance, builds a feature pyramid structure to fuse high- and low-dimensional feature information, and introduces a weighted EIOU-LOSS, which effectively improves the detection capability of small targets in complex backgrounds. Compared with the prior art, the present invention has the following advantages:

[0015] The content-guided feature fusion module (Context Guide Fusion) proposed in the present invention can more effectively fuse high- and low-dimensional feature information, so that the model can fully consider contextual information when identifying helmets, thereby improving recognition accuracy. The constructed feature pyramid structure can make full use of feature information of different scales, especially when dealing with small target helmets, and can more accurately locate and identify targets. The introduction of weighted EIOU-LOSS applies different weights to the scale deviation of the detection frame, which can effectively improve the detection accuracy of small targets. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 It is a diagram of the improved YOLOv10 model architecture in an embodiment of the present invention.

[0017] Figure 2 It is a diagram of the architecture of a content-guided feature fusion module in an embodiment of the present invention.

[0018] Figure 3 This is a comparison chart of mAP indicators between the method of the embodiment of the present invention and other methods.

[0019] Figure 4 This is the architecture diagram of the prior art YOLOv10 model. DETAILED DESCRIPTION

[0020] The present invention is further described below in conjunction with the accompanying drawings and embodiments.

[0021] This embodiment discloses a construction site safety helmet detection method based on content-guided pyramid structure improvement, comprising the following steps:

[0022] Step 1: Build a detection model.

[0023] In this embodiment, on-site image data of a construction site is obtained as a data set, and the Labeling tool is used to label the head images without safety helmets and the head images with safety helmets in the data set, and then the labeled image data in the data set is divided into a training set and a test set.

[0024] In this embodiment, the detection module is formed based on the YOLOv10 model.

[0025] The YOLOv10 model of the prior art uses an enhanced version of CSPNet in its backbone network. The neck is designed to aggregate features of different scales and pass them to the head using a PAN structure. In the head structure, a dual label allocation strategy is used to avoid NMS post-processing.

[0026] Specific as Figure 4 As shown, in the existing YOLOv10 model, the backbone network CSPNet is composed of the zeroth Conv layer, the first Conv layer, the second C2f layer, the third Conv layer, the fourth C2f layer, the fifth SCDown layer, the sixth C2f layer, the seventh SCDown layer, the eighth C2fCIB layer, the ninth SPPF layer, and the tenth PSA layer.

[0027] Therefore, in the existing YOLOv10 model, the feature results of different scales of the fourth C2f layer, the sixth C2f layer, and the tenth PSA layer are finally extracted through the backbone network and sent to the neck respectively.

[0028] In the existing YOLOv10 model, the neck part is composed of the eleventh upsample layer Upsample layer, the twelfth Concat layer, the thirteenth C2fCIB layer, the fourteenth upsample layer Upsample layer, the fifteenth Concat layer, the sixteenth C2f layer, the seventeenth Conv layer, the eighteenth Concat layer, the nineteenth C2fCIB layer, the twentieth SCDown layer, the twenty-first Concat layer, and the twenty-second C2fCIB layer. The result obtained by the fourth C2f layer in the backbone network is fused with the output of the fourteenth upsample layer Upsample layer in the neck part in the fifteenth Concat layer. The result obtained by the sixth C2f layer in the backbone network is fused with the result of the eleventh upsample layer Upsample layer in the neck part in the twelfth Concat layer. The result obtained by the tenth PSA layer in the backbone network is fused with the result of the twentieth SCDown layer in the neck part in the twenty-first Concat layer.

[0029] The head of the existing YOLOv10 model includes three v10Detect layers, which receive the outputs of the three key feature layers from the deep network of the model: the 16th C2f layer, the 19th C2fCIB layer, and the 22nd C2fCIB layer of the neck. The feature map is deeply analyzed and processed using methods such as bounding box regression and confidence score calculation. At the same time, the model uses a one-to-many allocation strategy during training and a one-to-one allocation prediction result during inference, thereby achieving efficient inference without NMS.

[0030] However, the YOLOv10 model of the prior art has the problem of not being able to pay good attention to the low-dimensional detail information of the image, resulting in poor performance when used for construction site safety helmet detection. Therefore, this embodiment improves the YOLOv10 model of the prior art, introduces a content-guided feature fusion module (Context Guide Fusion) into the YOLOv10 model of the prior art, and obtains an improved YOLOv10 model.

[0031] Specifically, in this embodiment, the twelfth Concat layer, the fifteenth Concat layer, and the twenty-first Concat layer in the neck part of the existing YOLOv10 model are replaced with the content-guided feature fusion module CGFusion, respectively, to obtain an improved YOLOv10 model.

[0032] like Figure 1As shown, the backbone network of the improved YOLOv10 model is the same as the backbone network of the existing YOLOv10 model, which consists of a zeroth Conv layer, a first Conv layer, a second C2f layer, a third Conv layer, a fourth C2f layer, a fifth SCDown layer, a sixth C2f layer, a seventh SCDown layer, an eighth C2fCIB layer, a ninth SPPF layer, and a tenth PSA layer.

[0033] like Figure 1 As shown, the neck part of the improved YOLOv10 model includes the eleventh upsample layer Upsample layer, the twelfth CGFusion layer, the thirteenth C2fCIB layer, the fourteenth upsample layer Upsample layer, the fifteenth CGFusion layer, the sixteenth C2f layer, the seventeenth Conv layer, the eighteenth Concat layer, the nineteenth C2fCIB layer, the twentieth SCDown layer, the twenty-first CGFusion layer, and the twenty-second C2fCIB layer. The result obtained by the fourth C2f layer in the backbone network is fused with the output of the fourteenth upsample layer Upsample layer in the neck part in the fifteenth CGFusion layer. The result obtained by the sixth C2f layer in the backbone network is fused with the result of the eleventh upsample layer Upsample layer in the neck part in the twelfth CGFusion layer. The result obtained by the tenth PSA layer in the backbone network is fused with the result of the twentieth SCDown layer in the neck part in the twenty-first CGFusion layer.

[0034] like Figure 1 As shown, in the improved YOLOv10 model of this embodiment, the head is the same as the head of the YOLOv10 model in the prior art, including three v10Detect layers. These three v10Detect layers receive the outputs of the three key feature layers from the deep network of the model: the sixteenth C2f layer, the nineteenth C2fCIB layer, and the twenty-second C2fCIB layer of the neck part. The feature map is deeply analyzed and processed using methods such as bounding box regression and confidence score calculation. At the same time, the model uses a one-to-many allocation strategy during training and a one-to-one allocation prediction result during reasoning, thereby achieving efficient reasoning without NMS.

[0035] In summary, the improved YOLOv10 model structure of this embodiment includes a backbone network, a neck improved by a content-guided feature fusion module, and a detection head with a dual label allocation strategy.

[0036] In the feature acquisition process, shallow features have high resolution and contain more position and detail information, but have low semantics; high-level features have stronger semantic information, but have low resolution and poor perception of details. Therefore, this embodiment introduces a content-guided feature fusion module into the YOLOv10 model of the prior art, and effectively combines shallow and high-level features through a carefully designed fusion strategy, aiming to provide a more comprehensive and accurate feature representation for the helmet detection model by fusing shallow high-resolution information and high-level semantic information.

[0037] In this embodiment, the content-guided feature fusion module (i.e., CGFusion layer) is used three times, wherein the inputs of the twelfth CGFusion layer of the neck part are the results of the eleventh upsample layer Upsample layer in the neck part and the results of the sixth C2f layer in the backbone network, the inputs of the fifteenth CGFusion layer of the neck part are the results of the fourth C2f layer in the backbone network and the results of the fourteenth upsample layer Upsample layer in the neck part, and the inputs of the twenty-first CGFusion layer of the neck part are the results of the tenth PSA layer in the backbone network and the results of the twentieth SCDown layer in the neck part.

[0038] like Figure 2 As shown, in this embodiment, each content-guided feature fusion module includes a multi-scale attention module and a feature cross-fusion module, and the data processing process of the content-guided feature fusion module is:

[0039] S1, input features X0 and X1, the dimension is C*H*W, C is the number of channels, H is the feature height, W is the feature width, and then the Concat function concatenates X0 and X1 in the channel dimension according to formula (1) to obtain X2.

[0040] X2=cat(X0,X1) (1)

[0041] Among them: the dimension of the concatenated feature X2 is 2C*H*W; cat is the feature concatenation function of the Pytorch framework.

[0042] For the twelfth-layer feature fusion module CGFusion, its input features are the results obtained by the eleventh Upsample layer of upsampling the neck part and the results obtained by the sixth C2f layer in the backbone network, that is, X0 and X1 are the output of the eleventh Upsample layer and the output of the sixth C2f layer respectively.

[0043] For the fifteenth feature fusion module CGFusion, its input features are the results of the fourteenth upsample layer Upsample of the neck part and the results of the fourth C2f layer in the backbone network, that is, X0 and X1 are the outputs of the fourteenth upsample layer Upsample and the fourth C2f layer respectively.

[0044] For the 21st feature fusion module CGFusion, its input features are the results obtained from the tenth PSA layer in the backbone network and the results obtained from the twentieth SCDown layer in the neck part, that is, X0 and X1 are the outputs of the tenth PSA layer and the twentieth SCDown layer respectively.

[0045] S2. In the multi-scale attention module, the tensor X2 is processed to obtain its attention weight. The specific calculation process is as follows:

[0046] The tensor X2 is calculated according to formula (2), passing through a GAP module and two P W _Conv module and BN layer to get X 21 , formula (2) is as follows:

[0047] X 21 =GAP(BN(P W _Conv(BN(P W _Conv(X2))))) (2)

[0048] The tensor X2 is calculated according to formula (3) and passes through two P W _Conv module and BN layer to get X 22 , formula (3) is as follows:

[0049] X 22 =BN(P W _Conv(BN(P W _Conv(GAP(X2))))) (3)

[0050] Where: X 21 and X 21 The dimension is C*1*1, GAP is global average pooling, P W _Conv is the convolution calculation, and BN is the normalization function.

[0051] After that, the obtained feature X 21 , X 22 The fusion is performed as shown in formula (4) to obtain the fused feature X3.

[0052] X3=X 21 *X 22 (4)

[0053] The fused feature X3 is activated by the Sigmoid function to obtain the attention weight X3_weight, as shown in formula (5).

[0054]

[0055] S3, through the feature cross fusion module, X3_weight and features X0, X1 are fused to obtain weighted features X4, X5. The feature mutual fusion is performed according to formula (6) and formula (7):

[0056]

[0057]

[0058] S4, send the weighted features X4 and X5 to the channel dimension for concatenation to obtain the final fused output feature X out , as shown in formula (8):

[0059] X out =cat(X4,X5) (8)

[0060] Among them: cat is the Pytorch framework feature concatenation function, X out The dimensions are 2C*H*W.

[0061] In summary, this embodiment introduces a content-guided feature fusion module into the YOLOv10 model of the prior art to obtain an improved feature pyramid structure, namely an improved YOLOv10 model, as the neck part of the feature extraction model. The new feature pyramid structure can provide richer and more accurate feature representations at multiple scales, and better handle helmet targets of different sizes. Due to the fusion of feature information at multiple scales, the model can better cope with the challenges brought by scale changes and improve the accuracy of detection.

[0062] In the improved YOLOv10 model of this embodiment, first, the image data is input into the backbone network layer, and the enhanced version of CSPNet is used to extract feature information of different scales; the FPA (feature pyramid architecture) structure is optimized to more efficiently integrate key information from different scales. Specifically, CGFusion modules are deployed on the twelfth, fifteenth, and twenty-first layers of the architecture. These modules are responsible for accurately fusing multi-scale features to ensure the comprehensiveness and complementarity of information. Subsequently, these deeply fused rich features are passed to the detection head, which greatly improves the accuracy and efficiency of target recognition and positioning.

[0063] In this embodiment, the improved YOLOv10 model is trained by acquiring and annotating the training set. During the training, the weighted EIOU is used as the loss function, and different weights are applied to the center point distance deviation and the detection box scale deviation. The specific calculation process is shown in formula (9):

[0064]

[0065] α+β=3(10)

[0066] Where: c is the diagonal length of the minimum bounding rectangle of the detection box; c w and c h Respectively represent the width and height of the detection box; b and b gt They represent the center point coordinates of the detection box and the calibration box respectively; IOU represents the intersection-over-union ratio of the detection box and the calibration box; w gt and h gt Represent the width and height of the calibration box respectively; ρ represents the Euclidean distance; α and β represent the weights of this method. Formula (10) limits the sum of α and β, which is intended to only adjust the weight within the prediction box without imposing additional losses; WEIOU is the abbreviation of Weighted Enhanced Intersection over Unionk.

[0067] Step 2: Obtain the construction site image to be identified, input the construction site image to be identified into the detection model obtained in step 1, and use the detection model to detect and identify the safety helmet avatar from the construction site image to be identified.

[0068] Through multiple iterations of training and based on the loss function calculation results, the parameters of the improved YOLOv10 model are optimized and updated, thereby obtaining the trained improved YOLOv10 model detection model. The generalization performance of the detection model is evaluated using the test set.

[0069] like Figure 3 As shown, this method is compared with the yolov10 mAP indicator. Figure 3 It can be seen that the model improved by using the content-guided feature fusion module is improved from 0.833 to 0.892 compared with yolov10 mAP index. After the loss function is improved, its index is improved to 0.895. Therefore, it is shown that the method of this embodiment can effectively improve the accuracy of small target detection compared with other methods.

[0070] The preferred embodiments of the present invention are described in detail above in conjunction with the accompanying drawings. The embodiments described in the present invention are merely descriptions of the preferred embodiments of the present invention, and do not limit the concept and scope of the present invention. The various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction, and such combinations should also be regarded as the contents disclosed in the present disclosure as long as they do not violate the concept of the present invention. In order to avoid unnecessary repetition, the present invention will not further describe various possible combinations.

[0071] The present invention is not limited to the specific details of the above-mentioned embodiments. Within the technical concept of the present invention and without departing from the design concept of the present invention, various modifications and improvements made to the technical solution of the present invention by technical personnel in this field should fall within the protection scope of the present invention. The technical contents for which protection is sought in the present invention have been fully recorded in the claims.

Claims

1. A construction site safety helmet detection method based on content-guided pyramid structure improvement, characterized in that: The following steps are involved: Step 1: Build a detection model. The process is as follows: Generate a YOLOv10 model and replace the twelfth layer in the YOLOv10 network 15th floor 21st floor The layers are replaced with content-guided feature fusion modules to obtain an improved YOLOv10 model; Then, the YOLOv10 model is trained based on the training set data, and the detection model is obtained after the training is completed; Step 2: Input the construction site image to be identified into the detection model obtained in step 1, and use the detection model to detect and identify the safety helmet.

2. The construction site helmet detection method based on content-guided pyramid structure improvement according to claim 1 is characterized in that: In step 1, the content-guided feature fusion module includes a multi-scale attention module and a feature cross-fusion module, and its data processing process is as follows: First, the module receives the The function processes the features to obtain the concatenated features, and then the multi-scale attention module calculates the attention weights. After that, the feature cross-fusion module is used to multiply and sum the obtained attention weights with the original two features to obtain two features with attention weights. The function concatenates two features to get the final output.

3. The construction site helmet detection method based on content-guided pyramid structure improvement according to claim 1 is characterized in that: In step 1, weighted EIOU is used as the loss function during training.

Citation Information

Cited By

  • Construction site safety helmet dynamic detection method based on multi-scale spatial-temporal feature optimization

    CN120673329A

  • Construction site unsafe behavior identification method based on YOLOv8-DS network

    CN121600394A