Multi-target joint recognition and safety compliance real-time detection method and system for construction scene

CN122990334APending Publication Date: 2026-10-27GUOHUA ENERGY INVESTMENT
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611242633.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-17
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0006]本发明旨在解决现有施工场景安全监控技术中存在的多目标检测精度低、遮挡与小目标易漏检、多尺度特征融合不充分、缺乏时序预测与事前预警能力、检测结果不可解释难以溯源等技术问题

Benefits of technology

[0028]与现有技术相比,本发明具有以下有益效果:通过四叉树递归分割构建空间索引树,将叶子节点的尺度等级与特征图下采样倍率动态匹配建立锚点映射表,实现了候选目标至最优特征图层的自适应分配,显著提升了多尺度目标尤其是小目标的检测精度。通过构建行为树并融合环形缓冲区与时序预测网络,实现了违规行为发展趋势的智能预测与事前预警,将安全监控从事后追责转变为主动防范。通过生成包含空间轨迹、特征图激活区域及行为树推理路径的三重可解释溯源报告,解决了检测结果黑箱问题,为违规行为的追溯与审计提供了完整证据链。系统各模块协同工作,兼顾了检测精度与计算效率,适用于边缘设备部署,满足了施工场景全天候、高实时性的安全监控需求。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122990334A_ABST
    Figure CN122990334A_ABST
Patent Text Reader

Abstract

The application discloses a kind of multi-target joint identification and safety compliance real-time detection method and system for construction scene.The method comprises the following steps: constructing multi-class semantic annotation dataset and training basic model;After collecting construction scene image, the whole image is taken as root node to recursively execute quadtree segmentation, generate candidate target leaf node and assign scale level;After extracting multi-scale feature map, the scale level of leaf node is matched with the anchor mapping table of feature map down sampling rate;According to the anchor mapping table, the features are extracted on the corresponding feature map layer, and the identification result is output by the basic model;Continuous multiple frame identification results are stored in ring buffer and behavior tree is constructed, the violation probability is predicted by time series prediction network, and the warning is triggered when the threshold value is exceeded and the violation traceable report is generated.The application realizes the accurate identification of multi-target in construction scene and the early warning of violation behavior.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer vision and construction safety monitoring technology, specifically relating to a method and system for multi-target joint recognition and real-time detection of safety compliance in construction scenarios. Background Technology

[0002] With the continuous expansion of the power system and the rapid growth of infrastructure projects, insufficient safety distances between workers, construction machinery, and live equipment in construction scenarios have become a major cause of safety accidents such as electric shocks and collisions. Traditional safety supervision mainly relies on manual inspections and fixed monitoring, which has problems such as limited coverage, poor real-time performance, and strong subjectivity, making it difficult to meet the needs of all-weather, high-precision safety monitoring in construction sites that are numerous, widespread, complex, and ever-changing.

[0003] In recent years, deep learning-based target detection technology has gained widespread attention in the field of construction safety monitoring. Existing technologies, such as single-stage detection algorithms like the YOLO series, can achieve real-time detection of targets like construction workers and safety helmets. However, when faced with complex scenarios involving large construction machinery, long and flexible robotic arms, and densely distributed and diverse electrical equipment, they suffer from low accuracy in detecting small targets, easy omission of occluded targets, and insufficient multi-scale feature fusion. Furthermore, while existing binocular stereo vision methods can achieve three-dimensional spatial distance measurement, they consume significant computational resources, lack real-time performance, and are difficult to deploy on edge devices.

[0004] On the other hand, existing security monitoring systems are mostly post-incident accountability systems, lacking the ability to predict the development trend of violations in a timely manner and failing to provide proactive early warnings before incidents occur. Furthermore, the detection results lack interpretability, making it difficult to trace violations and impacting the closed-loop effectiveness of security management.

[0005] Therefore, there is an urgent need for a multi-target joint identification and real-time detection method for security compliance that can balance detection accuracy and computational efficiency, possess time-series prediction and early warning capabilities, and support the interpretable and traceable source of violations. Summary of the Invention

[0006] This invention aims to address the technical problems existing in current construction safety monitoring technologies, such as low multi-target detection accuracy, easy omission of occluded and small targets, insufficient multi-scale feature fusion, lack of temporal prediction and early warning capabilities, and uninterpretable and difficult-to-trace detection results. To this end, this invention provides a method and system for multi-target joint identification and real-time safety compliance detection in construction scenarios.

[0007] In a first aspect, embodiments of this application provide a method for multi-target joint identification and real-time safety compliance detection in construction scenarios, the method comprising:

[0008] Construct a multi-category semantic annotation dataset that includes construction protection equipment, construction machinery and electrical equipment, and train a multi-category target recognition basic model based on the dataset to obtain the model weights;

[0009] Collect images of the construction scene to obtain the image to be processed;

[0010] For the image to be processed, a set of candidate targets is generated by a sliding window or an initial target detector; quadtree segmentation is recursively performed with the entire image as the root node until the number of candidate targets contained in the image area covered by each generated leaf node does not exceed one; the coordinate information of each leaf node is recorded, and a predefined scale level is assigned to each leaf node according to the pixel area of ​​the area it covers;

[0011] The image to be processed is input into a convolutional neural network to extract multiple feature maps with different spatial downsampling ratios;

[0012] The scale level of each leaf node is matched with feature maps of different downsampling ratios to establish an anchor mapping table that indicates which feature layer each leaf node should be associated with for feature extraction.

[0013] Based on the anchor point mapping table, features of the corresponding regions of each leaf node are extracted on the corresponding feature layer, and the model weights are loaded. The multi-class target recognition basic model outputs a recognition result containing the target category and location.

[0014] Based on the recognition results of multiple consecutive frames of images, a security compliance analysis is performed, and an early warning is triggered when a violation is detected.

[0015] Secondly, embodiments of this application provide a multi-target joint identification and real-time safety compliance detection system for construction scenarios, applied to the multi-target joint identification and real-time safety compliance detection method for construction scenarios as described in the first aspect, the system comprising:

[0016] The model building module is used to build a multi-category semantic annotation dataset that includes construction protection equipment, construction machinery and electrical equipment, and to train a multi-category target recognition basic model based on the dataset to obtain model weights;

[0017] The image acquisition and processing module is used to acquire images of the construction scene and obtain images to be processed.

[0018] The candidate region extraction module is used to generate a set of candidate targets for the image to be processed through a sliding window or an initial target detector; recursively perform quadtree segmentation with the entire image as the root node until the number of candidate targets contained in the image region covered by each generated leaf node does not exceed one; record the coordinate information of each leaf node, and assign a predefined scale level to each leaf node according to the pixel area of ​​the region it covers;

[0019] The feature extraction module is used to input the image to be processed into a convolutional neural network and extract multiple feature maps with different spatial downsampling ratios;

[0020] The anchor point mapping module is used to match the scale level of each leaf node with feature maps of different downsampling ratios to establish an anchor point mapping table that indicates which feature layer each leaf node should be associated with for feature extraction.

