A fast and stable method for detecting hard hats at construction sites

By introducing a multi-scale weighted feature fusion network and position information matching algorithm into the PAA model, combined with FaceNet face recognition, the problem of slow speed of traditional hard hat detection methods is solved, and fast and stable hard hat detection on construction sites is achieved, meeting the real-time requirements requirements for accuracy and accuracy.

CN114202770BActive Publication Date: 2024-09-06NANJING YUNNIU INTELLIGENT TECH CO LTD +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202111307644.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-05
Publication Date
2024-09-06
Estimated Expiration
2041-11-05

AI Technical Summary

Technical Problem

Traditional hard hat detection methods are difficult to achieve fast detection speed while maintaining detection accuracy. In particular, large and complex networks require a large amount of computing power support and cannot meet the needs of real-time detection on construction sites.

Method used

Introduce a multi-scale weighted feature fusion network into the PAA model, reduce calculation parameters and calculation volume through ResNet feature extraction and multi-scale weighted feature fusion, and design a matching algorithm for the location information of helmets and construction workers, combined with the FaceNet face recognition network for real-time detection.

Benefits of technology

The detection speed is significantly improved while maintaining high accuracy, meeting the real-time and accuracy requirements of the construction site, and the detection accuracy and robustness are also improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114202770B
    Figure CN114202770B
Patent Text Reader

Abstract

The present invention discloses a fast and stable method for detecting hard hats at construction sites, including: extracting frames from the collected monitoring videos of hard hats and construction personnel at the construction sites, marking the hard hats and construction personnel respectively, expanding the sample set, and obtaining PAA model training samples; inputting the face pictures of construction personnel as face recognition data sets, obtaining face detection and recognition network training samples, and normalizing the training samples to a specified size; establishing an improved PAA model and training it to obtain an improved PAA model after training; designing a matching algorithm for the detection position information of hard hats and construction personnel, marking personnel who are not wearing hard hats; and outputting the construction personnel information through FaceNet face recognition network recognition. The present invention can reduce calculation parameters and calculation amount, significantly improve the detection speed while maintaining the detection accuracy, and meet the real-time and accuracy requirements of hard hat detection at construction sites.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to target detection technology in image processing, and in particular to a fast and stable construction site safety helmet detection method. Background Art

[0002] Safety helmet detection has attracted the research interest of many scholars due to the complex environment, camera shooting angle, and the distance between the camera and the target. Traditional target detection methods are widely used in the field of safety helmet detection, for example: using skin color detection to locate the face area, using the Hu matrix as the feature vector of the image, and using the support vector machine (SVM) as a classifier to identify the safety helmet; selecting SIFT corner point features and color statistical features for safety helmet detection; detecting the human body through HOG feature extraction, and then using the color histogram to identify the safety helmet. Although the above methods can meet the requirements of good accuracy, the traditional detection algorithms have problems such as difficulty in feature extraction and poor generalization ability, and further improvement is needed. In recent years, with the development of artificial intelligence, especially the rapid development of neural networks in recent years, using deep learning for safety helmet detection to replace cumbersome manual detection is becoming the mainstream development direction. It has the advantages of automation and efficiency, which can greatly reduce labor costs, and can accurately, comprehensively, and without blind spots supervise the construction personnel in the site. At the same time, with the maturity of face recognition technology, face recognition can be performed while identifying safety helmets, the identity information of people who are not wearing them can be recorded, and the warning information can be delivered to the right people.

[0003] Many algorithms have emerged from the research on applying deep learning methods to helmet detection, such as directly using Fast-RCNN for helmet detection, with an accuracy of 81.2%; using the improved GIoU calculation method combined with YOLOv3 for helmet detection, an accuracy of 85% can be obtained; by adding feature pyramids to YOLOv3 for multi-scale feature extraction, feature maps of different scales can be obtained to achieve a helmet detection performance with an accuracy of 88%, etc. Although the networks used above can realize automatic detection of helmets with high accuracy, the above networks are large and complex networks with long operation time and sufficient computing power support, and cannot maintain detection accuracy while having a fast detection speed.

