Personnel border crossing detection method in narrow space barrier-free scene

By installing cameras in a narrow space and using the YOLOv8 model for object detection and behavior analysis, the problem of traditional facilities monitoring blind spots in a narrow space is solved, real-time and accurate monitoring of construction workers' cross-border behavior is achieved, and safety and management efficiency are improved.

CN120279580APending Publication Date: 2025-07-08WUXI TAIHU POWER CONSTR CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510380651.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-28
Publication Date
2025-07-08

AI Technical Summary

Technical Problem

In narrow spaces such as power pipeline corridors, traditional physical isolation facilities are difficult to install and effectively supervise construction personnel's cross-border behavior, resulting in blind spots in safety monitoring and unable to achieve comprehensive and precise supervision.

Method used

Using intelligent image recognition and behavioral analysis technology, the video stream is collected in real time by installing a camera, and the target detection is performed using the YOLOv8 model. Combined with safety helmet judgment and permission judgment, virtual boundaries are set and the construction personnel's walking direction and angle are calculated to achieve cross-border detection.

Benefits of technology

Real-time and accurate monitoring of the cross-border behavior of people in small spaces is achieved, the false alarm rate is reduced, the safety and management efficiency of the construction site are improved, and management costs are optimized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120279580A_ABST
    Figure CN120279580A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of border crossing detection, and particularly relates to a method for detecting border crossing of people in a narrow space barrier-free scene, which comprises the following steps of: installing a camera at a position needing border crossing detection in a narrow space, and acquiring a video stream in real time; inputting each frame of image in the video stream into the trained YOLOv8 model for target detection, and obtaining the position and bounding box of a constructor; safety helmet judgment and authority judgment are carried out; and carrying out boundary crossing detection, setting a virtual boundary, calculating an included angle between the walking direction of the constructor and the virtual boundary, judging whether the constructor crosses the boundary or not through threshold comparison, and if a boundary crossing behavior exists, giving an alarm and recording. According to the method, the monitoring camera is combined with the image processing technology, real-time and accurate monitoring of the border crossing behaviors of the personnel in the narrow space is achieved, dependence on physical isolation facilities is not needed, and the limitation of a traditional method in a complex environment is overcome.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of cross - boundary detection, and particularly relates to a method for detecting personnel cross - boundary in a barrier - free scenario in a narrow space. Background Art

[0002] As an important carrier of high - voltage transmission line cables, the power cable tunnel is a key infrastructure for improving the urban modernization level and realizing intensive resource management. With the acceleration of the urbanization process, the construction of power cable tunnels has demonstrated significant economic and social value in ensuring power supply, enhancing urban safety, and reducing environmental pollution. However, since the construction project of power cable tunnels is usually large - scale and involves multiple construction sites and working surfaces, it is often necessary to carry out multi - point construction to ensure the smooth progress of the project. During this process, there are often some non - standard behaviors and habitual violations at the construction site, such as not wearing safety helmets, smoking, personnel crossing boundaries, etc. In particular, the frequent occurrence of personnel crossing - boundary behaviors seriously threatens the safety control effect of the construction site.

[0003] Personnel crossing the boundary usually refers to construction personnel entering an area where entry is not allowed without permission. For example, the staff in Area B enters the construction area of Area A, or the staff in Area A leaves Area A and approaches the vicinity of Area B, as Figure 1 shown.

[0004] This kind of behavior not only disrupts the on - site management order but also may lead to the occurrence of safety accidents. In order to effectively contain this phenomenon, it is necessary to strictly monitor and manage the area where personnel enter and leave at the construction site. Traditional cross - boundary detection methods mostly rely on physical facilities, such as access control systems, fences, or means such as face recognition and fingerprint punching. These traditional means can effectively restrict personnel from entering specific areas. However, since most power cable tunnels are located underground, with narrow spaces and complex structures, these traditional physical isolation facilities cannot play their due roles in such special environments. Especially during the construction process, facilities such as access control and fences are not only difficult to install, but once installed, due to limited space and high traffic requirements, they are likely to create blind spots in safety monitoring and cannot effectively achieve all - round supervision of construction personnel. Therefore, how to achieve efficient and accurate supervision of personnel crossing - boundary behaviors through intelligent means under such space - limited conditions has become a key issue in the construction and operation management of power cable tunnels. Summary of the Invention