[0021] The target recognition module is used to extract the features of the corresponding regions of each leaf node on the corresponding feature layer according to the anchor point mapping table, load the model weights, and output the recognition result containing the target category and location through the multi-class target recognition basic model.

[0022] The behavior analysis and early warning module is used to perform security compliance analysis based on the recognition results of multiple consecutive frames of images, and to trigger an early warning when a violation is detected.

[0023] Thirdly, embodiments of this application provide an electronic device, including:

[0024] processor;

[0025] Memory used to store processor-executable instructions;

[0026] The processor is configured to implement the multi-target joint identification and real-time safety compliance detection method for construction scenarios as described in the first aspect when executing the instructions.

[0027] Fourthly, embodiments of this application provide a computer-readable storage medium storing a program that instructs a device to execute the multi-target joint identification and real-time safety compliance detection method for construction scenarios as described in the first aspect.

[0028] Compared with existing technologies, this invention has the following advantages: By constructing a spatial index tree through recursive quadtree segmentation, and dynamically matching the scale level of leaf nodes with the feature map downsampling rate to establish an anchor point mapping table, adaptive allocation of candidate targets to the optimal feature layer is achieved, significantly improving the detection accuracy of multi-scale targets, especially small targets. By constructing a behavior tree and fusing a circular buffer with a temporal prediction network, intelligent prediction and early warning of the development trend of violations are achieved, transforming safety monitoring from post-event accountability to proactive prevention. By generating a triple-interpretable traceability report containing spatial trajectory, feature map activation region, and behavior tree inference path, the black-box problem of detection results is solved, providing a complete chain of evidence for tracing and auditing violations. The system's modules work collaboratively, balancing detection accuracy and computational efficiency, making it suitable for edge device deployment and meeting the all-weather, high-real-time safety monitoring needs of construction scenarios. Attached Figure Description

[0029] Figure 1 This is a schematic diagram of a multi-target joint identification and real-time safety compliance detection method for construction scenarios provided in an embodiment of this application.

[0030] Figure 2 This is an architecture diagram of a multi-target joint identification and real-time safety compliance detection system for construction scenarios provided in an embodiment of this application.

[0031] Figure 3 A schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0032] 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 a part of the embodiments of this application, and not all of them.

[0033] It should be noted that in the embodiments of this application, "at least one" refers to one or more, and "more than one" refers to two or more. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the specification of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application.

[0034] Based on the embodiments described in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0035] Example 1

[0036] Figure 1This is a schematic diagram illustrating a method for multi-target joint identification and real-time safety compliance detection in a construction scenario, provided as an embodiment of this application. Figure 1 As shown, a method for multi-target joint identification and real-time safety compliance detection in construction scenarios includes:

[0037] S1. Construct a multi-category semantically labeled dataset including construction protective equipment, construction machinery, and live equipment, and train a multi-category target recognition basic model based on this dataset to obtain model weights. First, a dedicated image library needs to be established, collecting photos of various construction targets and live equipment such as safety helmets, reflective vests, excavators, cranes, and transformers, and labeling the targets in each photo. Then, a deep learning model is trained using these labeled photos, enabling the model to accurately identify what these targets are and where they are located in complex scenes.

[0038] This step begins by collecting a large number of on-site images from surveillance videos of substations or construction sites, covering different time periods, weather conditions, and lighting conditions. Each image is then manually labeled, using rectangular boxes to outline targets such as safety helmets, reflective vests, excavators, cranes, transformers, and disconnectors, and assigning a corresponding category label to each box. After labeling, the images are fed into a convolutional neural network for training, allowing the network to repeatedly learn the visual features of various targets, ultimately resulting in a set of model weights. These weights act as the model's memory parameters, recording the appearance features of various targets, and will be used in subsequent steps to identify targets in new images.

[0039] S2. Acquire construction scene images and obtain the images to be processed. At the actual construction site, use fixed cameras or mobile monitoring equipment to capture real-time footage of the work area. The camera continuously captures video streams and outputs them frame by frame as digital images; each frame is the original image to be processed. If the lighting on site is insufficient, the images need to be enhanced before being sent to subsequent steps.

[0040] Specifically, the image quality adaptive enhancement sub-step includes:

[0041] S2.1 Evaluate the average brightness and contrast of the image to be processed. This sub-step first performs calculations and analysis on the original image captured by the camera. Specifically, the color image is converted to a grayscale image, and then the average brightness of all pixels in the entire image is calculated to obtain the global average brightness. At the same time, the contrast is evaluated by statistically analyzing the dispersion of pixel values ​​in the image. The wider the pixel value distribution, the more obvious the difference between light and dark and the higher the contrast; the more concentrated the distribution, the grayer the image is and the lower the contrast.

[0042] S2.2 If the average brightness is below the brightness threshold or the contrast is below the contrast threshold, a low-light enhancement network based on Retinex theory is activated to enhance the image. When it is determined that the average brightness of the image is too low (e.g., taken at dusk, night, or on a cloudy day) or the contrast is insufficient (e.g., backlighting or fog causing the image to appear grayish), the system automatically triggers a low-light enhancement module. This module is based on Retinex theory. This is an algorithmic approach that simulates human vision, assuming that an image can be decomposed into two parts: one part is the color and texture of the object itself (called the reflection component), and the other part is the light illuminating it from the outside (called the illuminance component). The low-light enhancement network estimates the illuminance component from the original image and adjusts it, while preserving the reflection component unchanged. This brightens the dark areas without losing the original color and detail information, ultimately outputting an enhanced image with appropriate brightness and clear details.

[0043] S2.3. The enhanced image is used as a new image to be processed and input into the step of generating the candidate target set. After the image quality is improved by enhancement, it replaces the original image as input data in the target detection process and is sent to the subsequent candidate target extraction step. In this way, safety helmets, construction machinery, or electrical equipment that were originally difficult to identify due to insufficient lighting can be more accurately detected and located by the detection model after enhancement.

[0044] S3. For the image to be processed, generate a candidate target set using a sliding window or an initial target detector; recursively perform quadtree segmentation with the entire image as the root node until the number of candidate targets contained in the image area covered by each generated leaf node does not exceed one; record the coordinate information of each leaf node, and assign a predefined scale level to each leaf node according to the pixel area of ​​the area it covers. After obtaining an image, the quadtree method is used to repeatedly cut the image into smaller and smaller squares until each small square contains at most one potential target. At the same time, record the coordinate position of each small square in the image, and label them as large target, medium target, or small target according to the area occupied by the target in the square in the image.

[0045] Specifically, in this embodiment, the termination condition for the recursive quadtree partitioning is a compound logic judgment, specifically:

