Construction site safety helmet dynamic detection method based on multi-scale spatial-temporal feature optimization
Through multi-frame information fusion and optical flow guidance mechanism, combined with a parallel cross-path extraction module, the detection difficulties of fast-moving and complex backgrounds in construction site hard hat detection are solved, and high-precision and robust hard hat detection is achieved.
Patent Information
- Application Number
- CN202510721978.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-09-19
AI Technical Summary
Existing construction site hard hat detection methods mainly rely on single-frame images and lack analysis of the time dimension, resulting in limited detection capabilities for fast-moving or occluded targets. They also have weak generalization capabilities in different environments and are easily affected by lighting and background interference, resulting in high false detection and missed detection rates.
Using multi-frame information fusion technology and optical flow guidance mechanism, a multi-frame temporal residual fusion module and an optical flow guided feature fusion module are designed. Combined with the parallel cross path extraction module, the adaptability to complex backgrounds and the robustness of target detection are enhanced through multi-scale feature fusion strategy and contextual attention mechanism.
The system improves the temporal consistency of helmet detection and its adaptability in complex backgrounds, reduces the false detection and missed detection rates, enhances the ability to capture fast-moving targets, and achieves high-precision helmet detection.
Smart Images

Figure CN120673329A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer vision technology, and in particular relates to a dynamic detection method for construction site safety helmets based on multi-scale spatiotemporal feature optimization. Background Art
[0002] Safety management at construction sites is crucial for the smooth progress of engineering projects. The proper wearing of hard hats is directly related to workers' personal safety. However, traditional manual monitoring methods are costly, inefficient, and prone to omissions. With the development of computer vision technology, deep learning-based video object detection technology has been widely used in safety monitoring to improve safety supervision capabilities at construction sites.
[0003] Currently, many studies focus on deep learning-based methods such as Faster R-CNN, YOLO, and SSD, which primarily rely on single-frame images for object detection. However, these methods still face multiple challenges in construction site environments.
[0004] While traditional change detection methods are still used in some scenarios, they are often sensitive to factors such as lighting, shadows, and sensor variations, and have limitations when dealing with complex urban environments and large-scale remote sensing data. Object detection methods based on deep learning have achieved success in some application areas, but due to the limitations of convolution operations, they often capture limited contextual information and lack global information. This results in shallow feature maps lacking deep features and makes it difficult to detect target edge pixels.
[0005] Existing object detection methods are often sensitive to environmental changes. For example, detection performance degrades significantly in strong lighting, shadows, or complex backgrounds. Furthermore, methods based on single-frame images often lack the ability to leverage temporal information, making it difficult to effectively track the temporal changes of an object.
[0006] The Chinese invention, "A Construction Site Safety Helmet Detection Method Based on an Improved Content-Guided Pyramid Structure," with publication number CN119181052A, provides a construction site safety helmet detection method based on an improved YOLOv10 model. The constructed feature pyramid structure can fully utilize feature information at different scales, particularly when processing small-target safety helmets, enabling more accurate target positioning and identification. However, it still has deficiencies in fast-moving target detection and occlusion handling. The Chinese invention, "Construction Site Safety Helmet Wearing Detection Method Based on an Improved YOLOV5 Model," with publication number CN115512387A, uses an improved YOLO network for safety helmet detection and combines region cropping with color feature analysis to improve detection accuracy. However, this method uses single-frame image information and has limited processing capabilities for dynamic target changes.
[0007] The existing methods for detecting hard hats on construction sites mainly have the following defects: 1) Most methods are based on single-frame detection and lack analysis of the temporal dimension, resulting in limited detection capabilities for fast-moving or occluded targets.
[0008] 2) The generalization ability is weak in different environments such as daytime, nighttime, and shadow areas, and it is easily affected by lighting and background interference.
[0009] 3) Existing methods still have a high rate of false detection and missed detection, especially in complex construction scenarios, where it is difficult to accurately distinguish between workers and backgrounds.
[0010] Therefore, there is an urgent need for a detection method that can comprehensively utilize spatiotemporal information to improve the accuracy and robustness of helmet detection in order to address the shortcomings of existing technologies. Summary of the Invention
[0011] The purpose of the present invention is to address the above-mentioned problems and provide a construction site safety helmet dynamic detection method based on multi-scale spatiotemporal feature optimization. The method utilizes multi-frame information fusion technology and optical flow guidance mechanism to improve the temporal consistency of target detection and enhance the adaptability to complex background interference. A multi-frame temporal residual fusion module is designed to fuse the feature information of multiple video frames, improve the stability of the target area and reduce the influence of motion blur. At the same time, the optical flow guidance feature fusion module is combined with the optical flow estimation algorithm to guide the feature extraction process, so that the model can more accurately capture fast-moving targets and improve the reliability of safety helmet detection. A parallel cross-path extraction module is introduced to combine global and local information, and the target feature expression ability is enhanced through parallel and cross-path structures, thereby reducing false detection and missed detection. A multi-scale feature fusion strategy is adopted, combined with a contextual attention mechanism, to improve the detection accuracy of target edges and optimize the robustness of the final detection results.
[0012] In order to achieve the above-mentioned objectives, in the first aspect, the present invention provides a dynamic detection method for construction site safety helmets based on multi-scale spatiotemporal feature optimization, where the detection target is a safety helmet, and the target detection model includes an optical flow feature extraction branch and a first and a second attention cross-fusion branch, multiple optical flow guided fusion branches and a target detection unit; the attention cross-fusion branch includes an optical flow guided feature fusion module, a residual network and a parallel cross-path extraction module connected in sequence, and the optical flow guided fusion branch includes an optical flow guided feature fusion module and a convolutional layer; the optical flow guided feature fusion module uses an optical flow estimation algorithm to extract optical flow features, and after fusing them with the depth features of the original frame, extracts high-level semantic information through a convolutional layer; the parallel cross-path extraction module uses a cross-fused channel attention and spatial attention mechanism to enhance target features and reduce background interference.
[0013] The dynamic detection method for a safety helmet comprises the following steps: Step 1: Obtain the RGB image frame and corresponding optical flow image of the construction site; Step 2: Use a multi-frame temporal residual fusion module to extract motion features from adjacent RGB image frames, and use the motion features and the optical flow image as input to the optical flow guided feature fusion module of the first attention cross fusion branch; Step 3: Using the residual network of the optical flow feature extraction branch and multiple convolutional layers to extract optical flow features from the optical flow image, which are used as inputs of the second attention cross fusion branch and each optical flow guided fusion branch respectively; Step 4: Use the optical flow guided feature fusion module to fuse the optical flow features and the image features of the original frame, and extract high-level semantic information as the feature data stream of the branch; Step 5: Use the output features of the first and second attention cross-fusion branches and each optical flow guided fusion branch as the input of the target detection unit, and use the target detection unit to obtain the helmet detection result.
[0014] Preferably, ResNet101 is used for the residual network in the optical flow feature extraction branch and the first and second attention cross-fusion branches.
[0015] Furthermore, in step 2, the multi-frame temporal residual fusion module adopts a temporal residual connection structure to calculate the feature residuals of the current image frame and its previous and subsequent adjacent frames, extract inter-frame motion information, and fuse it with the current image frame to enhance the time series information, thereby facilitating accurate detection of the position of the helmet at different times.
[0016] Preferably, in step 2, extracting motion features from adjacent RGB image frames using a multi-frame temporal residual fusion module specifically includes: (1) Extract the current frame from the video stream I ( t ) and its adjacent frames I ( t 1) ,To ensure the stability of features after feature aggregation, the features of different frames are ,standardized during the aggregation process. ; In the formula Represents the features after multi-frame fusion, Cat( ) represents the aggregation function, and Conv( ) represents the function used for standardization processing; (2) Current frame I ( t ) The features after fusion with multiple frames through residual connection connection, ensuring that the original feature information of the current frame is retained while fusing the context information of adjacent frames. ; ; In the formula Represents the characteristics of the residual structure output, Represents the features output by the multi-frame temporal residual fusion module.
[0017] Preferably, the optical flow feature extraction branch includes a first residual network, a second residual network and multiple convolutional layers connected in sequence, wherein the first residual network provides input for the optical flow guided feature fusion module of the second attention cross fusion branch, the second residual network provides input for the optical flow guided feature fusion module of the first optical flow guided fusion branch, and the convolutional layers of the optical flow feature extraction branch that are connected in sequence to the second residual network provide input for the optical flow guided feature fusion modules of the second, third and fourth optical flow guided fusion branches respectively.
[0018] Preferably, step 4 specifically includes the following sub-steps: Step 4.1: Use the optical flow estimation algorithm to extract the optical flow features and perform channel segmentation with the input features to obtain local and global motion information. ; ; ; ; Where, Represents the input optical flow information; and Different channel information of optical flow features; Represents input feature information; and Different channel information of optical flow features; 、 All are functions of convolution operation; Step 4.2: Fuse the optical flow features with the depth features of the original frame at the channel level. ; Where, represents the input features of the current frame, Represents the features after the fusion of optical flow features and input features; represents the splicing function; Step 4.3: Further optimize the fused features, extract high-level semantic information through convolution operations, and input them into the residual network of the attention cross-fusion branch or the convolution layer of the optical flow guided fusion branch.
[0019] Preferably, in step 5, the target detection unit adopts a non-maximum suppression algorithm to filter effective helmet detection frames through a confidence threshold and remove redundant detection frames.
[0020] Preferably, the training method of the target detection model comprises the following steps: S1. Input the sample data into the target detection model, obtain the detection results, and match them with the true labels of the samples; S2. Calculate the loss function value based on the detection results and the true label to measure the prediction error; S3. Perform gradient calculation based on the calculated loss function value and update the model parameters through backpropagation to improve the accuracy and robustness of target detection; S4. Determine whether the current number of iterations reaches the set training round. If so, end the training and execute step S5; otherwise, execute step S1 to continue training the target detection model. S5. After training is completed, the model is verified on the test data set, the detection performance evaluation index is calculated, and the generalization ability of the model is evaluated.
[0021] In a second aspect, the present invention provides a construction site safety helmet dynamic detection system based on multi-scale spatiotemporal feature optimization, comprising: Optical flow feature extraction unit: uses a residual network and multiple convolutional layers to extract optical flow features from the optical flow image, providing input for the attention cross fusion unit and the optical flow feature fusion unit; Attention cross-fusion unit: calls the MTRF module, OFFG module, residual network module and PCE module to obtain optimized features including optical flow features and cross-fused channel attention and spatial attention, and outputs them to the target detection module; Optical flow feature fusion unit: Using the OFFG module and convolution layer, the optical flow features of different scales provided by the optical flow feature extraction unit are segmented into channels to obtain local and global motion information. After channel-level fusion with the deep features of the original frame, high-level semantic features are extracted and output to the target detection module after convolution operation. Object detection module: Based on the feature data output by the attention cross fusion unit and the optical flow feature fusion unit, the non-maximum suppression algorithm is used to filter the effective helmet detection frame through the confidence threshold and output the helmet detection result; Residual network module: uses ResNet101 network to process input feature data; MTRF module: used to calculate the feature residuals of the current image frame and its previous and next adjacent frames, extract inter-frame motion information, and fuse it with the current image frame to enhance the time series information; OFFG module: uses the optical flow estimation algorithm to extract optical flow features, fuses them with the depth features of the original frame, and extracts high-level semantic information through the convolution layer; PCE module: uses cross-fusion channel attention and spatial attention mechanisms to enhance target features.
[0022] Compared with the prior art, the present invention has the following beneficial effects: 1) This invention achieves spatiotemporal information complementarity by constructing a parallel processing framework consisting of an optical flow feature branch, a dual-attention cross-fusion branch, and a multi-level optical flow guidance branch. By cascading temporal residual fusion, optical flow guidance, and cross-attention modules, it systematically addresses the temporal consistency and background interference issues in dynamic target detection. Leveraging a collaborative optimization mechanism for spatiotemporal features, it achieves technological breakthroughs in dynamic target stability, rapid motion capture, and complex background interference resistance, resulting in high detection accuracy, strong environmental adaptability, and engineering feasibility. This invention is applicable to complex construction environments, enabling automated detection and monitoring of workers' helmet wear, reducing manual supervision costs, improving construction site safety, and meeting the needs of smart construction site development.
[0023] 2) This paper designs a multi-frame temporal residual fusion module to enhance time series information and improve the stability of dynamic helmet detection. Using a temporal residual calculation method to capture motion change characteristics between consecutive frames, and using a fusion strategy to improve the model's temporal perception, this module effectively reduces false and missed detections caused by rapid human movement or partial occlusion by helmets, thereby improving the temporal robustness of target detection.
[0024] 3) The optical flow-guided feature fusion module provided by this invention improves the accuracy of moving target detection. By combining optical flow information with target tracking, this module can more accurately analyze the motion patterns of helmets, ensuring accurate target positioning even in complex backgrounds. Compared to traditional detection methods based on single-frame features, optical flow information provides additional motion compensation, making helmet detection more robust.
[0025] 4) The parallel cross-path extraction module provided by this invention enhances the multi-scale feature representation capability of target detection. Combining channel attention and spatial attention mechanisms, this module strengthens the feature representation of key target areas and improves detection accuracy. Channel attention optimizes the weight distribution of features at different scales, while spatial attention enhances the feature response of the helmet area, addressing false detections caused by background interference.
[0026] 5) Through multi-scale spatiotemporal feature optimization, the present invention can effectively deal with complex situations such as target occlusion and motion blur, and improve the spatiotemporal consistency of helmet detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The present invention will be further described below with reference to the accompanying drawings.
[0028] Figure 1 2 is a structural diagram of the target detection model according to an embodiment of the present invention.
[0029] Figure 2 2 is a structural diagram of a multi-frame temporal residual fusion network according to an embodiment of the present invention.
[0030] Figure 3 This is a structural diagram of the optical flow guided feature fusion network according to an embodiment of the present invention.
[0031] Figure 4 This is a structural diagram of a parallel cross-path extraction network according to an embodiment of the present invention.
[0032] Figure 5 Flowchart of the target detection model training method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0033] like Figure 1 As shown, the target detection model includes an optical flow feature extraction branch, a first and a second attention cross fusion branch, multiple optical flow guided fusion branches and a target detection unit; the attention cross fusion branch includes an optical flow guided feature fusion module OFFG, a residual network and a parallel cross path extraction module PCE connected in sequence, and the optical flow guided fusion branch includes an optical flow guided feature fusion module OFFG and a convolutional layer.
[0034] The optical flow feature extraction branch includes two residual networks and multiple convolutional layers for providing optical flow features to the attention cross fusion branch or the optical flow guided fusion branch.
[0035] like Figure 2 As shown in the figure, the multi-frame temporal residual fusion module MTRF adopts a temporal residual connection structure to calculate the feature residuals of the current image frame and its previous and subsequent adjacent frames, extract the inter-frame motion information, and fuse it with the current image frame to enhance the time series information, which facilitates the accurate detection of the position of the helmet at different times.
[0036] like Figure 4 As shown in the figure, the optical flow guided feature fusion module OFFG adopts an optical flow estimation algorithm such as PWC-Net to extract optical flow features, fuse them with the depth features of the original frame, and extract high-level semantic information to improve the detection accuracy of the target in motion.
[0037] like Figure 5 As shown in the figure, the parallel cross path extraction module PCE adopts the cross-fusion channel attention and spatial attention mechanism to enhance target features and reduce background interference.
[0038] In the embodiment, the target detection model reduces model parameters by sharing weights, so that it can learn static information and motion information at the same time, which helps to improve the detection accuracy of safety helmets in construction site environments and enhance the perception of dynamic targets.
[0039] The dynamic detection method of construction site hard hats based on multi-scale spatiotemporal feature optimization includes: Step 1: Obtain the RGB image frame and the corresponding optical flow image of the construction site.
[0040] The system uses RGB video frames from a construction site as input images and simultaneously calculates corresponding optical flow images to enhance the perception of moving targets. The RGB images are used to extract static features of the worker and helmet, while the optical flow images are used to capture the helmet's motion trajectory, improving detection stability in dynamic environments.
[0041] Step 2: Use the multi-frame temporal residual fusion module MTRF to extract motion features from adjacent RGB image frames, and use the motion features and the optical flow image as the input of the optical flow guided feature fusion module OFFG of the first attention cross fusion branch.
[0042] Step 2.1: Extract the current frame from the video stream I ( t ) and its preceding and following adjacent frames I ( t 1) ,To ensure the stability of features after feature aggregation, the features of different frames are ,standardized during the aggregation process. ; In the formula Represents the features after multi-frame fusion, Cat( ) represents the aggregation function, and Conv( ) represents the function used for standardization processing; Step 2.2: Current Frame I ( t ) The features after fusion with multiple frames through residual connection connection, ensuring that the original feature information of the current frame is retained while fusing the context information of adjacent frames. ; ; In the formula Represents the characteristics of the residual structure output, Represents the features output by the multi-frame temporal residual fusion module.
[0043] Step 3: Use the residual network of the optical flow feature extraction branch and multiple convolutional layers to extract optical flow features from the optical flow image, which are used as inputs of the second attention cross fusion branch and each optical flow guided fusion branch respectively.
[0044] The optical flow feature extraction branch includes a first residual network, a second residual network and four convolutional layers connected in sequence, wherein the first residual network provides input for the optical flow guided feature fusion module of the second attention cross fusion branch, and the second residual network provides input for the optical flow guided feature fusion module of the first optical flow guided fusion branch. The convolutional layers of the optical flow feature extraction branch connected in sequence with the second residual network provide input for the optical flow guided feature fusion modules of the second, third and fourth optical flow guided fusion branches respectively.
[0045] Step 4: Use the optical flow guided feature fusion module to fuse the optical flow features and the image features of the original frame, and extract high-level semantic information as the feature data stream of the branch; Step 4.1: Use the optical flow estimation algorithm to extract the optical flow features and perform channel segmentation with the input features to obtain local and global motion information. ; ; ; ; Where, Represents the input optical flow information; and Different channel information of optical flow features; Represents input feature information; and Different channel information of optical flow features; 、 All are functions of convolution operation; Step 4.2: Fuse the optical flow features with the depth features of the original frame at the channel level. ; Where, represents the input features of the current frame, Represents the features after the fusion of optical flow features and input features; represents the splicing function; Step 4.3: Further optimize the fused features, extract high-level semantic information through convolution operations, and input them into the residual network of the attention cross-fusion branch or the convolution layer of the optical flow guided fusion branch.
[0046] Step 5: Use the parallel cross path extraction module PCE to enhance the target features in the feature data of the first and second attention cross fusion branches; use the output features of the first and second attention cross fusion branches and each optical flow guided fusion branch as the input of the target detection unit. The target detection unit uses the non-maximum suppression algorithm to filter the effective helmet detection frame through the confidence threshold, remove the redundant detection frame, and obtain the helmet detection result.
[0047] The method for processing the input feature data by the parallel cross path extraction module PCE specifically includes: (1) Input feature map after optical flow fusion , the channel attention mechanism is used to calculate the importance weights of different channels: ; in, The feature map representing the fused optical flow features output by the residual network, represents the importance weight of the channel, represents the sigmoid activation function, Represents a convolution operation with a convolution kernel size of 1×1, which is used to calculate channel-level weights; (2) Feature map Perform spatial attention calculations to enhance attention to the target area. ; in, represents the importance weight of the space, Represents a convolution operation with a convolution kernel size of 3×3, calculating the attention weight of the spatial dimension; (3) Cross-fuse channel and spatial attention to obtain the final feature optimization result: ; in, Represents the optimized features; (4) Input the optimized features into the target detection unit.
[0048] like Figure 5 As shown in Figure 2, the training method of the target detection model includes the following steps: S1. Input the sample data into the target detection model, obtain the detection results, and match them with the true labels of the samples; S2. Calculate the loss function based on the detection results and the true label to measure the prediction error. The loss function uses the cross-entropy loss function to optimize the classification accuracy of the helmet detection. S3. Perform gradient calculation based on the calculated loss value and update the model parameters through backpropagation to improve the accuracy and robustness of target detection; S4. Determine whether the current number of iterations is less than the set training epoch; if it has not reached the set epoch, return to step S1 and continue training; otherwise, enter the next stage of model verification; S5. After training is completed, the model is validated on the test dataset, detection performance indicators (such as accuracy, recall rate, F1 score, etc.) are calculated, the generalization ability of the model is evaluated, and hyperparameters are optimized to improve the final detection effect.
[0049] In this embodiment, the mean average precision (mAP) is used as the performance evaluation indicator.
[0050] The mean precision is used to measure the accuracy of target detection for a certain category. It is defined as the area under the precision-recall (PR) curve and is calculated as follows: ; Among them, AP represents the mean precision, Indicates the recall rate R The accuracy under The mean average precision is used to measure the average target detection accuracy across all categories, and the calculation formula is: ; Where mAP represents the mean average precision, represents the mean accuracy of the i-th category, and N represents the number of categories.
[0051] mAP slow 、mAP medium 、mAP fast Measures the detection accuracy of slow, medium and fast moving targets, ; Where mAP slow represents the average accuracy of slow-moving targets, The number of categories for slow-moving targets; ; Where mAP medium represents the average accuracy of medium-speed moving targets, The number of categories of medium-speed moving targets; ; Where mAP fast represents the average precision of fast moving targets, is the number of categories of fast-moving targets.
[0052] In order to verify the effectiveness of the method of the present invention, experiments were conducted and verified on the ImageNet-VID and self-built construction site helmet detection datasets. The mean average precision (mAP) was used as the main evaluation indicator to measure the performance of the detection method at different motion speeds. mAP measures the detection accuracy of the model in different categories. mAP (slow), mAP (medium) and mAP (fast) respectively represent the detection performance of the model at different target motion speeds, that is, the detection effect of slow-moving, medium-speed moving and fast-moving targets. These indicators can fully reflect the detection capability of the present invention in a dynamic environment, ensuring that it can stably and effectively detect the wearing of helmets under different working conditions. The experimental results are shown in Table 1.
[0053] Table 1
[0054] As can be seen from Table 1, the helmet detection model provided by the present invention has achieved good detection results. The average accuracy on the self-built dataset is >90%, and the average accuracy for medium-speed moving targets reaches 91.6%, which has high dynamic detection accuracy.
Claims
1. A dynamic detection method for construction site safety helmets based on multi-scale spatiotemporal feature optimization, where the detection target is a safety helmet, is characterized by: The target detection model includes a first and a second attention cross-fusion branch and multiple optical flow guided fusion branches and a target detection unit; the attention cross-fusion branch includes an optical flow guided feature fusion module, a residual network and a parallel cross path extraction module connected in sequence, and the optical flow guided fusion branch includes an optical flow guided feature fusion module and a convolutional layer; The parallel cross-path extraction module adopts the cross-fusion channel attention and spatial attention mechanism to enhance target features and reduce background interference; The method comprises the following steps: Step 1: Obtain the RGB image frame and corresponding optical flow image of the construction site; Step 2: Use a multi-frame temporal residual fusion module to extract motion features from adjacent RGB image frames, and use the motion features and the optical flow image as input to the optical flow guided feature fusion module of the first attention cross fusion branch; Step 3: Use a residual network and multiple convolutional layers to extract optical flow features from the optical flow image, which are used as inputs of the second attention cross fusion branch and each optical flow guided fusion branch respectively; Step 4: Use the optical flow guided feature fusion module to fuse the optical flow features and the image features of the original frame, and extract high-level semantic information as the feature data stream of the branch; Step 5: Use the output features of the first and second attention cross-fusion branches and each optical flow guided fusion branch as the input of the target detection unit, and use the target detection unit to obtain the helmet detection result.
2. The dynamic detection method for a safety helmet according to claim 1, characterized in that: ResNet101 is used as the residual network in the attention cross fusion branch.
3. The dynamic detection method for a safety helmet according to claim 1 or 2, characterized in that: In step 2, the multi-frame temporal residual fusion module adopts a temporal residual connection structure to calculate the feature residuals of the current image frame and its previous and subsequent adjacent frames, extract inter-frame motion information, and fuse it with the current image frame to enhance the time series information, thereby facilitating accurate detection of the position of the helmet at different times.
4. The dynamic detection method for a safety helmet according to claim 3, characterized in that: In step 2, the multi-frame temporal residual fusion module is used to extract motion features from adjacent RGB image frames, specifically including: (1) Extract the current frame from the video stream I ( t ) and its preceding and following adjacent frames I ( t 1) ,To ensure the stability of features after feature aggregation, the features of different frames are ,standardized during the aggregation process. ; In the formula Represents the features after multi-frame fusion, Cat( ) represents the aggregation function, and Conv( ) represents the function used for standardization processing; (2) Current frame I ( t ) The features after fusion with multiple frames through residual connection connection, ensuring that the original feature information of the current frame is retained while fusing the context information of adjacent frames. ; ; In the formula Represents the characteristics of the residual structure output, Represents the features output by the multi-frame temporal residual fusion module.
5. The dynamic detection method for a safety helmet according to claim 4, characterized in that: In step 3, an optical flow feature extraction branch is used to provide optical flow features from the optical flow image. The optical flow feature extraction branch includes a first residual network, a second residual network and multiple convolutional layers connected in sequence, wherein the first residual network provides input to the optical flow guided feature fusion module of the second attention cross fusion branch, the second residual network provides input to the optical flow guided feature fusion module of the first optical flow guided fusion branch, and the convolutional layers of the optical flow feature extraction branch that are sequentially connected to the second residual network provide input to the optical flow guided feature fusion modules of the second, third and fourth optical flow guided fusion branches respectively.
6. The dynamic detection method for a safety helmet according to claim 5, characterized in that: The step 4 specifically includes the following sub-steps: Step 4.1: Use the optical flow estimation algorithm to extract the optical flow features and perform channel segmentation with the input features to obtain local and global motion information. ; ; ; ; Where, Represents the input optical flow information; and Different channel information of optical flow features; Represents input feature information; and Different channel information of optical flow features; 、 All are functions of convolution operation; Step 4.2: Fuse the optical flow features with the depth features of the original frame at the channel level. ; Where, represents the input features of the current frame, Represents the features after the fusion of optical flow features and input features; represents the splicing function; Step 4.3: Further optimize the fused features, extract high-level semantic information through convolution operations, and input them into the residual network of the attention cross-fusion branch or the convolution layer of the optical flow guided fusion branch.
7. The dynamic detection method for a safety helmet according to claim 6, characterized in that: The parallel cross-path extraction module processes the input feature data in the following manner: (1) Input feature map after optical flow fusion , the channel attention mechanism is used to calculate the importance weights of different channels: ; in, The feature map representing the fused optical flow features output by the residual network, represents the importance weight of the channel, represents the sigmoid activation function, Represents a convolution operation with a convolution kernel size of 1×1, which is used to calculate channel-level weights; (2) Feature map Perform spatial attention calculations to enhance attention to the target area. ; in, represents the importance weight of the space, Represents a convolution operation with a convolution kernel size of 3×3, calculating the attention weight of the spatial dimension; (3) Cross-fuse channel and spatial attention to obtain the final feature optimization result: ; in, Represents the optimized features; (4) Input the optimized features into the target detection unit.
8. The dynamic detection method for a safety helmet according to claim 1, 2, 4, 5, 6 or 7, characterized in that: In step 5, the target detection unit uses a non-maximum suppression algorithm to filter effective helmet detection frames through a confidence threshold and remove redundant detection frames.
9. The dynamic detection method for a safety helmet according to claim 8, characterized in that: The training method of the target detection model includes the following steps: S1. Input the sample data into the target detection model, obtain the detection results, and match them with the true labels of the samples; S2. Calculate the loss function value based on the detection results and the true label to measure the prediction error; S3. Perform gradient calculation based on the calculated loss function value and update the model parameters through backpropagation to improve the accuracy and robustness of target detection; S4. Determine whether the current number of iterations reaches the set training round. If so, end the training and execute step S5; otherwise, execute step S1 to continue training the target detection model. S5. After training is completed, the model is verified on the test data set, the detection performance evaluation index is calculated, and the generalization ability of the model is evaluated.
10. The dynamic detection method for a safety helmet according to claim 9, characterized in that: In step S5, the mean average precision (mAP) is used as the performance evaluation indicator; The mean precision is used to measure the accuracy of target detection for a certain category and is defined as the area under the precision-recall curve; The mean average precision is used to measure the average target detection accuracy across all categories, and the calculation formula is: ; Where mAP represents the mean average precision, represents the mean accuracy of the i-th category, and N represents the number of categories; mAP slow 、mAP medium 、mAP fast Measures the detection accuracy of slow, medium and fast moving targets, ; ; ; Where mAP slow 、mAP medium 、mAP fast Represent the average accuracy of slow, medium and fast moving targets respectively, 、 、 The number of categories of slow, medium and fast moving targets respectively.
Citation Information
Patent Citations
Construction site safety helmet wearing detection method based on improved YOLOV5 model
CN115512387A
Construction site safety helmet detection method based on content-guided pyramid structure improvement
CN119181052A