[0004] PAA (Probabilistic Anchor Assignment) is an object detection network proposed by XL8 & Qualcomm (Korea) and published in the ECCV 2020 journal. The paper focuses on the anchor allocation problem in object detection. As we all know, the anchor allocation strategy is a very important link, which often determines subsequent operations such as bounding box regression, and thus affects the final performance of the model. PAA inherits the ideas of FCOS and ATSS. The ATSS model can predict the centrality score and select the appropriate anchor as the positive sample by adaptively selecting the score. PAA is further improved on this basis. The model is based on the Gaussian mixture model and proposes to regard the anchor score as a probability. At the same time, the evaluation index of anchor quality is composed of classification score, prediction box positioning score and model parameters. The official experimental results show that after adopting the new allocation strategy, the model reaches state-of-the-art on the COCO dataset, achieving the best performance at the time. Summary of the invention

[0005] Purpose of the invention: The purpose of the present invention is to provide a fast and stable method for detecting safety helmets on construction sites. A multi-scale weighted feature fusion network is proposed in the PAA model to enhance the learning ability of the PAA model, reduce calculation parameters and amount of calculation, and significantly improve the detection speed while maintaining detection accuracy.

[0006] Technical solution: A fast and stable construction site safety helmet detection method of the present invention comprises the following steps:

[0007] S1. Collect monitoring videos of safety helmets and construction workers at different time periods, angles and scales at the construction site;

[0008] S2. Extract frames from the surveillance video to obtain a set of pictures, and annotate the helmets and construction workers in each picture. Then, add the annotated helmet and construction worker pictures and annotation files to the SHWD public helmet dataset and the Fudan public pedestrian dataset for dataset expansion to obtain PAA model training samples.

[0009] S3, using the vggface2 dataset as the face detection dataset, entering the face pictures of the construction workers as the face recognition dataset, obtaining the FaceNet face recognition network training samples, and normalizing them; then using the normalized FaceNet face recognition network training samples to train the FaceNet face recognition network;

[0010] S4, establishing an improved PAA model, and training the improved PAA model based on the PAA model training samples;

[0011] S5. Use the trained improved PAA model to detect the image to be detected, and obtain the detection frames of the safety helmet and the construction worker;

[0012] S6. Design an algorithm for matching the position information of the helmet and the construction worker, and match the position information of the helmet and the construction worker detection frame obtained in step S5 one by one. If there is no match, mark it as a person not wearing a helmet and input it into the FaceNet face recognition network;

[0013] S7. Use the FaceNet facial recognition network to detect and identify the faces of construction workers who are not wearing helmets, obtain the facial position information of the construction workers, and match it with the position information in the construction worker detection frame. After the matching is completed, the information of the construction workers is recorded.

[0014] Furthermore, step S2 is specifically as follows: extract frames from the surveillance video at a set frequency and save them as a group of pictures; select all the safety helmets in the picture with a labeling box and mark them as safetyhat, select all the construction workers in the picture with a labeling box and mark them as people, and mark the obtained pictures containing safety helmets and / or construction worker labeling boxes in VOC format, generate a corresponding xml file, the xml file contains information about the pictures and labeling boxes, and then add the labeled safety helmets and construction worker pictures and the corresponding xml files to the SHWD public safety helmet dataset and the Fudan public pedestrian dataset for dataset expansion to obtain PAA model training samples.

[0015] Furthermore, normalizing the FaceNet face recognition network training samples in step S3 refers to normalizing the images in the FaceNet face recognition network training samples to a set size according to the image resolution size.

[0016] Furthermore, the establishment and training method of the improved PAA model in step S4 is:

[0017] S41, after the PAA model training samples are passed through the ResNet feature extraction network in the original PAA model to obtain feature maps of three scales, the feature map with the smallest scale is downsampled twice to obtain feature maps of five scales in total;