[0046] S3.1 If the pixel intensity variance of the area covered by the current node is greater than a preset variance threshold, the region is determined to be complex and needs further segmentation. During quadtree segmentation, after obtaining each image region node, the system calculates the variance of the grayscale values ​​of all pixels within that region. Variance represents the dispersion of pixel values. If the region contains both bright targets and dark backgrounds, the large difference in pixel values ​​and the large variance indicate a complex texture and the potential presence of multiple targets or a boundary between a target and the background. If the pixel values ​​within the region are uniform and the variance is small, the region may be inside a single target or a pure background. When the calculated variance exceeds a preset threshold, the system determines that the region is too complex and needs to be further subdivided into four smaller sub-regions. Conversely, if the variance is less than or equal to the threshold, the region meets one of the conditions for stopping segmentation in terms of texture complexity.

[0047] S3.2 If the number of connected components identified through connected component analysis within the current node is greater than one, then the node is determined to contain more than one candidate target and further segmentation is required. In addition to judgments based on texture complexity, the system also performs connected component analysis on the current region. Connected component analysis is an image processing method that groups adjacent pixels with similar pixel values ​​into the same connected component. For example, in an image, two people standing in different positions will form two independent connected regions based on their respective outlines. The system uses this analysis to count the number of connected regions within the current region. If the count is greater than one, it indicates that the region indeed contains two or more separate targets, thus requiring further segmentation to separate each target into different sub-regions; if the number of connected regions is less than or equal to one, it indicates that the region contains at most one target, satisfying one of the conditions for stopping segmentation.

[0048] S3.3. If the side length of the current node is less than the preset minimum segmentation side length, segmentation stops. To prevent computational explosion caused by infinite subdivision, the system presets a minimum segmentation side length. When the side length (i.e., the width or height of the region) of a node in an image region is less than this minimum value, segmentation will stop even if the region has complex textures or contains multiple targets. This is because regions that are too small have no practical significance for further subdivision. Regions that are too small may only contain local fragments of the target, and continuing segmentation will result in the loss of overall information. At this point, the system directly stops recursively processing that node and treats it as a leaf node.

[0049] S3.4. A node is marked as a leaf node and segmentation stops only if the pixel intensity variance of the current node is less than or equal to a preset variance threshold, the number of connected regions within the current node is less than or equal to one, and the side length of the current node is greater than or equal to a preset minimum segmentation side length. This is a comprehensive condition for determining a leaf node; all three conditions must be met simultaneously: the texture is not complex (small variance), there is at most one target (the number of connected regions does not exceed one), and the region size has not yet reached the limit of the minimum side length. Only when all three conditions are met is the node identified as a leaf node, and further segmentation stops. These three conditions are like security checkpoints. Complex textures, multiple targets, and excessively small regions are all rejected; only when all three conditions are met can a node become a leaf node. The regions within each leaf node will subsequently be treated as a whole for feature extraction and target recognition, avoiding the situation where the same target is split into multiple regions or multiple targets are mixed within a single region.

[0050] The above compound logical judgment can be uniformly represented by the following formula for determining the leaf node:

[0051] Set node region The pixel intensity variance is The number of connected regions is The side length of the region is Then the leaf node determination function Defined as

[0052] ,

[0053] in, Represents the quadtree in which the first... Layer The image region corresponding to each node; , For pixel grayscale values, The average gray level of the region. The total number of pixels within the region; The preset variance threshold has a value range of [50, 200]. This represents the number of connected regions obtained through 8-connected neighborhood analysis. , These represent the width and height of the node region, respectively. The preset minimum segmentation side length has a value range of [16, 64] pixels. When =1, node Marked as a leaf node and stop splitting; when When the value is 0, the node is determined to need to be further divided into four child nodes. Existing quadtree segmentation is usually based on only a single condition (such as region size or pixel consistency). This formula uses a logical AND operation to jointly determine the three dimensions of texture complexity, number of targets, and spatial size, and is applicable for the first time to the special needs of dense targets and variable scale in construction scenarios.

[0054] Specifically, in this embodiment, assigning a predefined scale level to each leaf node is as follows:

[0055] S3.5. The ratio of the pixel area of ​​a leaf node to the area of ​​the entire image is used as its relative scale. After the quadtree segmentation is completed, each leaf node corresponds to a rectangular region in the image, containing a candidate target. The system first calculates the number of pixels occupied by this rectangular region in the image, i.e., the pixel area of ​​the leaf node; at the same time, it calculates the total number of pixels in the entire image, i.e., the area of ​​the entire image. Then, the pixel area of ​​the leaf node is divided by the area of ​​the entire image to obtain a ratio between 0 and 1. This ratio is the relative scale of the target. For example, a small target at a distance may only occupy one-thousandth of the entire image, while a large robotic arm at close range may occupy one-quarter of the image. The advantage of using a relative scale is that it can uniformly measure the proportion of the target in the image, regardless of the camera's shooting resolution or the image size.

[0056] S3.6. Based on the physical size and imaging patterns of typical targets in construction scenarios, multiple relative scale intervals are preset, defined as large-scale, medium-scale, and small-scale levels, respectively. In actual construction scenarios, the size range of different types of targets in the image follows certain patterns. For example, protective equipment such as safety helmets and goggles typically occupy only a small portion of the image at normal shooting distances, belonging to small-scale targets; the mechanical arm of an excavator and the hook of a crane occupy a medium proportion, belonging to medium-scale targets; while the body of a large crane and the overall outline of a transformer occupy a large portion of the image, belonging to large-scale targets. Based on this prior knowledge, the system pre-sets three relative scale intervals: for example, a relative scale less than 0.01 is defined as the small-scale interval, between 0.01 and 0.1 as the medium-scale interval, and greater than 0.1 as the large-scale interval. The boundary values ​​of these intervals can be flexibly adjusted according to the specific construction scenario and the camera installation location.

[0057] S3.7 Each leaf node is assigned a corresponding scale level based on the interval its relative scale falls into. The system compares the relative scale calculated in step S3.5 with the three preset intervals in step S3.6. If the relative scale falls within the small scale interval, the leaf node is labeled as small scale; if it falls within the medium scale interval, it is labeled as medium scale; and if it falls within the large scale interval, it is labeled as large scale. This scale level label will be used in the subsequent anchor mapping step to determine which feature map layer the target within the leaf node should be used to extract features. Small-scale targets are matched with high-resolution shallow feature maps to preserve detailed textures, while large-scale targets are matched with low-resolution deep feature maps to obtain overall semantic information. Through this relative scale-based hierarchical classification, the system can automatically select the most suitable processing path for targets of different sizes.

[0058] The scale level of leaf nodes is determined using the following relative scale calculation formula:

[0059] Set leaf nodes The pixel area is The pixel area of ​​the entire image is Then the relative scale of the node Defined as:

[0060] , ,

[0061] in, These represent the width and height of the leaf node region, respectively. The scale level is then determined. Determined by the following formula:

[0062] ,

[0063] in, leaf node The relative scale, with values ​​ranging from (0,1]; This is a small-scale threshold, typically set to 0.01. This is a large-scale threshold, typically set to 0.1. =0 indicates a small scale. =1 indicates mesoscale. =2 indicates a large scale. Existing methods typically use the absolute value of pixel area for classification. This formula introduces the concept of relative scale for the first time, eliminating the influence of changes in camera resolution and shooting distance on scale classification, and thus exhibiting scale invariance.

