Construction site worker unsafe behavior identification method, system, equipment and medium
By using the SloULoss loss function, mean drift clustering algorithm and NAM attention mechanism in the YOLOv5 algorithm, an improved target recognition model is built, which solves the problems of misdetection and missed detection in the detection of unsafe behavior of construction workers in the existing technology, and improves the reliability and efficiency of detection.
Patent Information
- Application Number
- CN202311329980.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-13
- Publication Date
- 2025-04-15
AI Technical Summary
In the prior art, the target detection model based on algorithms such as YOLOv5 has problems with mis-checking and missed inspections in the unsafe behavior detection of construction personnel at oil and gas field construction sites, and the overall convergence speed is slow, resulting in a decrease in detection reliability.
By replacing the CioULoss loss function as the SloULoss loss function in the YOLOv5 algorithm framework, introducing the mean drift clustering algorithm to suppress the anchor box, and introducing the NAM attention mechanism to optimize the convolutional block attention module to build an improved target recognition model.
It effectively accelerates the convergence speed of the YOLOv5 algorithm, improves the regression accuracy and detection accuracy, improves the overall confidence of feature recognition, and can more accurately detect the unsafe behavior of construction workers.
Smart Images

Figure CN119832624A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of oil and gas field operation monitoring, and in particular relates to a method, system, equipment and medium for identifying unsafe behaviors of workers at a construction site. Background Art
[0002] As oil and gas field exploration accelerates and digital automation of logging and drilling leads to faster production, the number of oil and gas field production and construction well stations and well sites increases, requiring ever-expanding monitoring areas and scales. This, in turn, places higher demands on safety management and control at production and construction sites. The need for real-time monitoring of unsafe behaviors and conditions in key areas such as production sites, construction sites, and pipelines is becoming increasingly urgent.
[0003] At present, target detection models constructed based on the YOLOv5 algorithm network, YOLOv3 algorithm network, VGG16 algorithm network, AlexNet network and ResNet network in the existing technology complete target detection of multiple scene images captured by video surveillance systems deployed in oil and gas fields based on the current detection models. However, the detection results output by the target detection models constructed based on these algorithm networks have problems of false detection and missed detection of construction workers, and the overall convergence speed of the algorithm is slow, which leads to reduced reliability in detecting unsafe behaviors of construction workers at oil and gas field construction sites. Summary of the Invention
[0004] In order to solve the above-mentioned problems existing in the prior art, the purpose of the present invention is to provide a method, system, equipment and medium for identifying unsafe behaviors of workers on a construction site.
[0005] The technical solution adopted in the present invention is:
[0006] The method for identifying unsafe behaviors of workers at a construction site includes the following steps:
[0007] Acquire one or more scene images of an oil and gas field construction site captured by a video surveillance system;
[0008] The target recognition model constructed by the improved YOLOv5 algorithm is used to identify the behavior of the construction workers in the one or more scene images, thereby obtaining an identification result of the unsafe behavior of the construction workers in the one or more scene images. The improved YOLOv5 algorithm specifically comprises: based on the YOLOv5 algorithm framework, replacing the CioULoss loss function of the YOLOv5 algorithm framework with the SloULoss loss function, suppressing the anchor boxes extracted by the YOLOv5 algorithm framework based on the mean shift clustering algorithm, and introducing the NAM attention mechanism to optimize the convolutional block attention module of the YOLOv5 algorithm framework;
[0009] The recognition results are processed by business logic to generate warning information corresponding to unsafe behaviors of construction workers in one or more scene images.
[0010] The present invention is based on replacing the CioULoss loss function of the YOLOv5 algorithm framework with the SloULoss loss function, so that the SIoULoss loss function redefines the distance loss by introducing the vector angle between the required regressions, effectively reducing the degrees of freedom of regression, accelerating the convergence speed of the YOLOv5 algorithm framework and improving the regression accuracy; further, the anchor box extracted by the YOLOv5 algorithm framework is suppressed based on the mean shift clustering algorithm to improve the confidence of the anchor box, thereby improving the detection accuracy; finally, the NAM attention mechanism is introduced to optimize the convolution block attention module of the original YOLOv5 algorithm framework, so as to improve the attention performance of the YOLOv5 algorithm, so as to better detect the unsafe behavior of construction workers. Therefore, the target recognition model constructed based on the improved YOLOv5 algorithm framework of the present invention improves the overall confidence of feature recognition, and can more accurately detect the recognition results of unsafe behaviors of on-site construction workers.
[0011] As a preferred embodiment of the present invention, the following steps are also included:
[0012] Selecting a first sub-scene image representing a static dangerous area of the construction site and a second sub-scene image representing a dynamic dangerous area according to the scene image frame;
[0013] Construction workers close to the first sub-scene image or the second sub-scene image are identified according to the target recognition model, and warning information corresponding to unsafe behavior is generated.
[0014] As a preferred solution of the present invention, the construction workers close to the first sub-scene image are identified according to the target recognition model, and warning information corresponding to unsafe behavior is generated, specifically:
[0015] Identify and label the first sub-scene image according to the target recognition model to generate a local mask feature vector and a global mask feature vector of the first sub-scene image;
[0016] Jointly encoding the local mask feature vector and the global mask feature vector to obtain a pixel surface feature vector of the first sub-scene image;
[0017] Constructing a clustering attention mechanism based on a bidirectional long short-term memory neural network, and reconstructing a surface pixel feature vector of the first sub-scene image according to the clustering attention mechanism to obtain a deep pixel feature vector of the first sub-scene image;
[0018] The deep pixel feature vector of the first sub-scene image is input into the fully connected neural network layer of the target recognition model for classification and regression processing to obtain the recognition result of the unsafe behavior of the construction workers in the first sub-scene image.
[0019] As a preferred solution of the present invention, the construction workers close to the second sub-scene image are identified according to the target recognition model, and warning information corresponding to unsafe behavior is generated, specifically:
[0020] Identify and label the second sub-scene image according to the target recognition model to generate a local mask feature vector and a global feature vector of the second sub-scene image;
[0021] jointly encoding the local feature vector and the global feature vector of the second subscene image to obtain a surface pixel feature vector of the second subscene image;
[0022] The surface pixel feature vector of the second sub-scene image is input into the fully connected neural network layer of the target recognition model for classification and regression processing to obtain the recognition result of the unsafe behavior of the construction workers in the second sub-scene image.
[0023] As a preferred embodiment of the present invention, the identification results of the construction workers' unsafe behaviors include one or more of illegal actions in static danger areas, whether they are close to dynamic danger areas, whether they are wearing work clothes, and whether they are wearing safety helmets.
[0024] As a preferred embodiment of the present invention, the expression of the SloULoss loss function is:
[0025] Among them, IoU represents the overlap rate between the predicted box and the real box, Δ represents the distance cost redefined after considering the angle cost, and Ω represents the shape cost;
[0026] Suppressing anchor boxes extracted by the YOLOv5 algorithm framework based on the mean shift clustering algorithm, specifically: clustering the center points of multiple anchor boxes of the feature map extracted by the YOLOv5 algorithm framework using the mean shift clustering algorithm to obtain multiple groups of clustered anchor boxes, suppressing the confidence values calculated by the multiple groups of clustered anchor boxes based on a preset loss function threshold, and deleting anchor boxes that do not meet the loss function threshold; wherein, the sliding radius of the mean shift clustering algorithm is calculated based on the length and width of the anchor box;
[0027] The NAM attention mechanism is introduced to optimize the convolutional block attention module of the YOLOv5 algorithm framework. Specifically, according to the weight factor of the NAM attention mechanism, the scale factors of the channel attention module and the spatial attention module contained in the convolutional block attention module are respectively optimized by batch normalization and pixel normalization.
[0028] As a preferred embodiment of the present invention, the confidence value is calculated as follows:
[0029] Where s r Represents the confidence value of the rth group of anchor boxes, s i is the confidence value of the i-th group of anchor boxes, b i represents the i-th group of anchor boxes, IoU represents the loss function threshold, b r represents the rth group of anchor boxes, s r Represents the confidence value, softmax represents the normalization function, and N represents the total number of anchor boxes.
[0030] Construction site worker unsafe behavior identification system:
[0031] It includes an image acquisition module for acquiring one or more scene images of the oil and gas field construction site captured by the video monitoring system;
[0032] A recognition module is configured to identify the behavior of construction workers in the one or more scene images using a target recognition model constructed using an improved YOLOv5 algorithm, thereby obtaining recognition results of unsafe behaviors of construction workers in the one or more scene images. The improved YOLOv5 algorithm specifically includes: replacing the CioULoss loss function of the YOLOv5 algorithm framework with the SloULoss loss function, suppressing the anchor boxes extracted by the YOLOv5 algorithm framework based on the mean shift clustering algorithm, and introducing the NAM attention mechanism to optimize the convolutional block attention module of the YOLOv5 algorithm framework;
[0033] The alarm processing module is used to perform business logic processing on the recognition results and generate alarm information corresponding to unsafe behaviors of construction workers in one or more scene images.
[0034] An electronic device includes a processor, a communication interface, a memory and a communication bus; wherein the processor, the communication interface and the memory communicate with each other via the communication bus; the memory is used to store computer programs; and the processor is used to execute the programs stored in the memory to implement the above-mentioned method for identifying unsafe behaviors of construction site workers.
[0035] A computer-readable storage medium is used to store computer-readable instructions, which, when executed, perform the operations of the above-mentioned method for identifying unsafe behaviors of construction site workers.
[0036] The beneficial effects of the present invention are:
[0037] The present invention is based on replacing the CioULoss loss function of the YOLOv5 algorithm framework with the SloULoss loss function, so that the SIoULoss loss function redefines the distance loss by introducing the vector angle between the required regressions, effectively reducing the degrees of freedom of regression, accelerating the convergence speed of the YOLOv5 algorithm framework and improving the regression accuracy; further, the anchor box extracted by the YOLOv5 algorithm framework is suppressed based on the mean shift clustering algorithm to improve the confidence of the anchor box, thereby improving the detection accuracy; finally, the NAM attention mechanism is introduced to optimize the convolution block attention module of the original YOLOv5 algorithm framework, so as to improve the attention performance of the YOLOv5 algorithm, so as to better detect the unsafe behavior of construction workers. Therefore, the target recognition model constructed based on the improved YOLOv5 algorithm framework of the present invention improves the overall confidence of feature recognition, and can more accurately detect the recognition results of unsafe behaviors of on-site construction workers. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 1 is a flow chart of a method for identifying unsafe behaviors of workers at a construction site provided by an embodiment of the present invention;
[0039] Figure 2 This is a functional block diagram of a system for identifying unsafe behaviors of construction workers provided by an embodiment of the present invention;
[0040] Figure 3 It is a structural diagram of an electronic device provided by an embodiment of the present invention.
[0041] In the figure: 210 - image acquisition module; 220 - recognition module; 230 - alarm processing module; 300 - server; 310 - processor; 320 - memory; 330 - communication interface. DETAILED DESCRIPTION
[0042] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings herein can be arranged and designed in various different configurations.
[0043] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but rather merely represents selected embodiments of the present invention. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention. It should be noted that the embodiments of the present invention and the features therein may be combined with each other unless there is a conflict.
[0044] like Figure 1 As shown, the method for identifying unsafe behaviors of construction workers at a construction site of this embodiment includes the following steps:
[0045] S110: Acquire one or more scene images of the oil and gas field construction site captured by the video surveillance system.
[0046] In this embodiment, the one or more scene images include pictures of various scenes at different time periods at the oil and gas operation site. The scenes include wellheads, equipment areas, process areas, valve rooms, purification plants, etc., and the time periods include morning, noon, evening, etc. This ensures the accuracy of recognition in different scenes using the target recognition model established in step S120.
[0047] S120: Identify the behavior of the construction workers in the one or more scene images through a target recognition model constructed by an improved YOLOv5 algorithm to obtain an identification result of unsafe behavior of the construction workers in the one or more scene images; wherein the improved YOLOv5 algorithm is specifically as follows: based on the YOLOv5 algorithm framework, replace the CioULoss loss function of the YOLOv5 algorithm framework with the SloULoss loss function, suppress the anchor box extracted by the YOLOv5 algorithm framework based on the mean shift clustering algorithm, and introduce the NAM attention mechanism to optimize the convolution block attention module of the YOLOv5 algorithm framework.
[0048] In this embodiment, the YOLOv5 algorithm achieved good detection results in open source datasets and engineering applications. However, for large-scale oil and gas field construction scenarios, where construction workers, machinery, and helmets are often small objects, the detection process is prone to problems such as low accuracy, high missed detection rates, and poor results. Therefore, this embodiment, based on the YOLOv5 algorithm, improves target detection and enhances detection results by replacing the loss function, increasing the suppression of anchor boxes, and adding the Normalization-based Attention Module (NAM).
[0049] S130: Performing business logic processing on the recognition result to generate warning information corresponding to unsafe behaviors of construction workers in one or more scene images.
[0050] In this embodiment, the business logic refers to making judgments based on the recognition results. For example, if the construction worker is wearing a safety helmet, no alarm message will be generated. If he is not wearing a helmet, a voice message indicating that he is not wearing a safety helmet will be generated and broadcast through the smart terminal at the construction site.
[0051] Therefore, this embodiment is based on replacing the CioULoss loss function of the YOLOv5 algorithm framework with the SloULoss loss function, so that the SioULoss loss function redefines the distance loss by introducing the vector angle between the required regressions, effectively reducing the degree of freedom of the regression, accelerating the convergence speed of the YOLOv5 algorithm framework and improving the regression accuracy; further, the anchor box extracted by the YOLOv5 algorithm framework is suppressed based on the mean shift clustering algorithm to improve the confidence of the anchor box, thereby improving the detection accuracy; finally, the NAM attention mechanism is introduced to optimize the convolution block attention module of the original YOLOv5 algorithm framework, thereby improving the attention performance of the YOLOv5 algorithm, so as to better detect the unsafe behavior of construction workers. Therefore, the present invention constructs a target recognition model based on the improved YOLOv5 algorithm framework, and recognizes and detects targets in one or more construction site scene images based on this target recognition model, thereby improving the overall confidence of feature recognition and more accurately detecting the recognition results of unsafe behaviors of on-site construction workers.
[0052] In one embodiment, a first sub-scene image representing a static dangerous area of the construction site and a second sub-scene image representing a dynamic dangerous area are selected based on the scene image frame; construction workers close to the first sub-scene image or the second sub-scene image are identified based on the target recognition model, and warning information corresponding to unsafe behavior is generated.
[0053] Specifically, due to the complex on-site construction environment, construction workers may lack a certain level of safety awareness and easily overlook seemingly safe but potentially risky areas, which can lead to accidents. Based on the construction unit's construction specifications and the actual site conditions, the principles for demarcating dangerous areas, the types of accidents that may occur, and the level of danger are determined.
[0054] For example, conventional methods for identifying static dangerous areas mostly adjust the camera's installation position according to the dangerous area to achieve local area detection, which is suitable for conventional construction sites where the camera position is convenient to install. Due to the characteristics of oil and gas field construction sites, cameras are mostly fixedly installed at a location far away from the site in order to monitor a large area, so the conventional method of adjusting the camera's installation position is not applicable. How to detect unsafe behaviors such as personnel intrusion into local dangerous areas while ensuring large-scale scene monitoring is of great significance to the safety management and control of oil and gas field construction sites. Therefore, this embodiment selects a first sub-scene image representing the static dangerous area of the construction site and a second sub-scene image representing the dynamic dangerous area based on the acquired scene image; then, the construction personnel close to the first sub-scene image or the second sub-scene image are identified according to the target recognition model, and an alarm message corresponding to the unsafe behavior is generated.
[0055] In one embodiment, construction workers close to the first sub-scene image are identified and warning information corresponding to unsafe behavior is generated, specifically: the first sub-scene image is identified and labeled according to the target recognition model to generate a local mask feature vector and a global mask feature vector of the first sub-scene image; the local mask feature vector and the global mask feature vector are jointly encoded to obtain a pixel surface feature vector of the first sub-scene image; a clustering attention mechanism based on a bidirectional long short-term memory neural network is constructed, and the pixel surface feature vector of the first sub-scene image is reconstructed according to the clustering attention mechanism to obtain a deep pixel feature vector of the first sub-scene image; the deep pixel feature vector of the first sub-scene image is input into the fully connected neural network layer of the target recognition model for classification and regression processing to obtain an identification result of the unsafe behavior of the construction workers in the first sub-scene image.
[0056] In this embodiment, first, a local mask feature vector and a global mask feature vector of the first sub-scene image are generated. An encoder or an autoencoder can be used to jointly encode the local mask feature vector and the global mask feature vector. After encoding, the surface pixel features representing the first sub-scene image are output. Furthermore, a clustering attention mechanism based on a bidirectional long short-term memory neural network is constructed to reconstruct the pixel surface features of the first sub-scene image and obtain the deep pixel features of the image, thereby enriching the attention representation of unsafe construction behaviors and improving the accuracy of subsequent classification and regression using a fully connected neural network.
[0057] In one embodiment, construction workers close to the second sub-scene image are identified according to the target recognition model, and warning information corresponding to unsafe behavior is generated, specifically: the second sub-scene image is identified and labeled according to the target recognition model, and a local mask feature vector and a global feature vector of the second sub-scene image are generated; the local feature vector and the global feature vector of the second sub-scene image are jointly encoded to obtain a surface pixel feature vector of the second sub-scene image; the surface pixel feature vector of the second sub-scene image is input into the fully connected neural network layer of the target recognition model for classification and regression processing, and the recognition result of the unsafe behavior of the construction workers in the second sub-scene image is obtained.
[0058] In this embodiment, compared with the recognition of the first sub-scene image described in the above embodiment, consideration is given to the need to identify the specific behaviors of construction workers in static hazardous areas, such as whether they are making phone calls, smoking, wearing work clothes, etc. Therefore, based on the surface pixel features of the first sub-scene image, deep pixel features with deeper attention representation are reconstructed, thereby avoiding the problem of decreased prediction accuracy caused by false detection and missed detection of scene images, and making the final result after classification and regression processing more accurate.
[0059] In this embodiment, for the second sub-scene image, it is only necessary to determine whether there are construction workers approaching or entering, and there is no need to detect the behavior of people in dynamic dangerous areas, such as the working areas near construction machinery such as rollers, excavators, cranes, etc.
[0060] In one embodiment, the identification result of the unsafe behavior of the construction site workers includes one or more of illegal actions in a static danger zone, whether the worker is close to a dynamic danger zone, whether the worker is wearing work clothes, and whether the worker is wearing a safety helmet.
[0061] In one implementation, the expression of the SloULoss loss function is: Among them, IoU represents the overlap rate between the predicted box and the real box, Δ represents the distance cost redefined after considering the angle cost, and Ω represents the shape cost; the anchor box extracted by the YOLOv5 algorithm framework is suppressed based on the mean shift clustering algorithm, specifically: the center points of multiple anchor boxes of the feature map extracted by the YOLOv5 algorithm framework are clustered using the mean shift clustering algorithm to obtain multiple groups of clustered anchor boxes, and the confidence values calculated by the multiple groups of clustered anchor boxes are suppressed by a preset loss function threshold, and the anchor boxes that do not meet the loss function threshold are deleted; wherein, the sliding radius of the mean shift clustering algorithm is calculated according to the length and width of the anchor box; the NAM attention mechanism is introduced to optimize the convolution block attention module of the YOLOv5 algorithm framework, specifically: according to the weight factor of the NAM attention mechanism, the scale factors of the channel attention module and the spatial attention module contained in the convolution block attention module are respectively optimized by batch normalization and pixel normalization.
[0062] In this embodiment, the YOLOv5 algorithm uses CIoULoss as the bounding box regression loss function, and uses the Logits loss function and binary cross entropy (BCE) to calculate the loss of target score and class probability respectively. However, the direction of mismatch between the true box and the predicted box is not considered. The predicted box may "wander around" during the training process, resulting in slow model convergence, low efficiency, and poor results. To address the above problems, this embodiment uses the SIoULoss loss function to replace the CioULoss loss function. The SIoULoss loss function introduces the vector angle between the required regressions, redefines the distance loss, effectively reduces the degrees of freedom of regression, accelerates network convergence, and further improves the regression accuracy.
[0063] The calculation formula of IoU is B.B gt Represent the predicted box and the true box respectively.
[0064] The confidence value of this embodiment is equivalent to increasing the confidence value of the anchor box that contributes more to the detection target, reducing the confidence value of the candidate box that contributes less to the detection target, enhancing the correlation between the confidence of the anchor box and whether it is accurate, and improving the accuracy of suppressing redundant anchor boxes.
[0065] In one embodiment, the confidence value is calculated as follows: Where s r Represents the confidence value of the rth group of anchor boxes, s i is the confidence value of the i-th group of anchor boxes, b i represents the i-th group of anchor boxes, IoU represents the loss function threshold, b r represents the rth group of anchor boxes, s rRepresents the confidence value, softmax represents the normalization function, and N represents the total number of anchor boxes.
[0066] Based on the same inventive concept as the identification method provided in the above embodiment, please refer to Figure 2 This embodiment also provides a construction site worker unsafe behavior identification system, the system comprising:
[0067] An image acquisition module 210 is used to acquire one or more scene images of the oil and gas field construction site captured by a video surveillance system;
[0068] The recognition module 220 is configured to identify the behavior of the construction workers in the one or more scene images using a target recognition model constructed using an improved YOLOv5 algorithm, thereby obtaining recognition results of unsafe behaviors of the construction workers in the one or more scene images. The improved YOLOv5 algorithm specifically includes: replacing the CioULoss loss function of the YOLOv5 algorithm framework with the SloULoss loss function, suppressing the anchor boxes extracted by the YOLOv5 algorithm framework based on the mean shift clustering algorithm, and introducing the NAM attention mechanism to optimize the convolutional block attention module of the YOLOv5 algorithm framework;
[0069] The alarm processing module 230 is used to perform business logic processing on the recognition results and generate alarm information corresponding to unsafe behaviors of construction workers in one or more scene images.
[0070] The construction site worker unsafe behavior identification system in the embodiment of the present application is similar to the above Figure 1 The shown system for identifying unsafe behaviors of construction site workers is an invention based on the same concept. Through the above detailed description of the method for identifying unsafe behaviors of construction site workers, those skilled in the art can clearly understand the implementation process of the system for identifying unsafe behaviors of construction site workers in this embodiment. Therefore, for the sake of conciseness of the specification, it will not be repeated here.
[0071] Accordingly, the construction site worker unsafe behavior identification system provided by this embodiment is based on replacing the CioULoss loss function of the YOLOv5 algorithm framework with the SloULoss loss function, so that the SioULoss loss function redefines the distance loss by introducing the vector angle between the required regressions, effectively reducing the degree of freedom of regression, accelerating the convergence speed of the YOLOv5 algorithm framework and improving the regression accuracy; further, the anchor box extracted by the YOLOv5 algorithm framework is suppressed based on the mean shift clustering algorithm to improve the confidence of the anchor box, thereby improving the detection accuracy; finally, the NAM attention mechanism is introduced to optimize the convolution block attention module of the original YOLOv5 algorithm framework, so as to improve the attention performance of the YOLOv5 algorithm, so as to better detect the unsafe behavior of construction workers. Therefore, the target recognition model constructed based on the improved YOLOv5 algorithm framework of the present invention improves the overall confidence of feature recognition and can more accurately detect the recognition results of unsafe behaviors of on-site construction workers.
[0072] Based on the same inventive concept as the method for identifying unsafe behaviors of construction workers in the aforementioned embodiment, the embodiment of this specification further provides an electronic device, such as Figure 3 Please refer to Figure 3 , Figure 3 The figure shows a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The server 300 includes a processor 310, a memory 320, a communication interface 330, and at least one communication bus for connecting the processor 310, the memory 320, and the communication interface 330. The memory 320 includes, but is not limited to, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (PROM), or a compact disc read-only memory (CD-ROM), and is used for storing relevant instructions and data.
[0073] The communication interface 330 is used to receive and send data. The processor 310 may be one or more CPUs. In the case where the processor 310 is a CPU, the CPU may be a single-core CPU or a multi-core CPU. The processor 310 in the electronic device 300 is used to read one or more programs 321 stored in the memory 320 and perform the following operations: obtaining one or more scene images of an oil and gas field construction site captured by a video surveillance system; identifying the behavior of construction workers in the one or more scene images through a target recognition model constructed by an improved YOLOv5 algorithm, and obtaining recognition results of unsafe behaviors of construction workers in the one or more scene images; wherein the improved YOLOv5 algorithm is specifically as follows: based on the YOLOv5 algorithm framework, replacing the CioULoss loss function of the YOLOv5 algorithm framework with the SloULoss loss function, suppressing the anchor box extracted by the YOLOv5 algorithm framework based on the mean shift clustering algorithm, and introducing the NAM attention mechanism to optimize the convolution block attention module of the YOLOv5 algorithm framework; performing business logic processing on the recognition results to generate warning information corresponding to the unsafe behaviors of construction workers in the one or more scene images.
[0074] Based on the inventive concept of the method for identifying unsafe behaviors of construction site workers in the aforementioned embodiment, this embodiment also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, it implements the steps of any method of the method for identifying unsafe behaviors of construction site workers described above.
[0075] The present invention is not limited to the above-mentioned optional implementation modes. Anyone can derive other forms of products under the inspiration of the present invention. However, no matter what changes are made in the shape or structure, any technical solution that falls within the scope defined by the claims of the present invention falls within the scope of protection of the present invention.
Claims
1. A method for identifying unsafe behaviors of workers at a construction site, characterized by: The following steps are involved: Acquire one or more scene images of the oil and gas field construction site captured by a video surveillance system; The behavior of the construction workers in the one or more scene images is identified by a target recognition model constructed by the improved YOLOv5 algorithm, and the identification result of the unsafe behavior of the construction workers in the one or more scene images is obtained; wherein the improved YOLOv5 algorithm is specifically as follows: based on the YOLOv5 algorithm framework, the CioULoss loss function of the YOLOv5 algorithm framework is replaced by the SloULoss loss function, the anchor box extracted by the YOLOv5 algorithm framework is suppressed based on the mean shift clustering algorithm, and the NAM attention mechanism is introduced to optimize the convolution block attention module of the YOLOv5 algorithm framework; The recognition result is processed by business logic to generate warning information corresponding to unsafe behaviors of construction workers in one or more scene images.
2. The method for identifying unsafe behaviors of construction workers at a construction site according to claim 1, characterized in that: The following steps are also included: Selecting a first sub-scene image representing a static dangerous area of the construction site and a second sub-scene image representing a dynamic dangerous area according to the scene image frame; Construction workers close to the first sub-scene image or the second sub-scene image are identified according to the target recognition model, and warning information corresponding to unsafe behavior is generated.
3. The method for identifying unsafe behaviors of construction workers at a construction site according to claim 2, characterized in that: The construction personnel close to the first sub-scene image are identified according to the target recognition model, and warning information corresponding to the unsafe behavior is generated, specifically: Identify and annotate the first subscene image according to the target recognition model to generate a local mask feature vector and a global mask feature vector of the first subscene image; Jointly encoding the local mask feature vector and the global mask feature vector to obtain a pixel surface feature vector of the first sub-scene image; Constructing a clustering attention mechanism based on a bidirectional long short-term memory neural network, and reconstructing a surface pixel feature vector of the first sub-scene image according to the clustering attention mechanism to obtain a deep pixel feature vector of the first sub-scene image; The deep pixel feature vector of the first sub-scene image is input into the fully connected neural network layer of the target recognition model for classification and regression processing to obtain the recognition result of the unsafe behavior of the construction workers in the first sub-scene image.
4. The method for identifying unsafe behaviors of construction workers at a construction site according to claim 2, characterized in that: The construction workers close to the second sub-scene image are identified according to the target recognition model, and warning information corresponding to the unsafe behavior is generated, specifically: Identify and annotate the second subscene image according to the target recognition model to generate a local mask feature vector and a global feature vector of the second subscene image; Jointly encoding the local feature vector and the global feature vector of the second subscene image to obtain a surface pixel feature vector of the second subscene image; The surface pixel feature vector of the second sub-scene image is input into the fully connected neural network layer of the target recognition model for classification and regression processing to obtain the recognition result of the unsafe behavior of the construction workers in the second sub-scene image.
5. The method for identifying unsafe behaviors of construction workers at a construction site according to claim 1, characterized in that: The identification result of the unsafe behavior of the construction worker includes one or more of illegal actions in a static danger area, whether the worker is close to a dynamic danger area, whether the worker is wearing work clothes, and whether the worker is wearing a safety helmet.
6. The method for identifying unsafe behaviors of construction workers at a construction site according to claim 1, characterized in that: The expression of the SloULoss loss function is: Among them, IoU represents the overlap rate between the predicted box and the real box, Δ represents the distance cost redefined after considering the angle cost, and Ω represents the shape cost; The method comprises the following steps: suppressing the anchor frames extracted by the YOLOv5 algorithm framework based on the mean shift clustering algorithm, specifically: clustering the center points of multiple anchor frames of the feature map extracted by the YOLOv5 algorithm framework using the mean shift clustering algorithm to obtain multiple groups of clustered anchor frames, suppressing the confidence values calculated by the multiple groups of clustered anchor frames using a preset loss function threshold, and deleting the anchor frames that do not meet the loss function threshold; wherein the sliding radius of the mean shift clustering algorithm is calculated according to the length and width of the anchor frame; The NAM attention mechanism is introduced to optimize the convolutional block attention module of the YOLOv5 algorithm framework. Specifically, according to the weight factor of the NAM attention mechanism, the scale factors of the channel attention module and the spatial attention module contained in the convolutional block attention module are respectively optimized by batch normalization and pixel normalization.
7. The method for identifying unsafe behaviors of construction workers at a construction site according to claim 6, characterized in that: The confidence value is calculated as follows: In the formula, s r Represents the confidence value of the rth group of anchor boxes, s i is the confidence value of the i-th group of anchor boxes, b i represents the i-th group of anchor boxes, IoU represents the loss function threshold, b r represents the rth group of anchor boxes, s r Represents the confidence value, softmax represents the normalization function, and N represents the total number of anchor boxes.
8. Construction site worker unsafe behavior identification system, characterized by: It includes an image acquisition module for acquiring one or more scene images of the oil and gas field construction site captured by the video monitoring system; A recognition module is used to recognize the behavior of the construction workers in the one or more scene images through a target recognition model constructed by an improved YOLOv5 algorithm, and obtain recognition results of unsafe behaviors of the construction workers in the one or more scene images; wherein the improved YOLOv5 algorithm is specifically: based on the YOLOv5 algorithm framework, the CioULoss loss function of the YOLOv5 algorithm framework is replaced by the SloULoss loss function, the anchor box extracted by the YOLOv5 algorithm framework is suppressed based on the mean shift clustering algorithm, and the convolution block attention module of the YOLOv5 algorithm framework is optimized by introducing the NAM attention mechanism; The alarm processing module is used to perform business logic processing on the recognition results and generate alarm information corresponding to unsafe behaviors of construction workers in one or more scene images.
9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus; wherein the processor, the communication interface and the memory communicate with each other through the communication bus; the memory is used to store computer programs; the processor is used to execute the programs stored in the memory to implement the method for identifying unsafe behaviors of construction site workers as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Used to store computer-readable instructions, which, when executed, perform the operations of the method for identifying unsafe behaviors of construction site workers according to any one of claims 1 to 7.