A method, equipment and medium for monitoring the safety attire of workers during deep foundation pit construction.

By improving the YOLOv11 detection network model and combining it with structure-aware feature extraction, cross-scale spatial coordinate attention fusion, and cascaded neural contextual attention modules, the problems of high false detection rate and low accuracy of occluded target detection in deep foundation pit construction were solved. This enabled high-precision monitoring of construction workers' safety attire, improving the system's practicality and reliability.

CN122049818BActive Publication Date: 2026-06-30JIANGXI SCI & TECH NORMAL UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
JIANGXI SCI & TECH NORMAL UNIV
Filing Date
2026-04-13
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

Existing technologies for deep foundation pit construction suffer from problems such as high false detection rate, poor cross-scale feature fusion effect, low detection accuracy of occluded targets, and insufficient compliance judgment logic, resulting in insufficient practicality and reliability of safety monitoring for deep foundation pit construction personnel.

Method used

An improved YOLOv11 detection network model is adopted, which combines a structure-aware feature extraction convolutional module, a cross-scale spatial coordinate attention fusion module, and a cascaded neural context attention module. Combined with electronic fence logic judgment and temporal sliding window, the feature extraction capability and occluded target detection accuracy are improved.

Benefits of technology

It significantly reduced the false negative rate of small targets, improved detection accuracy and system robustness, ensured accurate monitoring of construction workers' safety attire, and met the real-time monitoring needs in the complex environment of deep foundation pits.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122049818B_ABST
    Figure CN122049818B_ABST
Patent Text Reader

Abstract

This application belongs to the fields of computer technology and construction technology, and discloses a method, equipment and medium for monitoring the safety clothing of construction workers in deep foundation pits. The method includes: acquiring real-time video streams collected by deep foundation pit monitoring equipment and decoding them into video frames to be processed; inputting the video frames into an improved YOLOv11 detection network model, which processes the video frames through a designed structure-aware feature extraction convolution module, a cascaded neural context attention module and a cross-scale spatial coordinate attention fusion module, and outputs initial detection results including target bounding box coordinates, target category labels and confidence scores; based on the initial detection results, determining the attributes of the work area through a preset electronic fence, and generating final clothing status judgment information using dual geometric constraints and temporal sliding window voting; triggering an alarm when the judgment information is a violation, effectively improving the accuracy of monitoring the safety clothing of construction workers in the complex environment of deep foundation pits.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of computer technology and building construction, and in particular to a method, equipment and medium for monitoring the safety clothing of workers in deep foundation pit construction. Background Technology

[0002] Deep foundation pit engineering is a high-risk sub-project in building construction, characterized by confined spaces, poor lighting, great depth, and complex procedures. In deep foundation pit operations, the correct wearing of safety helmets and reflective vests by construction workers is a crucial protective measure to ensure their safety, prevent falling objects and mechanical injuries, and is also a mandatory requirement of relevant safety regulations.

[0003] Currently, safety monitoring of deep foundation pits mainly relies on manual inspections by on-site safety officers or patrols of video surveillance footage by monitoring center staff. However, this traditional method has significant limitations. On the one hand, manual inspections are limited by manpower and time, making it difficult to achieve 24 / 7, full-coverage real-time monitoring, especially in complex terrain and poor lighting conditions at the bottom of the foundation pit, easily creating blind spots. On the other hand, manual video surveillance is inefficient, and monitoring personnel are easily affected by subjective factors such as fatigue and lack of concentration, leading to a high rate of missed detections of violations. With the rapid development of computer vision technology, object detection algorithms based on convolutional neural networks have begun to be introduced into the safety monitoring of construction sites.

[0004] However, directly applying existing general-purpose object detection algorithms to the specific and complex scenario of deep foundation pits still faces a series of technical bottlenecks. The technical problems to be solved by this invention are: the existing technology has insufficient feature extraction capability when dealing with the complex background of deep foundation pits, resulting in a high false detection rate; when dealing with targets with huge scale spans, the cross-scale feature fusion effect is poor, resulting in missed detection of small targets; when the target is severely occluded, the context reasoning ability is weak, resulting in low detection accuracy of occluded targets; and the lack of rigorous compliance judgment logic leads to misjudging states such as "holding a safety helmet" as "wearing", and video signal jitter easily causes frequent false alarms, affecting the practicality and reliability of the system. Summary of the Invention

[0005] To address the problems mentioned in the background art, this invention provides a method, equipment, and medium for monitoring the safety attire of construction workers in deep foundation pits. This method improves the accuracy of monitoring the safety attire of construction workers in complex environments such as deep foundation pits by improving the network structure of the target detection model and combining it with a rigorous post-processing logic judgment algorithm.

[0006] In a first aspect, the present invention provides a method for monitoring the safety attire of workers during deep foundation pit construction, comprising the following steps:

[0007] Acquire real-time video streams collected by deep foundation pit monitoring equipment and decode them into video frames to be processed;

[0008] The video frames are input into a pre-trained improved YOLOv11 detection network model. In the backbone and neck network of this improved YOLOv11 detection network model, a structure-aware feature extraction convolutional module is designed to replace the original Conv module, and a cascaded neural contextual attention module is designed to replace the original C3k2 module. In the neck network, a cross-scale spatial coordinate attention fusion module is designed to replace the original upsampling and stitching structure. The improved YOLOv11 detection network model processes the video frames and outputs initial detection results including target bounding box coordinates, target category labels, and confidence scores.

