A safety helmet wearing detection method for long distance and high depression angle

By introducing the CS, STIEM, and FFM modules into the detection model, the problems of insufficient small target feature extraction and occlusion in helmet wearing detection at long distances and high angles of depression are solved, the detection accuracy is improved, and the resistance to background noise is enhanced.

CN118397549BActive Publication Date: 2025-11-21FUZHOU UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410561349.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-08
Publication Date
2025-11-21
Estimated Expiration
2044-05-08

AI Technical Summary

Technical Problem

Existing methods for detecting helmet wearing at long distances and high elevation angles have shortcomings in detection accuracy and handling of background noise interference, especially in the insufficient extraction of small target features and occlusion issues, resulting in low detection accuracy.

Method used

A CS module is introduced into the backbone network to focus on the key location information and channel features of the safety helmet target. A STIEM module is designed to fully extract key information of small targets. An FFM module is used to alleviate the occlusion problem. An MDCM module is inserted into the upsampling network to locate the target using environmental information. The loss function is modified to accelerate the convergence speed of the prediction box.

Benefits of technology

It improves the accuracy of helmet wearing detection at long distances and high elevation angles, reduces background noise interference, enhances the ability to identify small targets, and improves the accuracy of the detection model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118397549B_ABST
    Figure CN118397549B_ABST
Patent Text Reader

Abstract

The present application relates to a kind of safety helmet wearing detection methods under long-distance high angle of depression.The method comprises: the safety helmet data set under long-distance high angle of depression of actual construction site is built;Improved CenterNet safety helmet wearing detection network model is built;The training of improved model is carried out using training total set;Improved model is evaluated;Actual video stream is used to test improved model;Improved model is with CenterNet network as core to improve model, CS module is introduced after N2, N3 and N4 layer in CenterNet main network, STIEM module replaces N1 layer in CenterNet main network, FFM module is introduced in up-sampling network, MDCM module is inserted between up-sampling network and prediction network, and loss function is modified when training.The method is aimed at the existing deficiencies, improves the safety helmet wearing detection precision of model under long-distance high angle of depression.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of target detection of deep neural networks, and in particular to a safety helmet wearing detection method for long-distance high-dip angle. BACKGROUND

[0002] In the construction site operation scene, it has become a crucial measure to ensure the safety of construction personnel. In order to fulfill this safety obligation, it is stipulated that construction personnel must wear safety helmets during work to protect them from potential dangers. Behind this stipulation is the concern for workers falling from a high place or being injured by falling objects, because statistics show that brain injury accidents are quite common in construction site production. The implementation of wearing safety helmets is not only due to regulatory requirements, but also to effectively reduce the possibility of head injury.

[0003] The current mainstream safety helmet detection method is to detect safety helmet wearing through a deep learning model after training. At present, most experts, scholars and enterprises improve and design based on advanced general target detection algorithms, such as FasterR-CNN (Faster Region-based Convolutional Neural Network), SSD (Single Shot Multibox Detector), YOLO (You Only Look Once) and anchor-free CenterNet detection algorithm, etc. At present, most of the pan-tilt cameras of outdoor construction sites are installed in high points, so the videos collected are the safety helmet wearing situation under long-distance high-dip angle scenes. The purpose of this is to reduce the number of pan-tilt cameras and control costs to supervise the safety helmet wearing situation in a large range. In the large-scale shooting scene, the pixels of safety helmets in the image are small, belonging to the category of small targets, and there are problems of difficult-to-identify features. In addition, the pictures taken outdoors are easily affected by environmental factors and shooting device factors, resulting in problems of safety helmet small target occlusion, background noise interference similar to target information and safety helmet deformation. However, most technical improvements are trained through the open source dataset SHWD (Safety Helmet Wearing Dataset). The data pictures in the open source dataset SHWD are not actual construction site pictures under long-distance high-dip angle, which leads to the problem of low detection accuracy of the detection model in the actual long-distance high-dip angle construction site scene.

