A method and device for intelligent and precise identification and detection of labor protection products based on semantic segmentation

Through the intelligent recognition and detection method based on semantic segmentation, combined with deep learning technology, it solves the problem of difficulty in judging the standardization of labor protection equipment wearing detection in the existing technology, achieves refined identification of seat belt wearing conditions, and accurately detects violations. , improving the efficiency of safety management.

CN118470332BActive Publication Date: 2024-09-13HANGZHOU DIANZI UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410936337.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-12
Publication Date
2024-09-13
Estimated Expiration
2044-07-12

AI Technical Summary

Technical Problem

It is difficult to judge the standardization of safety belts by existing labor protection equipment wearing detection methods, especially if the belt is missing, such as the chest belt, waist belt or leg belt is not fastened, which leads to safety hazards.

Method used

Using intelligent recognition and detection methods based on semantic segmentation, combined with deep learning technology, through target detection and semantic segmentation models, the video data is preprocessed, target detected and semantic segmented, the number of pixels of different categories is counted, and logical judgments are made to output judgment information. .

Benefits of technology

It achieves refined identification of seat belt wearing conditions, can accurately detect irregularities such as loose seat belts, missing legs, chest and waist, etc., improves the intelligence and refinement of seat belt wearing detection, and reduces the need for manual detection. Errors and missed detections.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118470332B
    Figure CN118470332B
Patent Text Reader

Abstract

The present invention discloses a method and device for intelligent and precise identification and detection of labor protection products based on semantic segmentation. The method comprises: first, a target detection model is trained through a target detection data set to accurately detect the labor protection products on the workers in the picture captured by the camera. Then, the semantic segmentation model is trained with the help of the semantic segmentation data set to perform fine-grained regional segmentation on the detected protective products to improve the accuracy and precision of the segmentation. Subsequently, a refined evaluation of unsafe wearing behaviors is performed based on whether the ratio of the number of different types of pixels exceeds a preset threshold. Finally, the video information of the evaluation results and the correction and suggestions of unsafe wearing behaviors are output to improve the labor safety level of the workers. The present invention can monitor the wearing conditions of workers in real time, identify potential safety hazards in a timely manner, and provide an effective safety management solution for the workplace.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of industrial safety, and in particular to a method and a device for intelligent and precise recognition and detection of labor protection equipment based on semantic segmentation. Background Art

[0002] With the increasing attention paid to production safety, all walks of life have taken measures to ensure the safety of employees and thus safeguard the interests of enterprises. As one of the high-risk industries, production safety in the chemical industry is particularly important. At present, some scholars have conducted research on the wearing of seat belts by personnel. The existing detection is mainly based on the identification of seat belts and personnel position information. These methods have achieved certain results in detecting seat belts. However, it is difficult to judge the standardization of wearing. Even if it is detected that a person is wearing a seat belt, the existing methods are difficult to judge whether the wearing is standard, and there is no refined detection and judgment of the seat belt.

[0003] For example, the Chinese invention patent with publication number CN117726991A discloses a method and terminal for detecting safety belts in a high-altitude hanging basket. The safety belt detection method disclosed in the patent focuses on verifying the coordinates of the detection target to ultimately determine whether the safety belt is not worn.

[0004] The Chinese invention patent with publication number CN115131732A discloses a method for detecting illegal wearing of seat belts that combines target detection and semantic segmentation. The core is to determine whether the seat belt is worn illegally based on the relative positions of the key point positioning information of the personnel, the whole body lacing detection information and the scaffolding area positioning information, and the position of the hanging rope. This method can detect the wearing position of the seat belt to a certain extent, so as to determine whether it is worn in a standardized manner. However, its main focus is still on the judgment of the position, rather than a comprehensive analysis of the wearing details.

[0005] In summary, the main existing problems are: lack of detailed detection. Existing methods can usually only detect whether the seat belt is worn and make safety judgments through auxiliary methods, but cannot detect the specific details of wearing the seat belt. It is difficult to identify the situation of missing fastening. Some key parts that are not fastened (such as chest belt, waist belt or leg belt) are often overlooked, resulting in safety hazards.