[0009] Based on the initial detection results, the electronic fence logic judgment and spatiotemporal topology constraints are executed: the preset electronic fence is used to determine the work area attributes of the personnel target, the wearing relationship between the personnel and the safety helmet is matched through dual geometric constraints, a single frame wearing judgment result is generated, and the continuous single frame wearing judgment results are voted on using a time-series sliding window to output the final clothing status judgment information.

[0010] Based on the final clothing status determination information, when a violation is determined, an alarm is triggered and image evidence containing the violation information is retained.

[0011] As an optional implementation of the first aspect of this application, the processing procedure of the structure-aware feature extraction convolutional module includes: receiving an input feature map and inputting the input feature map in parallel to the main path convolutional path, the vertical sensing branch path, and the horizontal sensing branch path; the main path convolutional path uses square convolution to extract conventional spatial features and generate a main path feature response; the vertical sensing branch path uses narrow convolution in the vertical direction to enhance vertical structural features and generate a vertical path feature response; the horizontal sensing branch path uses flat convolution in the horizontal direction to enhance horizontal structural features and generate a horizontal path feature response; during the training phase, the main path feature response, the vertical path feature response, and the horizontal path feature response are fused element-wise, and the fused feature map is output through batch normalization and activation function processing; the calculation process is defined by the following formula: ; ; ; ;in, Represents input features; , and These represent the kernel size as follows: , and Convolution operations; , and These represent the characteristic responses of the main road, perpendicular road, and horizontal road, respectively; BN represents batch normalization. Indicates the activation function; This represents the fused feature map output by the structure-aware feature extraction convolutional module; during the inference phase, the weights of the convolutional kernels of the main convolutional path, the vertical perception branch path, and the horizontal perception branch path are structurally reparameterized with the batch normalization layer parameters and merged into a single standard convolutional kernel.

[0012] As an optional implementation of the first aspect of this application, the processing procedure of the cross-scale spatial coordinate attention fusion module includes: receiving a semantic feature map from a deep layer and a detail feature map from a shallow layer; upsampling the semantic feature map from the deep layer to align its spatial dimensions with the detail feature map from the shallow layer; performing spatial attention operations and coordinate attention operations on the upsampled semantic feature map and the detail feature map from the shallow layer, respectively, to suppress background noise and retain accurate positional information, generating two purified features that have undergone dual attention weighting; concatenating the two purified features in the channel dimension and performing deep fusion through a convolutional layer to output the fused multi-scale features; the calculation process is defined by the following formula: ; ; ; ; ; ;in, This represents the deep semantic feature map. This represents the detailed feature map of the shallow layer. Indicates an upsampling operation. This represents the spatial attention weight generation function; This represents the coordinate attention weight generation function. These represent the global average pooling along the X and Y axes, respectively. Indicates channel splicing. This represents the deep semantic feature map after upsampling. This represents the activation function. and These represent the kernel size as follows: and Convolution operation, and These represent convolution operations in the X and Y directions with a kernel size of 1×1, respectively. This represents the global average pooling result along the channel dimension of the feature map F; This represents the global max pooling result along the channel dimension of the feature map F. This represents the feature map after the upsampled deep semantic feature map is weighted by double attention. This represents the feature map after the shallow detail feature map has been weighted by double attention. This represents the fused multi-scale features output by the cross-scale spatial coordinate attention fusion module.

[0013] As an optional implementation of the first aspect of this application, the processing procedure of the cascaded neural context attention module includes: receiving input features; performing channel segmentation and mapping on the input features through convolution to divide them into features of the main gradient flow branch and features of the residual connection branch; inputting the features of the main gradient flow branch into a deep computing path composed of multiple cascaded neural context attention units, performing layer-by-layer abstraction to extract contextual semantic features, and generating deep-processed features; concatenating the deep-processed features with the features of the residual connection branch, and fusing them through output convolution to output the final context-enhanced features; its calculation process is defined by the following formula: ; ;

[0014] ;in, Indicates input features, Indicates channel segmentation. Indicates the first Mapping function for each neural context attention unit, Indicates the kernel size as Convolution operation, This represents the characteristics of the main gradient flow branch. The characteristics representing residual connection branches, This represents the features after deep processing. Indicates channel splicing. This indicates the output convolution operation. This represents the final contextual enhancement feature output by the cascaded neural contextual attention module.

[0015] As an optional implementation of the first aspect of this application, the processing procedure of the neural context attention unit includes: performing parallel channel-dimensional max pooling and average pooling on the input features of the neural context attention unit, and concatenating the pooling results to generate a compressed feature map; applying a depthwise separable convolution to the compressed feature map to capture long-range environmental context information and generate context description features; performing global average pooling on the input features of the neural context attention unit, generating channel attention weights through a multilayer perceptron, using the channel attention weights and the context description features to perform residual correction on the input features, and outputting features recalibrated with context information; the calculation process is defined by the following formula:

[0016] ; ;

[0017] ; ;in, This represents the input features of the neural contextual attention unit. Indicates contextual description features, Represents a compressed feature map. Indicates channel attention weights. and This represents max pooling and average pooling along the channel dimension. This indicates a splicing operation. Indicates the core size is Depth-separable convolution, This indicates global space average pooling. This represents a multilayer perceptron. This represents the activation function. This represents the features output by the neural context attention unit that have been recalibrated with contextual information.