[0018] S42, establishing a multi-scale weighted feature fusion network, and fusing the obtained feature maps of five scales;

[0019] S43. By comparing the safety helmets, construction worker positions and classification results obtained by the prediction network with the labeled information, the error is determined, the model performance is continuously improved, and the optimal model parameters are saved, thus completing the training of the improved PAA model.

[0020] Furthermore, step S42 is specifically as follows:

[0021] S421, arranging the obtained five scale feature maps from small to large scale, and sequentially calling them the first scale feature map, the second scale feature map, the third scale feature map, the fourth scale feature map and the fifth scale feature map, that is, the feature map with the smallest scale is called the first scale feature map, and the feature map with the largest scale is called the fifth scale feature map;

[0022] The first scale input feature map and the second scale output feature map are fused to obtain the first scale output feature map. The specific calculation formula is:

[0023]

[0024] in, is the first scale input feature map, is the first scale output feature map, is the second scale output feature map, downsampling() is the downsampling operation, ω 11 With ω 12 is the feature fusion parameter; Conv is the channel fusion operation;

[0025] S422: First, calculate the second-scale intermediate feature map for the output of the second-scale feature map. The second-scale intermediate feature map is formed by merging the first-scale input feature map and the second-scale input feature map. The specific calculation formula of the second-scale output feature map is:

[0026]

[0027] in, is the second scale intermediate feature map, is the second scale input feature map, ω 21 With ω 22 is the feature fusion parameter, which is obtained by training the improved PAA model. The second-scale output feature map is fused by the second-scale intermediate feature map, the second-scale input feature map, the first-scale input feature map and the third-scale output feature map. The specific calculation formula is:

[0028]

[0029] in, is the second scale output feature map, is the third scale output feature map, upsampling() is the upsampling operation, ω′ 21 ,ω′ 22 ,ω′ 23 and ω′ 24 is the feature fusion parameter;

[0030] S423, the processing of the third scale feature map and the fourth scale feature map is similar, and the intermediate feature map is formed by merging the input feature map of this scale with the intermediate feature map of the previous scale. The specific calculation formula is:

[0031]

[0032] in, is the intermediate feature map of this scale, Input feature map for this scale, is the intermediate feature map of the previous scale, ω1, ω i2 is the feature fusion parameter. The output feature map of this scale is fused by the intermediate feature map of this scale, the input feature map of this scale, the input feature map of the previous scale and the output feature map of the next scale. The specific formula is:

[0033]

[0034] in, Output feature map for this scale, Input feature map for this scale, is the intermediate feature map of this scale, Input feature map for the previous scale, Output feature map for the next scale, ω′ i1 ,ω′ i2 ,ω′ i3 and ω′ i4 is the feature fusion parameter;

[0035] S424, calculating a fifth scale output feature map;

[0036] The fifth-scale intermediate feature map is formed by merging the input feature map of this scale with the fourth-scale intermediate feature map. The specific formula is:

[0037]

[0038] in, is the fifth scale intermediate feature map, Input feature map for the fourth scale, is the fourth scale intermediate feature map, ω 51 With ω 52 is the feature fusion parameter; the fifth-scale output feature map is fused by the fifth-scale intermediate feature map, the fifth-scale input feature map and the fourth-scale input feature map; the specific calculation formula is:

[0039]

[0040] in, Input feature map for the fifth scale, ω′ 51 ,ω′ 52and ω′ 53 is the feature fusion parameter;

[0041] S425: Use the first to fifth scale output feature maps obtained as the input feature maps of the next process, and repeat steps S421 to S425 for multiple times until the detection accuracy of the improved PAA model reaches the optimal value, then stop the loop.

[0042] Further, step S6 specifically includes: designing a matching algorithm for the safety helmet and the construction worker position information, and matching the safety helmet and the construction worker detection frame obtained in step S5 one by one; the matching algorithm specifically includes:

[0043] The IoG of the helmet detection frame hel and the pedestrian detection frame per is greater than 0.5. Assume that the distance between the bottom of the helmet detection frame and the top of the construction worker prediction frame is H hel-p , the height of the helmet detection frame is H hel , the height of the construction worker detection frame is H p ,Require The left and right sides of the safety helmet detection frame are located within the left and right boundaries of the construction worker detection frame;

[0044] If the matching algorithm is satisfied, the next construction worker and helmet location information are matched;

[0045] If the matching algorithm is not satisfied, the construction worker is marked as not wearing a helmet, and the next construction worker and helmet location information are matched;

[0046] Until all construction workers are matched.

[0047] Furthermore, the method for matching the position information in the construction worker detection frame in step S7 is: if the position of the face detection frame of the construction worker who is not wearing a safety helmet is located in the construction worker detection frame, the identity of the construction worker is recorded.

[0048] Beneficial effects: Compared with the prior art, the present invention proposes a multi-scale weighted feature fusion network in the PAA model to enhance the learning ability of the PAA model, reduce calculation parameters and calculation amount, and significantly improve the detection speed while maintaining detection accuracy; a position matching algorithm is designed for the position information of safety helmets and construction workers, and construction workers who do not meet the matching algorithm are marked as not wearing safety helmets and face recognition is performed through the FaceNet face recognition network and identity information is recorded in real time in the background. The position matching algorithm has a certain robustness to changes in the height of construction workers, and can match safety helmets well when the construction workers are standing or squatting and other height changes. At the same time, it also has a certain effect on improving the detection accuracy of small targets. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 is a flow chart of the method of the present invention;

[0050] Figure 2 This is a structural diagram of the improved PAA model of the present invention. DETAILED DESCRIPTION

[0051] The present invention is further described below in conjunction with specific implementations and drawings. The following description is only a specific implementation of the present invention, but the protection scope of the present invention is not limited thereto. Any person familiar with the technology can understand that any change or replacement that can be thought of within the technical scope disclosed by the present invention should be included in the scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

[0052] like Figure 1 As shown, a fast and stable construction site helmet detection method of the present invention first passes the PAA model training sample through the ResNet feature extraction network to obtain five feature maps of different scales, then fuses the five feature maps through the proposed multi-scale weighted feature fusion network, and finally obtains the detection results of the helmet and the construction personnel through the prediction network, and then determines whether the construction personnel are wearing helmets through the designed position matching algorithm. After the construction personnel who are not wearing helmets are detected, they are input into the FaceNet face recognition network trained by the FaceNet face recognition network training samples to obtain the identity information of the construction personnel who are not wearing helmets. Specifically, it includes the following steps:

[0053] S1. Collect monitoring videos of safety helmets and construction workers at different time periods, angles and scales at the construction site.

[0054] S2. Extract frames from the surveillance video to obtain a set of pictures, and annotate the helmets and construction workers in each picture. Then, add the annotated helmet and construction worker pictures and annotation files to the SHWD public helmet dataset and the Fudan public pedestrian dataset for dataset expansion to obtain PAA model training samples.

[0055] Specifically: Using Python programming program, first use the built-in function VideoCapture() of OpenCV to read the surveillance video, and then save the video in jpg format by setting the frequency of extracting one frame every 0.5s; and mark the safety helmets and construction workers separately, using the LabelImg image annotation tool, select all the safety helmets in the picture with annotation boxes, and mark them as safetyhat, select the construction workers in the picture with annotation boxes, and mark them as people, and the obtained picture will contain safety helmet and / or construction worker annotation boxes; use the LabelImg image annotation tool to annotate the pictures containing safety helmet and / or construction worker annotation boxes into VOC format, and generate the corresponding xml file, wherein the xml file contains the information of the picture and the annotation box, and then add the annotated safety helmet and construction worker pictures and the corresponding xml files to the SHWD public safety helmet dataset and the Fudan public pedestrian dataset respectively to expand the dataset and obtain the PAA model training samples.