[0006] In view of the above-mentioned deficiencies in the prior art, the present invention proposes an intelligent and fine recognition and detection method for the wearing of labor protection articles based on semantic segmentation. By using deep learning technology, it performs fine recognition and detection on whether the workers are wearing safety belts and whether the safety belts are worn properly (such as loose safety belts, violations such as missing legs (left legs and right legs), missing chest belts and missing waist belts), completes the detection of safety belt wearing violations by relevant construction workers, and provides an intelligent and efficient solution for safety management in the chemical industry. Summary of the invention

[0007] In order to solve the problem of irregular wearing of labor protection products, the purpose is to provide a method and device for intelligent and precise identification of labor protection products based on semantic segmentation, which solves the problem that the standardization is difficult to judge in the existing labor protection products wearing detection method. The technical solution to achieve the purpose of the present invention is as follows:

[0008] In a first aspect, the present invention provides a method for intelligent and precise recognition and detection of labor protection products based on semantic segmentation, comprising the following steps:

[0009] S1: Collect video data shot in different scenes and annotate them for target detection to obtain a target detection dataset. Use the target detection dataset to train a target detection network to obtain a target detection model.

[0010] S2: Collect video data shot in different scenes, perform data enhancement and semantic segmentation annotation to obtain a semantic segmentation dataset, use the semantic segmentation dataset to train a semantic segmentation network, and obtain a semantic segmentation model;

[0011] S3: Obtain video data of the staff entering the designated area, and perform image denoising preprocessing on the wearable video data;

[0012] S4: Use the object detection model trained in S1 to perform object detection on the preprocessed video data;

[0013] S5: Use the semantic segmentation model trained in S2 to perform semantic segmentation on the video data detected in step S4;

[0014] S6: Evaluate the data after semantic segmentation, count the number of pixels of different categories according to the prediction results, make corresponding logical judgments, and output the corresponding judgment information.

[0015] In a second aspect, the present invention provides an intelligent and precise identification and detection device for wearing labor protection articles based on semantic segmentation, the device comprising:

[0016] Target detection model building unit: used to collect video data shot in different scenes, and perform target detection annotation to obtain a target detection data set, and use the target detection data set to train a target detection network to obtain a target detection model;

[0017] Semantic segmentation model building unit: used to collect video data shot in different scenes, perform data enhancement and semantic segmentation annotation, obtain semantic segmentation data set, use the semantic segmentation data set to train the semantic segmentation network, and obtain the semantic segmentation model;

[0018] Image denoising unit: used to obtain video data of staff entering the designated area and perform image denoising preprocessing on the wearable video data;

[0019] Object detection unit: Use the trained object detection model to perform object detection on the preprocessed video data;

[0020] Semantic segmentation unit: Use the trained semantic segmentation model to perform semantic segmentation on video data;

[0021] The result output unit is used to evaluate the data after semantic segmentation, count the number of pixels of different categories according to the prediction results, make corresponding logical judgments, and output the corresponding judgment information.

[0022] Beneficial effects of the present invention: Refined identification and detection are performed. The intelligent and refined identification and detection method for wearing labor protection products based on semantic segmentation can perform refined identification of the wearing of seat belts. The present invention can not only detect whether a seat belt is worn, but also identify various wearing violations, such as loose seat belts, missing legs, missing chests and missing waists. These violations can be accurately detected, realizing the intelligentization and refinement of seat belt wearing detection, reducing errors and missed detections in manual detection, and improving overall management efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of this specification. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0024] Figure 1 is a flowchart showing a method for intelligent and precise identification and detection of labor protection products based on semantic segmentation according to an embodiment of the present specification;

[0025] Figure 2 is a schematic diagram representing the Temporal Feature Fusion Module (TFAM);

[0026] Figure 3 is a flow chart for explaining the risk assessment of wearing protective equipment in this embodiment;

[0027] Figure 4 It is a schematic diagram showing an intelligent and precise recognition and detection device for wearing labor protection articles based on semantic segmentation. DETAILED DESCRIPTION

[0028] In order to more clearly illustrate the purpose, technical solutions and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments are only used to explain the present invention and are not intended to limit its scope. The components of the embodiments shown in the description and the accompanying drawings can be arranged and designed in various different configurations.

[0029] The detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the present invention, but represents selected embodiments of the present invention. Technicians can obtain other embodiments based on the principles and ideas of the present invention, and these embodiments also belong to the scope of protection of the present invention.