[0018] As an optional implementation of the first aspect of this application, the step of determining the work area attribute of the personnel target using a preset electronic fence includes: in the coordinate system of the monitoring screen, delineating the area of ​​the pit edge, trestle, or support beam as the high-altitude edge work area and defining it as a closed polygon electronic fence; defining the remaining area as the ordinary ground work area; extracting the coordinates of the bottom center point of the personnel target detection box in the initial detection result; using the ray method to determine whether the bottom center point coordinates are located within the closed polygon electronic fence; if the number of intersections between the rays emitted from the bottom center point coordinates in any direction and the boundary of the closed polygon electronic fence is odd, then the personnel target is determined to be located within the high-altitude edge work area; otherwise, the personnel target is determined to be located within the ordinary ground work area; outputting the work scene attribute label associated with the personnel target; the determination process is defined by the following formula: ;

[0019] ;in, This represents the two-dimensional pixel area covered by the electronic fence, i.e., a closed polygonal electronic fence. Represents two-dimensional Cartesian coordinates. Indicates the number of vertices of the polygon. Indicates an indicator function, These represent adjacent vertices that form the boundary of the polygon. Indicates from the center point of personnel The emitted horizontal rays, This represents the geometric intersection operation between a ray and a boundary line segment. This represents the modulo operation. This indicates the attribute label representing the current work scenario of the personnel.

[0020] As an optional implementation of the first aspect of this application, the step of generating a single-frame wearing determination result by matching the wearing relationship between a person and a safety helmet through dual geometric constraints includes: constructing a dual geometric constraint model to match each person detection box and safety helmet detection box in the initial detection result; performing a generalized overlap constraint to calculate the intersection-union ratio (IU) of the person detection box and the safety helmet detection box; if the IU exceeds a preset overlap threshold, the two are considered as potential associated objects; for potential associated objects that satisfy the generalized overlap constraint, performing a vertical pose topology constraint to determine whether the lower edge ordinate of the safety helmet detection box is within a preset proportion range of the head region of the person detection box; if both the generalized overlap constraint and the vertical pose topology constraint are satisfied, a single-frame wearing determination result of "effective wearing" is generated; otherwise, a single-frame wearing determination result of "not wearing" is generated.

[0021] As an optional implementation of the first aspect of this application, the step of voting on the consecutive single-frame clothing determination results using a time-series sliding window includes: establishing a fixed-length state buffer queue for each tracked person target; sequentially storing the single-frame clothing determination results for the same person target in consecutive video frames into the corresponding state buffer queue; setting a time-series sliding window on the state buffer queue, and counting the cumulative number of votes for "not wearing" within the window; when the cumulative number of votes reaches a preset minimum voting threshold, outputting the final clothing status determination information for the violation; the determination process is defined by the following formula: ; ;in, To accumulate votes in violation of regulations, Indicates the number of video frames. Indicates an indicator function, This represents a state cache queue. The minimum voting threshold to trigger an alarm. The final clothing status determination information is output.

[0022] In a second aspect, embodiments of this application provide an electronic device, which includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor. When the program or instructions are executed by the processor, they implement the steps of the method described in the first aspect.

[0023] Thirdly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.

[0024] Compared with the prior art, the present invention has the following beneficial effects:

[0025] 1. The Structure-Aware Feature Extraction Convolutional Module (SFEConv) proposed in this invention innovatively constructs a three-way parallel architecture comprising a main-path square convolution, a vertically narrow convolution, and a horizontally flattened convolution, utilizing the principle of asymmetric convolution. This design can target and enhance the upright posture features of people in deep foundation pits and the horizontal texture features of reflective clothing and safety helmet brims, while naturally suppressing interference from disordered background noise such as soil and gravel by utilizing asymmetric receptive fields. Furthermore, this module supports structural reparameterization during the inference phase, significantly improving the purity of feature extraction in complex backgrounds without increasing inference time.

[0026] 2. The cross-scale spatial coordinate attention fusion module (MSCAF) proposed in this invention effectively solves the semantic gap problem when fusing deep abstract features and shallow detailed features through the dual support of spatial attention and coordinate attention. This module explicitly extracts high and low layer features before feature stitching, which can accurately capture the position information of tiny safety helmets at the bottom of distant foundation pits, overcome the defect of weak features being easily submerged in traditional linear stitching methods, and significantly reduce the false negative rate of small targets.

[0027] 3. The Cascaded Neural Contextual Attention Module (C3k2-CNCA) proposed in this invention significantly enhances the model's contextual reasoning ability for partially occluded targets through a deep integration of cascaded residual architecture and hybrid attention mechanism. This module can utilize semantic cues from the surrounding environment to complete and enhance features even when target features are incomplete, effectively solving the problem of missed detection when construction workers are squatting or obscured by support structures.

[0028] 4. The spatiotemporal topology and electronic fence judgment logic constructed in this invention accurately eliminates misjudgments of non-compliant states such as "holding a safety helmet" through a vertical pose constraint model, effectively smooths the detection flicker caused by video jitter by using a time-series sliding window voting mechanism, and realizes differentiated control of high-altitude work areas and ordinary work areas by combining ROI electronic fences, thus ensuring the rigor and robustness of the monitoring system from the algorithm logic level. Attached Figure Description

[0029] Figure 1 This is a flowchart illustrating a method for monitoring the safety attire of construction workers in deep foundation pits, as described in an embodiment of the present invention.