[0056] S3. Use the vggface2 dataset as the face recognition dataset, input the face pictures of the construction workers as the face recognition dataset, obtain the FaceNet face recognition network training samples, and normalize them; then use the normalized FaceNet face recognition network training samples to train the FaceNet face recognition network.

[0057] Specifically, the resize() function in OpenCV is used to normalize the FaceNet face recognition network training samples to the specified scale, that is, the image is read first, and the image is normalized to a size of 190×170 by using the image resolution conversion function in the resize() function.

[0058] S4. Establish an improved PAA model, and train the improved PAA model based on the PAA model training samples to obtain the trained improved PAA model.

[0059] The improved PAA model proposes a multi-scale weighted feature fusion network in the original PAA model. Its structural diagram is shown in the figure. Figure 2 As shown in the figure, it introduces bidirectional cross-scale connections and weighted feature fusion to balance feature information of different scales while reducing the amount of computation.

[0060] The establishment and training methods of the improved PAA model are as follows:

[0061] S41. After the PAA model training samples are passed through the ResNet feature extraction network in the original PAA model to obtain feature maps of three scales, the feature map with the smallest scale is downsampled twice to obtain feature maps of five scales in total.

[0062] S42, establishing a multi-scale weighted feature fusion network, and fusing the obtained feature maps of five scales; specifically:

[0063] S421, arranging the obtained five scale feature maps from small to large scale, and sequentially calling them the first scale feature map, the second scale feature map, the third scale feature map, the fourth scale feature map and the fifth scale feature map, that is, the feature map with the smallest scale is called the first scale feature map, and the feature map with the largest scale is called the fifth scale feature map;

[0064] Combine the first scale feature map with the second scale output feature map Fusion is performed to obtain the first scale output feature map. The specific calculation formula is:

[0065]

[0066] in, is the first scale input feature map, is the first scale output feature map, is the second scale output feature map, downsampling() is the downsampling operation, ω 11 With ω 12 is the feature fusion parameter obtained by training the improved PAA model; Conv is the channel fusion operation, using 1×1 convolution;

[0067] S422: For the output of the second-scale feature map (i.e., the second-scale output feature map), a second-scale intermediate feature map is first calculated. The second-scale intermediate feature map is formed by merging the first-scale input feature map and the second-scale input feature map. The specific calculation formula is:

[0068]

[0069] in, is the second scale intermediate feature map, is the second scale input feature map, ω 21 With ω 22 is the feature fusion parameter, which is obtained by training the improved PAA model. The second-scale output feature map is fused by the second-scale intermediate feature map, the second-scale input feature map, the first-scale input feature map and the third-scale output feature map. The specific calculation formula is:

[0070]

[0071] in, is the second scale output feature map, is the third scale output feature map, upsampling() is the upsampling operation, ω′ 21 ,ω′ 22 ,ω′23 and ω′ 24 is the feature fusion parameter obtained by training the improved PAA model, Conv is the channel fusion operation, using 1×1 convolution;

[0072] S423, the processing of the third scale feature map and the fourth scale feature map is similar, and the intermediate feature map is formed by merging the input feature map of this scale with the intermediate feature map of the previous scale. The specific calculation formula is:

[0073]

[0074] in, is the intermediate feature map of this scale, Input feature map for this scale, is the intermediate feature map of the previous scale, ω i1 ,ω i2 is the feature fusion parameter, which is obtained by training the improved PAA model. The output feature map of this scale is fused by the intermediate feature map of this scale, the input feature map of this scale, the input feature map of the previous scale and the output feature map of the next scale. The specific formula is:

[0075]

[0076] in, Output feature map for this scale, Input feature map for this scale, is the intermediate feature map of this scale, Input feature map for the previous scale, Output feature map for the next scale, ω′ i1 ,ω′ i2 ,ω i3 and ω′ i4 is the feature fusion parameter obtained by training the improved PAA model, Conv is the channel fusion operation, using 1×1 convolution;

[0077] S424, calculating a fifth scale output feature map;