[0064] S4. Input the image to be processed into a convolutional neural network to extract multiple feature maps with different spatial downsampling ratios. The original image is fed into a convolutional neural network, which extracts features layer by layer, generating several feature maps of different sizes and with different information of interest. Some feature maps have high resolution but focus on close objects, suitable for capturing details of small targets; others have low resolution but focus on distant objects, suitable for capturing the overall outline of large targets.

[0065] Specifically, in this embodiment, the original image is fed into a pre-trained convolutional neural network, which consists of multiple stacked convolutional layers. After the image enters from the input layer, it is processed sequentially through each layer: shallow layers retain high resolution, capable of capturing details such as the edges and textures of the helmet, but with lower semantic abstraction; deep layers continuously reduce the size of the feature maps through convolution operations with a stride of 2. Each doubling of the size is called a downsampling. The higher the downsampling factor, the lower the resolution of the feature map but the richer the semantic information. In this way, the network outputs multiple feature maps of different sizes and meanings. For example, a feature map downsampled by 4 times is suitable for capturing details of small targets, while a feature map downsampled by 32 times is suitable for capturing the overall outline of large targets.

[0066] S5. Match the scale level of each leaf node with feature maps of different downsampling ratios to establish an anchor mapping table that indicates which feature layer each leaf node should be associated with for feature extraction. Match the target size label of each small square in step S3 with the various feature maps obtained in step S4. Small targets correspond to high-resolution shallow feature maps, and large targets correspond to low-resolution deep feature maps, thus establishing a lookup table to clarify which feature map each small square should extract features from.

[0067] Specifically, in this embodiment, matching the scale level of each leaf node with feature maps at different downsampling ratios is performed based on the principle of scale-semantic correspondence, including:

[0068] S5.1. For leaf nodes assigned to the large-scale level, match feature maps from deeper layers of the convolutional neural network with a downsampling factor of 16 or 32. When a target within a leaf node is marked as large-scale, it means that the target occupies a large area in the image, typically corresponding to the complete body of large construction machinery or large electrical equipment in a substation. These targets require a holistic understanding of their outline structure and spatial location, with relatively lower requirements for detailed texture. Therefore, the system matches these leaf nodes to deeper feature maps in the convolutional neural network. These feature maps undergo multiple downsampling processes, reducing the image size to one-sixteenth or one-thirty-second of the original image. Each pixel in the feature map corresponds to a larger area in the original image, capable of covering the entire region of a large target. Simultaneously, the semantic information extracted by the deeper network is more abstract and complete, aiding in the identification of the overall category and approximate location range of large targets.

[0069] S5.2. For leaf nodes assigned to the small-scale level, match them with feature maps from shallower layers of the convolutional neural network, with a downsampling factor of four or eight. When a target within a leaf node is labeled as small-scale, it means that the target occupies a small area in the image, typically corresponding to small protective equipment such as helmets and goggles, or distant personnel and small parts. These targets are small in size, rich in detail, but visual features are easily lost, thus requiring high spatial resolution of the feature maps. The system matches these leaf nodes to shallower feature maps in the convolutional neural network. These feature maps are only downsampled a small amount, and the image size is usually one-quarter or one-eighth of the original image, preserving high spatial resolution. On the small-sized feature maps, each pixel corresponds to a small area in the original image, enabling precise location of small targets; at the same time, the shallow network retains rich details such as edges and textures, helping to accurately identify subtle features such as the color and shape of helmets. By employing this differentiated matching strategy of pairing large targets with deep layers and small targets with shallow layers, each target can have its features extracted at the most appropriate feature level, thus balancing the overall perception capability of large targets with the detailed discrimination capability of small targets.

[0070] Set leaf nodes The scale level is The feature maps generated by the convolutional neural network are denoted as... Its downsampling factor is Then the anchor mapping function Defined as:

[0071] ,in ,

[0072] The parameterized expression of the matching rule is as follows:

[0073] ,

[0074] in, This represents the feature map of the m-th layer, where m = 1, 2, 3, 4 correspond to the downsampling factor, respectively. , , , ; Let the target downsampling rate function be . , , Or 32; To achieve the actual downsampling ratio Compared with the target ratio The closest feature map index; Output the matching feature layer as the anchor point mapping result.

[0075] Based on the optimal feature layer index obtained from the above matching The corresponding downsampling factor is denoted as Then the leaf node Anchor point coordinates on the matching feature map Calculate using the following formula:

[0076] , ,

[0077] in, leaf node The coordinates of the center in the original image. This is a floor function. In existing methods, all targets share the same set of feature maps (such as multi-scale prediction in the YOLO series), while this formula achieves a dynamic optimal match between the target scale and the feature map downsampling rate, and for the first time establishes an explicit mapping function from the target's relative scale to the feature layer.

[0078] S6. Based on the anchor point mapping table, extract the features of the corresponding regions of each leaf node on the corresponding feature layer, load the model weights, and output the recognition result containing the target category and location through the multi-class target recognition basic model. According to the lookup table established in step S5, extract the corresponding image features at the specified feature map location, then load the model weights trained in step one, identify the target within each small square, and finally output the category of each target (e.g., safety helmet or crane) and its specific location box in the image.

[0079] Specifically, in this embodiment, according to the anchor point mapping table established in step S5, the region corresponding to each leaf node is found at the specified feature layer level, and the feature vector of that region is extracted. Then, the model weights trained in step one are loaded, and the extracted feature vectors are fed into the classifier for judgment. The classifier will output the category label of the target within each leaf node (e.g., "safety helmet", "crane arm", "transformer"), as well as the precise location bounding box of the target in the image. This step is equivalent to letting the model "recognize" what is in each candidate region and where it is located.

[0080] S7. Based on the recognition results of multiple consecutive frames of images, perform safety compliance analysis and trigger an early warning when a violation is detected. Analyze the recognition results of multiple consecutive frames to see the target's movement trajectory and the trend of changes in distance between the target and energized equipment. When the time-series prediction model determines that an imminent danger of close proximity, collision, or electric shock is imminent, issue an early warning signal before the actual danger occurs to remind on-site personnel to take timely evacuation measures.

[0081] Specifically, in this embodiment, the security compliance analysis based on the recognition results of multiple consecutive frames of images, and the triggering of an early warning when a violation is detected, specifically includes:

[0082] S7.1. The recognition results of multiple consecutive frames of images are used to perform cross-frame identity association based on the target's appearance features and motion trajectory, and stored in a fixed-capacity circular buffer. In actual construction scenarios, the same target may appear continuously in multiple frames of images. The system needs to determine which target in the current frame is the same object as the target in the previous frame; this process is called cross-frame identity association. Specifically, the appearance features of the target (such as the color of a safety helmet, the shape and outline of a robotic arm) and motion trajectory (such as whether the target's position change between adjacent frames conforms to the law of uniform motion) are compared. After successful association, the category label, position coordinates, recognition confidence, and other information of each target in each frame are stored in a circular buffer in chronological order. The circular buffer is a fixed-length storage structure. When the amount of stored data reaches its limit, new data will overwrite the oldest data, thus always maintaining the detection records within the most recent period. This design controls memory usage while retaining necessary historical information for subsequent time-series analysis.