[0030] Figure 2 This is a schematic diagram of the architecture of the improved YOLOv11 detection network model in an embodiment of the present invention;

[0031] Figure 3 This is a schematic diagram of the structure-aware feature extraction convolutional module (SFEConv) in an embodiment of the present invention;

[0032] Figure 4This is a schematic diagram of the cross-scale spatial coordinate attention fusion module (MSCAF) in an embodiment of the present invention;

[0033] Figure 5 This is a schematic diagram of the structure of the cascaded neural contextual attention module (C3k2-CNCA) in an embodiment of the present invention;

[0034] Figure 6 This is a schematic diagram of the structure of the Neural Contextual Attention Unit (CNCA) in an embodiment of the present invention;

[0035] Figure 7 This is a flowchart illustrating the logical determination based on spatiotemporal topological constraints and electronic fences in an embodiment of the present invention. Detailed Implementation

[0036] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0037] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0038] This invention provides a machine vision-based method for monitoring the safety attire of construction workers in deep foundation pits, such as... Figure 1 As shown, it includes the following steps:

[0039] S1: Acquire the real-time video stream collected by the deep foundation pit monitoring equipment and decode it into video frames to be processed.

[0040] For example, by collecting and annotating real-world data, a high-quality data foundation is provided for model training, which includes, but is not limited to, the following preparatory work before model training: dataset acquisition and augmentation; data annotation and format conversion; and dataset partitioning.

[0041] S2: Input the video frame into a pre-trained improved YOLOv11 detection network model. In the backbone and neck network of the improved YOLOv11 detection network model, design a structure-aware feature extraction convolutional module to replace the original Conv module, and design a cascaded neural contextual attention module to replace the original C3k2 module. In the neck network, design a cross-scale spatial coordinate attention fusion module to replace the original upsampling and stitching structure. The improved YOLOv11 detection network model processes the video frame and outputs an initial detection result containing the target bounding box coordinates, target category label, and confidence score.

[0042] In this step, an improved YOLOv11 detection network model is built and trained.

[0043] like Figure 2 As shown, this embodiment deeply optimizes the structure of the original YOLOv11 detection network model, including: designing a structure-aware feature extraction convolutional module (SFEConv) in the backbone network and neck network to replace the original Conv module, and designing a cascaded neural context attention module (C3k2-CNCA) to replace the original C3k2 module. In the neck network, a cross-scale spatial coordinate attention fusion module (MSCAF) is designed to replace the original upsampling and splicing structure.

[0044] In this step, such as Figure 3 As shown, the implementation process of the structure-aware feature extraction convolution (SFEConv) is as follows: To address the problem of cluttered backgrounds and significant target geometric features in deep foundation pits, this embodiment designs a three-way parallel branch structure. First, the input feature map... Simultaneously, it enters three parallel convolutional paths: the first path is the main convolutional path, using... Convolutional processing extracts conventional spatial features, focusing on capturing the overall contour of the target and generating the main path feature response; the second path is a vertical perception branch path, employing... Convolution is used to specifically enhance the vertical structural features of the human body's upright posture and safety ropes, generating vertical path feature responses; the third path is a horizontal sensing branch, employing... Convolution is specifically used to enhance horizontal structural features such as reflective clothing stripes and helmet brims, generating horizontal path feature responses. During training, the outputs of the three branches are element-wise added and fused, and then processed using batch normalization (BN) and an activation function. During inference, leveraging the linear additivity of convolution, the weights of the three convolutional kernels and the BN layer parameters are reparameterized and merged into a standard value. Convolution kernel.

[0045] Its calculation process is defined by the following formula:

[0046] ;

[0047] ;

[0048] ;

[0049] ;

[0050] in, Represents input features; , and These represent the kernel size as follows: , and Convolution operations; , and These represent the characteristic responses of the main road, perpendicular road, and horizontal road, respectively; BN represents batch normalization. Indicates the activation function; This represents the fused feature map output by the structure-aware feature extraction convolutional module.

[0051] In this step, such as Figure 4 As shown, the implementation process of the cross-scale spatial coordinate attention fusion module (MSCAF) is as follows: This module is configured to receive semantic feature maps from deep layers. and shallow detail feature map This aims to address the semantic misalignment and small target loss issues during deep and shallow feature fusion. Firstly, it employs bilinear interpolation... Upsampling is performed to align spatial dimensions. Subsequently, a dual attention mechanism is introduced to refine the two feature paths: the first is spatial attention (SA), used to suppress soil background noise. This performs global average pooling and global max pooling along the channel dimension of the input features, concatenates the results, and then passes them through a... Convolution generates a spatial weight map. The second layer is Coordinate Attention (CA), used to preserve precise location information. It uses a one-to-one global average pooling to aggregate features along the horizontal (X-axis) and vertical (Y-axis) directions respectively, generating a pair of orientation-aware feature maps. After convolutional encoding and channel splitting, attention weights for the horizontal and vertical directions are generated respectively. The two feature maps after double attention weighting are concatenated along the channel dimension and passed through a... Convolution is used for deep fusion.

[0052] Its calculation process is defined by the following formula:

[0053] ;

[0054] ;

[0055] ;

[0056] ;

[0057] ;

[0058] ;