[0005] In view of the above deficiencies in the prior art, the purpose of the present invention is to provide a method for detecting personnel cross - boundary in a barrier - free scenario in a narrow space, and to achieve precise monitoring of personnel behaviors through intelligent image recognition and behavior analysis technologies.

[0006] To achieve the above objectives, the present invention provides a method for detecting personnel crossing the boundary in a barrier-free scenario in a narrow space, including the following steps: S1. Install a camera at the position in the narrow space where boundary crossing detection is required to collect video streams in real time; S2. Input each frame of the video stream into the trained YOLOv8 model for object detection to obtain the positions and bounding boxes of construction workers; S3. Perform safety helmet determination and permission determination. When it is determined that the safety helmet is not worn or there is no permission, an alarm is issued and recorded. When it is determined that the safety helmet is worn and there is permission, go to step S4; S4. Perform boundary crossing detection. Set a virtual boundary and calculate the angle between the walking direction of the construction worker and the virtual boundary. Determine whether the construction worker crosses the boundary by threshold comparison. If there is a boundary crossing behavior, an alarm is issued and recorded. If there is no boundary crossing behavior, return to step S2 to continue the detection.

[0007] As a preferred solution of the present invention, in S1, the narrow space is an underground pipe gallery, and the camera is a high-definition camera, and it is ensured that the camera can cover all areas in the narrow space where boundary crossing detection is carried out.

[0008] As a preferred solution of the present invention, in S2, the input image size of the YOLOv8 model is w×h, where w is the width of the input image and h is the height of the input image. The size of the input image is adjusted to 640×640 by scaling. When training the YOLOv8 model, each frame of the historical video stream is used as a training image, and data augmentation is performed on the training image to improve the robustness of the model.

[0009] As a preferred solution of the present invention, the method of performing data augmentation on the training image is a combination of one or more of random cropping, flipping, rotation, light intensity transformation, structural occlusion, adaptive key area enhancement, and temporal coherence enhancement, where: Light intensity transformation: Based on the light map estimation algorithm or the Retinex algorithm, randomly attenuate the brightness of the training image in a region to simulate the non-uniform lighting conditions in the narrow space; Structural occlusion: Construct an occlusion template library, including three-dimensional projection maps of obstacles in the narrow space. Project the three-dimensional model of the obstacle onto the training image through the perspective transformation algorithm, and add rust effect rendering based on the HSV color space; Adaptive key area enhancement: Extract the human body heat distribution map through a pre-trained attention network, calculate the target saliency weight, and perform differential enhancement on the bounding box area based on the weight value; Temporal coherence enhancement: Extract N consecutive frames of images from the training image to form a training unit, and apply consistent enhancement parameters to the training images within the same training unit.

[0010] As a preferred embodiment of the present invention, in S2, the YOLOv8 model uses a convolutional neural network CNN architecture for feature extraction and object detection, including a backbone network Backbone, the last layer Head of the model, and an intermediate layer Neck connecting the Backbone and the Head. The Backbone is responsible for extracting basic features from the input image, performing convolutional operations, and generating feature maps. The Neck uses a feature pyramid to process feature maps of different scales and fuse features of different scales. The Head outputs prediction information for each object, including the class probability, bounding box, center point coordinates of the bounding box, width and height of the bounding box, and confidence associated with the bounding box for each construction worker. After object detection by the YOLOv8 model, non-maximum suppression NMS is used to retain the bounding box with the highest confidence. The method is to sort all candidate boxes by confidence, and then for each candidate box b i , calculate its overlap with other boxes , expressed as: ; In the formula, Area represents the area of the bounding box; both i and j are indices of candidate boxes, and i≠j; if , then remove the candidate box b j , is the overlap threshold.