[0004] The patent application publication No. CN115131724A discloses a safety helmet wearing detection method suitable for long-distance high depression angle. The safety helmet wearing detection network mainly consists of a feature extraction module and a feature mapping module. The feature extraction module is responsible for feature extraction of the safety helmet picture input into the network. The feature mapping module continuously stacks convolutional layers and up-sampling layers, and performs dimension splicing with the CSP layer output of the feature extraction module. Finally, the prediction frame and the category are mapped to the original picture. The above method has two shortcomings: the first convolutional layer in the feature extraction module simply and directly compresses the size of the original image and improves the dimension, without fully extracting the key information of the safety helmet small target in the early stage of the feature extraction module, resulting in missed detection and false detection of the safety helmet target, and low average precision; when feature fusion is used in the feature mapping module, the 40x40 feature map after 4 times of size reduction in the feature extraction module is dimensionally spliced with the 40x40 feature map after up-sampling in the feature mapping module. For partially occluded safety helmet small targets, the high down-sampling multiple after 4 times of size reduction makes it difficult for the network to distinguish the edges of the target, thereby reducing the average detection precision of the model. In the present invention, the STIEM module is designed to address the first shortcoming, using a 1x1 convolution kernel and different branch extraction methods to effectively solve the problem of insufficient extraction of key information of safety helmet small targets in the early stage, and effectively improve the average detection precision; the FFM module is designed to address the second shortcoming, using a lower down-sampling feature map containing more edge information of occluded targets to effectively improve the average detection precision. SUMMARY

[0005] The purpose of the present application is to overcome the shortcomings of the existing safety helmet wearing detection technology under long distance and high depression angle, and provide a safety helmet wearing detection method under long distance and high depression angle, so as to improve the detection accuracy of safety helmet wearing detection under long distance and high depression angle. For the problem of background noise interference similar to target information, the CS module is introduced after the N2, N3 and N4 feature layers in the backbone network, so that the backbone network pays more attention to the key position information and channel feature information of the safety helmet target, and reduces the attention of the background noise. For the problem of insufficient extraction of small target key information of safety helmet in the early stage of the backbone network, the STIEM module is designed in the backbone network, which uses small convolution kernel and different processing methods of multiple branches to make the backbone network fully extract the small target key information of the safety helmet. For the occlusion problem of the small target of the safety helmet, the FFM module is designed in the up-sampling network, which effectively alleviates the occlusion problem of the small target of the safety helmet by using the lower down-sampling feature map containing more edge information of the occluded target. For the safety helmet deformation problem, the MDCM module is designed to effectively use the surrounding environment information to locate and identify the target, and reduce the dependence of the model on the shape of the safety helmet. For the problem of inaccurate regression prediction box, by modifying the loss function during training, introducing the minimum box containing the prediction box and the real target box and highlighting the position center weight, the convergence speed of the prediction box to the real target box is accelerated in the back propagation, and the center point of the prediction box is more fitted to the real target box center when the model predicts.

[0006] To achieve the above purpose, the technical scheme of the present application is: a safety helmet wearing detection method under long distance and high depression angle, comprising the following steps:

[0007] Step S1, constructing a safety helmet data set under long distance and high depression angle of actual construction site, and preprocessing;

[0008] Step S2, constructing an improved CenterNet safety helmet wearing detection network model;

[0009] Step S3, taking the training total set of the preprocessed safety helmet data set obtained in step S1 as the real result, inputting the improved CenterNet safety helmet wearing detection network model constructed in step S2, sequentially passing through the backbone network, the up-sampling network and the prediction network in the improved CenterNet safety helmet wearing detection network model, and obtaining the prediction result of the safety helmet wearing image through forward propagation. The loss value between the prediction result and the actual result is calculated through the modified loss function in the improved CenterNet safety helmet wearing detection network model, and the parameters of the improved CenterNet safety helmet wearing detection network model are continuously optimized through the back propagation algorithm;