[0059] in, Represents deep semantic feature maps, Represents the detailed feature map of the shallow layer. Indicates an upsampling operation. This represents the spatial attention weight generation function; This represents the coordinate attention weight generation function. These represent the global average pooling along the X and Y axes, respectively. Indicates channel splicing. This represents the deep semantic feature map after upsampling. This represents the activation function. and These represent the kernel size as follows: and Convolution operation, and These represent convolution operations in the X and Y directions with a kernel size of 1×1, respectively. This represents the global average pooling result along the channel dimension of the feature map F; This represents the global max pooling result along the channel dimension of the feature map F. This represents the feature map after the upsampled deep semantic feature map is weighted by double attention. This represents the feature map after the shallow detail feature map has been weighted by double attention. This represents the fused multi-scale features output by the cross-scale spatial coordinate attention fusion module.

[0060] In this step, such as Figure 5 As shown, the implementation process of the cascaded neural contextual attention module (C3k2-CNCA) is as follows: In this embodiment, this module replaces the original C3k2 module to enhance the model's contextual reasoning ability for partially occluded targets. This module follows the CSPNet (Cross Stage Partial Network) architecture, first processing the input features... pass Convolution performs channel segmentation and mapping, consisting of a principal gradient flow branch and a residual connection branch. The principal gradient flow branch enters from... A deep computation path consisting of cascaded Neural Contextual Attention Units (CNCA) is used to abstract robust contextual semantic features layer by layer. Finally, the deep-processed features are concatenated with the residual branches and fused through output convolution.

[0061] Its calculation process is defined by the following formula:

[0062] ;

[0063] ;

[0064] ;

[0065] in, Indicates input features, Indicates channel segmentation. Indicates the first Mapping function for each neural context attention unit, Indicates the kernel size as Convolution operation, This represents the characteristics of the main gradient flow branch. The characteristics representing residual connection branches, This represents the features after deep processing. Indicates channel splicing. This indicates the output convolution operation. This represents the final context-enhanced feature output by the cascaded neural context attention module.

[0066] Furthermore, as a core component, such as Figure 6 As shown, the specific implementation process of the Neural Contextual Attention Unit (CNCA) is as follows: This unit innovatively designs a three-step processing logic of "compression-perception-recalibration". First, channel pooling: input features Parallel max pooling and average pooling along the channel dimension are performed, and the results are concatenated to preserve significant feature responses with extremely low computational cost, generating a compressed feature map. Secondly, large kernel perception: applying pressure to the compressed feature map. (or greater) depthwise separable convolutions (DWConv) are used to capture long-range environmental context information beyond the target ontology, generating contextual description features. Finally, channel recalibration: raw input The vector is compressed into a one-dimensional vector using global average pooling, and then channel attention weights are generated using a multilayer perceptron (MLP). This weight, combined with contextual descriptive features, performs residual correction on the original features.

[0067] Its calculation process is defined by the following formula:

[0068] ;

[0069] ;

[0070] ;

[0071] ;

[0072] in, This represents the input features of the neural contextual attention unit. Indicates contextual description features, Represents a compressed feature map. and This represents pooling along the channel dimension. This indicates a splicing operation. Indicates the core size is Depth-separable convolution, This indicates global space average pooling. This represents a multilayer perceptron. This represents the activation function. This represents the features output by the neural context attention unit that have been recalibrated with contextual information; through this cascaded design, the model can fill in the missing parts using features of the surrounding environment when the target is occluded.

[0073] The real-time video stream is input into the trained improved YOLOv11 detection network model. The model utilizes the learned structure-aware features and contextual semantic features to output the bounding box coordinates of all targets in the current frame. Category labels and confidence levels.

[0074] S3: Based on the initial detection results, perform electronic fence logic judgment and spatiotemporal topology constraints: use the preset electronic fence to determine the work area attributes of the personnel target, match the wearing relationship between the personnel and the safety helmet through dual geometric constraints, generate a single frame wearing judgment result, use a time-series sliding window to vote on the continuous single frame wearing judgment results, and output the final clothing status judgment information.

[0075] To achieve accurate monitoring of the compliance of construction workers' attire in complex deep foundation pit scenarios, this embodiment designs a logical judgment algorithm that includes regional attribute perception, spatial constraints, and temporal disturbance immunity (such as...). Figure 7(As shown). It is worth noting that the system maintains a consistent detection mode across all scenarios, using electronic fence technology to tag workers with spatial semantic attributes. The specific implementation process is as follows:

[0076] First, based on the ray casting algorithm for determining the work area attributes (high-altitude / ground-based), an electronic fence is manually established in the coordinate system of the monitoring screen. Administrators can modify the fence boundaries in real time through the system's visual interface to adapt to changes in construction progress. The edges of the foundation pit, trestle bridges, or support beams are designated as "high-altitude edge work areas," while other areas are designated as "ordinary ground work areas" by default. The system uses the ray casting algorithm to determine the current work environment attributes of personnel.

[0077] Assume the monitoring screen is in a two-dimensional Cartesian coordinate system. Define the high-altitude work area as a closed polygon. The bottom center point of the personnel detection frame is If and only if from A point is considered to be within a polygon's boundary if the number of intersections between a ray emitted in any direction and the polygon's boundary is odd. The mathematical expression for this logical determination is:

[0078] ;

[0079] ;