[0030] The features, operations or characteristics described in the specification may be combined in any appropriate manner to form various embodiments. The steps or actions in the method description may also be swapped or adjusted in order according to the judgment of the technician. Therefore, the order in the specification and drawings is only for the purpose of clearly describing the embodiment of the safety belt and is not meant to be a required order unless otherwise specified that a certain order must be followed.

[0031] The present application provides a method for intelligent and precise identification and detection of labor protection products based on semantic segmentation, which includes: collecting video data shot in different scenes, and annotating target detection to obtain a target detection data set, using the target detection data set to train a target detection network, and obtaining a target detection model; collecting video data shot in different scenes, and performing data enhancement and semantic segmentation annotation using an interactive semi-automatic image segmentation and annotation tool based on the SAM (Semi-Automatic Masking) algorithm to obtain a semantic segmentation data set, and using the semantic segmentation data set to train a semantic segmentation network to obtain a semantic segmentation model; obtaining video data of staff entering a designated area, and using an image denoising method to pre-process the wearing video data; using a target detection algorithm and a trained target detection model to perform target detection on the pre-processed video; using a semantic segmentation algorithm and a trained semantic segmentation model to perform semantic segmentation on the detected video data in the human body area; evaluating the data segmented by the semantic segmentation model, counting the number of pixels appearing in each category in the image according to the prediction results, and performing corresponding logical judgments, and outputting corresponding information. The present application obtains whether labor protection products are worn through a target detection model, and then uses a semantic segmentation model to detect whether the wearing of labor protection products is in violation of regulations.

[0032] The features and performance of the present invention are further described in detail below in conjunction with the embodiments and drawings.

[0033] Embodiment 1

[0034] A preferred embodiment of the present invention provides a method for intelligent and precise identification and detection of labor protection products based on semantic segmentation. For the specific workflow, please refer to Figure 1 , including the following steps:

[0035] Training phase

[0036] S1: Collect video data shot in different scenes and annotate them for target detection to obtain a target detection dataset. Use the target detection dataset to train a target detection network to obtain a target detection model.

[0037] Specifically, in this embodiment, 700 photos taken by the camera are selected and annotated for target detection, specifically the seat belt and human body are annotated. The target detection data set obtained is divided into a training set and a validation set according to a ratio of 4:1. The target detection network is trained using the YOLOv8 algorithm. The YOLO algorithm is an end-to-end one-stage target detection algorithm based on deep learning and convolutional neural networks. Darknet-53 is used as the backbone network, PANet is used as the Neck structure, and the decoupled head structure is used as the Head part. The TaskAlignedAssigner positive sample allocation strategy is used for Loss calculation. Finally, the detected target bounding box is output, as well as the corresponding target category confidence and category probability. Specific parameters: the number of training iterations is 1000, the maximum learning rate is 0.01, the minimum learning rate is the maximum learning rate × 0.01, the training set cropping size is 640 × 640, the label smoothing is 0.02, the Stochastic Gradient Descent (SGD) optimizer is used, the learning rate reduction method is cos, the weight decay is 0.0005, and the activation function is Sigmoid Linear Unit (SiLU). The overall backbone is as follows: Conv+Conv+C2f+Conv+C2f+Conv+C2f+Conv+C2f+SPPF. While ensuring accuracy, it has a very high detection speed and can achieve real-time detection.

[0038] S2: Collect video data shot in different scenes, perform data enhancement and semantic segmentation annotation to obtain a semantic segmentation dataset, and use the semantic segmentation dataset to train a semantic segmentation model to obtain an improved model;

[0039] Specifically, in this embodiment, 200 photos taken by the camera are selected for semantic segmentation annotation, specifically, the semantic segmentation data set is annotated into seven categories: background, safety, loose seat belt, leg leakage, chest leakage, waist leakage, and other (including: back, left and right) as a semantic segmentation data set for wearing labor protection products; and then divided into a training set and a test set according to a ratio of 4:1, the training set is used for semantic segmentation training, and the test set is used to verify the effect of semantic segmentation. Then, the semantic segmentation data set is used to train the semantic segmentation network, and the semantic segmentation network adopts an improved U-net model, with specific parameters as follows: the number of training iterations is 500 times, the maximum learning rate is 0.0001, the minimum learning rate is the maximum learning rate × 0.01, the training set cropping size is 512 × 512, the batch size is set to 2, and the Sophia optimizer is used. The optimizer significantly reduces the training time by improving the optimization algorithm, while maintaining the accuracy and performance of the model, and can be trained at twice the speed of the Adam optimizer, improving the training efficiency and accelerating the model convergence. The learning rate reduction method selects cos, and the backbone feature extraction network is VGG. In this embodiment, the input image size is 512×512×3, and the specific encoding layer execution method is as follows:

[0040] 1. conv1: Perform two [3,3] 64-channel convolutions to obtain a preliminary effective feature layer of [512,512,64], and then perform 2x2 maximum pooling to obtain a feature layer of [256,256,64].

[0041] 2. conv2: Perform two [3,3] 128-channel convolutions to obtain a preliminary effective feature layer of [256,256,128], and then perform 2x2 maximum pooling to obtain a feature layer of [128,128,128].

[0042] 3. conv3: Perform three [3,3] 256-channel convolutions to obtain a preliminary effective feature layer of [128,128,256], and then perform 2x2 maximum pooling to obtain a feature layer of [64,64,256].

[0043] 4. conv4: Perform three [3,3] 512-channel convolutions to obtain a preliminary effective feature layer of [64,64,512], and then perform 2X2 maximum pooling to obtain a [32,32,512] feature layer.

[0044] 5. conv5: Perform three [3,3] 512-channel convolutions to obtain a preliminary effective feature layer of [32,32,512].

[0045] The five preliminary effective feature layers are upsampled and feature fused. The specific steps are as follows:

[0046] 1. The obtained preliminary effective feature layer [32,32,512] is upsampled to obtain a feature layer of [64,64,512] and the preliminary effective feature layer of [64,64,512] obtained in conv4. Feature fusion (TFAM) is performed to obtain a feature layer of [64,64,512]. The [64,64,512] feature layer is convolved twice to obtain [64,64,512], and then the number of channels is adjusted to [64,64,256] using a 1x1 convolution kernel;

[0047] 2. The obtained preliminary effective feature layer of [64, 64, 256] is upsampled to obtain a feature layer of [128, 128, 256] and the preliminary effective feature layer of [128, 128, 256] obtained in conv3. Feature fusion (TFAM) is performed to obtain a feature layer of [128, 128, 256]. The [128, 128, 256] feature layer is convolved twice to obtain [128, 128, 256], and then the number of channels is adjusted to [128, 128, 128] using a 1x1 convolution kernel;

[0048] 3. The obtained preliminary effective feature layer [128,128,128] is upsampled to obtain a feature layer of [256,256,128] and the preliminary effective feature layer of [256,256,128] obtained in conv2. Feature fusion (TFAM) is performed to obtain a feature layer of [256,256,128]. The [256,256,128] feature layer is convolved twice to obtain [256,256,128], and then the number of channels is adjusted to [256,256,64] using a 1x1 convolution kernel;

[0049] 4. The obtained preliminary effective feature layer is upsampled to obtain a feature layer of [512, 512, 64] and the [512, 512, 64] preliminary effective feature layer obtained in conv1 is feature fused (TFAM) to obtain a feature layer of [512, 512, 64], and then a 1x1 convolution kernel is used to adjust the number of channels to [512, 512, 64];

[0050] Finally, a 1x1 convolution is used to adjust the channels and adjust the number of channels of the final feature layer to the target category. In this embodiment, the number of target categories is 6. The improved U-Net model is a deep learning architecture for image segmentation, which adopts an encoder-decoder structure and realizes accurate segmentation through skip connections and multi-scale feature fusion;

[0051] Specifically, the semantic segmentation annotation adopts an interactive semi-automatic image segmentation annotation tool based on the SAM (Semi-Automatic Masking) algorithm, an application designed specifically for image segmentation tasks, which aims to simplify the image annotation process, improve annotation efficiency, and retain the judgment ability of human experts. It can quickly and accurately create accurate segmentation annotations for target objects in images.

[0052] Specifically, the encoder-decoder structure adopted in the improved U-net model. The encoder is composed of multiple encoding layers, and each encoding layer is composed of a series of convolutional layers and pooling layers. The convolutional layer is used to extract image features, and the pooling layer is used to gradually reduce the size of the feature map. After each encoding layer, the size of the feature map decreases, but the number of channels increases, thereby capturing feature information at different levels and scales. The last layer output of the encoder is a series of high-dimensional feature maps, which represent the abstract representation of the image at different levels. The decoder is symmetrical with the encoder, and its goal is to decode the high-dimensional feature map output by the encoder into a segmentation result of the same size as the original input image. The decoder gradually restores the resolution of the feature map through upsampling operations, and fuses the decoder's feature map with the encoder feature map of the corresponding level through jump connections; in this embodiment, a temporal feature fusion module (Temporal The decoder outputs the last layer of the decoder as a segmented image, which has the same size as the original input image but contains pixel-level object segmentation information.