[0010] Step S4, the improved CenterNet safety helmet wearing detection network model index evaluation is carried out with the test set of the preprocessed safety helmet data set obtained in step S1, and the accuracy, recall rate and average precision are used for effect evaluation.

[0011] Step S5, using the improved CenterNet safety helmet wearing detection network model with the best average precision in step S4, the video data stream of the pan-tilt camera at the commanding height position is used as the input of the improved CenterNet safety helmet wearing detection network model to detect the safety helmet wearing under long-distance high depression angle and generate the detection frame of safety helmet wearing, and the detection frame of the head wearing safety helmet is marked as hat, and the detection frame of the head not wearing safety helmet is marked as person.

[0012] In an embodiment of the present application, in step S1, a safety helmet data set under long-distance high depression angle in an actual construction site is constructed and preprocessed, specifically: a safety helmet data set is obtained by using a pan-tilt camera at a commanding height position in an actual construction site to take safety helmet wearing images in a large range, the safety helmet data set is data enhanced through left and right random flipping, brightness adjustment, translation and cropping, then the safety helmet data set is divided into a training total set and a test set according to a proportion of 9:1, and then the training total set is divided into a training set and a validation set according to a proportion of 9:1, and the proportion allocation is randomly allocated through a random seed.

[0013] In an embodiment of the present application, in step S2, the improved CenterNet safety helmet wearing detection network model is obtained by improving the CenterNet network structure as the core, the improved CenterNet safety helmet wearing detection network model is introduced into the N2, N3 and N4 layers in the ResNet-50 backbone network, the STIEM module is used to replace the N1 layer in the ResNet-50 backbone network, the FFM module is introduced into the up-sampling network, the MDCM module is inserted between the up-sampling network and the prediction network, and the loss function during training is modified.

[0014] In an embodiment of the present application, the CS module is composed of a CA spatial attention mechanism module and a SE channel attention mechanism module in series, and the output feature layers after introducing the CS module into the N2, N3 and N4 feature layers in the ResNet-50 backbone network correspond to N2_1, N3_1 and N3_1 feature layers respectively.

[0015] In an embodiment of the present application, the STIEM module first changes the channel number of the feature layer of the input picture by 1x1 convolution kernel convolution, then processes the feature layer through three branches, the first branch is composed of 1x1 convolution kernel convolution and BN layer connected in sequence, the second branch is composed of 3x3 convolution kernel convolution and BN layer connected in sequence, and the third branch is to directly stack the feature layers processed through the three branches through the BN layer and then pass through the RELU activation function; then 3x3 convolution kernel convolution is used for feature layer down sampling; finally, the feature layer is output after being processed by the CS module.

[0016] In an embodiment of the present application, the FFM module takes the Ni_1 feature layer in the backbone network and the Pi feature layer in the up-sampling network as the input feature layer, where i respectively takes 2 and 3, changes the channel number of the Ni_1 feature layer to be equal to the channel number of the Pi feature layer through the CBR module of 1x1 convolution kernel, concatenates the two equal feature layers, then the concatenated feature layer is processed through the CBR module of 1x1 convolution kernel to reduce the channel number of the feature layer to half, and finally the feature layer is output as the P2_1 and P3_1 feature layers after being processed by the CS module.

[0017] In an embodiment of the present application, the MDCM module takes P2_1 as the input feature layer, then processes the feature layer through four branches, the first branch is 1x1 convolution kernel convolution, the second branch is 3x3 convolution kernel and the hollow convolution rate is 2n, the third branch is 3x3 convolution kernel and the hollow convolution rate is 5n, and the fourth branch is 3x3 convolution kernel and the hollow convolution rate is 10n, the feature layer after being concatenated through the three branches is processed through the CBR module of 1x1 convolution kernel to reduce the channel number of the feature layer to one fourth, then the feature layer output by the CBR module is added with the input feature layer P2_1 in residual, and finally the feature layer is output as P2_2 after being processed by the CS module.

[0018] In an embodiment of the present application, the CBR module is composed of Conv2d convolution, BN layer and RELU activation function.