[0078] The fifth-scale intermediate feature map is formed by merging the input feature map of this scale with the fourth-scale intermediate feature map. The specific formula is:

[0079]

[0080] in, is the fifth scale intermediate feature map, Input feature map for the fourth scale, is the fourth scale intermediate feature map, ω 51 With ω 52is the feature fusion parameter obtained by training the improved PAA model. The fifth-scale output feature map is fused by the fifth-scale intermediate feature map, the fifth-scale input feature map, and the fourth-scale input feature map. The specific calculation formula is:

[0081]

[0082] in, Input feature map for the fifth scale, ω′ 51 ,ω′ 52 and ω′ 53 is the feature fusion parameter obtained by training the improved PAA model, Conv is the channel fusion operation, using 1×1 convolution;

[0083] S425: The first to fifth scale output feature maps are used as the input feature maps of the next process, and the processes S421 to S425 are repeated multiple times. The errors are determined by comparing the predicted positions of the helmets and construction workers and the classification results with the labeled information, and the model performance is continuously improved until the detection accuracy of the improved PAA model reaches the optimal value. The cycle is stopped and the final parameters are saved as the trained improved PAA model.

[0084] S5. Use the trained improved PAA model to detect the image to be detected and obtain the detection frames of the safety helmet and the construction worker.

[0085] S6: Design an algorithm for matching the safety helmet and the position information of the construction workers, and match the safety helmet obtained in step S5 with the position information in the construction worker detection frame one by one. If there is no match, mark it as a person not wearing a safety helmet and input it into the FaceNet face recognition network.

[0086] The safety helmet and construction worker position information matching algorithm is used to match the safety helmet and construction worker detection frames obtained in step S5 one by one; the matching algorithm is specifically as follows:

[0087] The IoG of the helmet detection frame hel and the pedestrian detection frame per is greater than 0.5. Assume that the distance between the bottom of the helmet detection frame and the top of the construction worker prediction frame is H hel-p , the height of the helmet detection frame is H hel , the height of the construction worker detection frame is H p ,Require The left and right sides of the safety helmet detection frame are located within the left and right boundaries of the construction worker detection frame;

[0088] If the matching algorithm is satisfied, the next construction worker and helmet location information are matched;

[0089] If the matching algorithm is not satisfied, the construction worker is marked as not wearing a helmet, and the next construction worker and helmet location information are matched;

[0090] Until all construction workers are matched.

[0091] S7: Use the FaceNet facial recognition network to detect and identify the faces of construction workers who are not wearing helmets, obtain the facial position information of the construction workers, and match it with the position information in the construction worker detection frame. After the matching is completed, the information of the construction workers is recorded.

[0092] The invention proposes a fast and stable construction site helmet detection method, which improves the original PAA model by adding a multi-scale weighted feature fusion network. The method is as follows: using a GPU (Nvidia Tesla T4 graphics card), firstly, the labeled helmet and construction personnel data sets are added to the SHWD public helmet data set and the Fudan public pedestrian data set respectively, to obtain the PAA model training sample, and the PAA model training sample is input into the ResNet50 network for feature extraction to obtain the initial three feature maps at different scales, and then the feature maps are fused by the proposed multi-scale weighted feature fusion network, and finally the helmet and construction personnel detection results are obtained, including the classification results and location information of the helmet and construction personnel. The loss function is the difference between the predicted helmet and construction personnel and the information annotated in the PAA training sample. The loss function is reduced by continuous training of the neural network to improve the detection accuracy. After 50 rounds of training, the detection accuracy is the highest, so the training is stopped, and the final model parameters are saved as the helmet and construction personnel detection model.

[0093] Table 1 shows the training parameters of the improved PAA model proposed in the present invention.

[0094] Table 1. Training parameters

[0095]

[0096] Table 2 shows the comparative experimental results of the improved PAA model proposed in the present invention.

[0097] Table 2 Comparative experiments of improved PAA model