[0053] Specifically, the temporal feature fusion module TFAM features fusion as follows Figure 2 As shown in the figure, it includes a channel branch and a spatial branch. The channel branch is used to enhance the attention of channel information, and the spatial branch is used to enhance the attention of spatial information. The two input features are simultaneously pooled in the spatial dimension and the channel dimension, and then the spatial dimension pooling and the channel dimension pooling are spliced ​​respectively, and then the weights are determined to retain useful information, and finally separated; through weight adjustment, the more valuable parts of the features are retained, while unimportant or misleading information is suppressed, thereby improving the accuracy and robustness of change detection. TFAM uses channel and spatial attention to determine the important parts of the features. In the channel branch, the two feature layers of the input are passed through global pooling across spatial dimensions to aggregate spatial information. The aggregation process can be expressed as:

[0054]

[0055] Where Sc represents the aggregated spatial features, Feature layer1 and Feature layer2 represent the features in the backbone feature extraction and the features in the enhanced feature extraction, respectively, and Avg (·) and Max (·) represent the global average pooling and global maximum pooling across spatial dimensions, respectively.

[0056] The aggregated spatial features are passed to two 1D convolutions to generate channel weights:

[0057]

[0058] Where Wc1, Wc2 represent dual-channel weights, Conv1(·) and Conv2(·) represent one-dimensional convolutions. Then the Softmax method is used to normalize these two weights so that their sum is equal to 1:

[0059]

[0060] Where W'c1, W'c2 represent the output channel weights. In the spatial branch, the spatial weights W's1 and W's2 are implemented in the same way to determine the important part between features in the spatial dimension. The channel weights and spatial weights are summed up to get the total weight to determine the important part between features. Finally, the total weight is multiplied by the feature and summed up to effectively fuse the bi-temporal features. The output can be expressed as:

[0061]

[0062] The Output layer represents the fused features. By adjusting the weights, the more valuable parts of the dual-phase features are retained, while unimportant or misleading information is suppressed, thereby improving the accuracy and robustness of the model.

[0063] The training file uses the VOC format. The original image is a common RGB image, and the label is a grayscale image. Semantic segmentation is to classify each pixel of the original image. Therefore, the network can be trained by comparing the probability of each pixel belonging to each category in the prediction result with the label. The LOSS used by the model consists of two parts:

[0064] When the semantic segmentation platform uses Softmax to classify pixels, it uses Cross Entropy Loss to calculate the loss. The calculation formula is:

[0065]

[0066] Where i represents the index of the category, p(xi) is the probability of category i in the true label, and q(x i) is the model’s predicted probability for class i.

[0067] Dice loss uses the evaluation index of semantic segmentation as Loss. The Dice coefficient is a set similarity measurement function, which is usually used to calculate the similarity of two samples. The value range is [0,1]. The Dice Loss expression is as follows:

[0068]

[0069] Among them, X represents the pixel label of the real segmentation image, Y represents the pixel category of the model predicted segmentation image, |X∩Y| is approximately the dot product between the pixels of the predicted image and the pixels of the real label image, and |X| and |Y| are approximately the sum of the pixels in their respective corresponding images.

[0070] Specifically, in this embodiment, the data enhancement in S2 adopts elastic deformation. Elastic deformation is a non-rigid deformation method that creates an elastic effect by applying random nonlinear displacement to the image. Its principle steps are as follows:

[0071] S2.1: Divide the image into small local regions (patches);

[0072] S2.2: A displacement field is randomly generated in each local area, that is, Δx(x,y)=rand(-1,+1), Δy(x,y)=rand(-1,+1), where rand(-1,+1) generates a random number uniformly distributed between (-1,1), and then convolves Δx and Δy with a Gaussian function with a standard deviation of σ. It is used to represent the movement direction and displacement of pixels in the area;

[0073] S2.3: Multiply the displacement field after Gaussian convolution by the proportional factor α=4 that controls the deformation intensity to obtain an elastic deformation displacement field. Finally, apply this displacement field to the image after affine transformation to obtain the final elastic deformation enhanced data.