[0019] In an embodiment of the present application, the loss function is divided into three parts:

[0020]

[0021]

[0022]

[0023] L=L k +λ1L off +λ2L eiouFormula four;

[0024] Wherein formula one represents a key point classification loss function, for solving the problem of unbalanced training samples, the real target key point is distributed to the heat map Y through a Gaussian function xyc ∈[0,1], the size is The heat map of the predicted target key point is represented, N represents the number of targets in the image, and alpha and beta are hyperparameters; Formula two represents a target center point loss function, The offset of the prediction result is represented, P represents the real coordinate position of the target in the original image, R represents the down-sampling multiple, The value of P after down-sampling R times is represented; Formula three represents a real target frame loss function, IOU represents the intersection over union of the real target frame and the predicted frame, rho is the Euclidean distance, and b represents the center point of the predicted frame; b gt The center point of the real target frame is represented; w represents the width of the predicted frame; w gt The width of the real target frame is represented; h represents the height of the predicted frame; h gt The height of the real target frame is represented; c represents the diagonal length of the minimum bounding box covering the predicted frame and the real target frame; C w The width of the minimum bounding box covering the predicted frame and the real target frame is represented; C h The height of the minimum bounding box covering the predicted frame and the real target frame is represented; Formula four represents the composition of the total loss function, wherein lambda1 and lambda2 are hyperparameters.

[0025] The above loss function is aimed at the problem of inaccurate regression prediction frame, the traditional CenterNet model loss function only converges the center, length and width of the predicted frame, without considering the convergence trend direction of the regression, the modified loss function introduces the minimum frame containing the predicted frame and the real target frame and highlights the position center weight, accelerates the convergence speed of the predicted frame to the real target frame in the back propagation, and makes the predicted frame center point more fitted with the real target frame center when the model predicts, improves the safety hat wearing detection precision of the improved CenterNet safety hat wearing detection network model under a long distance and a high depression angle.

[0026] The application also provides a safety hat wearing detection system for a long distance and a high depression angle, which comprises a memory, a processor and computer program instructions stored in the memory and capable of being executed by the processor, and when the processor executes the computer program instructions, the method steps described above can be realized.

[0027] Compared with the prior art, the present application has the following beneficial effects: the present application proposes different modules to solve and alleviate the problems of safety helmet wearing detection under long-distance high depression angle, improves the safety helmet wearing detection precision of the improved CenterNet safety helmet wearing detection network model under long-distance high depression angle, constructs a safety helmet image dataset suitable for actual construction under long-distance high depression angle, and makes the improved CenterNet model tend to fit this kind of dataset, thereby solving the current safety helmet dataset demand under long-distance high depression angle. BRIEF DESCRIPTION OF DRAWINGS

[0028] Figure 1 is a structural diagram of an original CenterNet model;

[0029] Figure 2 is a structural diagram of an improved CenterNet safety helmet wearing detection network model of the present application;

[0030] Figure 3 is a structural diagram of a CS module of the present application;

[0031] Figure 4 is a structural diagram of a STIEM module of the present application;

[0032] Figure 5 is a structural diagram of a FFM module of the present application;

[0033] Figure 6 is a structural diagram of a MDCM module of the present application. DETAILED DESCRIPTION

[0034] The technical solutions of the present application will be described in detail below with reference to the accompanying drawings.

[0035] It should be noted that the following detailed description is exemplary and is intended to provide further explanation of the present application. Unless otherwise indicated, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application pertains.

[0036] It should be noted that the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, the singular form is intended to include the plural form unless the context clearly indicates otherwise, and it should also be understood that when the terms "comprise" and / or "include" are used in the specification, there is a presence of a feature, step, operation, device, component and / or combinations thereof.

[0037] The present embodiment discloses a safety helmet wearing detection method under long-distance high depression angle, which comprises the following steps:

[0038] Step S1, a safety helmet dataset under a long distance and a high angle of elevation of an actual construction site is constructed, specifically, a pan-tilt camera at a commanding point in an actual construction site scene is used to shoot safety helmet wearing images in a large range, data augmentation is performed on the safety helmet dataset by means of left-right random flipping, brightness adjustment, translation and cropping, then the safety helmet dataset is divided into a training total set and a test set according to a proportion of 9:1, and the training total set is divided into a training set and a verification set according to a proportion of 9:1, and the proportion allocation is randomly allocated through a random seed;

[0039] Step S2, an improved CenterNet safety helmet wearing detection network model is constructed Figure 1 is an original model, Figure 2 is an improved model of the application), the improved CenterNet safety helmet wearing detection network model is obtained by improving a CenterNet network structure as a core, the improved model introduces a CS module after N2, N3 and N4 layers in a ResNet-50 backbone network, replaces N1 layer in the ResNet-50 backbone network with an STIEM module, introduces an FFM module in an up-sampling network, inserts an MDCM module between the up-sampling network and a prediction network, and modifies a loss function during training;

[0040] Step S3, the training total set in the preprocessed data set obtained in step S1 is input into the improved CenterNet safety helmet wearing detection network model constructed in step S2 as a real result, sequentially passes through the backbone network, the up-sampling network and the prediction network in the improved CenterNet safety helmet wearing detection network model, and a prediction result of the safety helmet wearing image is obtained through forward propagation, a loss value between the prediction result and the actual result is calculated through the modified loss function, and the parameters of the network model are continuously optimized through a back propagation algorithm;

[0041] Step S4, the test set in the preprocessed data set obtained in step S1 is used to evaluate the improved CenterNet safety helmet wearing detection network model, and accuracy, recall rate and average precision are used to evaluate the effect.

[0042] Step S5, the model with the best average precision in step S4 is used, a video data stream of the pan-tilt camera at the commanding point is used as model input to detect safety helmet wearing under a long distance and a high angle of elevation and generate a detection frame of whether a safety helmet is worn, and a detection frame of a head wearing a safety helmet is marked as hat, and a detection frame of a head not wearing a safety helmet is marked as person.

[0043] In the embodiment, the CS module in step S2 is as follows Figure 3As shown, the output feature layer after the CS module is introduced after the N2, N3 and N4 feature layers in the ResNet-50 backbone network is composed of a series of CA spatial attention mechanism modules and SE channel attention mechanism modules, which corresponds to the N2_1, N3_1 and N3_1 feature layers in the improved CenterNet model, so that the backbone network pays more attention to the key position information and channel feature information of the safety helmet target when extracting feature information, and distinguishes the real target feature information of the safety helmet from some background information similar to the real target, thereby improving the safety helmet wearing detection precision of the improved CenterNet safety helmet wearing detection network model under long distance and high depression angle.

[0044] In this embodiment, the STIEM module in step S2 is as shown in the following table: Figure 4 As shown, the feature layer channel number of the input picture is changed by using a 1x1 convolution kernel convolution, and the relationship between the feature information is expanded; then three branch feature processing is performed, the first branch is composed of a 1x1 convolution kernel convolution and a BN layer connected in sequence, the second branch is composed of a 3x3 convolution kernel convolution and a BN layer connected in sequence, and the third branch is to directly stack the feature layers processed by the three branches through a BN layer and then pass through a RELU activation function, different convolution kernel multi-branch processing is beneficial to enrich the feature information of the safety helmet small target; then a 3x3 convolution kernel convolution is used for feature layer down sampling; finally, the feature layer is processed by the CS module, and the output feature layer in the improved CenterNet model structure diagram is N1_1, in order to solve the problem of insufficient extraction of key information of the safety helmet small target in the early stage of the backbone network, the traditional method is only to use a large convolution kernel or single convolution for down sampling, and the model does not fully extract the key information of the safety helmet small target in the early stage of network feature extraction, which leads to deviation in the prediction of the prediction network in the later stage, and the STIEM module solves the problem of insufficient extraction of key information of the safety helmet small target in the early stage of the backbone network, and improves the safety helmet wearing detection precision of the improved CenterNet safety helmet wearing detection network model under long distance and high depression angle.