[0011] As a preferred embodiment of the present invention, in S3, the method for helmet determination is that if there is a helmet feature within the head area of a construction worker and the corresponding confidence is greater than the confidence threshold, it is determined that the construction worker is wearing a helmet; otherwise, it is determined that the construction worker is not wearing a helmet. The method for permission determination is to compare, based on face recognition, with the permission data stored in the database to determine whether the construction worker corresponding to the face recognition result has permission.

[0012] As a preferred embodiment of the present invention, in S4, the virtual boundary is set as a straight line along the wall, passage, or doorway of a narrow space, defined as a straight line from to , where P0 and P1 represent two points, , are the coordinates corresponding to P0 and P1, thereby determining the direction of the virtual boundary; Let the direction vector of the virtual boundary be , where: ; ; The unit vector of the virtual boundary is: ; The walking direction of the construction worker is calculated based on the change in their position in consecutive frames. Let the position of the construction worker at time t be , and at time t - 1, their position be , then the vector V p of the walking direction of the construction worker is calculated as follows: ; The unit vector of the walking direction of the construction worker is: ; Then, the included angle is calculated. The included angle is the included angle between V p and V b . The dot product of vectors is used to calculate the included angle: ; Among them, the dot product , and we get : ; In the formula, , are the components of in the x - direction and y - direction respectively; , are the components of in the x - direction and y - direction respectively.

[0013] As a preferred embodiment of the present invention, in S4, the out - of - bounds determination is as follows: Let the out - of - bounds included - angle threshold be . If: ; Then it is determined that the construction worker has crossed the virtual boundary.

[0014] As a preferred embodiment of the present invention, the virtual boundary supports dynamic adaptive adjustment. The specific method is: Programmable marker points are deployed inside the camera's field of view. A three - dimensional space topology map is generated in real time through SLAM technology. When it is detected that the structure in a narrow space has changed, the coordinates of P0 and P1 are dynamically interpolated and corrected based on the topology map. The correction formula is: ; ; In the formula, k = 0, 1, represents the original coordinates of P0 and P1; represents the corrected coordinates; is the displacement of the obstacle; is the environmental adaptation coefficient; is the obstacle movement direction angle.

[0015] As a preferred solution of the present invention, in S4, when performing out-of-bounds determination, a velocity vector constraint condition is added, specifically: Define the instantaneous velocity v of the construction worker t : ; In the formula, is the frame interval time; Introduce the velocity direction consistency factor , expressed as: ; In the formula, M represents the number of frames in several frames before determination, and m is one of them; is the unit vector of the walking direction of the construction worker corresponding to the m-th frame; When the following conditions are simultaneously met, it is determined as effective out-of-bounds: ; ; ; In the formula, represents the minimum effective out-of-bounds speed threshold; is the consistency factor threshold, used to exclude false judgments caused by random jitter.

[0016] The algorithm involved in the present invention can be executed by an electronic device. The electronic device includes a memory, a processor, and a computer program stored on the memory and executable on the processor. The above algorithm calculation is realized by the processor executing the software.

[0017] The beneficial effects of the present invention are: The present invention combines a monitoring camera with image processing technology to achieve real-time and accurate monitoring of personnel out-of-bounds behavior in a narrow space. Its advantages are that it does not rely on physical isolation facilities, overcomes the limitations of traditional methods in complex environments, and at the same time, through intelligent behavior analysis, improves the response speed and accuracy of monitoring, reduces the need for manual intervention, and effectively improves the safety and management efficiency of the construction site.