[0083] S7.2 Based on construction safety specifications, construct a hierarchical behavior tree, where the root node represents the overall safety status, the intermediate nodes represent various categories of violations, the leaf nodes represent specific violations, and the state transitions between nodes are triggered by the target category, positional relationship, and time interval conditions in the identification results.

[0084] The system pre-builds a behavior tree based on the safety management regulations of the construction site. The bottom layer of the tree consists of leaf nodes, each corresponding to a specific violation, such as "crane boom entering a no-go zone with live electrical equipment," "personnel not wearing safety helmets," and "insufficient distance between machinery and overhead wires." Intermediate nodes group these specific violations by category; for example, "Machinery Violations" includes sub-nodes such as "crane boom violations" and "bucket collision risk," while "Personnel Violations" includes sub-nodes such as "not wearing safety helmets" and "entering a no-go zone." The root node represents the overall safety status of the entire construction site. State transitions between nodes are triggered by recognition results: when a specific violation is detected, the corresponding leaf node becomes "activated"; when multiple leaf nodes are activated, their parent node updates its own state according to preset logic (e.g., "activation occurs when any node is activated" or "activation only occurs when all nodes are activated"); finally, the state of the root node reflects the overall risk level of the scenario. Triggering conditions include target category matching (e.g., crane detection), spatial location relationships (e.g., robotic arm coordinates entering a marked danger zone), and time intervals (e.g., violation lasting more than 3 seconds).

[0085] S7.3. Traverse the time-sorted recognition result sequence in the circular buffer to drive the behavior tree to perform state and confidence inference updates from the leaf nodes to the root node.

[0086] The system reads the recognition results from the circular buffer frame by frame in chronological order, from oldest to newest. For each frame, based on the target category and location information detected in that frame, it determines which leaf nodes' trigger conditions are met, thereby updating the activation state and confidence level of the corresponding leaf nodes (confidence level represents the degree of certainty that the violation actually occurred, ranging from 0 to 1). Then, starting from the updated leaf node, the process is passed upwards along the tree connection, updating the state and confidence level of intermediate nodes and the root node in turn. For example, if the confidence level of the "crane entry into restricted area" leaf node increases, the confidence level of its parent node "mechanical violation" will also increase accordingly, and consequently, the risk score of the "overall safety status" root node will also rise. This bottom-up reasoning method ensures that the lower-level detection results can be progressively aggregated into the higher-level risk assessment.

[0087] The confidence update of behavior tree nodes follows the following recursive formula:

[0088] Let the set of child nodes of node n in the behavior tree be . The confidence level of child node c is The weight of child node c is Then the confidence level of parent node n at time t for:

[0089] ,

[0090] Among them, weight Satisfy the normalization condition:

[0091] , ,

[0092] For the root node Scenario-level security score Defined as:

[0093] ,

[0094] leaf nodes confidence level The update is triggered directly by the target recognition result, and its update rule is as follows:

[0095] ,

[0096] in α is the preset confidence increment coefficient, β is the preset confidence decay coefficient, and α,β∈[0,1] are the preset increment and decay coefficients. For indicator functions, Leaf nodes The corresponding violation condition is met at time t. This indicates that the violation conditions have been removed. Let n be the confidence level of node n at time t. Let be the set of child nodes of node n. In this embodiment, α is 0.1 and β is 0.05, that is, the confidence increases by 0.1 each time the violation condition is met, and the confidence decreases by 0.05 each time the violation condition is cleared, with a maximum confidence of 1.

[0097] Existing behavior trees used for robot path planning do not include the concept of confidence. This formula, for the first time, incorporates the uncertainty of deep learning detection results into the behavior tree node state in the form of confidence, and propagates it step by step from the leaf node to the root node, realizing a quantitative mapping from detection confidence to safety score.

[0098] S7.4 Input the sequence of state and confidence changes of each node in the behavior tree within a time window into a time series prediction model. The model outputs a probability value that indicates the impending occurrence of a potential violation risk. When the probability value exceeds the dynamic warning threshold, a warning is triggered.

[0099] The system not only focuses on the current state of the behavior tree but also on the changing trends of each node within a historical time window. For example, the behavior of "the boom moving closer to the live equipment" manifests as a gradual decrease in the spatial distance between the boom node and the live equipment node over multiple consecutive frames. These time-varying confidence sequences are input into a time-series prediction model, which learns typical patterns of change before violations occur in historical data to predict the probability of an actual violation occurring within the next few seconds. For example, a model output of 0.85 indicates an 85% probability of an impending safety incident. The warning threshold is not fixed; the system dynamically adjusts it based on recent performance. If false alarms are frequent, the threshold is appropriately increased to reduce interference; if there are many missed alarms, the threshold is appropriately decreased to increase sensitivity. When the predicted probability exceeds the current dynamic threshold, the system immediately issues an audible and visual alarm, pushes a message to the management terminal, or triggers equipment braking, buying valuable reaction time for on-site personnel before the actual danger occurs. This "pre-event warning" mechanism differs from traditional post-event alarms, realizing a shift from passive response to proactive prevention.

[0100] Specifically, the time-series prediction model is a neural network that integrates multi-source information, comprising:

[0101] A time-series encoded stream, consisting of two layers of gated recurrent units, processes the state and confidence sequences of the behavior tree nodes, outputting a time-series feature vector. The time-series encoded stream is specifically responsible for analyzing the evolution of violations over time. It takes the confidence sequence of each node in the behavior tree within a continuous time window as input; for example, it records the confidence of the "crane boom approaches restricted area" node every second, recording 16 times to form a time series of length 16. This data is then sequentially fed into the two-layer gated recurrent unit network. A gated recurrent unit is a neural network structure specifically designed for processing time-series data. Internally, it incorporates two control switches: an "update gate" and a "reset gate." The update gate controls how much historical information needs to be retained in the current moment, while the reset gate controls how much past information needs to be forgotten. This design allows the network to effectively capture short-term fluctuations and long-term trends, such as the long-term trend of gradually increasing confidence as the crane boom continuously moves towards live equipment, or the short-term fluctuation of rapidly rising and falling confidence when personnel briefly enter and immediately exit a restricted area. After being processed layer by layer by two layers of gated recurrent units, the network outputs a fixed-length temporal feature vector, which encapsulates the changing patterns of behavior tree nodes over a period of time.