[0098] Params FLOPs (floating point operations) mAP Frame rate PAA 3.828M 2.21G 0.896 6.8fps Improving PAA 2.825M 1.67G 0.905 10.4fps

[0099] It can be seen from Table 2 that the improved PAA model of the present invention has different degrees of improvement in accuracy and detection speed, with mAP of 90.5% and frame rate of 10.4fps.

[0100] In summary, the present invention adopts some advanced methods to improve the PAA model, while maintaining the detection accuracy, reducing the calculation parameters and the amount of calculation, and significantly improving the detection speed, meeting the real-time and accuracy requirements of the safety helmet detection at the construction site.

Claims

1. A fast and stable method for detecting safety helmets at construction sites, characterized in that: The following steps are involved: S1. Collect monitoring videos of safety helmets and construction workers at different time periods, angles and scales at the construction site; S2. Extract frames from the surveillance video to obtain a set of pictures, and annotate the helmets and construction workers in each picture. Then, add the annotated helmet and construction worker pictures and annotation files to the SHWD public helmet dataset and the Fudan public pedestrian dataset for dataset expansion to obtain PAA model training samples. S3, using the vggface2 dataset as the face detection dataset, entering the face pictures of the construction workers as the face recognition dataset, obtaining the FaceNet face recognition network training samples, and normalizing them; then using the normalized FaceNet face recognition network training samples to train the FaceNet face recognition network; S4. Establish an improved PAA model and train the improved PAA model based on the PAA model training samples; specifically: S41, after the PAA model training samples are passed through the ResNet feature extraction network in the original PAA model to obtain feature maps of three scales, the feature map with the smallest scale is downsampled twice to obtain feature maps of five scales in total; S42, establishing a multi-scale weighted feature fusion network, and fusing the obtained feature maps of five scales; specifically: S421, arranging the obtained five scale feature maps from small to large scale, and sequentially calling them the first scale feature map, the second scale feature map, the third scale feature map, the fourth scale feature map and the fifth scale feature map, that is, the feature map with the smallest scale is called the first scale feature map, and the feature map with the largest scale is called the fifth scale feature map; The first scale input feature map and the second scale output feature map are fused to obtain the first scale output feature map. The specific calculation formula is: in, is the first scale input feature map, is the first scale output feature map, is the second scale output feature map, downsampling() is the downsampling operation, ω 11 With ω 12 is the feature fusion parameter; Conv is the channel fusion operation; S422: First, calculate the second-scale intermediate feature map for the output of the second-scale feature map. The second-scale intermediate feature map is formed by merging the first-scale input feature map and the second-scale input feature map. The specific calculation formula of the second-scale output feature map is: in, is the second scale intermediate feature map, is the second scale input feature map, ω 21 With ω 22 is the feature fusion parameter, which is obtained by training the improved PAA model. The second-scale output feature map is fused by the second-scale intermediate feature map, the second-scale input feature map, the first-scale input feature map and the third-scale output feature map. The specific calculation formula is: in, is the second scale output feature map, is the third scale output feature map, upsampling() is the upsampling operation, ω′ 21 ,ω′ 22 ,ω′ 23 and ω′ 24 is the feature fusion parameter; S423, the processing of the third scale feature map and the fourth scale feature map is similar, and the intermediate feature map is formed by merging the input feature map of this scale with the intermediate feature map of the previous scale. The specific calculation formula is: in, is the intermediate feature map of this scale, Input feature map for this scale, is the intermediate feature map of the previous scale, ω i1 ,ω i2 is the feature fusion parameter. The output feature map of this scale is fused by the intermediate feature map of this scale, the input feature map of this scale, the input feature map of the previous scale and the output feature map of the next scale. The specific formula is: in, Output feature map for this scale, Input feature map for this scale, is the intermediate feature map of this scale, Input feature map for the previous scale, Output feature map for the next scale, ω′ i1 ,ω′ i2 ,ω′ i3 and ω′ i4 is the feature fusion parameter; S424, calculating a fifth scale output feature map; The fifth-scale intermediate feature map is formed by merging the input feature map of this scale with the fourth-scale intermediate feature map. The specific formula is: in, is the fifth scale intermediate feature map, Input feature map for the fourth scale, is the fourth scale intermediate feature map, ω 51 With ω 52 is the feature fusion parameter; the fifth-scale output feature map is fused by the fifth-scale intermediate feature map, the fifth-scale input feature map and the fourth-scale input feature map; the specific calculation formula is: in, Input feature map for the fifth scale, ω′ 51 ,ω′ 52 and ω′ 53 is the feature fusion parameter; S425: The obtained output feature maps of the first to fifth scales are used as the input feature maps of the next process, and the process from step S421 to step S425 is repeated multiple times until the detection accuracy of the improved PAA model reaches the optimal value, and then the loop is stopped; S43, by comparing the safety helmet, construction worker position and classification results obtained by the prediction network with the labeled information to determine the error, continuously improve the model performance, and save the optimal model parameters, that is, complete the training of the improved PAA model; S5. Use the trained improved PAA model to detect the image to be detected, and obtain the detection frames of the safety helmet and the construction worker; S6. Design a matching algorithm for the position information of the helmet and the construction personnel, and match the position information of the helmet and the construction personnel detection frame obtained in step S5 one by one. If there is no match, mark it as a person not wearing a helmet and input it into the FaceNet face recognition network; specifically: design a matching algorithm for the position information of the helmet and the construction personnel, and match the helmet and the construction personnel detection frame obtained in step S5 one by one; the matching algorithm is specifically: The IoG of the helmet detection frame hel and the pedestrian detection frame per is greater than 0.