[0018] The present invention also has the ability of intelligent behavior analysis, which can accurately judge the out-of-bounds behavior by analyzing the angular change between the walking direction of the personnel and the safety boundary. This method not only improves the accuracy of out-of-bounds detection, but also reduces the false alarm rate of alarms, ensuring the efficient preservation and processing of violation information. In practical applications, the invention significantly improves the safety of narrow spaces (especially the construction of underground pipe galleries), optimizes the management efficiency and cost, and provides an intelligent and high-performance solution for construction safety management. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 is a schematic diagram of out-of-bounds in the background art of the present invention; Figure 2 is a schematic diagram of the process principle of the present invention; Figure 3 is the overall flowchart of the present invention; Figure 4 is a schematic diagram of the change in the angle between the walking direction of the personnel and the boundary in the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0020] The following further describes the embodiments of the present invention with reference to the drawings: Embodiment 1: As Figure 2 and Figure 3 shown, the method for detecting out-of-bounds of personnel in a narrow space without obstacles includes the following steps: S1. Install cameras at the positions in the narrow space where out-of-bounds detection is required to collect video streams in real time; S2. Input each frame of the video stream into the trained YOLOv8 model for object detection to obtain the positions and bounding boxes of the construction personnel; S3. Perform helmet judgment and permission judgment. When it is judged that the helmet is not worn or there is no permission, an alarm is issued and recorded. When it is judged that the helmet is worn and there is permission, go to step S4; S4. Perform out-of-bounds detection, set a virtual boundary, and calculate the angle between the walking direction of the construction personnel and the virtual boundary. Determine whether the construction personnel cross the boundary by comparing with a threshold. If there is an out-of-bounds behavior, an alarm is issued and recorded. If there is no out-of-bounds behavior, return to step S2 to continue the detection.

[0021] In S1, the narrow space is an underground pipe gallery (this embodiment mainly focuses on underground pipe galleries), and the cameras are high-definition cameras (multiple cameras can be set), and it is ensured that the cameras can cover all areas in the narrow space where out-of-bounds detection is carried out.

[0022] In S2, the input image size of the YOLOv8 model is w×h, where w is the width of the input image and h is the height of the input image. The size of the input image is scaled and adjusted to 640×640. When training the YOLOv8 model, each frame of the historical video stream is used as a training image, and data augmentation is performed on the training image to improve the robustness of the model.

[0023] The ways of performing data augmentation on the training image are one or a combination of more of random cropping, flipping, rotation, illumination intensity transformation, structural occlusion, adaptive key area enhancement, and temporal coherence enhancement, where: Random cropping, flipping, and rotation are common data augmentation methods used to increase the diversity of training data and improve the generalization ability of the model; Illumination intensity transformation: Based on the illumination map estimation algorithm or the Retinex algorithm, random area brightness attenuation is performed on the training image to simulate non-uniform illumination conditions in a narrow space; Structural occlusion: Build an occlusion template library, including three-dimensional projection maps of obstacles in a narrow space. Project the three-dimensional model of the obstacle onto the training image through the perspective transformation algorithm, and add rust effect rendering based on the HSV color space; Adaptive key area enhancement: Extract the human body heat distribution map through a pre-trained attention network (using a spatial pyramid structure, extracting multi-scale features through parallel 3×3 and 5×5 convolutional kernels), calculate the target saliency weight, and perform differential enhancement on the bounding box area based on the weight value; Temporal coherence enhancement: Extract N consecutive frames of images from the training image to form a training unit, and apply consistent enhancement parameters to the training images within the same training unit.

[0024] In S2, the YOLOv8 model uses a convolutional neural network CNN architecture for feature extraction and object detection, including the backbone network Backbone, the last layer Head of the model, and the intermediate layer Neck connecting Backbone and Head. Backbone is responsible for extracting basic low-level to high-level features from the input image, performing convolutional operations, and generating feature maps. Neck uses a feature pyramid to process feature maps of different scales and fuse features of different scales; Head outputs prediction information for each target, including the class probability (such as whether it is a "person") of each construction worker, the bounding box, the center point coordinates of the bounding box, the width and height of the bounding box, and the confidence level related to the bounding box; The Backbone of YOLOv8 includes: C2f module: The C2f module is the basic unit for feature extraction in YOLOv8. It reduces the number of parameters and improves the calculation efficiency through residual connections and bottleneck structures.