[0102] A context-encoding stream, composed of a 3D convolutional network, processes a sequence of downsampled feature map snapshots synchronously acquired from the circular buffer, outputting a spatiotemporal feature vector. The context-encoding stream is specifically responsible for analyzing environmental background changes in the construction scene. It synchronously acquires feature map snapshots from several past frames of images from the circular buffer. These feature maps have undergone preliminary processing and downsampling compression by the convolutional network, preserving the spatial layout information of the site while reducing the data volume. A 3D convolutional network is a type of convolutional operation capable of simultaneously processing spatial and temporal dimensions: ordinary 2D convolution extracts features by sliding a window across an image, while 3D convolution extracts both temporal and spatial information simultaneously from a video clip. For example, 3D convolution can capture the process of a crane boom moving from the upper left to the lower right over several consecutive frames, or the trend of people gradually gathering around electrical equipment. The network treats these consecutive frame feature map snapshots as a spatiotemporal cube, and extracts a spatiotemporal feature vector containing both spatial distribution and motion trends by sliding the 3D convolutional kernel across the cube. This vector describes the spatiotemporal changes in the scene background, such as environmental information related to safety risks, such as the gradual darkening of lighting conditions and the gradual increase in target density.

[0103] An information fusion and decision-making module is used to concatenate the temporal feature vector and the spatiotemporal feature vector and input them into a multi-head attention layer. This concatenation is then processed by a fully connected layer and a sigmoid activation function to output the probability of future violations. The information fusion and decision-making module is responsible for integrating the information extracted from the two encoding streams and making a final judgment. First, the temporal feature vector output from the temporal encoding stream and the spatiotemporal feature vector output from the context encoding stream are concatenated end-to-end into a longer fusion vector. This fusion vector contains both the violation confidence change pattern from the behavior tree and the spatiotemporal evolution information of the scene background. This fusion vector is then input into the multi-head attention layer. The working principle of the multi-head attention mechanism is: simultaneously observing the input information from multiple different angles, each "head" learns to focus on different aspects. Some heads may focus more on the distance change trend between the boom and the live equipment, some on whether the personnel movement speed is abnormal, and some on whether there are potential targets in the occluded area. Each head outputs a weighted and focused feature representation, and then the outputs of all heads are concatenated in parallel. The advantage of the attention mechanism lies in its ability to automatically determine which time segments and spatial regions are most important for predicting violation risk and assign them higher weights. Finally, the feature vector processed by the attention layer is fed into a fully connected layer. Each neuron in the fully connected layer is connected to all input features, and through linear weighting and nonlinear transformation, the high-dimensional features are mapped to a value between 0 and 1. This value is then processed by the Sigmoid activation function as the final output. The Sigmoid function is an S-shaped curve function that maps any real number to the interval between 0 and 1, making it very suitable for representing probability values. An output value close to 1 indicates a high probability of a future violation, while an output value close to 0 indicates a low risk. The system compares this probability value with a dynamic warning threshold; if the threshold is exceeded, a warning is triggered. Through this dual-stream fusion design, the model utilizes both the structured knowledge of the behavior tree and the spatiotemporal contextual information in the original image, improving the accuracy and robustness of violation risk prediction.

[0104] The warning threshold adopts the following adaptive update mechanism: Let the current warning threshold be... The false alarm rate for the most recent N warnings was The false negative rate was Then the updated threshold for:

[0105] ,

[0106] in, The warning threshold at time t is initially set to 0.7; , represents the percentage of false alarms in the last N warnings. Number of false alarms Total number of warnings; This represents the percentage of unreported violations in the last N actual violations. The number of times the report was missed. This represents the total number of actual violations. The target false positive / false negative rate is typically set to 0.05. The adaptive learning rate ranges from [0.1, 0.5]. To ensure stability of the threshold, [the following parameters are used]. Apply boundary constraints:

[0107] ,

[0108] in, The preset minimum threshold value is 0.3. The preset maximum threshold is set to 0.95. Existing early warning systems typically use fixed thresholds, which cannot adapt to changes in safety risks across different construction scenarios and time periods. This formula, for the first time, uses the system's own false alarm rate and false negative rate as feedback signals, dynamically adjusting the early warning threshold through an exponential adaptive mechanism, thereby reducing false alarm interference while ensuring early warning sensitivity.

[0109] Specifically, upon triggering an alert, an interpretable violation tracing report is generated simultaneously. This report includes at least the following:

[0110] Based on the target's identity, the historical motion trajectory of the violating target in the image space is extracted from the circular buffer. When the system triggers an alert, it first needs to identify the core target that triggered the alert. Each target is assigned a unique identity during cross-frame association, such as "crane 01" or "personnel 03". Based on this identity, the system retrieves the target's position records in all frames over a past period from the circular buffer, including the center coordinates and corner coordinates of the target's bounding box in each frame. Connecting these coordinates in chronological order forms a motion trajectory line. For example, the crane's trajectory line starts from the edge of the safe area and extends frame by frame towards the energized equipment. Each point on the trajectory is marked with a corresponding timestamp and distance value from the energized equipment. This trajectory line can be overlaid on the original image or video for visualization, allowing safety managers to intuitively see "where the violating target came from and where it is going." Whether it approaches slowly or suddenly intrudes, whether it stays in the danger zone or briefly enters and then exits, can help determine the severity and nature of the violation.

[0111] Based on the anchor point mapping table, the activation region of the violation target on the key feature map of the convolutional neural network is located and visualized. Besides the intuitive spatial location information, the system also needs to explain "why the model identifies this target as a violation." To this end, the system retrieves the anchor point mapping table established in step five to find which feature map layer the leaf node corresponding to the violation target matches and the anchor point's coordinates on the feature map. Then, on the corresponding feature layer of the convolutional neural network, a region centered on the anchor point is extracted, and the feature response intensity of each location within this region is calculated. Locations with high response intensity indicate that the model focuses on these pixels when identifying the target. These high-response regions are overlaid on the original image as heatmaps: the redder the color, the higher the model's attention; the bluer the color, the lower the attention. For example, when the model identifies the violation of not wearing a safety helmet, the heatmap may highlight the face and head areas in red; when identifying a crane boom approaching a conductor, the heatmap will form a red connecting band between the boom end and the conductor. This visualized activation region map helps managers understand the basis of the model's judgments, enhancing the credibility and interpretability of the detection results.

[0112] The system extracts the complete inference path leading to this warning from the behavior tree, listing the specific identification results and conditions for state transitions at each node along the trigger path. The triggering of violations is often not an isolated event, but rather the result of the gradual accumulation of multiple conditions. The system performs a depth-first search from the root node of the behavior tree, finding all node paths from the root node to the leaf node that triggered the warning. For each node on the path, the system records how it was activated: which detection result triggered the state transition and what conditions were met. For example, a complete inference path might look like this: First layer, if a target of category "crane robotic arm" appears in the current frame's identification result and its coordinates enter the preset danger zone coordinate range, the "robotic arm entry prohibited" leaf node is triggered; Second layer, if the confidence level of the "robotic arm entry prohibited" node exceeds a preset threshold, its parent node "mechanical violation" node is triggered; Third layer, the weighted sum of the confidence levels of the "mechanical violation" node and the "personnel violation" node at that moment reaches the root node's trigger threshold, ultimately leading to a global warning. The system compiles a text report containing every node along the path, its confidence value, and the specific details of each transition condition (e.g., "the coordinates of the danger zone are x∈[100,300], y∈[200,400]"). Safety managers can read this report to trace the entire warning process, understanding the identification results and the layers of reasoning that led to the warning, thus aiding subsequent safety rectification and accountability. These three parts together constitute a complete and interpretable violation tracing report, achieving full-chain transparency regarding "what target violated the rules, how the model identified it, and how the warning was logically derived."