[0074] Testing Phase

[0075] S3: Obtain video data of staff entering the designated area, and pre-process the wearable video data using image denoising methods;

[0076] Specifically, in this embodiment, the video data of the specified area is acquired in real time for preprocessing, including image denoising, to reduce noise and improve the recognizability of video quality, thereby improving the recognition rate and accuracy of the algorithm. Bilateral Filter, a commonly used denoising method, is an image filtering technology that takes into account the spatial distance between pixels and the difference between pixel values ​​to maintain the edges and details of the image and can effectively remove noise. It is based on two similarity metrics: spatial similarity and grayscale similarity. In bilateral filtering, the new value of a pixel is calculated by taking the weighted average of the pixels in its neighborhood, with the weights determined by the spatial distance and grayscale similarity. This allows the filter to retain edges while smoothing the image. The bilateral filtering algorithm formula is as follows:

[0077]

[0078] Where I is the input image; p is the position of the current pixel; Ω is the window centered at p; W p is the normalized weight,

[0079] ; is the spatial Gaussian kernel, which is used to measure the spatial distance between pixels; is the grayscale Gaussian kernel, which is used to measure the grayscale similarity between pixels; I p and I q Represent the grayscale values ​​of pixels p and q respectively.

[0080] S4: Use the object detection model trained in S1 to perform object detection on the preprocessed video. By inputting the preprocessed video data, the YOLO model can detect the human body area in the video in real time and determine whether the operator is wearing labor protection equipment. If the wearing of labor protection equipment safety belts is detected, enter S5 to continue semantic segmentation. Otherwise, an alarm is issued and marked as a violation event.

[0081] S5: Use the semantic segmentation model to perform semantic segmentation on the video data detected by YOLO in step S4. The semantic segmentation specifically includes the following steps:

[0082] S5.1: Backbone feature extraction. The model uses the backbone part to obtain feature layers one after another. The backbone feature extraction part is similar to VGG, which is a stack of convolution and maximum pooling. Five preliminary effective feature layers can be obtained by backbone feature extraction. In S5.2, the model uses these five effective feature layers to perform feature fusion.

[0083] S5.2: To enhance feature extraction, the model uses the five preliminary effective feature layers obtained from the backbone to perform upsampling, and uses TFAM to fuse features with the corresponding feature layers to obtain an effective feature layer that finally fuses all features.

[0084] S5.3: Prediction, the model uses the last fused feature layer obtained to classify each feature point. Since the input and output sizes of the model are consistent, it is equivalent to classifying each pixel point.

[0085] S6: Evaluate the data after semantic segmentation, count the number of pixels of different categories according to the prediction results, make corresponding logical judgments, and output the corresponding judgment information. For the specific workflow, please refer to Figure 3 .

[0086] In one embodiment, the S6 logic judgment divides the detected label categories into seven categories: background, safety, loose seat belt state, leg (left leg and right leg) leakage, chest leakage, waist leakage and others (including back, left and right sides). Define A0 and A1 to represent the number of background and safety pixels respectively, A2 represents the number of pixels in the loose seat belt state, A3 represents the number of pixels in the left leg and right leg leakage respectively, A4 represents the number of pixels in the chest leakage, and A5 represents the number of pixels in the waist leakage; the number of pixels in the unsafe state B1 is the sum of the number of pixels in the five categories of loose seat belt state, leg leakage (left leg and right leg), chest leakage, and waist leakage. ε represents an infinitesimal positive number, which is used to ensure that the denominator is not zero, that is: B1=A2+A3+A4+A5. The logic judgment calculation formula is:

[0087]

[0088] If the number of pixels in B1 is greater than the number of pixels in A1, and P1 is greater than the set threshold T (threshold), it is judged as unsafe to wear and needs to be dressed. 2、 A 3、 A 4、 A5 and A1 ratio P j Compare with the set threshold to obtain specific violation details. The calculation formula is:

[0089]

[0090] P i By comparing with the corresponding thresholds, the looseness of the safety belt, the lack of fastening of the legs (left and right legs), the lack of fastening of the chest and the lack of fastening of the waist can be detected respectively, and multiple violations can be detected at the same time. If neither of the above two conditions is met, the present invention determines that the operator is wearing in compliance and can pass.