[0025] Conv Module: The convolutional layer is used to extract basic features of images, such as edges and textures.

[0026] SPPF Module (SpatialPyramidPoolingFast): Used for pooling operations at different scales, stitching together feature maps of different scales to improve the detection ability for objects of different sizes.

[0027] Neck includes: SPPF Module: Used for pooling operations at different scales, stitching together feature maps of different scales to improve the detection ability for objects of different sizes.

[0028] PAA Module (ProbabilisticAnchorAssignment): Used to intelligently assign anchor boxes to optimize the selection of positive and negative samples and improve the training effect of the model.

[0029] PAN Module (PathAggregationNetwork): Includes two PAN modules for path aggregation of features at different levels, enhancing the expressive power of feature maps through bottom-up and top-down paths.

[0030] Head includes: Convolutional layer and activation function: The Head part usually includes several convolutional layers and activation functions. These convolutional layers are used to further process the feature maps output by the Neck part to extract more high-level features. Common activation functions include ReLU or Leaky ReLU, which can introduce non-linearity to enhance the feature expression ability.

[0031] Prediction Layers: In YOLOv8, the prediction layer is a key component responsible for generating the final detection results. The prediction layer includes three main outputs: Bounding Box Regression: Predicts the location and size of the target. Usually outputs four values corresponding to the center coordinates, width, and height of the bounding box.

[0032] Confidence Scores: Predicts whether there is a target within each bounding box and the confidence of the target.

[0033] Class Probabilities: Predicts the probability that the target belongs to each class.

[0034] Non-Maximum Suppression (NMS): The final prediction results will undergo non-maximum suppression processing to remove duplicate detection boxes. NMS retains the bounding box with the highest confidence and removes other bounding boxes with high overlap with it, ensuring that each object is detected only once.

[0035] YOLOv8 predicts the class probability distribution for each detection box. The class probability of each box represents the likelihood that the box belongs to a specific class.

[0036] After object detection, the YOLOv8 model uses non-maximum suppression NMS to remove bounding boxes with a lot of overlap and retains the bounding box with the highest confidence. The method is to sort all candidate boxes by confidence, and then for each candidate box b i , calculate its overlap with other boxes , expressed as: ; In the formula, Area represents the area of the bounding box; i and j are both indices of candidate boxes, and i ≠ j; if , then remove candidate box b j , is the overlap threshold.

[0037] In S3, the method for helmet determination is that if there are helmet features (especially obvious features) within the head area of the construction worker and the corresponding confidence is greater than the confidence threshold, then it is determined that the construction worker is wearing a helmet; otherwise, it is determined that the construction worker is not wearing a helmet. The method for permission determination is to compare the face recognition result with the permission data stored in the database based on face recognition to determine whether the construction worker corresponding to the face recognition result has permission. It is also possible to perform identification and judgment based on RFID radio frequency tags, or set permission judgment devices or personnel at the entrance of a confined space.

[0038] As Figure 4 shown, in S4, the virtual boundary is set as a straight line along the wall, passage, or doorway of the confined space, and it is defined as the straight line from to , P0 and P1 represent two points, , are the coordinates corresponding to P0 and P1, respectively, to determine the direction of the virtual boundary; Let the direction vector of the virtual boundary (boundary line) be , where: ; ; The unit vector of the virtual boundary is: ; The walking direction of the construction workers is calculated based on the change in their positions in consecutive frames. Assume that at time t, the position of the construction worker is , and at time t - 1, the position is . Then the vector V p of the walking direction of the construction worker is calculated as follows: ; The unit vector of the walking direction of the construction worker is: ; Then the angle calculation is performed. The angle is the angle between V p and V b . The dot product of vectors is used to calculate the angle: ; Among them, the dot product , and we get : ; In the formula, , are respectively the components of in the x - direction and y - direction; , are respectively the components of in the x - direction and y - direction.