[0113] In the process of security compliance testing, the authenticity and immutability of data are crucial for post-event auditing, liability determination, and dispute resolution. Therefore, this system also includes a separate data storage step S8: This step associates the identification results, warning events, and the interpretable traceability report to generate testing records; adds a timestamp field to each testing record, and stores the record in a local encrypted database after signing it using an asymmetric encryption algorithm, supporting post-event auditing and verification. This step is executed after each round of testing analysis and the generation of a traceability report.

[0114] Specifically, the system first integrates the following three data components generated during the current detection process: the identification results (i.e., the target category, bounding box coordinates, compliance status, and violation confidence level output in step S6), the warning events (i.e., the warning type, warning time, warning threshold, and predicted probability value triggered in step S7), and the interpretable traceability report (i.e., the historical motion trajectory, feature map activation area heatmap, and behavior tree inference path generated in this step or simultaneously generated in step S7). This integration generates a complete and indivisible detection record, ensuring that each record contains all evidentiary information from the initial identification to the final decision. Then, the system adds a precise timestamp field to this record. The timestamp is typically generated by a trusted time source provided by the National Time Service Center, proving the specific moment the detection record was generated and preventing subsequent tampering with the time information. Next, the system uses an asymmetric encryption algorithm to digitally sign the detection record containing the timestamp. The asymmetric encryption algorithm uses a pair of keys: a private key and a public key. The system uses its own private key to encrypt the hash value of the detection record to generate a signature. Since the private key is only kept by the system itself, any subsequent modification to the record will result in signature verification failure. After signing, the system stores the original detection record, signature, and certificate together in a local encrypted database. The database itself also uses a high-strength encryption algorithm to protect the stored content. When auditing or verification is required, the administrator can access the stored record and verify the signature using the corresponding public key. If the signature is correct and the record content is consistent with the signature, it proves that the record has not been tampered with since it was stored, and its content has legally recognized evidentiary value. Through this mechanism, the system can not only detect and warn of violations in real time, but also provide a complete, reliable, and traceable chain of evidence for each warning, meeting the compliance requirements of industrial enterprises for security management data.

[0115] Example 2

[0116] like Figure 2 As shown, this application provides a system architecture diagram for multi-target joint identification and real-time safety compliance detection in construction scenarios, applied to the multi-target joint identification and real-time safety compliance detection method for construction scenarios as described in Embodiment 1, including:

[0117] The model building module 210 is used to build a multi-category semantic annotation dataset including construction protection equipment, construction machinery and electrical equipment, and to train a multi-category target recognition basic model based on the dataset to obtain model weights.

[0118] The image acquisition and processing module 220 is used to acquire images of the construction scene and obtain images to be processed.

[0119] The candidate region extraction module 230 is used to generate a set of candidate targets for the image to be processed by a sliding window or an initial target detector; recursively perform quadtree segmentation with the entire image as the root node until the number of candidate targets contained in the image region covered by each generated leaf node does not exceed one; record the coordinate information of each leaf node, and assign a predefined scale level to each leaf node according to the pixel area of ​​the region it covers.

[0120] The feature extraction module 240 is used to input the image to be processed into a convolutional neural network and extract multiple feature maps with different spatial downsampling ratios.

[0121] Anchor point mapping module 250 is used to match the scale level of each leaf node with feature maps of different downsampling ratios to establish an anchor point mapping table that indicates which feature layer each leaf node should be associated with for feature extraction.

[0122] The target recognition module 260 is used to extract the features of the corresponding regions of each leaf node on the corresponding feature layer according to the anchor point mapping table, load the model weights, and output the recognition result containing the target category and location through the multi-class target recognition basic model.

[0123] The behavior analysis and early warning module 270 is used to perform security compliance analysis based on the recognition results of multiple consecutive frames of images, and to trigger an early warning when a violation is detected.

[0124] Figure 3 This is an electronic device provided in one embodiment of this application. For example... Figure 3 As shown, the electronic device includes at least the following components: processor 301 and memory 300, communication interface 303, and bus 302.

[0125] In this embodiment of the application, memory 300 is used to store executable instructions of processor 301, which, when configured to execute instructions, implements the method as described in the first aspect.

[0126] In embodiments of this application, a computer-readable storage medium includes instructions that instruct a device to perform the method as described in the first aspect. For example, the instructions instruct the device to perform... Figure 1 The method is shown in the process steps.

[0127] In one embodiment of this application, the program operating in the electronic device may be a program that controls a central processing unit (CPU) or similar device to achieve the functions of the above-described embodiments of the present invention (a program that enables the computer to function). Information processed by these systems is then temporarily stored in random access memory (RAM) during processing, and subsequently stored in various ROMs such as read-only memory (FlashROM) and hard disk drives (HDDs), and read, corrected, and written by the CPU as needed.

[0128] It should be noted that a portion of the electronic device described above can also be implemented using a computer. In this case, the program for implementing the control function can be recorded on a computer-readable recording medium, and the program recorded on the recording medium can be read into the computer and executed.

[0129] It should be noted that the computer mentioned here refers to a computer built into an electronic device, employing hardware including an operating system and peripheral devices. Furthermore, computer-readable recording media refers to removable media such as floppy disks, magneto-optical disks, ROMs, and CD-ROMs, as well as storage systems such as hard drives built into the computer.

[0130] Furthermore, computer-readable recording media can include: media that dynamically stores programs for short periods of time, such as communication lines used when transmitting programs via networks like the Internet or communication lines like telephone lines; and media that store programs for fixed periods of time, such as volatile memory inside a computer that serves as a server or client in this case. In addition, the aforementioned program can be a program used to implement the above-mentioned functions, or it can be a program that can implement the above-mentioned functions by combining them with programs already recorded in the computer.

[0131] Furthermore, the electronic device in the above embodiments can also be implemented as an assembly (system group) composed of multiple systems. Each system constituting the system group can possess some or all of the functions or functional blocks of the electronic device in the above embodiments. As a system group, it is sufficient to have all the functions or functional blocks of the electronic device.

[0132] Those skilled in the art should recognize that the above embodiments are only used to illustrate this application and are not intended to limit this application. Any appropriate changes and variations made to the above embodiments within the essential spirit and scope of this application fall within the scope of protection claimed in this application.

Claims

