A method and apparatus for detecting a safety helmet wearing
By using a detection model trained on sample images on offshore drilling platforms, extracting and fusing features of safety helmets and human bodies, the problem of inaccurate detection of safety helmet wearing on offshore drilling platforms was solved, and accurate detection was achieved in monochromatic environments.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CNOOC GAS & POWER GRP
- Filing Date
- 2023-08-16
- Publication Date
- 2026-06-02
AI Technical Summary
In existing technologies, the results of helmet wearing detection on offshore drilling platforms are inaccurate, especially in monochromatic environments where it is difficult to accurately identify whether someone is not wearing a helmet.
A detection model trained on sample images is adopted. The helmet image feature extraction unit and the human body image feature extraction unit extract the helmet and human body features in the surveillance video respectively. The features are combined in the fusion unit and matched by the prediction unit to determine whether anyone is not wearing a helmet.
It improves the accuracy of helmet wearing detection in monochromatic environments, ensures the accuracy and timeliness of detection results, and reduces reliance on manual detection.
Smart Images

Figure CN117612075B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of target detection technology, and in particular to a method and apparatus for detecting helmet wearing, a computing device, and a storage medium. Background Technology
[0002] Safety helmets are protective equipment used to ensure personal safety during industrial production. Accidents involving workers being injured on construction sites due to not wearing safety helmets are frequent. Therefore, checking the wearing of safety helmets can help eliminate potential safety hazards in a timely manner and protect the lives of workers.
[0003] Currently, most safety helmet inspections are conducted manually via surveillance video. This method relies heavily on the visual perception of the monitoring personnel. More importantly, in certain applications, environmental factors play a significant role. For example, on offshore drilling platforms, the open and monotonous surroundings can make it difficult to distinguish objects during inspection, leading to inaccurate results.
[0004] Therefore, accurately detecting the wearing status of safety helmets on offshore drilling platforms is a technical deficiency that needs to be overcome. Summary of the Invention
[0005] This invention provides a method and apparatus for detecting helmet wearing, a computing device and a storage medium, to solve the defects of inaccurate results in the detection of helmet wearing on offshore drilling platforms in the prior art.
[0006] This invention provides a method for detecting helmet wearing, used on offshore drilling platforms, the method comprising:
[0007] Acquire monitoring videos of offshore drilling platforms; wherein the monitoring videos include multiple monitoring images;
[0008] Multiple surveillance images are sequentially input into the detection model to obtain a helmet detection result set and a human body detection result set; wherein, the helmet detection result set includes at least one helmet detection result, and the human body detection result set includes at least one human body detection result;
[0009] The human body detection result set is matched with the safety helmet detection result set. If it is determined that at least one human body detection result and the safety helmet detection result are not matched successfully, then the person corresponding to the human body detection result is determined to be not wearing a safety helmet.
[0010] The detection model includes a helmet image feature extraction unit and a human body image feature extraction unit, which are used to extract helmet image features and human body image features from the monitoring image, respectively.
[0011] The detection model is trained based on sample images, the corresponding helmet calibration results, and human body calibration results.
[0012] The present invention also provides a helmet-wearing detection device for use on offshore drilling platforms, the detection device comprising:
[0013] The monitoring video acquisition module is used to acquire monitoring videos of offshore drilling platforms; wherein, the monitoring video includes multiple monitoring images;
[0014] The output detection result module is used to sequentially input multiple monitoring images into the detection model to obtain a safety helmet detection result set and a human body detection result set; wherein, the safety helmet detection result set includes at least one safety helmet detection result, and the human body detection result set includes at least one human body detection result;
[0015] The detection result matching module is used to match the human body detection result set with the safety helmet detection result set. If it is determined that at least one human body detection result and the safety helmet detection result are unsuccessful in matching, then it is determined that the person corresponding to the human body detection result is not wearing a safety helmet.
[0016] The detection model includes a helmet image feature extraction unit and a human body image feature extraction unit, which are used to extract helmet image features and human body image features from the monitoring image, respectively.
[0017] The detection model is trained based on sample images, the corresponding helmet calibration results, and human body calibration results.
[0018] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of any of the above-described helmet wearing detection methods.
[0019] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above-described helmet wearing detection methods.
[0020] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the safety helmet wearing detection methods described above.
[0021] The safety helmet wearing detection method and device provided by the present invention inputs multiple monitoring images from the acquired monitoring video into the detection model in sequence, thereby obtaining safety helmet detection results and human body detection results respectively. The detection model recognizes human body and safety helmet to overcome the defect that human beings are easily unable to distinguish them in monotonous working conditions. Then, the human body detection results are matched with the safety helmet detection results to determine whether there are people not wearing safety helmets, ensuring the accuracy of the detection results.
[0022] Secondly, the method and apparatus of the present invention, by adding an attention layer after two upsampling layers, facilitates more accurate extraction of helmet image features and human image features after the image feature size is enlarged by the upsampling layer, which is beneficial to the accuracy of subsequent layer processing.
[0023] Furthermore, the method and apparatus of the present invention combine the second human image features and the second safety helmet image features in the first stitching layer and then perform convolution processing; combine the first human image features and the first safety helmet image features in the second stitching layer and then perform convolution processing; and combine the third human image features and the third safety helmet image features in the third stitching layer and then perform convolution processing. This achieves the combination of safety helmet image features and human image features, thus eliminating the need for separate anchor frame labeling for each of the safety helmet image features and human image features. Instead, safety helmet anchor frames and human anchor frames are simultaneously labeled in the same image, facilitating comparison. Attached Figure Description
[0024] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0025] Figure 1 This is one of the flowcharts of the helmet wearing detection method provided by the present invention;
[0026] Figure 2 This is a schematic diagram of the detection model provided by the present invention;
[0027] Figure 3 This is the second flowchart of the helmet wearing detection method provided by the present invention;
[0028] Figure 4 This is a detailed structural schematic diagram of the detection model provided by the present invention;
[0029] Figure 5 This is the third flowchart of the helmet wearing detection method provided by the present invention;
[0030] Figure 6 This is the fourth flowchart of the helmet wearing detection method provided by the present invention;
[0031] Figure 7 This is the fifth flowchart of the helmet wearing detection method provided by the present invention;
[0032] Figure 8 This is the sixth flowchart of the helmet wearing detection method provided by the present invention;
[0033] Figure 9 This is a schematic diagram of the safety helmet anchor frame and the human body anchor frame provided by the present invention;
[0034] Figure 10 This is the seventh flowchart of the helmet wearing detection method provided by the present invention;
[0035] Figure 11 This is a schematic diagram of the structure of the helmet wearing detection device provided by the present invention;
[0036] Figure 12 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0037] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0038] Existing technologies also include methods for detecting safety helmets using network models. The core idea is to acquire an image, input it into a network model, and then have the model detect the presence of a human head. If a head is found, it means the person is not wearing a safety helmet. While this method overcomes the shortcomings of manual detection, its applicability is limited, and inaccuracies can still occur during image recognition. This is especially true in the open and monotonous environments of offshore platforms, where detection results can be poor.
[0039] The following is combined with Figures 1-12 The present invention describes a helmet wearing detection method and apparatus, electronic device, storage medium, and program product.
[0040] See Figure 1 This invention discloses a method for detecting helmet wearing, used on offshore drilling platforms. The detection method includes:
[0041] 101. Acquire monitoring videos of offshore drilling platforms; wherein the monitoring videos include multiple monitoring images.
[0042] In this embodiment, the acquisition method can be to acquire surveillance video based on a time period. For example, if the time period is set to 1 minute, then the surveillance video of each 1 minute is acquired as the object to be detected, and the multiple surveillance images included in the surveillance video are subsequently detected.
[0043] Optionally, the monitoring video of the offshore drilling platform can be obtained by one camera or by multiple cameras. Each camera transmits the captured monitoring video back to the processor in the central control room for unified scheduling.
[0044] 102. Input the multiple monitoring images into the detection model in sequence to obtain the safety helmet detection result set and the human body detection result set.
[0045] The helmet detection result set includes at least one helmet detection result, and the human body detection result set includes at least one human body detection result.
[0046] The detection model includes a helmet image feature extraction unit and a human body image feature extraction unit, which are used to extract helmet image features and human body image features from the monitoring image, respectively.
[0047] Specifically, human image features can be all human image features displayed in the surveillance image, rather than just features of a portion of the human body.
[0048] The features of a safety helmet image can include features of all safety helmets.
[0049] The detection model is trained based on sample images, the helmet calibration results corresponding to the sample images, and human body calibration results.
[0050] The sample images can be historical surveillance images containing human image features and safety helmet image features extracted from historical surveillance videos. The human image features and safety helmet image features are labeled, and the labeled historical surveillance images are input into the detection model for supervised training.
[0051] Specifically, the training steps can be applied for:
[0052] 1) Supervised training of the helmet image feature extraction unit and prediction unit is performed using the helmet image features and their labels in historical surveillance images.
[0053] 2) The supervised training unit for extracting safety helmet images is trained together with the untrained units for extracting human body images, fusing images, and predicting images. The training set consists of human body image features and their labels from historical surveillance images. During training, the parameters of the human body image feature extraction unit, fusing unit, and predicting unit need to be adjusted, but the parameters of the safety helmet image feature extraction unit are not adjusted.
[0054] 3) After training, a complete trained detection model is obtained. At this point, the monitoring model has the generalization ability to extract both helmet image features and human body image features simultaneously.
[0055] The detection model can be of various types, such as Convolutional Neural Network (CNN), Transfer Learning Model (ResNet), YOLO Model, etc. The detection model in this embodiment can combine the regression problem of classification and target localization by using anchor boxes, thus achieving high efficiency, flexibility and good generalization performance.
[0056] 103. Match the human body detection result set with the safety helmet detection result set. If it is determined that at least one human body detection result and the safety helmet detection result are unsuccessful in matching, then it is determined that the person corresponding to the human body detection result is not wearing a safety helmet.
[0057] In this embodiment, for example, if the human body detection result set includes 5 human body detection results and the safety helmet detection result set includes 5 safety helmet detection results, then the 5 human body detection results are matched with the 5 safety helmet detection results respectively. Specifically, any human body detection result can be matched with at least one nearest safety helmet detection result.
[0058] Several factors are considered for a successful match:
[0059] If a worker is walking normally while wearing a safety helmet, the positions of the human image feature and the safety helmet image feature should correspond to each other, with the safety helmet image feature located above the human image feature.
[0060] However, it's also possible that the worker is bending over or squatting. In such cases, the helmet image features might be located to one side of the human image features or partially overlap with them. Therefore, after identifying the helmet and human image features, we can further identify the current pose of the human image features and then determine the matching relationship between the helmet and human image features based on the pose.
[0061] For example, if the person is standing or squatting, the helmet image features are located above the human body image features;
[0062] If the person is bending over, the features of the safety helmet image are located within the area of the human body image features, or the area of the safety helmet image features partially overlaps with the area of the human body image features.
[0063] If the helmet is lying down or prone, the helmet image features may be temporarily missing. In this case, it is temporarily marked as the helmet's default state, but no further action is taken.
[0064] If a human body detection result confirms that a person is not wearing a safety helmet, an alarm message can be issued to remind the person to put one on immediately. The alarm message can be a voice prompt played through a loudspeaker or sent to the control room personnel, who will then contact the person not wearing a helmet to put it on immediately.
[0065] If a worker is seen bending over or squatting, the worker's movements can be tracked using multiple surveillance images before or after the current image until a standing or walking image is obtained. Then, the safety helmet image features and human body image features of the standing or walking image are matched to make a comprehensive judgment.
[0066] The safety helmet wearing detection method provided by this invention sequentially inputs multiple monitoring images from the acquired surveillance video into a detection model to obtain safety helmet detection results and human body detection results. The detection model's identification of human body and safety helmet overcomes the deficiency of human beings being unable to distinguish clearly in monotonous working conditions. Then, the human body detection results are matched with the safety helmet detection results to determine whether there are any people not wearing safety helmets, ensuring the accuracy of the detection results.
[0067] Optionally, after acquiring the monitoring video of the offshore drilling platform, the method further includes: performing preliminary screening on the multiple monitoring images to filter out monitoring images that include human outlines.
[0068] Step 102 specifically includes: inputting the multiple monitoring images, including human body contours, into the detection model to obtain the safety helmet detection result and the human body detection result.
[0069] By conducting an initial screening, surveillance images that clearly show no human presence can be removed, avoiding the need for subsequent model processing and calculations on such images and reducing the computational load.
[0070] Specifically, see Figure 2 The detection model includes: a human image feature extraction unit, a safety helmet image feature extraction unit, a fusion unit, and a prediction unit;
[0071] The human body image feature extraction unit and the safety helmet image feature extraction unit are both connected to the input end. The input end can preprocess the original input monitoring image to obtain a preprocessed monitoring image.
[0072] This preprocessing can perform Mosaic data augmentation, adaptive anchor box calculation, and adaptive image scaling, making the preprocessed monitoring images easier to label and extract features during subsequent convolution processing.
[0073] The human image feature extraction unit is used to extract human image features from the input surveillance image and generate human image features of different sizes.
[0074] The safety helmet image feature extraction unit is used to extract safety helmet image features from the input monitoring image and generate safety helmet image features of different sizes.
[0075] The fusion unit is used to fuse human image features and safety helmet image features to obtain fused image features;
[0076] The prediction unit is used to label based on the fused image features, and to label the positions of the helmet image features and human body image features.
[0077] Specifically, see Figure 3 Step 102 includes:
[0078] 301. Preprocess multiple monitoring images to obtain corresponding preprocessed monitoring images.
[0079] 302. Input the preprocessed monitoring image into the human image feature extraction unit and output the human image features.
[0080] In this embodiment, the human image features include first human image features, second human image features, and third human image features of different sizes. The human image features are also represented in the form of a feature map, with dimensions H (height) * W (width).
[0081] 303. Input the preprocessed monitoring image into the safety helmet image feature extraction unit and output the safety helmet image features.
[0082] In this embodiment, the safety helmet image features include first safety helmet image features, second safety helmet image features, and third safety helmet image features of different sizes. The safety helmet image features are also represented in the form of a feature map, with dimensions of H (height) * W (width).
[0083] Among them, the first safety helmet image feature and the first human body image feature have the same size, the second safety helmet image feature and the second human body image feature have the same size, and the third safety helmet image feature and the third human body image feature have the same size.
[0084] 304. Input the human image features and the safety helmet image features into the fusion unit, and output the fused image features.
[0085] Accordingly, the fused image features in this embodiment include: first fused image features, second fused image features, and third fused image features of different sizes.
[0086] 305. Input the fused image features into the prediction unit and output at least one safety helmet anchor frame and at least one human body anchor frame labeled in the monitoring image.
[0087] In this embodiment, the prediction unit includes multiple prediction layers of different sizes, such as 80*80, 60*60 and 40*40, so as to calibrate the anchor boxes of the fused image features from different sizes.
[0088] Through steps 301 to 305, multiple safety helmet anchor frames and human body anchor frames marked in the monitoring images are obtained, which are then used for matching in the next step.
[0089] More specifically, see Figure 4 , Figure 4 Detailed structural diagrams of each unit of the detection model are shown.
[0090] The helmet image feature extraction unit includes a first convolutional layer, a second convolutional layer, and a third convolutional layer connected in sequence. The kernel sizes of the first, second, and third convolutional layers decrease in size, and they are used to perform convolution processing on the input image or image features, respectively. In this embodiment, the kernel sizes of the first, second, and third convolutional layers are 38*38, 20*20, and 12*12, respectively. By concatenating multiple convolutional layers with different kernel sizes, the detection model can learn more deeply and fully, improving its ability to extract helmet image features.
[0091] In this embodiment, see Figure 4 The first, second, and third convolutional layers have essentially the same composition, consisting of CBL units and CSP2_1 units.
[0092] In this embodiment, the CBL unit is the sum of Conv+BN+Leaky ReLU activation functions. There are two main types of CSP units. In the main branch, the CSP1_N unit first passes through the CBL unit, then through N stacked residual blocks (Res Blocks), undergoes convolution, is concatenated with the residual branch, and finally passes through BN+leakeyReLU+CBL to obtain the output. The main difference between CSP2_N and CSP1_N in the main branch lies in the residual blocks. CSP2_N has 2N residual blocks.
[0093] The human image feature extraction unit includes a slicing layer, a fourth convolutional layer, a fifth convolutional layer, and a sixth convolutional layer connected in sequence. The slicing layer is used to slice the input image. The convolutional kernel sizes of the fourth, fifth, and sixth convolutional layers decrease in size and are used to perform convolution processing on the input image or image features, respectively. In this embodiment, the kernel sizes of the first, second, and third convolutional layers are 38*38, 20*20, and 12*12, respectively. By concatenating multiple convolutional layers with different kernel sizes, the detection model can learn more deeply and fully, improving its ability to extract human image features.
[0094] The fourth, fifth, and sixth convolutional layers have different compositions.
[0095] The fourth convolutional layer consists of CBL+CSP1_1+CBL+CSP1_3, the fifth convolutional layer consists of CBL+CSP1_3, and the sixth convolutional layer consists of CBL+SPP+CSP2_1.
[0096] The SPP structure, also known as spatial pyramid pooling, can transform feature maps of arbitrary size into feature vectors of fixed size.
[0097] The fusion unit includes: a seventh convolutional layer, an eighth convolutional layer, a ninth convolutional layer, a tenth convolutional layer, and an eleventh convolutional layer; a first upsampling layer and a first attention layer; a second upsampling layer and a second attention layer; a first splicing layer; a second splicing layer; a third splicing layer, and a fourth splicing layer.
[0098] Depend on Figure 4 As can be seen, in this embodiment, the seventh convolutional layer is a CBL structure, the eighth convolutional layer is a CSP2_1+CBL structure, the ninth convolutional layer is a CSP2_1 structure, the tenth convolutional layer is a CBL structure, the eleventh convolutional layer is a CSP2_1 structure, the twelfth convolutional layer is a CBL structure, and the thirteenth convolutional layer is a CSP2_1 structure.
[0099] The seventh convolutional layer is connected to the sixth convolutional layer and the first upsampling layer, respectively;
[0100] The first attention layer is connected to the first upsampling layer and the first splicing layer, respectively;
[0101] The first splicing layer is connected to the fifth convolutional layer, the second convolutional layer, and the first attention layer, respectively;
[0102] The eighth convolutional layer is connected to the first splicing layer, the second upsampling layer, the ninth convolutional layer, and the tenth convolutional layer, respectively.
[0103] The second upsampling layer is connected to the second attention layer;
[0104] The second attention layer is connected to the second splicing layer;
[0105] The second splicing layer is connected to the first convolutional layer, the fourth convolutional layer, and the ninth convolutional layer, respectively;
[0106] The ninth convolutional layer is connected to the tenth convolutional layer;
[0107] The third splicing layer is connected to the tenth convolutional layer and the eighth convolutional layer, respectively;
[0108] The eleventh convolutional layer is connected to the third splicing layer;
[0109] The eleventh convolutional layer is connected to the fourth splicing layer through the twelfth convolutional layer;
[0110] The fourth splicing layer is also connected to the seventh convolutional layer and the third convolutional layer, respectively;
[0111] The fourth splicing layer is connected to the twelfth convolutional layer.
[0112] The prediction unit includes a first prediction layer, a second prediction layer, and a third prediction layer corresponding to safety helmet anchor frames and human body anchor frames of different sizes.
[0113] See Figure 5 Step 303 specifically includes:
[0114] 501. Input the preprocessed monitoring image into the first convolutional layer for convolution processing, and output the first safety helmet image features.
[0115] 502. Input the first safety helmet image features into the second convolutional layer for convolution processing, and output the second safety helmet image features.
[0116] 503. Input the second safety helmet image features into the third convolutional layer for convolution processing, and output the third safety helmet image features.
[0117] Through steps 501 to 503, image features of the first safety helmet, the second safety helmet, and the third safety helmet of different sizes are obtained respectively, so that safety helmets can be identified at different sizes, making the safety helmet identification results more accurate.
[0118] In this embodiment, the size of the first safety helmet image feature is 76*76, the size of the second safety helmet image feature is 38*38, and the size of the third safety helmet image feature is 19*19.
[0119] See Figure 6 Step 302 specifically includes:
[0120] 601. Input the preprocessed monitoring image into the slicing layer and output multiple monitoring image slices.
[0121] For example, if the original 608*608*3 preprocessed surveillance image is input into the Focus structure, it is first transformed into a 304*304*12 image by slicing, and then undergoes a convolution operation with 32 convolution kernels to finally become a 304*304*32 surveillance image slice.
[0122] 602. Input the monitoring image slices into the fourth convolutional layer for convolution processing, and output the first human image features.
[0123] 603. Input the first safety helmet image features into the fifth convolutional layer for convolution processing, and output the second human body image features.
[0124] 604. Input the second safety helmet image features into the sixth convolutional layer for convolution processing, and output the third human body image features.
[0125] Through steps 601 to 604, first human image features, second human image features, and third human image features of different sizes are obtained respectively, so that human bodies can be identified at different sizes, making the human body recognition results more accurate.
[0126] In this embodiment, the size of the first human image feature is 76*76, the size of the second human image feature is 38*38, and the size of the third human image feature is 19*19.
[0127] See Figure 7 Step 304 includes:
[0128] 701. Input the third human image feature into the seventh convolutional layer to obtain the first convolutional feature.
[0129] In this embodiment, the size of the first convolutional feature is 19*19.
[0130] 702. The first convolutional features are sequentially upsampled and self-attention processed through the first upsampling layer and the first attention layer to obtain the first self-attention features.
[0131] In this embodiment, by adding a first attention layer after the first upsampling layer, the extracted safety helmet image features and human body image features are more accurate after the image feature size is enlarged by the first upsampling layer, which is beneficial to the accuracy of subsequent layer processing.
[0132] 703. Input the second human image features, the second safety helmet image features, and the first self-attention features into the first stitching layer for stitching processing to obtain the first stitching features.
[0133] In this embodiment, the size of the first splicing feature is 38*38.
[0134] 704. Input the first spliced feature into the eighth convolutional layer for convolution processing to obtain the second convolutional feature.
[0135] In this embodiment, the size of the second convolutional feature is 38*38.
[0136] 705. The second convolutional feature is sequentially upsampled and self-attention processed through the second upsampling layer and the second attention layer to obtain the second self-attention feature.
[0137] In this embodiment, by adding a second attention layer after the second upsampling layer, the extracted helmet image features and human image features are more accurate after the image feature size is enlarged by the second upsampling layer, which is beneficial to the accuracy of subsequent layer processing.
[0138] 706. Input the first human image features, the first safety helmet image features, and the second self-attention features into the second stitching layer for stitching processing to obtain the second stitching features.
[0139] In this embodiment, the size of the second splicing feature after splicing is 76*76.
[0140] 707. Input the second stitching feature into the ninth convolutional layer for convolution processing to obtain the first fused image feature.
[0141] In this embodiment, the size of the first fused image feature is 76*76.
[0142] 708. The first fused image features are convolved through the tenth convolutional layer to obtain the third convolutional features.
[0143] The first fused image feature with a size of 76*76 is convolved through the tenth convolutional layer to obtain the third convolutional feature with a size of 38*38.
[0144] 709. Input the second convolutional feature and the third convolutional feature into the third splicing layer for splicing processing to obtain the third spliced feature.
[0145] The size of the third splicing feature is 38*38.
[0146] 710. Input the third stitching feature into the tenth convolutional layer for convolution processing to obtain the second fused image feature.
[0147] In this embodiment, the size of the second fused image feature is 38*38.
[0148] 711. The second fused image features are processed by convolution in the eleventh convolutional layer to obtain the fourth convolutional features.
[0149] The second fused image feature with a size of 38*38 is convolved through the eleventh convolutional layer to obtain the fourth convolutional feature with a size of 19*19.
[0150] 712. Input the first convolutional feature, the fourth convolutional feature, and the third safety helmet image feature into the fourth stitching layer for stitching processing to obtain the fourth stitching feature.
[0151] In this embodiment, the size of the fourth splicing feature is 19*19.
[0152] 713. Input the fourth stitching feature into the twelfth convolutional layer for convolution processing to obtain the third fused image feature.
[0153] In this embodiment, the size of the third fused image feature is 19*19.
[0154] Through steps 701 to 713, the fusion of safety helmet image features and human body image features is achieved, and the first fused image feature, the second fused image feature, and the third fused image feature are finally obtained. This enables the combination of safety helmet image features and human body image features of different sizes, so that it is not necessary to separately perform anchor frame calibration for safety helmet image features and human body image features. It is possible to simultaneously annotate safety helmet anchor frames and human body anchor frames in the same image, which is convenient for comparison.
[0155] In addition, this embodiment obtains and fuses image features of safety helmets and human bodies of different sizes to achieve matching of target image features under multiple different sizes, thereby overcoming the defect that it is easy to not be able to distinguish them in a monochromatic working environment.
[0156] Furthermore, the monitoring images are generated by copying the same monitoring image into a first monitoring image, a second monitoring image, and a third monitoring image, which correspond to the annotations of the safety helmet anchor frame and the human body anchor frame in the first prediction layer, the second prediction layer, and the third prediction layer, respectively.
[0157] See Figure 8 Step 305 includes:
[0158] 801. Input the first fused image features into the first prediction layer, and output at least one first safety helmet anchor frame and at least one first human body anchor frame labeled in the first monitoring image.
[0159] 802. Input the second fused image features into the second prediction layer, and output at least one second safety helmet anchor frame and at least one second human body anchor frame labeled in the second monitoring image.
[0160] 803. Input the third fused image features into the third prediction layer, and output at least one third safety helmet anchor frame and at least one third human body anchor frame labeled in the third monitoring image.
[0161] The effects of the first safety helmet anchor frame and the first human body anchor frame are shown in [reference]. Figure 9 a. The effects of the second safety helmet anchor frame and the second human body anchor frame are respectively referred to... Figure 9 b. For the effects of the third safety helmet anchor frame and the third human body anchor frame, please refer to... Figure 9 c.
[0162] Among them, the dimensions of the first safety helmet anchor frame, the second safety helmet anchor frame, and the third safety helmet anchor frame decrease in that order; the dimensions of the first human body anchor frame, the second human body anchor frame, and the third human body anchor frame also decrease in that order.
[0163] In this embodiment, targets with a detection area greater than 76*76 pixels are generally defined as large targets, targets with a detection area in the range of (19*19, 76*76) pixels are defined as medium targets, and targets with a detection area less than or equal to 19*19 pixels are defined as small targets. The size of the monitored image is generally 1920×1080. If the target is too small, the detection performance of the existing YOLO v5 model is poor. Table 1 shows a comparison of the detection accuracy of the detection model in this embodiment and the existing YOLO v5 model. As can be seen from Table 1, compared with the existing YOLO v5 model, the smaller the target, the more accurate the detection result.
[0164] Table 1
[0165]
[0166] For each surveillance image, see Figure 10 Step 103 includes:
[0167] 1001. Match the positions of the first safety helmet anchor frame and the first human body anchor frame to obtain the first matching result.
[0168] 1002. Match the positions of the second safety helmet anchor frame and the second human body anchor frame to obtain the second matching result.
[0169] 1003. Match the positions of the third safety helmet anchor frame and the third human body anchor frame to obtain the third matching result.
[0170] As mentioned earlier, position matching needs to be determined based on the person's position and posture. For a person walking upright normally, the helmet anchor frame is above the body anchor frame, resulting in a successful match; otherwise, it is unsuccessful. However, in other situations, such as when a person is bending over, the helmet anchor frame is not necessarily above the body anchor frame; it may be located to the side of the body anchor frame or at least partially overlap with it. Each situation requires specific analysis.
[0171] To prevent matching failures, the obtained helmet anchor frame results and human body anchor frame results can be input into the matching model for processing to obtain the matching results.
[0172] The matching model needs to be trained in advance using human images, safety helmet anchor frame location labels, and human body anchor frame location labels to make the matching results more accurate.
[0173] 1004. If at least one of the first matching result, the second matching result, and the third matching result fails, then the person corresponding to the human body detection result in the monitoring image is determined to be not wearing a safety helmet.
[0174] Steps 1001-1004 are used to match the positions of the safety helmet anchor frame and the worker anchor frame to obtain a matching result. If the matching result is unsuccessful, subsequent alarm operations are performed to achieve timely alarms and improve worker safety on the construction site.
[0175] The helmet wearing detection device provided by the present invention is described below. The helmet wearing detection device described below can be referred to in correspondence with the helmet wearing detection method described above.
[0176] This invention discloses a helmet-wearing detection device, see [link to relevant documentation]. Figure 11 For use on offshore drilling platforms, the detection device includes:
[0177] The monitoring video acquisition module 1101 is used to acquire monitoring videos of an offshore drilling platform; wherein, the monitoring video includes multiple monitoring images;
[0178] The output detection result module 1102 is used to sequentially input multiple monitoring images into the detection model to obtain a safety helmet detection result set and a human body detection result set; wherein, the safety helmet detection result set includes at least one safety helmet detection result, and the human body detection result set includes at least one human body detection result;
[0179] The detection result matching module 1103 is used to match the human body detection result set with the safety helmet detection result set. If it is determined that at least one human body detection result and the safety helmet detection result are not successfully matched, then it is determined that the person corresponding to the human body detection result is not wearing a safety helmet.
[0180] The detection model includes a helmet image feature extraction unit and a human body image feature extraction unit, used to extract helmet image features and human body image features from the monitoring image, respectively; the detection model is trained based on sample images, helmet calibration results corresponding to the sample images, and human body calibration results.
[0181] Optionally, the device further includes: a preliminary screening module, used to perform preliminary screening on multiple monitoring images after acquiring the monitoring video of the offshore drilling platform, and to screen monitoring images that include human outlines;
[0182] The output detection result module 1102 is specifically used to: input the multiple monitoring images including human body contours into the detection model to obtain the safety helmet detection result and the human body detection result.
[0183] Optionally, the detection model includes: a human image feature extraction unit, a safety helmet image feature extraction unit, a fusion unit, and a prediction unit;
[0184] The helmet detection result is the helmet anchor frame marked in the monitoring image, and the human body detection result is the human body anchor frame marked in the monitoring image;
[0185] The output detection result module 1102 includes:
[0186] The preprocessing module is used to preprocess multiple monitoring images to obtain corresponding preprocessed monitoring images;
[0187] The human image feature extraction module is used to input the preprocessed monitoring image into the human image feature extraction unit and output human image features;
[0188] The safety helmet image feature extraction module is used to input the preprocessed monitoring image into the safety helmet image feature extraction unit and output the safety helmet image features;
[0189] The fusion module is used to input the human image features and the safety helmet image features into the fusion unit and output fused image features;
[0190] An anchor frame generation module is used to input the fused image features into the prediction unit and output at least one safety helmet anchor frame and at least one human body anchor frame labeled in the surveillance image.
[0191] Optionally, the safety helmet image feature extraction unit includes: a first convolutional layer, a second convolutional layer, and a third convolutional layer connected in sequence, wherein the kernel sizes of the first convolutional layer, the second convolutional layer, and the third convolutional layer decrease, and are respectively used to perform convolution processing on the input image or image features;
[0192] The safety helmet image features include first safety helmet image features, second safety helmet image features, and third safety helmet image features of different sizes;
[0193] The safety helmet image feature extraction module is specifically used for:
[0194] The preprocessed monitoring image is input into the first convolutional layer for convolution processing, and the first safety helmet image features are output.
[0195] The first safety helmet image features are input into the second convolutional layer for convolution processing, and the second safety helmet image features are output.
[0196] The second safety helmet image features are input into the third convolutional layer for convolution processing, and the third safety helmet image features are output.
[0197] Optionally, the human image feature extraction unit includes: a slicing layer, a fourth convolutional layer, a fifth convolutional layer, and a sixth convolutional layer connected in sequence. The slicing layer is used to slice the input image. The convolutional kernels of the fourth, fifth, and sixth convolutional layers decrease in size and are used to perform convolution processing on the input image or image features, respectively.
[0198] The human image features include first human image features, second human image features, and third human image features of different sizes;
[0199] The human image feature extraction module is specifically used for:
[0200] The preprocessed monitoring image is input into the slicing layer, and multiple monitoring image slices are output.
[0201] The surveillance image is segmented and input into the fourth convolutional layer for convolution processing, and the first human image feature is output.
[0202] The first safety helmet image features are input into the fifth convolutional layer for convolution processing, and the second human body image features are output.
[0203] The second safety helmet image features are input into the sixth convolutional layer for convolution processing, and the third human body image features are output.
[0204] Optionally, the fused image features include: first fused image features, second fused image features, and third fused image features of different sizes;
[0205] The fusion unit includes: a seventh convolutional layer, an eighth convolutional layer, a ninth convolutional layer, a tenth convolutional layer and an eleventh convolutional layer, a first upsampling layer and a first attention layer, a second upsampling layer and a second attention layer, a first splicing layer, a second splicing layer, a third splicing layer and a fourth splicing layer.
[0206] The seventh convolutional layer is connected to the sixth convolutional layer and the first upsampling layer, respectively; the first attention layer is connected to the first upsampling layer and the first splicing layer, respectively; the first splicing layer is connected to the fifth convolutional layer, the second convolutional layer and the first attention layer, respectively; the eighth convolutional layer is connected to the first splicing layer, the second upsampling layer, the ninth convolutional layer and the tenth convolutional layer, respectively.
[0207] The second upsampling layer is connected to the second attention layer; the second attention layer is connected to the second splicing layer; the second splicing layer is connected to the first convolutional layer, the fourth convolutional layer, and the ninth convolutional layer respectively; the ninth convolutional layer is connected to the tenth convolutional layer; the third splicing layer is connected to the tenth convolutional layer and the eighth convolutional layer respectively.
[0208] The eleventh convolutional layer is connected to the third splicing layer; the eleventh convolutional layer is connected to the fourth splicing layer through the twelfth convolutional layer; the fourth splicing layer is also connected to the seventh convolutional layer and the third convolutional layer respectively; the fourth splicing layer is connected to the twelfth convolutional layer.
[0209] The fusion module is specifically used for:
[0210] The third human image feature is input into the seventh convolutional layer to obtain the first convolutional feature;
[0211] The first convolutional feature is sequentially passed through the first upsampling layer and the first attention layer for upsampling and self-attention processing to obtain the first self-attention feature;
[0212] The second human image features, the second safety helmet image features, and the first self-attention features are input into the first stitching layer for stitching processing to obtain the first stitching features;
[0213] The first spliced feature is input into the eighth convolutional layer for convolution processing to obtain the second convolutional feature;
[0214] The second convolutional feature is sequentially upsampled and self-attention processed through the second upsampling layer and the second attention layer to obtain the second self-attention feature;
[0215] The first human image features, the first safety helmet image features, and the second self-attention features are input into the second stitching layer for stitching processing to obtain the second stitching features;
[0216] The second stitched feature is input into the ninth convolutional layer for convolution processing to obtain the first fused image feature;
[0217] The first fused image features are convolved through the tenth convolutional layer to obtain the third convolutional features;
[0218] The second convolutional feature and the third convolutional feature are input into the third splicing layer for splicing to obtain the third splicing feature;
[0219] The third stitching feature is input into the tenth convolutional layer for convolution processing to obtain the second fused image feature;
[0220] The second fused image features are processed by convolution in the eleventh convolutional layer to obtain the fourth convolutional features;
[0221] The first convolutional feature, the fourth convolutional feature, and the third safety helmet image feature are input into the fourth stitching layer for stitching processing to obtain the fourth stitching feature;
[0222] The fourth stitching feature is input into the twelfth convolutional layer for convolution processing to obtain the third fused image feature.
[0223] Optionally, the prediction unit includes: a first prediction layer, a second prediction layer, and a third prediction layer corresponding to safety helmet anchor frames and human body anchor frames of different sizes;
[0224] The monitoring images include a first monitoring image, a second monitoring image, and a third monitoring image generated by copying the same monitoring image;
[0225] The anchor frame generation module is specifically used for:
[0226] The first fused image features are input into the first prediction layer, and at least one first safety helmet anchor frame and at least one first human body anchor frame are output, which are labeled in the first monitoring image.
[0227] The second fused image features are input into the second prediction layer, and at least one second safety helmet anchor frame and at least one second human body anchor frame are output, which are labeled in the second monitoring image.
[0228] The third fused image features are input into the third prediction layer, and at least one third safety helmet anchor frame and at least one third human body anchor frame are output, which are labeled in the third monitoring image.
[0229] The dimensions of the first safety helmet anchor frame, the second safety helmet anchor frame, and the third safety helmet anchor frame decrease in that order, as do the dimensions of the first human body anchor frame, the second human body anchor frame, and the third human body anchor frame.
[0230] Optionally, for each monitored image, the detection result matching module 1103 is specifically used for:
[0231] The first safety helmet anchor frame and the first human body anchor frame are matched in position to obtain a first matching result; the second safety helmet anchor frame and the second human body anchor frame are matched in position to obtain a second matching result; the third safety helmet anchor frame and the third human body anchor frame are matched in position to obtain a third matching result; if at least one of the first matching result, the second matching result and the third matching result is unsuccessful, then it is determined that the person corresponding to the human body detection result in the monitoring image is not wearing a safety helmet.
[0232] The helmet-wearing detection device provided in this embodiment sequentially inputs multiple monitoring images from the acquired surveillance video into the detection model, thereby obtaining helmet detection results and human body detection results respectively. The detection model's identification of human body and helmet overcomes the defect that humans can easily not distinguish them in monotonous working conditions. Then, the human body detection results are matched with the helmet detection results to determine whether there are any people not wearing helmets, ensuring the accuracy of the detection results.
[0233] Figure 12 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 12As shown, the electronic device may include: a processor 1210, a communications interface 1220, a memory 1230, and a communications bus 1240, wherein the processor 1210, the communications interface 1220, and the memory 1230 communicate with each other through the communications bus 1240. The processor 1210 can call logic instructions in the memory 1230 to execute a helmet-wearing detection method, including: acquiring monitoring video of an offshore drilling platform; wherein the monitoring video includes multiple monitoring images; sequentially inputting the multiple monitoring images into a detection model to obtain a helmet detection result set and a human body detection result set; wherein the helmet detection result set includes at least one helmet detection result, and the human body detection result set includes at least one human body detection result; matching the human body detection result set with the helmet detection result set, and if it is determined that at least one human body detection result does not match the helmet detection result, then it is determined that the person corresponding to the human body detection result is not wearing a helmet; wherein the detection model includes a helmet image feature extraction unit and a human body image feature extraction unit, used to extract helmet image features and human body image features from the monitoring images respectively; the detection model is trained based on sample images, helmet calibration results corresponding to the sample images, and human body calibration results.
[0234] Furthermore, the logical instructions in the aforementioned memory 1230 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0235] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the safety helmet wearing detection method provided by the above methods, including: acquiring monitoring video of an offshore drilling platform; wherein the monitoring video includes multiple monitoring images; sequentially inputting the multiple monitoring images into a detection model to obtain a safety helmet detection result set and a human body detection result set; wherein the safety helmet detection result set includes at least one safety helmet detection result, and the human body detection result set includes at least one human body detection result; matching the human body detection result set with the safety helmet detection result set, and if it is determined that the matching result of at least one human body detection result with the safety helmet detection result is unsuccessful, then determining that the person corresponding to the human body detection result is not wearing a safety helmet; wherein the detection model includes a safety helmet image feature extraction unit and a human body image feature extraction unit, used to extract safety helmet image features and human body image features from the monitoring images respectively; the detection model is trained based on sample images, the safety helmet calibration results corresponding to the sample images, and the human body calibration results.
[0236] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the safety helmet wearing detection method provided by the above methods, including: acquiring monitoring video of an offshore drilling platform; wherein the monitoring video includes multiple monitoring images; sequentially inputting the multiple monitoring images into a detection model to obtain a safety helmet detection result set and a human body detection result set; wherein the safety helmet detection result set includes at least one safety helmet detection result, and the human body detection result set includes at least one human body detection result; matching the human body detection result set with the safety helmet detection result set, and if it is determined that the matching result between at least one human body detection result and the safety helmet detection result is unsuccessful, then determining that the person corresponding to the human body detection result is not wearing a safety helmet; wherein the detection model includes a safety helmet image feature extraction unit and a human body image feature extraction unit, used to extract safety helmet image features and human body image features from the monitoring images respectively; the detection model is trained based on sample images, the safety helmet calibration results corresponding to the sample images, and the human body calibration results.
[0237] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0238] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0239] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for detecting helmet wearing, characterized in that, For use on offshore drilling platforms, the method includes: Acquire monitoring videos of offshore drilling platforms; wherein the monitoring videos include multiple monitoring images; Multiple surveillance images are sequentially input into the detection model to obtain a helmet detection result set and a human body detection result set; wherein, the helmet detection result set includes at least one helmet detection result, and the human body detection result set includes at least one human body detection result; The human body detection result set is matched with the safety helmet detection result set. If it is determined that at least one human body detection result and the safety helmet detection result are not matched successfully, then the person corresponding to the human body detection result is determined to be not wearing a safety helmet. The detection model includes a helmet image feature extraction unit and a human body image feature extraction unit, used to extract helmet image features and human body image features from the monitoring image, respectively; and The detection model is trained based on sample images, the safety helmet calibration results corresponding to the sample images, and human body calibration results; The detection model further includes: a fusion unit and a prediction unit; The helmet detection result is the helmet anchor frame marked in the monitoring image, and the human body detection result is the human body anchor frame marked in the monitoring image; Multiple surveillance images are sequentially input into the detection model to obtain a safety helmet detection result set and a human body detection result set, including: The multiple monitoring images are preprocessed to obtain corresponding preprocessed monitoring images; The preprocessed monitoring image is input into the human image feature extraction unit, and the human image features are output. The preprocessed monitoring image is input into the safety helmet image feature extraction unit, which outputs the safety helmet image features. The human image features and the safety helmet image features are input into the fusion unit, and the fused image features are output. The fused image features are input into the prediction unit, which outputs at least one safety helmet anchor frame and at least one human body anchor frame labeled in the surveillance image. The method further includes: outputting image features of safety helmets of different sizes and human body image features of different sizes; The fusion unit includes an upsampling layer and an attention layer, which are used to upsample and self-attention the features, and then stitch together the human body image features and safety helmet image features of the same size to output fused image features.
2. The helmet wearing detection method according to claim 1, characterized in that, After acquiring monitoring video of the offshore drilling platform, the method further includes: The multiple surveillance images are initially screened to select those that include human body outlines; Multiple surveillance images are sequentially input into the detection model to obtain helmet detection results and human body detection results, including: The multiple monitoring images, including human body outlines, are input into the detection model to obtain the safety helmet detection result and the human body detection result.
3. The helmet wearing detection method according to claim 1, characterized in that, The safety helmet image feature extraction unit includes: a first convolutional layer, a second convolutional layer, and a third convolutional layer connected in sequence, wherein the kernel sizes of the first convolutional layer, the second convolutional layer, and the third convolutional layer decrease, and are respectively used to perform convolution processing on the input image or image features; The safety helmet image features include first safety helmet image features, second safety helmet image features, and third safety helmet image features of different sizes; The preprocessed monitoring image is input into the safety helmet image feature extraction unit, which outputs safety helmet image features, including: The preprocessed monitoring image is input into the first convolutional layer for convolution processing, and the first safety helmet image features are output. The first safety helmet image features are input into the second convolutional layer for convolution processing, and the second safety helmet image features are output. The second safety helmet image features are input into the third convolutional layer for convolution processing, and the third safety helmet image features are output.
4. The helmet wearing detection method according to claim 3, characterized in that, The human image feature extraction unit includes a slicing layer, a fourth convolutional layer, a fifth convolutional layer, and a sixth convolutional layer connected in sequence. The slicing layer is used to slice the input image. The convolutional kernels of the fourth, fifth, and sixth convolutional layers decrease in size and are used to perform convolutional processing on the input image or image features, respectively. The human image features include first human image features, second human image features, and third human image features of different sizes; The preprocessed monitoring image is input into the human image feature extraction unit, which outputs human image features, including: The preprocessed monitoring image is input into the slicing layer, and multiple monitoring image slices are output. The surveillance image is segmented and input into the fourth convolutional layer for convolution processing, and the first human image feature is output. The first safety helmet image features are input into the fifth convolutional layer for convolution processing, and the second human body image features are output. The second safety helmet image features are input into the sixth convolutional layer for convolution processing, and the third human body image features are output.
5. The helmet wearing detection method according to claim 4, characterized in that, The fused image features include: first fused image features, second fused image features, and third fused image features of different sizes; The fusion unit includes: a seventh convolutional layer, an eighth convolutional layer, a ninth convolutional layer, a tenth convolutional layer and an eleventh convolutional layer, a first upsampling layer and a first attention layer, a second upsampling layer and a second attention layer, a first splicing layer, a second splicing layer, a third splicing layer and a fourth splicing layer. The seventh convolutional layer is connected to the sixth convolutional layer and the first upsampling layer, respectively; The first attention layer is connected to the first upsampling layer and the first splicing layer, respectively; The first splicing layer is connected to the fifth convolutional layer, the second convolutional layer, and the first attention layer, respectively; The eighth convolutional layer is connected to the first splicing layer, the second upsampling layer, the ninth convolutional layer, and the tenth convolutional layer, respectively. The second upsampling layer is connected to the second attention layer; The second attention layer is connected to the second splicing layer; The second splicing layer is connected to the first convolutional layer, the fourth convolutional layer, and the ninth convolutional layer, respectively; The ninth convolutional layer is connected to the tenth convolutional layer; The third splicing layer is connected to the tenth convolutional layer and the eighth convolutional layer, respectively; The eleventh convolutional layer is connected to the third splicing layer; The eleventh convolutional layer is connected to the fourth splicing layer through the twelfth convolutional layer; The fourth splicing layer is also connected to the seventh convolutional layer and the third convolutional layer, respectively; The fourth splicing layer is connected to the twelfth convolutional layer; The human image features and the safety helmet image features are input into the fusion unit, and the fused image features are output, including: The third human image feature is input into the seventh convolutional layer to obtain the first convolutional feature; The first convolutional feature is sequentially passed through the first upsampling layer and the first attention layer for upsampling and self-attention processing to obtain the first self-attention feature; The second human image features, the second safety helmet image features, and the first self-attention features are input into the first stitching layer for stitching processing to obtain the first stitching features; The first spliced feature is input into the eighth convolutional layer for convolution processing to obtain the second convolutional feature; The second convolutional feature is sequentially upsampled and self-attention processed through the second upsampling layer and the second attention layer to obtain the second self-attention feature; The first human image features, the first safety helmet image features, and the second self-attention features are input into the second stitching layer for stitching processing to obtain the second stitching features; The second stitched feature is input into the ninth convolutional layer for convolution processing to obtain the first fused image feature; The first fused image features are convolved through the tenth convolutional layer to obtain the third convolutional features; The second convolutional feature and the third convolutional feature are input into the third splicing layer for splicing to obtain the third splicing feature; The third stitching feature is input into the tenth convolutional layer for convolution processing to obtain the second fused image feature; The second fused image features are processed by convolution in the eleventh convolutional layer to obtain the fourth convolutional features; The first convolutional feature, the fourth convolutional feature, and the third safety helmet image feature are input into the fourth stitching layer for stitching processing to obtain the fourth stitching feature; The fourth stitching feature is input into the twelfth convolutional layer for convolution processing to obtain the third fused image feature.
6. The helmet wearing detection method according to claim 5, characterized in that, The prediction unit includes: a first prediction layer, a second prediction layer, and a third prediction layer corresponding to safety helmet anchor frames and human body anchor frames of different sizes; The monitoring images include a first monitoring image, a second monitoring image, and a third monitoring image generated by copying the same monitoring image; The fused image features are input into the prediction unit, which outputs at least one helmet anchor frame and at least one human body anchor frame labeled in the surveillance image, including: The first fused image features are input into the first prediction layer, and at least one first safety helmet anchor frame and at least one first human body anchor frame are output, which are labeled in the first monitoring image. The second fused image features are input into the second prediction layer, and at least one second safety helmet anchor frame and at least one second human body anchor frame are output, which are labeled in the second monitoring image. The third fused image features are input into the third prediction layer, and at least one third safety helmet anchor frame and at least one third human body anchor frame are output, which are labeled in the third monitoring image. The dimensions of the first safety helmet anchor frame, the second safety helmet anchor frame, and the third safety helmet anchor frame decrease in that order, as do the dimensions of the first human body anchor frame, the second human body anchor frame, and the third human body anchor frame.
7. The helmet wearing detection method according to claim 6, characterized in that, For each surveillance image, the human detection result set is matched with the safety helmet detection result set. If at least one human detection result fails to match the safety helmet detection result, the person corresponding to that human detection result is determined to be not wearing a safety helmet, including: The first safety helmet anchor frame and the first human body anchor frame are matched in position to obtain the first matching result; The second safety helmet anchor frame and the second human body anchor frame are matched in position to obtain a second matching result; The third safety helmet anchor frame and the third human body anchor frame are matched in position to obtain a third matching result; If at least one of the first, second, and third matching results fails, the person in the human detection result in the surveillance image is determined to be not wearing a safety helmet.
8. A helmet-wearing detection device, characterized in that, For use on offshore drilling platforms, the device includes: The monitoring video acquisition module is used to acquire monitoring videos of offshore drilling platforms; wherein, the monitoring video includes multiple monitoring images; The output detection result module is used to sequentially input multiple monitoring images into the detection model to obtain a safety helmet detection result set and a human body detection result set; wherein, the safety helmet detection result set includes at least one safety helmet detection result, and the human body detection result set includes at least one human body detection result; The detection result matching module is used to match the human body detection result set with the safety helmet detection result set. If it is determined that at least one human body detection result and the safety helmet detection result are unsuccessful in matching, then it is determined that the person corresponding to the human body detection result is not wearing a safety helmet. The detection model includes a helmet image feature extraction unit and a human body image feature extraction unit, which are used to extract helmet image features and human body image features from the monitoring image, respectively. The detection model is trained based on sample images, the safety helmet calibration results corresponding to the sample images, and human body calibration results; The detection model further includes: a fusion unit and a prediction unit; The helmet detection result is the helmet anchor frame marked in the monitoring image, and the human body detection result is the human body anchor frame marked in the monitoring image; Multiple surveillance images are sequentially input into the detection model to obtain a safety helmet detection result set and a human body detection result set, including: The multiple monitoring images are preprocessed to obtain corresponding preprocessed monitoring images; The preprocessed monitoring image is input into the human image feature extraction unit, and the human image features are output. The preprocessed monitoring image is input into the safety helmet image feature extraction unit, which outputs the safety helmet image features. The human image features and the safety helmet image features are input into the fusion unit, and the fused image features are output. The fused image features are input into the prediction unit, which outputs at least one safety helmet anchor frame and at least one human body anchor frame labeled in the surveillance image. Output image features of safety helmets of different sizes and human body images of different sizes; The fusion unit includes an upsampling layer and an attention layer, which are used to upsample the features and perform self-attention processing, and then stitch and fuse the human body image features and safety helmet image features of the same size to output fused image features.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the helmet wearing detection method as described in any one of claims 1 to 7.