[0080] in, This represents the two-dimensional pixel area covered by the electronic fence, i.e., a closed polygon. Represents two-dimensional Cartesian coordinates. Indicates the number of vertices of the polygon. Indicates an indicator function, These represent adjacent vertices that form the boundary of the polygon. Indicates from the center point of personnel The emitted horizontal rays, This represents the geometric intersection operation between a ray and a boundary line segment. This represents the modulo operation. This indicates the current work scenario attribute label for the personnel. This label does not change the model's detection logic and is only used as a basis for subsequent risk classification.

[0081] Then, based on the dual geometric constraints, the system executes a unified wearing relationship determination logic regardless of the personnel's work status. This embodiment constructs a dual geometric constraint model: one is a generalized overlap constraint, which calculates the personnel detection box. With candidate safety helmet detection frame The intersection-over-union ratio (IoU) is determined only when the overlap exceeds a preset threshold. First, it is considered a potential associated object; second, there is a vertical pose topology constraint. To address the misjudgment of "handheld helmet" or "helmet on the ground," a strict vertical position constraint is established, requiring that the lower edge of the helmet's ordinate must be within a specific proportional range of the human head area. If the above constraints are met, it is judged as "validly worn"; otherwise, it is judged as "not worn."

[0082] Secondly, to eliminate detection state flicker caused by video transmission jitter or momentary target occlusion, this embodiment introduces a time-series sliding window voting mechanism based on temporal voting for each tracked person target. Establish a fixed-length state buffer queue to record consecutive states. The single-frame determination result of the frame.

[0083] ;

[0084] ;

[0085] in, To accumulate votes in violation of regulations, Indicates an indicator function, This represents a state cache queue. The minimum voting threshold to trigger an alarm. The final clothing status determination information is output.

[0086] S4: Based on the final clothing status determination information, when a violation is determined, an alarm is triggered and image evidence containing the violation information is retained.

[0087] When a person is determined to be in a violation state for a duration exceeding a set threshold, differentiated alarm information is generated based on the work scenario attributes obtained in step S3: if the person is marked as "high-altitude work state," a high-priority alarm record is generated; if marked as "ground work state," a normal-priority alarm record is generated. Simultaneously, control commands are sent to the connected audio equipment to play voice prompts; the system automatically captures on-site images containing the violating person, timestamp, and electronic fence boundary, overlays a violation type tag, and encrypts and stores the images on a local server as traceability evidence for safety management.

[0088] Example Verification and Analysis

[0089] To verify the effectiveness of the method proposed in this invention, video data was collected at a real deep foundation pit construction site to construct a dataset for comparative experiments. The experimental environment was based on the PyTorch framework, and the hardware platform was an NVIDIA GeForce RTX 3090 GPU.

[0090] 1. Comparative Experimental Analysis

[0091] The performance of the model of this invention was evaluated against current mainstream object detection models on the same test set. Evaluation metrics included precision, recall, mean average precision (mAP@0.5), number of parameters, and floating-point operations (FLOPs). Experimental results are shown in Table 1.

[0092] Table 1: Performance comparison of mainstream detection models and the model proposed in this application on the deep foundation pit dataset.

[0093]

[0094] From the data in Table 1, we can see that:

[0095] Regarding missed detection control: the recall rate of the model in this invention is as high as 93.4%, significantly better than YOLOv11 and YOLOv8. In deep foundation pit safety monitoring, the risk of missed detection is far greater than that of false detection. Therefore, the improvement of this indicator has important engineering application value, fully demonstrating the enhanced perception effect of the MSCAF module on occluded and small targets.

[0096] In terms of overall detection accuracy: the model of this invention achieves an mAP@0.5 of 94.2%, which not only surpasses the YOLO series models of the same magnitude, but also outperforms the computationally intensive Transformer architecture model RT-DETR.

[0097] In terms of deployment efficiency: Although the computational load of the model of this invention is slightly higher than that of YOLOv11, it still falls into the category of lightweight models and is far lower than RT-DETR, meeting the real-time requirements of embedded devices on construction sites.

[0098] 2. Visual Comparison

[0099] To visually demonstrate the advantages of this invention under complex working conditions, a typical deep foundation pit overhead occlusion scenario was selected for testing. The original image suffers from uneven lighting and occlusion due to the shooting angle. During the detection process, YOLOv11 failed to identify the yellow safety helmet worn by the construction worker, resulting in a missed detection, and its confidence level for reflective vests was low. In contrast, the model of this invention successfully detected the tiny safety helmet target and provided a clear confidence level, while correctly identifying the construction worker and reflective vest. This further verifies the effectiveness of the SFEConv structure-aware convolution proposed in this invention in suppressing background noise and enhancing target features.

[0100] 3. Ablation Experiment Analysis

[0101] Table 2 Ablation experimental results of each improved module in the method of this application

[0102]

[0103] To verify the specific contributions of the three core improvement modules (SFEConv, MSCAF, and C3k2-CNCA) proposed in this invention to the model performance, an ablation experiment with progressively added modules was conducted using YOLOv11 as a benchmark. The results are shown in Table 2.

[0104] (1) Effectiveness of Structure-Aware Feature Extraction Convolution (SFEConv): Comparing experimental groups A and B, it can be seen that after introducing the SFEConv module into the backbone network, the model's precision increased from 90.1% to 91.5%, and mAP@0.5 increased by 1.7%. This proves that SFEConv effectively extracts the specific structural features of construction personnel and equipment using asymmetric convolution kernels, and suppresses the interference of soil noise in the deep foundation pit background, thereby reducing false detections.