1. A method for multi-target joint identification and real-time safety compliance detection in construction scenarios, characterized in that, Includes the following steps: Construct a multi-category semantic annotation dataset that includes construction protection equipment, construction machinery and electrical equipment, and train a multi-category target recognition basic model based on the dataset to obtain the model weights; Collect images of the construction scene to obtain the image to be processed; For the image to be processed, a set of candidate targets is generated using a sliding window or an initial target detector; The quadtree segmentation is recursively performed with the entire image as the root node until the number of candidate targets contained in the image region covered by each generated leaf node does not exceed one. Record the coordinate information of each leaf node, and assign a predefined scale level to each leaf node based on the pixel area of ​​the area it covers; The image to be processed is input into a convolutional neural network to extract multiple feature maps with different spatial downsampling ratios; The scale level of each leaf node is matched with feature maps of different downsampling ratios to establish an anchor mapping table that indicates which feature layer each leaf node should be associated with for feature extraction. Based on the anchor point mapping table, features of the corresponding regions of each leaf node are extracted on the corresponding feature layer, and the model weights are loaded. The multi-class target recognition basic model outputs a recognition result containing the target category and location. Based on the recognition results of multiple consecutive frames of images, a security compliance analysis is performed, and an early warning is triggered when a violation is detected.

2. The method according to claim 1, characterized in that, The termination condition for the recursive quadtree partitioning is a compound logic judgment, specifically: If the pixel intensity variance of the area covered by the current node is greater than the preset variance threshold, the area is determined to have complex texture and needs to be further segmented. If the number of connected regions identified by connected component analysis within the current node is greater than one, then the node is determined to contain more than one candidate target and needs to be further segmented. If the side length of the current node is less than the preset minimum dividing side length, then stop dividing; A node is marked as a leaf node and segmentation is stopped if and only if the pixel intensity variance of the current node is less than or equal to a preset variance threshold, the number of connected regions in the current node is less than or equal to one, and the side length of the current node is greater than or equal to a preset minimum segmentation side length.

3. The method according to claim 1, characterized in that, The process of assigning a predefined scale level to each leaf node is as follows: The ratio of the pixel area of ​​a leaf node to the area of ​​the entire image is used as its relative scale. Based on the physical size and imaging patterns of typical targets in the construction scenario, multiple relative scale ranges are preset and defined as large-scale level, medium-scale level and small-scale level respectively. Each leaf node is assigned a corresponding scale level based on the interval it falls into according to its relative scale.

4. The method according to claim 1 or 3, characterized in that, The step of matching the scale level of each leaf node with feature maps at different downsampling ratios is performed based on the principle of scale-semantic correspondence, including: For leaf nodes assigned to large-scale levels, feature maps from deeper layers of the convolutional neural network with downsampling factors of sixteen or thirty-two are matched. For leaf nodes assigned to a smaller scale level, feature maps from shallower layers of the convolutional neural network with downsampling ratios of four or eight are matched.

5. The method according to claim 1, characterized in that, The recognition results based on multiple consecutive frames of images are used to perform security compliance analysis, and an early warning is triggered when a violation is detected. Specifically, this includes: The recognition results of multiple consecutive frames of images are used to perform cross-frame identity association based on the target's appearance features and motion trajectory, and stored in a circular buffer of fixed capacity. Based on construction safety specifications, a hierarchical behavior tree is constructed, where the root node represents the overall safety status, the intermediate nodes represent various categories of violations, the leaf nodes represent specific violations, and the state transitions between nodes are triggered by the target category, positional relationship, and time interval conditions in the identification results. The sequence of recognition results ordered by time in the circular buffer is traversed to drive the behavior tree to perform inference and update of state and confidence from leaf node to root node; The sequence of state and confidence changes of each node in the behavior tree within a time window is input into a time series prediction model. The model outputs a probability value that indicates a potential violation risk is about to occur. When the probability value exceeds the dynamic warning threshold, a warning is triggered.

6. The method according to claim 5, characterized in that, The time-series prediction model is a neural network that integrates multi-source information, comprising: A temporal coding stream, consisting of two layers of gated recurrent units, is used to process the state and confidence sequences of the behavior tree nodes and output a temporal feature vector. A context-encoded stream, consisting of a three-dimensional convolutional network, is used to process a sequence of downsampled feature map snapshots synchronously acquired from the circular buffer, and output a spatiotemporal feature vector. An information fusion and decision-making module is used to concatenate the temporal feature vector and the spatiotemporal feature vector and input them into a multi-head attention layer, and then output the probability of future violation risk through a fully connected layer and a sigmoid activation function.

7. The method according to claim 5, characterized in that, When an alert is triggered, an interpretable violation tracing report is generated simultaneously. This report includes at least the following: Based on the target's identity identifier, the historical motion trajectory of the violating target in the image space is extracted from the circular buffer. Based on the anchor point mapping table, locate and visualize the activation region of the violation target on the key feature map of the convolutional neural network; Extract the complete reasoning path that led to this warning from the behavior tree, and list the specific identification results and conditions of the state transition of each node on the triggering path.

8. The method according to claim 1, characterized in that, The process of acquiring construction scene images and obtaining the image to be processed also includes an image quality adaptive enhancement sub-step: Evaluate the average brightness and contrast of the image to be processed; If the average brightness is below the brightness threshold or the contrast is below the contrast threshold, then a low-light enhancement network based on Retinex theory is activated to enhance the image. The enhanced image is used as a new image to be processed and input into the step of generating a candidate target set.

9. The method according to claim 7, characterized in that, It also includes data notarization steps: The identification results, early warning events, and the explainable traceability report are correlated to generate detection records; Add a timestamp field to each detection record, and use an asymmetric encryption algorithm to sign the record before storing it in a local encrypted database, supporting post-event auditing and verification.

10. A multi-target joint identification and real-time safety compliance detection system for construction scenarios, applied to the method described in any one of claims 1 to 9, characterized in that, The system includes: The model building module is used to build a multi-category semantic annotation dataset that includes construction protection equipment, construction machinery and electrical equipment, and to train a multi-category target recognition basic model based on the dataset to obtain model weights; The image acquisition and processing module is used to acquire images of the construction scene and obtain images to be processed. The candidate region extraction module is used to generate a set of candidate targets for the image to be processed through a sliding window or an initial target detector; recursively perform quadtree segmentation with the entire image as the root node until the number of candidate targets contained in the image region covered by each generated leaf node does not exceed one; record the coordinate information of each leaf node, and assign a predefined scale level to each leaf node according to the pixel area of ​​the region it covers; The feature extraction module is used to input the image to be processed into a convolutional neural network and extract multiple feature maps with different spatial downsampling ratios; The anchor point mapping module is used to match the scale level of each leaf node with feature maps of different downsampling ratios to establish an anchor point mapping table that indicates which feature layer each leaf node should be associated with for feature extraction. The target recognition module is used to extract the features of the corresponding regions of each leaf node on the corresponding feature layer according to the anchor point mapping table, load the model weights, and output the recognition result containing the target category and location through the multi-class target recognition basic model. The behavior analysis and early warning module is used to perform security compliance analysis based on the recognition results of multiple consecutive frames of images, and to trigger an early warning when a violation is detected.