[0039] In S4, the out - of - bounds determination is as follows. Assume the out - of - bounds angle threshold is . If: ; Then it is determined that the construction worker has crossed the virtual boundary.

[0040] The virtual boundary supports dynamic adaptive adjustment. The specific method is: Deploy programmable marker points inside the camera's field of view. Generate a three - dimensional spatial topology map in real - time through SLAM technology. When it is detected that the structure in a narrow space has changed (such as the change in the position of obstacles), based on the topology map, the coordinates of P0 and P1 are dynamically interpolated and corrected. The correction formula is: ; ; In the formula, k = 0, 1, represents the original coordinates of P0 and P1; represents the corrected coordinates; is the displacement of the obstacle; is the environmental adaptation coefficient (estimated through a Kalman filter); is the moving direction angle of the obstacle. Aiming at the static setting defect of the virtual boundary, dynamic environment perception and boundary self-adaptation are realized through SLAM technology, solving the problem of boundary failure caused by construction environment changes in traditional solutions and improving robustness.

[0041] Boundary confidence evaluation can also be introduced. When the deviation between the virtual boundary and the physical structure is detected to exceed the threshold for several consecutive frames, an artificial review mechanism is triggered.

[0042] In this embodiment, various signals are transmitted through the flask framework and the http protocol. The recorded relevant violation information will be sent to the background server for storage for subsequent viewing, review, and processing.

[0043] The obstacle-free out-of-bounds detection method based on the change of the angle not only improves the safety of the construction personnel in the underground utility tunnel, but also optimizes the efficiency and cost of utility tunnel management, making the out-of-bounds detection more intelligent, accurate, and efficient. In the application experiment of the underground utility tunnel, the out-of-bounds detection accuracy rate using this detection method reaches 98%, the out-of-bounds trigger rate reaches 95%, the false alarm rate of the alarm is 5%, and the preservation rate of the violation information reaches 99%. Specifically, as shown in Table 1.

[0044] Table 1 Out-of-bounds detection results

[0045] Based on the above experimental results, the obstacle-free out-of-bounds detection method proposed in this embodiment based on the walking direction of the construction personnel and the change of the boundary angle has high accuracy and stability. In practical applications, this method can effectively judge out-of-bounds behavior by analyzing the walking direction of the construction personnel and the included angle between them and the virtual boundary through real-time video streams, and realize intelligent out-of-bounds detection with a low false alarm rate of the alarm (5%) and a high out-of-bounds detection accuracy rate (98%). At the same time, the out-of-bounds trigger rate reaches 95%, and the preservation rate of the violation information is as high as 99%, further verifying the reliability and practicality of the model. This method not only improves the safety of underground utility tunnel construction, but also significantly optimizes the efficiency and cost of utility tunnel management, providing strong support for realizing more intelligent and efficient construction safety management.

[0046] Embodiment 2: On the basis of Embodiment 1, when making an out-of-bounds determination, a speed vector constraint condition is added, specifically: Define the instantaneous speed v of the construction personnel t : ; In the formula, is the frame interval time; Introduce the speed direction consistency factor , expressed as: ; In the formula, M represents the number of frames before determination, and m is one of the frames; is the unit vector of the walking direction of the construction worker corresponding to the m-th frame; It is determined as a valid overstep when the following conditions are simultaneously met: ; ; ; In the formula, represents the minimum valid overstep speed threshold; is the consistency factor threshold, which is used to exclude false judgments caused by random jitter.

[0047] Based on the simple geometric angle judgment, multi-frame velocity vector analysis is introduced, and the false alarm rate is reduced through physical kinematic constraints. It is especially suitable for complex scenarios such as personnel wandering and jitter, and enhances the reliability of the determination logic. By adopting this determination method, the false alarm rate of the alarm can be further reduced.

[0048] Embodiment 3: On the basis of Embodiment 1 or Embodiment 2, a thermal imaging camera is additionally set at the position where overstep detection needs to be performed in a narrow space. When the light intensity in the narrow space is too low, the thermal imaging camera is enabled, and overstep detection is performed based on the personnel image obtained by the thermal imaging camera.