[0045] In this embodiment, the FFM module in step S2 is as shown in the following table: Figure 5As shown, the Ni_1 feature layer in the backbone network and the Pi feature layer in the up-sampling network are taken as the input feature layer, where i respectively takes 2 and 3, the channel number of the Ni_1 feature layer is changed to be equal to the channel number of the Pi feature layer through the CBR module with a 1x1 convolution kernel, the two equivalent feature layers are spliced through Concat, and then the spliced feature layer is reduced to half of the feature layer channel number through the CBR module with a 1x1 convolution kernel, the CBR module is composed of a Conv2d convolution, a BN layer and a RELU activation function; finally, the feature layer is processed through the CS module to output the P2_1 and P3_1 feature layers, the FFM module is mainly designed for the occlusion problem of the safety helmet small target, the occlusion problem of the safety helmet small target is effectively alleviated by fusing the lower down-sampling feature map containing more edge information of the occluded target, and the safety helmet wearing detection precision of the improved CenterNet safety helmet wearing detection network model under a long distance and a high angle of depression is improved.

[0046] In the present embodiment, the MDCM module in step S2 is as shown in the formula one. Figure 6 As shown, P2_1 is the input feature layer, then the feature layer is processed through four branches, the first branch is a 1x1 convolution kernel convolution, the second branch is a 3x3 convolution kernel and a hollow convolution with a hollow convolution rate of 2n, the third branch is a 3x3 convolution kernel and a hollow convolution with a hollow convolution rate of 5n, and the fourth branch is a 3x3 convolution kernel and a hollow convolution with a hollow convolution rate of 10n, the feature layer after splicing the feature layers processed through the three branches is reduced to one fourth of the feature layer channel number through the CBR module with a 1x1 convolution kernel, then the feature layer output by the CBR module is added to the residual of the P2_1 input feature layer, and finally the feature layer after processed through the CS module is output as P2_2, and the n value is taken as 1 in the present embodiment, the MDCM module effectively utilizes the surrounding environment information to locate and identify the target, reduces the dependence of the model on the safety helmet shape, and improves the safety helmet wearing detection precision of the improved CenterNet safety helmet wearing detection network model under a long distance and a high angle of depression.

[0047] In the present embodiment, the modified loss function in step S3 is divided into three parts:

[0048]

[0049]

[0050]

[0051] L = L k + λ1L off + λ2L eiou Formula four;

[0052] wherein formula one represents a key point classification loss function, used to solve the problem of unbalanced training samples, and the real target key point is distributed to the heat map Y through a Gaussian function xyc ∈[0,1], the size of which is represents a heat map of the predicted target key point, N represents the number of targets in the image, and a and β are hyperparameters; formula two represents a target center point loss function, represents the offset of the prediction result, P represents the real coordinate position of the target in the original image, and R represents the down-sampling multiple, represents the integer value of P after down-sampling R times; formula three represents a real target frame loss function, IOU represents the intersection over union of the real target frame and the predicted frame, ρ is the Euclidean distance, and b represents the center point of the predicted frame; b gt represents the center point of the real target frame; w represents the width of the predicted frame; w gt represents the width of the real target frame; h represents the height of the predicted frame; h gt represents the height of the real target frame; c represents the diagonal length of the minimum bounding box covering the predicted frame and the real target frame; C w represents the width of the minimum bounding box covering the predicted frame and the real target frame; C h represents the height of the minimum bounding box covering the predicted frame and the real target frame. Formula four represents the composition of the total loss function, wherein λ1 and λ2 are hyperparameters, in this embodiment, a is 2, β is 4, λ1 is 0.2, and λ2 is 1.5.