[0091] In the example, P2>=1 / 6, P3>=1 / 6, P4>=1 / 6 and P5>=1 / 6 can respectively detect the loose seat belt state, leg (left leg and right leg) unfastened, chest unfastened and waist unfastened conditions, and can detect multiple violations at the same time, such as chest and waist unfastened violations.

[0092] Embodiment 2

[0093] refer to Figure 4 The labor protection article wearing intelligent fine recognition detection device based on semantic segmentation shown in the figure comprises:

[0094] Target detection model building unit: used to collect video data shot in different scenes, and perform target detection annotation to obtain a target detection data set, and use the target detection data set to train a target detection network to obtain a target detection model;

[0095] Semantic segmentation model building unit: used to collect video data shot in different scenes, perform data enhancement and semantic segmentation annotation, obtain semantic segmentation data set, use the semantic segmentation data set to train the semantic segmentation network, and obtain the semantic segmentation model;

[0096] Image denoising unit: used to obtain video data of staff entering the designated area and perform image denoising preprocessing on the wearable video data;

[0097] Object detection unit: Use the trained object detection model to perform object detection on the preprocessed video data;

[0098] Semantic segmentation unit: Use the trained semantic segmentation model to perform semantic segmentation on video data;

[0099] The result output unit is used to evaluate the data after semantic segmentation, count the number of pixels of different categories according to the prediction results, make corresponding logical judgments, and output the corresponding judgment information.

[0100] Embodiment 3: In this embodiment, a computer-readable storage medium is provided, on which a computer program is stored. The computer program can be executed by a processor to implement the intelligent and precise identification and detection method for wearing labor protection products provided in Embodiment 1.

[0101] In summary, this application combines deep learning target detection and semantic segmentation. First, the target algorithm is used to determine the area of ​​people and labor protection products, and then the required target, that is, the worn seat belt, is semantically segmented. Finally, by comparing the number of different pixel points, it automatically determines whether the protection is a violation, thereby accurately identifying violations in the wearing of labor protection products and issuing an alarm.

[0102] The above description is only a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions and improvements made by any technician familiar with the field within the spirit and principle of the present invention should be included in the scope of protection of the present invention.

Claims

1. An intelligent and precise recognition and detection method for wearing labor protection products based on semantic segmentation, characterized in that The following steps are involved: S1: Collect video data shot in different scenes and annotate them for target detection to obtain a target detection dataset. Use the target detection dataset to train a target detection network to obtain a target detection model. S2: Collect video data shot in different scenes, perform data enhancement and semantic segmentation annotation to obtain a semantic segmentation dataset, use the semantic segmentation dataset to train a semantic segmentation network, and obtain a semantic segmentation model; S3: Obtain video data of the staff entering the designated area, and perform image denoising preprocessing on the wearable video data; S4: Use the object detection model trained in S1 to perform object detection on the preprocessed video data; S5: Use the semantic segmentation model trained in S2 to perform semantic segmentation on the video data detected in step S4; S6: Evaluate the data after semantic segmentation, count the number of pixels of different categories according to the prediction results, make corresponding logical judgments, and output corresponding judgment information; In S2, an improved UNet algorithm is used to train a semantic segmentation network, which is a deep learning architecture for image segmentation and adopts an encoder-decoder structure; The encoder is responsible for gradually reducing the resolution of the input image and extracting high-level semantic features of the image; The decoder gradually upsamples the low-resolution features and fuses them with the encoder features through a temporal feature fusion module, and finally outputs a segmentation result with the same resolution as the input image. The temporal feature fusion module includes two branches, namely a channel branch and a space branch. The channel branch is used to enhance the attention to channel information, and the space branch is used to enhance the attention to spatial information.

2. The labor protection article wearing intelligent fine identification detection method according to claim 1 is characterized in that: In S1, the YOLOv8 algorithm is used for target detection.

3. The labor protection article wearing intelligent fine identification detection method according to claim 1 is characterized in that: The data enhancement in S2 adopts elastic deformation, and the specific steps are as follows: S2.1: Segment the image into several local regions; S2.2: A displacement field is randomly generated in each local area, namely Δ x ( x , y ) = rand(-1,+1), Δ y ( x , y )=rand(-1,+1), where rand(-1,+1) generates a random number uniformly distributed between (-1,1); a Gaussian function with a standard deviation of σ is used to calculate Δ x and Δ y Convolution is performed to represent the moving direction and displacement of pixels in the local area; S2.3: Multiply the displacement field after Gaussian convolution by the proportional factor α that controls the deformation intensity to obtain an elastic deformation displacement field. Apply this displacement field to the image after affine transformation to obtain the final elastic deformation enhanced data.