5. Assume that the distance between the bottom of the helmet detection frame and the top of the construction worker prediction frame is H hel-p , the height of the helmet detection frame is H hel , the height of the construction worker detection frame is H p ,Require The left and right sides of the safety helmet detection frame are located within the left and right boundaries of the construction worker detection frame; If the matching algorithm is satisfied, the next construction worker and helmet location information are matched; If the matching algorithm is not satisfied, the construction worker is marked as not wearing a helmet, and the next construction worker and helmet location information are matched; Until all construction workers are matched; S7. Use the FaceNet facial recognition network to detect and identify the faces of construction workers who are not wearing helmets, obtain the facial position information of the construction workers, and match it with the position information in the construction worker detection frame. After the matching is completed, the information of the construction workers is recorded.

2. A fast and stable construction site safety helmet detection method according to claim 1, characterized in that: Step S2 is specifically as follows: extract frames from the surveillance video at a set frequency and save them as a group of pictures; select all the helmets in the picture with a labeling box and mark them as safetyhat, select all the construction workers in the picture with a labeling box and mark them as people, and mark the obtained pictures containing the safety helmet and / or construction worker labeling boxes in VOC format, generate the corresponding xml file, the xml file contains the information of the picture and the labeling box, and then add the labeled safety helmet and construction worker pictures and the corresponding xml files to the SHWD public safety helmet dataset and the Fudan public pedestrian dataset respectively to expand the dataset to obtain PAA model training samples.

3. A fast and stable construction site safety helmet detection method according to claim 1, characterized in that: Normalizing the FaceNet face recognition network training samples in step S3 refers to normalizing the images in the FaceNet face recognition network training samples to a set size according to the image resolution size.

4. A fast and stable construction site safety helmet detection method according to claim 1, characterized in that: The method for matching the position information in the construction worker detection frame in step S7 is: if the face detection frame position of the construction worker who is not wearing a safety helmet is located in the construction worker detection frame, the identity of the construction worker is recorded.

Citation Information

Patent Citations

  • Construction safety helmet wearing monitoring method based on computer vision human body posture estimation

    CN110502965A

  • Construction worker identity recognition and safety helmet wearing detection method and system

    CN111598040A

  • Rapid face detection and recognition method for DSP platform

    CN112749626A

  • Multi-scale aware pedestrian detection method based on improved full convolutional network

    US20210056351A1