[0049] When the light intensity is too low (for example, due to environmental restrictions or damage to lighting equipment), a normal camera cannot obtain a clear image. It is possible to make a manual judgment based on the video stream, or a light sensor can be configured to detect the light intensity. When the light intensity is lower than a preset threshold, the thermal imaging camera is turned on.

[0050] In an environment with insufficient light, the imaging quality of a normal camera will significantly decline, and it may not be able to accurately detect construction workers and their behaviors. The thermal imaging camera is not restricted by light conditions and can form an image by sensing the infrared radiation emitted by an object. Even in a completely dark environment, it can clearly capture the position and activities of personnel, thus ensuring the continuous and stable operation of the overstep detection system. Although the improvement in this embodiment increases the cost to a certain extent, it can expand the applicable range of this detection method in different environments.

Claims

1. Method for detecting personnel crossing the boundary in a barrier-free scenario in a narrow space, characterized in that It includes the following steps: S1. Install a camera at the position where out-of-bounds detection is required in a narrow space to collect video streams in real time; S2. Input each frame of the video stream into the trained YOLOv8 model for object detection to obtain the positions and bounding boxes of construction workers; S3. Perform safety helmet determination and permission determination. When it is determined that the safety helmet is not worn or there is no permission, an alarm is issued and recorded. When it is determined that the safety helmet is worn and there is permission, go to step S4; S4. Perform out-of-bounds detection. Set a virtual boundary and calculate the angle between the walking direction of the construction worker and the virtual boundary. Determine whether the construction worker has crossed the boundary by comparing with a threshold. If there is an out-of-bounds behavior, an alarm is issued and recorded. If there is no out-of-bounds behavior, return to step S2 to continue the detection.

2. The method for detecting personnel crossing the boundary in a barrier-free scenario in a narrow space according to claim 1, wherein: In S1, the narrow space is an underground utility tunnel, and the camera is a high-definition camera, and it is ensured that the camera can cover all areas in the narrow space where out-of-bounds detection is carried out.

3. The method for detecting personnel crossing the boundary in a barrier-free scenario in a narrow space according to claim 1, characterized in that: In S2, the input image size of the YOLOv8 model is w×h, where w is the width of the input image and h is the height of the input image. The size of the input image is adjusted to 640×640 by scaling. When training the YOLOv8 model, each frame of the historical video stream is used as a training image, and data augmentation is performed on the training image to improve the robustness of the model.

4. The method for detecting personnel out-of-bounds in a barrier-free scenario in a narrow space according to claim 3, characterized in that: The method of performing data augmentation on the training image is a combination of one or more of random cropping, flipping, rotation, illumination intensity transformation, structural occlusion, adaptive key region enhancement, and temporal coherence enhancement, where: Illumination intensity transformation: Based on the illumination map estimation algorithm or the Retinex algorithm, randomly attenuate the brightness of the training image in a region to simulate the non-uniform illumination conditions in a narrow space; Structural occlusion: Construct an occlusion template library, including three-dimensional projection maps of obstacles in a narrow space. Project the three-dimensional model of the obstacle onto the training image through the perspective transformation algorithm, and add rust effect rendering based on the HSV color space; Adaptive key region enhancement: Extract the human body heat distribution map through a pre-trained attention network, calculate the target saliency weight, and perform differential enhancement on the bounding box region based on the weight value; Temporal coherence enhancement: Extract N consecutive frames of images from the training image to form a training unit, and apply consistent enhancement parameters to the training images within the same training unit.