4. The labor protection article wearing intelligent fine identification detection method according to claim 1 is characterized in that: The image denoising method in S3 is bilateral filtering, and the bilateral filtering algorithm formula is as follows: ; in, I is the input image; p is the current pixel position; Ω is p Centered window; is the normalized weight; is the spatial Gaussian kernel, which is used to measure the spatial distance between pixels; is the grayscale Gaussian kernel, which is used to measure the grayscale similarity between pixels; I p and I q Represents pixels p and q The gray value of .

5. The labor protection article wearing intelligent fine identification detection method according to claim 1 is characterized in that: If it is detected in S4 that there is no labor protection equipment in a certain human body area, it is marked as a violation event, otherwise the next step is entered to continue detection.

6. The labor protection article wearing intelligent fine identification detection method according to claim 1 is characterized in that: In the step S5, the semantic segmentation model is used to perform semantic segmentation on the labor protection products detected by YOLO, and the improved model is used to perform semantic segmentation on the human body area in the video detected by the YOLO model in step S4; the improved UNet model implementation specifically includes the following steps: S5.1: Backbone feature extraction: Five preliminary effective feature layers are obtained using backbone feature extraction; S5.2: Enhanced feature extraction: Upsample the five preliminary effective feature layers obtained, and use the temporal feature fusion module to fuse the features with the corresponding feature layers to obtain a final effective feature layer that integrates all features. S5.3: Prediction: The model uses the last fused feature layer obtained to classify each feature point. Since the input and output sizes of the model are consistent, it is equivalent to classifying each pixel point.

7. The labor protection article wearing intelligent fine identification detection method according to claim 1 is characterized in that: The S6 logical judgment is specifically: definition A 1 indicates the number of safe pixels. A 2 represents the number of pixels where the seat belt is loose. A 3 represents the number of pixels of the left and right leg leakage system, A 4 represents the number of pixels of the chest leakage system, A 5 represents the number of pixels missing from the waist. B 1= A 2+ A 3+ A 4+ A 5; Calculate the safety judgment function P 1 If the value of B The number of pixels of 1 is greater than or equal to A If the number of pixels with a value greater than or equal to the set threshold is greater than or equal to the set threshold, it is judged as unsafe to wear; The safety judgment function P 1 The calculation formula is: ; in, ε Represents an infinitesimal positive number.

8. An intelligent and precise identification and detection device for wearing labor protection articles based on semantic segmentation, characterized in that: The device comprises: Target detection model building unit: used to collect video data shot in different scenes, and perform target detection annotation to obtain a target detection data set, and use the target detection data set to train a target detection network to obtain a target detection model; Semantic segmentation model building unit: used to collect video data shot in different scenes, perform data enhancement and semantic segmentation annotation, obtain semantic segmentation data set, use the semantic segmentation data set to train the semantic segmentation network, and obtain the semantic segmentation model; Image denoising unit: used to obtain video data of staff entering the designated area and perform image denoising preprocessing on the wearable video data; Object detection unit: Use the trained object detection model to perform object detection on the preprocessed video data; Semantic segmentation unit: Use the trained semantic segmentation model to perform semantic segmentation on video data; The result output unit is used to evaluate the data after semantic segmentation, count the number of pixels of different categories according to the prediction results, make corresponding logical judgments, and output the corresponding judgment information; The improved UNet algorithm is used to train the semantic segmentation network. The algorithm is a deep learning architecture for image segmentation, which adopts an encoder-decoder structure; The encoder is responsible for gradually reducing the resolution of the input image and extracting high-level semantic features of the image; The decoder gradually upsamples the low-resolution features and fuses them with the encoder features through a temporal feature fusion module, and finally outputs a segmentation result with the same resolution as the input image. The temporal feature fusion module includes two branches, namely a channel branch and a space branch. The channel branch is used to enhance the attention to channel information, and the space branch is used to enhance the attention to spatial information.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which can be executed by a processor to implement the intelligent and precise identification and detection method for wearing labor protection products according to any one of claims 1 to 7.