[0053] The above loss function is aimed at the problem of inaccurate regression of the predicted frame. The traditional CenterNet model loss function only converges the center, length, and width of the predicted frame, without considering the convergence trend direction. The modified loss function introduces the minimum frame containing the predicted frame and the real target frame and highlights the position center weight, accelerates the convergence speed of the predicted frame to the real target frame in the back propagation, and makes the predicted frame center point more fitted to the real target frame center when the model is predicted, thereby improving the safety hat wearing detection precision of the improved CenterNet safety hat wearing detection network model under a long distance and high pitch angle.

[0054] Those skilled in the art will appreciate that embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage, etc.) containing computer-usable program code.

[0055] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.

[0056] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.

[0057] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.

[0058] The above description is only preferred embodiments of the present application, and is not intended to limit the present application to other forms described above. Any person skilled in the art can make modifications or improvements to the above-mentioned disclosed technical content without departing from the technical scope of the present application. However, any simple modification, equivalent change and modification of the above-mentioned embodiments without departing from the technical content of the present application, according to the technical essence of the present application, still belongs to the protection scope of the present application.

Claims

1. A method for detecting helmet wearing at long distances and high elevation angles, characterized in that, Includes the following steps: Step S1: Construct a dataset of safety helmets from a long distance at a high angle of elevation on an actual construction site, and preprocess it; Step S2: Construct an improved CenterNet helmet-wearing detection network model; Step S3: The preprocessed helmet dataset obtained in Step S1 is used as the training set as the real result and input into the improved CenterNet helmet wearing detection network model constructed in Step S2. The model is then passed through the backbone network, upsampling network, and prediction network in the improved CenterNet helmet wearing detection network model in sequence to obtain the prediction result of the helmet wearing image through forward propagation. The loss value between the prediction result and the actual result is calculated through the modified loss function in the improved CenterNet helmet wearing detection network model. The parameters of the improved CenterNet helmet wearing detection network model are continuously optimized through the backpropagation algorithm. Step S4: Use the preprocessed helmet dataset obtained in step S1 to centralize the test set and evaluate the performance of the improved CenterNet helmet wearing detection network model. The performance is evaluated using accuracy, recall, and mean precision. Step S5: Using the improved CenterNet helmet wearing detection network model with the best average accuracy from step S4, the video data stream from the PTZ camera at a high vantage point is used as the input to the improved CenterNet helmet wearing detection network model to perform helmet wearing detection at a long distance and high angle of attack and generate detection boxes for whether a helmet is worn or not. If the detection box for a head wearing a helmet is marked as "hat", the detection box for a head not wearing a helmet is marked as "person". In step S2, the improved CenterNet helmet-wearing detection network model is obtained by improving the CenterNet network structure. The improved CenterNet helmet-wearing detection network model introduces a CS module after layers N2, N3, and N4 in the ResNet-50 backbone network, replaces layer N1 in the ResNet-50 backbone network with the STIEM module, introduces an FFM module in the upsampling network, inserts an MDCM module between the upsampling network and the prediction network, and modifies the loss function during training. The CS module is composed of a CA spatial attention mechanism module and an SE channel attention mechanism module connected in series. The output feature layers after introducing the CS module after the N2, N3, and N4 feature layers in the ResNet-50 backbone network are N2_1, N3_1, and N3_1 feature layers, respectively.

2. The method for detecting helmet wearing at a high angle of attack from a long distance, as described in claim 1, is characterized in that... In step S1, a safety helmet dataset is constructed from a long distance and high angle at the actual construction site, and preprocessed. Specifically, a large-scale image of safety helmets being worn is captured using a PTZ camera located at a high point in the actual construction site scene to obtain the safety helmet dataset. The dataset is augmented by randomly flipping left and right, adjusting brightness, translating, and cropping. Then, the safety helmet dataset is divided into a training set and a test set in a ratio of 9:

1. The training set is then divided into a training set and a validation set in a ratio of 9:

1. The ratio is randomly assigned using a random seed.