5. The method for detecting personnel crossing the boundary in a barrier-free scenario in a narrow space according to claim 1, characterized in that: In S2, the YOLOv8 model uses a convolutional neural network CNN architecture for feature extraction and object detection, including a backbone network Backbone, the last layer Head of the model, and an intermediate layer Neck connecting Backbone and Head. Backbone is responsible for extracting basic features from the input image, performing convolutional operations, and generating feature maps. Neck uses a feature pyramid to process feature maps of different scales and fuse features of different scales; Head outputs prediction information for each target, including the class probability of each construction worker, the bounding box, the center point coordinates of the bounding box, the width and height of the bounding box, and the confidence associated with the bounding box; After object detection by the YOLOv8 model, non-maximum suppression (NMS) is used to retain the bounding box with the highest confidence. The method is to sort all candidate boxes by confidence, and then for each candidate box b i , calculate its overlap with other boxes , which is expressed as: ; Where Area represents the area of the bounding box; both i and j are indices of candidate boxes, and i ≠ j; if then remove the candidate box b j , is the overlap threshold.

6. The method for detecting personnel crossing the boundary in a barrier-free scenario in a narrow space according to claim 1, characterized in that: In S3, the method for helmet determination is as follows: if there are helmet features in the head area of the construction worker and the corresponding confidence level is greater than the confidence threshold, it is determined that the construction worker is wearing a helmet; otherwise, it is determined that the construction worker is not wearing a helmet. The method for permission determination is as follows: based on face recognition, compare with the permission data stored in the database to determine whether the construction worker corresponding to the face recognition result has permission.

7. The method for detecting personnel over - boundary in a barrier - free scenario in a narrow space according to claim 1, wherein: In S4 described above, the virtual boundary is set as a straight line along the wall, passage or doorway of the narrow space, which is defined as the straight line from to . P0 and P1 represent two points, , are the coordinates corresponding to P0 and P1, thereby determining the direction of the virtual boundary; Let the direction vector of the virtual boundary be , where: ; ; Unit vector of the virtual boundary is as follows: ; The walking direction of the construction worker is calculated based on the change in their position in consecutive frames. Let the position of the construction worker at time t be , and at time t - 1, their position be . Then the vector V p representing the walking direction of the construction worker is calculated as follows: ; Unit vector of the walking direction of construction workers is as follows: ; Then the included angle calculation is performed. The included angle is V p and V b The included angle between them is calculated using the dot product of vectors: ; Among them, the dot product , obtaining : ; In the formula, , are respectively the components in the x-direction and y-direction; , are respectively the components in the x-direction and y-direction.

8. The method for detecting personnel crossing the boundary in a barrier-free scenario in a narrow space according to claim 7, wherein: In S4 described above, the out-of-bounds determination is that, assuming the out-of-bounds angle threshold is , if: ; Then it is determined that the construction worker has crossed the virtual boundary.

9. The method for detecting personnel crossing the boundary in a barrier-free scenario in a narrow space according to claim 7, characterized in that: The virtual boundary mentioned above supports dynamic adaptive adjustment. The specific method is as follows: Deploy programmable marker points within the camera's field of view. Generate a three-dimensional spatial topology map in real time through SLAM technology. When it is detected that the structure in a narrow space has changed, based on the topology map, dynamically interpolate and correct the coordinates of P0 and P1. The correction formula is: ; ; where k = 0, 1, represents the original coordinates of P0 and P1; represents the corrected coordinates; is the obstacle displacement; is the environmental adaptation coefficient; is the obstacle moving direction angle.

10. The method for detecting personnel crossing the boundary in a barrier-free scenario in a narrow space according to claim 8, characterized in that: In S4 mentioned above, when determining boundary crossing, add a velocity vector constraint condition, specifically: Define the instantaneous velocity v of construction workers t : ; wherein, is the frame interval time; Introduce the velocity direction consistency factor , which is expressed as: ; Wherein, M represents the number of several frames before determination, and m is one of the frames; is the unit vector of the walking direction of the construction worker corresponding to the m-th frame; It is determined to be a valid boundary crossing when the following conditions are met simultaneously: ; ; ; wherein, represents the minimum valid out-of-bounds speed threshold; is the consistency factor threshold, which is used to exclude misjudgments caused by random jitter.