[0105] (2) Effectiveness of the cross-scale spatial coordinate attention fusion network (MSCAF): Comparison of experimental groups B and C shows that after adding the MSCAF module to the neck network, the recall rate of the model increased significantly, from 88.9% to 92.8%. This directly confirms that the module solves the problem of small target information loss during feature downsampling through the coordinate attention mechanism, and greatly reduces the false negative rate.

[0106] (3) Effectiveness of the Cascaded Neural Contextual Attention Network (C3k2-CNCA): Experimental group D (the complete model of this application) introduced the CNCA module based on experimental group C, further improving mAP@0.5 to 94.2% and Recall to 93.4%. This shows that the CNCA module enhances the model's reasoning ability when the target is locally occluded by capturing long-distance contextual information, thus further improving the robustness of the system.

[0107] In summary, the three improved modules of this invention each perform their respective functions, playing key roles in anti-interference, prevention of missed detection, and anti-occlusion. Their collaborative work enables the final model to achieve optimal performance in complex deep foundation pit scenarios.

[0108] Optionally, this application embodiment also provides an electronic device, including a processor, a memory, and a program or instructions stored in the memory and executable on the processor. When the program or instructions are executed by the processor, they implement the various processes of the above-described embodiment of a method for monitoring the safety clothing of construction workers in deep foundation pits, and can achieve the same technical effect. To avoid repetition, they will not be described again here.

[0109] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described embodiment of a method for monitoring the safety attire of construction workers in deep foundation pits, and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0110] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0111] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0112] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, 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 is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0113] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

Claims

1. A method for monitoring safety gear of a deep foundation construction worker, characterized by, Includes the following steps: Acquire real-time video streams collected by deep foundation pit monitoring equipment and decode them into video frames to be processed; The video frames are input into a pre-trained improved YOLOv11 detection network model. In the backbone and neck network of this improved YOLOv11 detection network model, a structure-aware feature extraction convolutional module is designed to replace the original Conv module, and a cascaded neural contextual attention module is designed to replace the original C3k2 module. In the neck network, a cross-scale spatial coordinate attention fusion module is designed to replace the original upsampling and stitching structure. The improved YOLOv11 detection network model processes the video frames and outputs initial detection results including target bounding box coordinates, target category labels, and confidence scores. The processing steps of the structure-aware feature extraction convolutional module include: receiving an input feature map and inputting the input feature map in parallel to the main convolutional path, the vertical sensing branch path, and the horizontal sensing branch path; the main convolutional path uses square convolution to extract conventional spatial features and generate the main feature response; the vertical sensing branch path uses narrow convolution in the vertical direction to enhance vertical structural features and generate the vertical path feature response; the horizontal sensing branch path uses flat convolution in the horizontal direction to enhance horizontal structural features and generate the horizontal path feature response; during the training phase, the main path feature response, the vertical path feature response, and the horizontal path feature response are fused element-wise, and the fused feature map is output through batch normalization and activation function processing; the calculation process is defined by the following formula: ; ; ; ; wherein, represents an input feature; , and respectively represent convolution operations with kernel sizes of , and ; , and respectively represent feature responses of the main path, the vertical path and the horizontal path; BN represents a batch normalization process; represents an activation function; represents a fused feature map output by the structure-aware feature extraction convolution module; During the inference phase, the kernel weights of the main convolutional path, the vertical sensing branch path, and the horizontal sensing branch path are structurally reparameterized with the batch normalized layer parameters and merged into a single standard convolutional kernel. Based on the initial detection results, the electronic fence logic judgment and spatiotemporal topology constraints are executed: the preset electronic fence is used to determine the work area attributes of the personnel target, the wearing relationship between the personnel and the safety helmet is matched through dual geometric constraints, a single frame wearing judgment result is generated, and the continuous single frame wearing judgment results are voted on using a time-series sliding window to output the final clothing status judgment information. Based on the final clothing status determination information, when a violation is determined, an alarm is triggered and image evidence containing the violation information is retained.

2. The method according to claim 1, characterized in that, The processing steps of the cross-scale spatial coordinate attention fusion module include: It receives semantic feature maps from deep layers and detail feature maps from shallow layers; The deep semantic feature map is upsampled to align its spatial dimensions with the shallow detail feature map. Spatial attention and coordinate attention operations are performed on the upsampled semantic feature map and the shallow detail feature map respectively to suppress background noise and retain accurate location information, generating two purified features that have been weighted by dual attention. The two purified features are concatenated along the channel dimension and then deeply fused through a convolutional layer to output the fused multi-scale features. Its calculation process is defined by the following formula: ; ; ; ; ; ; in, This represents the deep semantic feature map. This represents the detailed feature map of the shallow layer. Indicates an upsampling operation. This represents the spatial attention weight generation function; This represents the coordinate attention weight generation function. These represent the global average pooling along the X and Y axes, respectively. Indicates channel splicing. This represents the deep semantic feature map after upsampling. This represents the activation function. and These represent the kernel size as follows: and Convolution operation, and These represent 1×1 convolution operations corresponding to the X-axis and Y-axis directions, respectively. This represents the global average pooling result along the channel dimension of the feature map F; This represents the global max pooling result along the channel dimension of the feature map F. This represents the feature map after the upsampled deep semantic feature map is weighted by double attention. This represents the feature map after the shallow detail feature map has been weighted by double attention. This represents the fused multi-scale features output by the cross-scale spatial coordinate attention fusion module.