3. The method for detecting helmet wearing at long distances and high elevation angles according to claim 1, characterized in that, The STIEM module first uses a 1×1 convolution kernel to change the number of feature layer channels in the input image. Then, it processes features through three branches. The first branch consists of a 1×1 convolution kernel and a BN layer connected in sequence. The second branch consists of a 3×3 convolution kernel and a BN layer connected in sequence. The third branch passes through the BN layer. The feature layers processed by the three branches are then directly superimposed and activated by the ReLU function. Finally, a 3×3 convolution kernel is used to downsample the feature layers. Finally, the feature layer is processed by the CS module and output as N1_1.

4. The method for detecting helmet wearing at long distances and high elevation angles according to claim 1, characterized in that, The FFM module takes the Ni_1 feature layer in the backbone network and the Pi feature layer in the upsampling network as input feature layers, where i is 2 and 3 respectively. The CBR module with a 1×1 convolution kernel changes the number of channels of the Ni_1 feature layer to be equal to the number of channels of the Pi feature layer. The two equivalent feature layers are concatenated. Then, the concatenated feature layer is passed through the CBR module with a 1×1 convolution kernel to reduce the number of channels of its feature layer to half. Finally, the feature layer is processed by the CS module to output feature layers P2_1 and P3_1 respectively.

5. The method for detecting helmet wearing at long distances and high elevation angles according to claim 4, characterized in that, The MDCM module takes P2_1 as its input feature layer, and then processes it through four branches. The first branch is a 1×1 convolution kernel convolution, the second branch is a 3×3 convolution kernel and a dilated convolution with a dilation rate of 2n, the third branch is a 3×3 convolution kernel and a dilated convolution with a dilation rate of 5n, and the fourth branch is a 3×3 convolution kernel and a dilated convolution with a dilation rate of 10n. The feature layer processed by the three branches is concatted and then passed through the CBR module with a 1×1 convolution kernel to reduce the number of feature layer channels to one-quarter. Then, the feature layer output by the CBR module is added to the residual of the input feature layer P2_1. Finally, the feature layer is processed by the CS module and output as feature layer P2_2.

6. A method for detecting helmet wearing at long distances and high elevation angles, as described in claim 4 or 5, characterized in that... The CBR module consists of Conv2d convolution, BN layer, and ReLU activation function.

7. The method for detecting helmet wearing at a high angle of attack from a long distance, as described in claim 1, is characterized in that... The loss function consists of three parts: L = L k +λ1L off +λ2L eiou Formula 4; Formula 1 represents the keypoint classification loss function, used to address the imbalance problem in training samples. The true target keypoints are distributed onto the heatmap Y using a Gaussian function. xyc ∈[0,1], its size is The first part represents a heatmap showing the key points of the predicted target, where N represents the number of targets in the image, and α and β are hyperparameters; Formula 2 represents the target center point loss function. The offset of the prediction result is represented by P, where P represents the true coordinates of the target in the original image, and R represents the downsampling factor. This represents the integer value of P after being downsampled by a factor of R; Formula 3 represents the true bounding box loss function, IOU represents the intersection-union ratio of the true bounding box and the predicted bounding box, ρ is the Euclidean distance, and b represents the center point of the predicted bounding box; b gt w represents the center point of the ground truth bounding box; w represents the width of the predicted bounding box; w gt h represents the width of the ground truth bounding box; h represents the height of the predicted bounding box; h gt represents the height of the ground truth bounding box; c represents the diagonal length of the smallest bounding box that covers both the predicted and ground truth bounding boxes; C w C represents the width of the smallest bounding box that covers both the predicted bounding box and the ground truth bounding box; h λ1 represents the height of the minimum bounding box that covers both the predicted bounding box and the ground truth bounding box; Equation 4 represents the composition of the total loss function, where λ1 and λ2 are hyperparameters.

8. A helmet-wearing detection system for use at long distances and high elevation angles, characterized in that, It includes a memory, a processor, and computer program instructions stored in the memory and executable by the processor, which, when executed by the processor, enable the implementation of the steps of the method as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Safety helmet wearing detection method suitable for long-distance high depression angle

    CN115131724A

  • High-density pedestrian head real-time tracking algorithm based on deep learning

    CN116959023A