3. The method according to claim 1, characterized in that, The processing steps of the cascaded neural contextual attention module include: The input features are received and channel segmented and mapped through convolution, dividing them into features of the main gradient flow branch and features of the residual connection branch. The features of the main gradient flow branch are input into a deep computing path composed of multiple cascaded neural context attention units, and layer-by-layer abstraction is performed to extract contextual semantic features and generate deep-processed features. The features after depth processing are concatenated with the features of the residual connection branch, and then fused through output convolution to output the final context-enhanced features. Its calculation process is defined by the following formula: ; ; ; in, Indicates input features, Indicates channel segmentation. Indicates the first Mapping function for each neural context attention unit, Indicates the kernel size as Convolution operation, This represents the characteristics of the main gradient flow branch. The characteristics representing residual connection branches, This represents the features after deep processing. Indicates channel splicing. This indicates the output convolution operation. This represents the final contextual enhancement feature output by the cascaded neural contextual attention module.

4. The method according to claim 3, characterized in that, The processing procedure of the neural contextual attention unit includes: The input features of the neural context attention unit are subjected to parallel channel-dimensional max pooling and average pooling, and the pooling results are concatenated to generate a compressed feature map. A depthwise separable convolution is applied to the compressed feature map to capture long-range environmental context information and generate contextual description features; Global average pooling is performed on the input features of the neural context attention unit, and channel attention weights are generated through a multilayer perceptron. The input features are then residually corrected using the channel attention weights and the context description features, and the features recalibrated with context information are output. Its calculation process is defined by the following formula: ; ; ; ; in, This represents the input features of the neural contextual attention unit. Indicates contextual description features, Represents a compressed feature map. Indicates channel attention weights. and This represents max pooling and average pooling along the channel dimension. This indicates a splicing operation. Indicates the core size is Depth-separable convolution, This indicates global space average pooling. This represents a multilayer perceptron. This represents the activation function. This represents the features output by the neural context attention unit that have been recalibrated with contextual information.

5. The method according to claim 1, characterized in that, The steps for determining the attributes of the work area where a person is located using a preset electronic fence include: In the coordinate system of the monitoring screen, the area of ​​the pit edge, trestle or support beam is designated as the high-altitude edge operation area and defined as a closed polygon electronic fence; the remaining area is defined as the ordinary ground operation area. Extract the coordinates of the bottom center point of the personnel target detection box in the initial detection results; The ray casting method is used to determine whether the coordinates of the bottom center point are located within the closed polygonal electronic fence. If the number of intersections between the rays emitted from the bottom center point coordinates in any direction and the boundary of the closed polygonal electronic fence is odd, the personnel target is determined to be located in the high-altitude edge operation area; otherwise, the personnel target is determined to be located in the ordinary ground operation area. The operation scene attribute label associated with the personnel target is output. The determination process is defined by the following formula: ; ; in, This represents the two-dimensional pixel area covered by the electronic fence, i.e., a closed polygonal electronic fence. Represents two-dimensional Cartesian coordinates. Indicates the number of vertices of the polygon. Indicates an indicator function, These represent adjacent vertices that form the boundary of the polygon. Indicates from the center point of personnel The emitted horizontal rays, This represents the geometric intersection operation between a ray and a boundary line segment. This represents the modulo operation. This indicates the attribute label representing the current work scenario of the personnel.

6. The method according to claim 1, characterized in that, The steps for generating a single-frame wearing determination result by matching the wearing relationship between the person and the safety helmet through dual geometric constraints include: A dual geometric constraint model is constructed to match each person detection box in the initial detection results with the safety helmet detection box; Generalized overlap constraint is applied, and the intersection-union ratio of the personnel detection box and the safety helmet detection box is calculated. If the intersection-union ratio exceeds the preset overlap threshold, the two are considered as potentially related objects. For potential associated objects that satisfy the generalized overlap constraint, perform vertical pose topology constraint and determine whether the lower edge ordinate of the safety helmet detection frame is within a preset proportion range of the head region of the personnel detection frame; If both the generalized overlap constraint and the vertical pose topology constraint are satisfied, a single-frame wearing determination result of "effective wearing" is generated; otherwise, a single-frame wearing determination result of "not wearing" is generated.

7. The method according to claim 6, characterized in that, The step of voting on the wearing determination results of consecutive single frames using a time-series sliding window includes: Establish a fixed-length state cache queue for each tracked person target; The single-frame wearing determination results for the same person target in consecutive video frames are sequentially stored into the corresponding state cache queue; A time-series sliding window is set on the state cache queue to count the cumulative number of votes determined as "not wearing" within the window; When the cumulative number of votes reaches the preset minimum voting threshold, the final dress status determination information, which is determined to be a violation, is output. The determination process is defined by the following formula: ; ; in, To accumulate votes in violation of regulations, Indicates the number of video frames. Indicates an indicator function, This represents a state cache queue. The minimum voting threshold to trigger an alarm. The final clothing status determination information is output.

8. An electronic device, characterized in that, The method includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor. When the program or instructions are executed by the processor, they implement the steps of a method for monitoring the safety attire of construction workers in deep foundation pits as described in any one of claims 1-7.

9. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions, which, when executed by a processor, implement the steps of a method for monitoring the safety attire of deep foundation pit construction workers as described in any one of claims 1-7.