A multi-stage target detection method and system for a smart construction site
Patent Information
- Application Number
- CN202611074502.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-20
- Publication Date
- 2026-10-30
AI Technical Summary
[0005]本发明的目的在于提供一种智慧工地的多阶段目标检测方法及系统,旨在解决现有技术中在单摄像头、大场景的小散型智慧工地中,远段目标尺寸过小、传统CNN特征提取易丢失信息、单一检测策略难以适配多尺度目标等问题,导致漏检严重、检测精度低的问题
通过将监控图像空间划分为前、中、远三段并实施差异化增强策略,对远段区域执行4倍超分辨率增强,克服了单摄像头大场景下远距离目标像素占比过低的固有难题,将远段小目标的检测召回率大幅提升,显著降低了漏检率;
Smart Images

Figure CN123016326A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of electronic information and artificial intelligence technology, specifically relating to a multi-stage target detection method and system for smart construction sites. Background Technology
[0002] In small-scale smart construction sites, only a single camera is typically deployed for large-scale monitoring, and these cameras often use an overhead shooting method. Personnel, equipment, and other targets at the construction site appear very small in size at a considerable distance from the camera, posing a typical challenge for small target detection. Traditional security detection algorithms mostly employ frameworks like YOLO and RT-DETR. To achieve higher processing speeds, the input image is typically scaled to 640×640 pixels before being sent to the network. During this process, targets that originally occupied only a few pixels at the far end of the camera are further compressed, becoming small targets smaller than 32×32 pixels. This makes it difficult for existing algorithms to guarantee detection accuracy, resulting in a high false negative rate.
[0003] The RT-DETR framework employs a hybrid architecture of CNN and Transformer, which improves generalization ability, but its CNN backbone is still based on a pyramid structure with multi-layer downsampling. For small targets, shallow location information and detailed textures are easily weakened or even completely lost during layer-by-layer downsampling, leaving almost no effective representation in high-level feature maps. Furthermore, a single detection strategy is geared towards full-image processing and cannot adaptively adjust to differences in target scale at different distances, making it difficult to balance detection accuracy and computational efficiency. The limitation of a single camera further amplifies the problem of insufficient long-range detection capability.
[0004] Therefore, how to design a multi-stage target detection method and system for smart construction sites that improves the accuracy and efficiency of long-distance small target detection is an urgent technical problem to be solved. Summary of the Invention
[0005] The purpose of this invention is to provide a multi-stage target detection method and system for smart construction sites, aiming to solve the problems in the existing technology of small and scattered smart construction sites with single cameras and large scenes, such as the small size of distant targets, the easy loss of information in traditional CNN feature extraction, and the difficulty of adapting a single detection strategy to multi-scale targets, which lead to serious missed detections and low detection accuracy.
[0006] In a first aspect, embodiments of this application provide a multi-stage target detection method for smart construction sites, comprising the following steps: Acquire a single frame monitoring image of the smart construction site at the current moment; The single-frame monitoring image is spatially divided to obtain non-overlapping front, middle and far regions. Differential image enhancement is performed on the front region, the middle region, and the far region; Based on a preset target detection model, feature extraction and target recognition are performed on the enhanced front region, the middle region and the far region of the image to obtain preliminary detection results; The preliminary detection results are mapped and restored to obtain the preliminary detection results with unified coordinates. The preliminary detection results after coordinate unification are spatially deduplicated and fused to obtain the final target detection results; Wherein, the front region is the central region of the image, the middle region is the remaining region in the lower half of the image after removing the portion overlapping with the front region, and the far region is the remaining region in the upper half of the image after removing the portion overlapping with the front region. The differential image enhancement for the front region, the middle region, and the far region includes: preserving the original resolution for the front region; performing super-resolution image enhancement at a first magnification for the middle region; and performing super-resolution image enhancement at a second magnification for the far region, wherein the second magnification is greater than the first magnification.
[0007] Preferably, the target detection model performs feature extraction and target recognition on the input image, specifically including: The backbone network with the DenseNet dense connection mechanism is used to extract features from the input image. By concatenating and reusing cross-layer features, a multi-layer initial feature map containing shallow detail information is generated. The multi-layer initial feature map is input into the Transformer module for global context modeling. The self-attention mechanism is used to calculate the long-distance dependency between different spatial locations and generate context-enhanced features. The attention mechanism module is used to adaptively weight the context enhancement features in the channel dimension and spatial dimension to enhance the feature representation of key small target regions and suppress background noise, thereby generating attention enhancement features. The attention enhancement features at different levels are upsampled and laterally connected and fused to generate multi-scale fusion feature layers that are adapted to the detection of large, medium and small targets respectively. The multi-scale fusion feature layer is input into the detection head to perform bounding box regression, category prediction, and confidence calculation.
[0008] Preferably, in the backbone network of the DenseNet dense connection mechanism, the first... Layer output features It is obtained by concatenating the output feature maps of all preceding layers and then performing a composite transformation.
[0009] Preferably, the step of mapping and restoring the preliminary detection results to coordinates specifically includes: Receive preliminary detection boxes from each region. Each detection box contains its coordinates in the local coordinate system, confidence level, category, and region information. For detection boxes from the middle and far regions, the local coordinates of the window are restored to the region coordinates in the enhanced image based on the offset of the sliding window in which they were generated. Based on the first magnification of the middle region and the second magnification of the far region, the scale inverse transformation is performed on the restored region coordinates, and the position offset of the region in the single frame monitoring image is superimposed, so that the coordinates of all detection boxes are uniformly mapped to the coordinate system of the single frame monitoring image.
[0010] Preferably, the step of performing spatial deduplication and fusion on all preliminary detection boxes after coordinate unification includes: For all detection boxes after coordinate unification, a preliminary screening is performed based on a preset confidence threshold, and detection boxes with confidence scores below the preset threshold, abnormal areas, or exceeding the legal range of the region are deleted. Deduplication within the execution area: For any two candidate boxes from the same area and of the same category, if their intersection-union ratio is greater than or equal to the preset internal deduplication threshold, they are determined to be duplicate targets and are merged. Perform cross-region deduplication: For any two candidate boxes from different regions and of the same category, if their intersection-union ratio is greater than or equal to the preset cross-region deduplication threshold, or if the distance between their center points is less than the preset distance threshold, they are determined to be duplicate detections of the same physical target and are merged. The internal deduplication threshold is greater than the cross-region deduplication threshold.
[0011] Preferably, when merging duplicate targets, the candidate box with the highest confidence is retained, or a weighted average of the coordinates and confidence of all duplicate candidate boxes is performed to generate a new candidate box.
[0012] Preferably, the sliding window has a size of 1280×1280 pixels; the first magnification is 1.5 times, and the second magnification is 4 times.
[0013] Preferably, the front area is defined using a fixed size or proportional method; The fixed size method is as follows: based on the center point of the image, a region of 1280×1280, 1024×1024 or 640×640 pixels is cropped out. The proportioning method is as follows: based on the center point of the image, crop out the central 1 / 2 region or the central 2 / 3 region.
[0014] Secondly, embodiments of this application provide a multi-stage target detection system for smart construction sites, including: The image acquisition module is used to acquire a single frame monitoring image of the smart construction site at the current moment; The image partitioning module is used to divide the single-frame monitoring image into spatial dimensions to obtain non-overlapping front, middle and far regions. A differential image enhancement module is used to perform differential image enhancement on the front region, the middle region, and the far region; The target detection module performs feature extraction and target recognition on the enhanced foreground, middle, and background regions of the image based on a preset target detection model to obtain preliminary detection results. The coordinate unification module is used to perform coordinate mapping and restoration on the preliminary detection results to obtain the preliminary detection results after coordinate unification. The spatial deduplication and result fusion module is used to perform spatial deduplication and fusion on the preliminary detection results after coordinate unification to obtain the final target detection result; Wherein, the front region is the central region of the image, the middle region is the remaining region in the lower half of the image after removing the portion overlapping with the front region, and the far region is the remaining region in the upper half of the image after removing the portion overlapping with the front region. The differential image enhancement for the front region, the middle region, and the far region includes: preserving the original resolution for the front region; performing super-resolution image enhancement at a first magnification for the middle region; and performing super-resolution image enhancement at a second magnification for the far region, wherein the second magnification is greater than the first magnification.
[0015] Preferably, the target detection model includes: The DenseNet backbone network is used to enable cross-layer feature reuse and prevent information loss of small targets in deep networks. The Transformer module, coupled to the output of the DenseNet backbone network, is used to perform global context modeling of multi-layer features. The attention mechanism module is used to adaptively weight the feature map in the spatial and channel dimensions to enhance the feature representation of key small target regions; A multi-scale feature fusion structure is used to fuse feature maps from different levels after attention mechanism processing, unifying the detection standards for large, medium, and small target scales. Compared with the prior art, the present invention has the following advantages: By dividing the monitoring image space into three segments—front, middle, and far—and implementing differentiated enhancement strategies, the far segment region is enhanced by 4 times super-resolution. This overcomes the inherent problem of low pixel ratio of distant targets in large scenes with a single camera, significantly improving the detection recall rate of small distant targets and significantly reducing the false negative rate. By introducing the DenseNet dense connection mechanism into the backbone network, direct cross-layer connection between shallow detail information and deep semantic information is realized, which effectively prevents the loss of small target information during continuous downsampling and enables the model to retain and utilize weak features such as edges and textures for accurate recognition. By designing a dual weighted mechanism of channel attention and spatial attention, the model can adaptively highlight key channels related to the color of the safety helmet and the outline of the human body, and locate and enhance the suspected target area in the far segment. At the same time, it effectively suppresses complex background noise such as steel bars and shadows, and significantly reduces the false detection rate in strong interference environments such as construction sites. By constructing multi-scale fusion feature layers P1, P2, and P3, high-resolution shallow features are dedicated to small target detection, while deep semantic features are dedicated to medium- and large target detection. This enables the same network to adapt to targets at different distances, resolving the contradiction that a single detection strategy cannot take into account multiple scale targets, and significantly improving the overall detection accuracy. By implementing a differentiated image enhancement strategy, the original resolution of the front section is preserved, the middle section is enhanced by 1.5 times, and only the far section is enhanced by 4 times. The computing resources are accurately allocated to the areas that are difficult to detect, avoiding the huge computational overhead caused by uniform high-magnification processing of the whole image. A balance is achieved between detection accuracy and processing speed, ensuring the real-time performance of the system. By introducing the Transformer global modeling module and using the self-attention mechanism to calculate the long-distance dependencies between distant pixels, the model can understand the spatial relationship between distant people and the surrounding environment, effectively making up for the shortcomings of traditional convolutional networks that only focus on local receptive fields, and enhancing the robustness to occlusion and complex pose targets. By designing a stepwise coordinate mapping and restoration mechanism based on sliding window offset, enhancement magnification and region offset, the detection results of each partition are uniformly mapped to the original image coordinate system. Differentiated deduplication thresholds within and across regions are set, and the center point distance is introduced as an auxiliary judgment condition. This effectively solves the fusion problem caused by inconsistent detection box size of the same target under different magnifications, and ensures the uniqueness and accuracy of the final detection results. The proposed multi-stage joint prevention and detection system can be regarded as a function parameterized by deep neural networks and image processing algorithms. It directly maps from a single frame monitoring image to a final target list under a unified coordinate system, without the need for additional deployment of multiple cameras or sensor hardware. This greatly reduces the system deployment cost and complexity, and provides a cost-effective full-scene safety monitoring solution for small and scattered smart construction sites. Attached Figure Description
[0016] Exemplary embodiments of the present invention can be more fully understood by referring to the accompanying drawings. The drawings are provided to further illustrate the embodiments of this application and form part of the specification. They are used together with the embodiments of this application to explain the present invention and do not constitute a limitation thereof. In the drawings, the same reference numerals generally represent the same components or steps.
[0017] Figure 1 A flowchart illustrating a multi-stage target detection method for a smart construction site, provided as an exemplary embodiment of this application; Figure 2 A flowchart illustrating the operation of a multi-stage target detection method for a smart construction site, provided as an exemplary embodiment of this application; Figure 3 A schematic diagram illustrating the division of a multi-stage region of an image provided in an exemplary embodiment of this application; Figure 4 A flowchart illustrating the processing of a target detection model provided in an exemplary embodiment of this application; Figure 5 A flowchart illustrating the processing of the DenseNet dense connection mechanism provided in an exemplary embodiment of this application; Figure 6 A flowchart of spatial deduplication and result fusion provided for an exemplary embodiment of this application; Figure 7 A schematic diagram of the structure of a multi-stage target detection system for a smart construction site is provided as an exemplary embodiment of this application; Figure 8 This is a block diagram illustrating the implementation of a multi-stage target detection system for a smart construction site, provided as an exemplary embodiment of this application. Detailed Implementation
[0018] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0019] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0020] Furthermore, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0021] Please refer to Figure 1 , Figure 1 This is a flowchart of a multi-stage target detection method for smart construction sites, as described in some embodiments of this application. The method includes the following steps: S110, acquires a single frame monitoring image of the smart construction site at the current moment; S120 divides a single frame of monitoring image into spatial dimensions to obtain non-overlapping front, middle and far regions. S130, perform differential image enhancement on the front, middle and far regions; S140, Based on the preset target detection model, feature extraction and target recognition are performed on the front, middle and far regions of the enhanced image to obtain preliminary detection results; S150, perform coordinate mapping and restoration on the preliminary detection results to obtain preliminary detection results with unified coordinates; S160, the preliminary detection results after coordinate unification are spatially deduplicated and fused to obtain the final target detection results; It should be noted that the method in this embodiment constitutes a multi-stage joint prevention and detection scheme. By dividing a single-frame monitoring image into three non-overlapping regions—front, middle, and far—in a spatial dimension, and employing differentiated enhancement and detection strategies for each region, it achieves full-scene target coverage detection under single-camera conditions. The entire processing flow can be viewed as a function parameterized by a deep neural network and image processing algorithms, directly mapping from a single-frame monitoring image to a final target list in a unified coordinate system, without the need to deploy multiple cameras or additional sensor hardware.
[0022] Reference Figure 2 The figure shows a flowchart of a multi-stage target detection method for smart construction sites according to an embodiment of this application. This embodiment will describe the overall framework in detail with reference to the detection method of the above embodiment.
[0023] Specifically, the single-frame monitoring image in step S110 can be obtained from the real-time video stream of a single camera deployed in the smart construction site. The system extracts image frames from the video stream at fixed time intervals as the single-frame monitoring image for the current moment; the fixed time interval can be 1 second or 2 seconds. The original resolution of the image is usually 2K (2560×1440 pixels) or higher, and the camera uses an overhead shooting method to cover the entire construction area, which includes targets such as personnel and equipment at different distances. After extracting the input original RGB image, all color channels retain their original colors for subsequent training and detection without grayscale processing; for non-RGB format images such as YUV, they are first converted to RGB format before being sent to the system for processing, making full use of the key role of the original image's color information in safety helmet color recognition, personnel clothing identification, etc.
[0024] Specifically, the spatial dimension division in step S120 is based on the perspective relationship of the camera shooting from above, dividing a single frame image into three non-overlapping regions. Figure 2 A schematic diagram of multi-stage image partitioning is given. The image coordinate system has its origin (0, 0) at the top left corner. The x-axis extends from left to right along the width direction, and the y-axis extends from top to bottom along the height direction. The image size is set to H×W (height×width). The specific partitioning methods include: The front area is defined as the central area of the image. It can be defined using a fixed size method or a proportional method. The fixed size method is to crop an area of 1280×1280, 1024×1024 or 640×640 pixels based on the center point of the image. The proportional method is to crop a central 1 / 2 area or a central 2 / 3 area based on the center point of the image. The middle region is defined as the remaining area in the lower half of the image after removing the part that overlaps with the front region. That is, the range of the middle region is the lower half of the image in the vertical direction y ∈ [H / 2, H] minus the part that overlaps with the front region. The far region is defined as the remaining area in the upper half of the image after removing the part that overlaps with the front region. That is, the range of the far region is the upper half of the vertical direction of the image, y ∈ [0, H / 2] minus the part that overlaps with the front region.
[0025] The above division method results in three mutually exclusive spatial regions with no overlap, collectively covering the entire image area. The core of this division strategy lies in utilizing the spatial distribution pattern in overhead shots: targets farther from the camera are positioned closer to the upper half of the image and have smaller image sizes, while targets closer to the camera are positioned closer to the image center and have larger image sizes. This physically segments targets at different distances into different processing channels, laying the foundation for subsequent differentiated processing.
[0026] Specifically, the differential image enhancement in step S130 is performed based on the characteristics of target imaging in different regions.
[0027] For the foreground region, the original resolution is retained without super-resolution enhancement. This is because the foreground region corresponds to close-range targets, and their imaging size in the image is relatively large. They can be effectively identified by the detection model at the original resolution. Retaining the original resolution can save computing resources. For the middle region, super-resolution image enhancement at the first magnification is performed, preferably 1.5 times. By appropriately increasing the pixel ratio of the target at a medium distance, its features are more easily captured by the detection network. For distant regions, a second-magnification super-resolution image enhancement is performed, which is greater than the first magnification, preferably 4 times. This high-magnification significantly enlarges tiny targets that originally occupied only tens or even a few pixels to a scale that can be effectively processed by the detection network. Super-resolution enhancement can be implemented using a deep learning-based super-resolution model or traditional interpolation methods such as bicubic interpolation. The first magnification can be adjusted between 1.2 and 2.0, and the second magnification can be adjusted between 3.0 and 6.0, depending on the target scale distribution, computing resources, and real-time requirements in the actual scene.
[0028] The differentiated image enhancement strategy in this embodiment differs from the existing approach of uniformly scaling the entire frame image to a fixed size. Instead, it constructs an enhancement system that adapts to the spatial location of the target, so that targets at different distances receive resolution compensation that matches their scale before being fed into the detection network.
[0029] Specifically, the target detection model in step S140 adopts an improved small target enhancement detection model based on RT-DETR. (Refer to...) Figure 4 The model performs feature extraction and target recognition on the input image, specifically including the following steps: (1) The backbone network with the DenseNet dense connection mechanism is used to extract features from the input image. Multi-layer initial feature maps containing shallow detail information are generated by cross-layer feature concatenation and reuse. Layer output features It is obtained by concatenating the output feature maps of all preceding layers and then performing a composite transformation, and it is expressed by the following formula: (1); in, Representing the The layer contains a composite transformation of batch normalization (BN), rectified linear activation function (ReLU), and 3×3 convolution operation. [ ] represents the splicing operation along the channel dimension. For network input layer, to Level 1 to Level 2 Output feature map of the layer.
[0030] The above concatenation operation links the feature maps of all preceding layers along the channel dimension, allowing the i-th layer to directly access the features generated by all previous layers. This enables the direct fusion of shallow texture, edge, and positional details with deep semantic information, greatly mitigating information attenuation in continuous downsampling of small objects. The processing flow of the DenseNet dense connection mechanism is as follows: Figure 5 As shown.
[0031] (2) Input the multi-layer initial feature map into the Transformer module to perform global context modeling. By constructing Query, Key, and Value and using the multi-head self-attention mechanism to calculate the long-distance dependency between different spatial locations, context enhancement features are generated to make up for the shortcomings of the convolutional network that only focuses on the local receptive field. This enables the model to use the spatial structural relationship between the distant worker and the background elements such as scaffolding and ground to assist in the discrimination of small targets. (3) The attention mechanism module is used to adaptively weight the context enhancement features in the channel dimension and spatial dimension to generate attention-enhanced features. Channel attention determines which convolutional kernel channels are more important and adaptively adjusts the weights of different channels to highlight key channels related to the color and contour features of the safety helmet, human body contour features, etc. Spatial attention determines which spatial locations are more important, locates and enhances the spatial region where the suspected target is located in the far part of the image, while suppressing complex background noise such as steel bars and shadows. (4) Attention enhancement features at different levels are fused through upsampling and lateral connections to generate multi-scale fusion feature layers P1, P2, and P3, which are adapted to the detection of large, medium, and small targets respectively. Among them, P1 is a high-resolution feature layer that retains rich details and is specifically used for small target detection; P3 is a deep semantic feature layer with strong semantic information and is specifically used for medium and large target detection; P2 is an intermediate layer feature map that takes into account the needs of both large and small target detection. This feature fusion structure enables the network to predict targets at different distances in the same image from the most suitable feature layer, avoiding small targets being wrongly identified on high-level feature maps with strong semantics but lost details.
[0032] (5) Input the multi-scale fusion feature layers P1, P2 and P3 into the detection head, perform target box regression, category prediction and confidence calculation, and directly generate the final target list in a unified coordinate system from the single frame monitoring image.
[0033] In step S140, the detection methods differ for different regions: For the foreground region, since the original resolution is preserved and the image size is moderate, it is directly fed into the detection model as a whole; For the middle and far regions, since the image size increases significantly after super-resolution enhancement (e.g., a 2K original image can reach 8K level after 4x super-resolution), directly feeding the entire image into the network would result in excessive computation. Therefore, a sliding window method is used for local detection. The sliding window size is preferably 1280×1280 pixels, and the step size is set to an appropriate proportion of the window size. The enhanced region image is scanned block by block, and the detection model is called for each block. At the same time, for the enhanced image of the far region, the enhanced outer region is cropped, and only the detection box in the effective region corresponding to the actual space of the far region is retained to eliminate boundary artifacts and background noise caused by large magnification.
[0034] Specifically, the coordinate mapping and restoration in step S150 is used to uniformly map detection boxes from different regions and coordinate systems to the coordinate system of the original single-frame monitoring image.
[0035] For each detection box, the information it carries includes its coordinates in the local coordinate system. Confidence level ,category Information on the region and scaling factor The S150 processing procedure includes: For detection boxes from the middle and far regions, the offset of the top-left corner of the sliding window in the enhancement map at the time of their generation is used as the basis for the detection. This restores the local coordinates of the window to the region coordinates in the enhanced image. ; Based on the first scaling factor of the middle region (which can be 1.5 times in a preferred embodiment) and the second scaling factor of the far region (which can be 4 times in a preferred embodiment), an inverse scaling transformation is performed on the restored region coordinates, i.e. , This is then superimposed with the positional offset of the region within a single frame of the surveillance image. Obtain the coordinates of the original image. , ; For the detection boxes in the foreground region, since no super-resolution enhancement or sliding window processing is performed, it is only necessary to overlay the offset of the center cropped region in the original image. After the above three-level transformation: local coordinates of the window → coordinates of the enhanced image region → coordinates of the original image, the coordinates of all detection boxes are unified to the same image coordinate system.
[0036] Specifically, the spatial deduplication and fusion in step S160 is used to eliminate duplicate detection of the same physical target that may occur due to independent detection by the three channels (front, middle, and far), thus achieving a true multi-stage joint defense effect. (Refer to...) Figure 6 This step specifically includes: (1) For all detection boxes after coordinate unification, perform preliminary screening based on the preset confidence threshold, delete detection boxes with confidence lower than the preset threshold, abnormal area (such as boxes that are too small or too large) and boxes that exceed the legal range of this region, and exclude obviously unreliable candidate results. (2) Perform deduplication within the region: For any two candidate boxes from the same region and of the same category and If its Greater than or equal to the preset internal deduplication threshold If a target is identified as a duplicate, it will be merged, with an internal deduplication threshold. The preferred value is 0.5; (3) Perform cross-region deduplication: For any two candidate boxes from different regions but of the same category and If their intersection and comparison Greater than or equal to the preset cross-region deduplication threshold or center point distance Less than the preset distance threshold If the detection is repeated, it is considered a duplicate detection of the same physical target and the results are merged; cross-region deduplication threshold. Preferably, it is between 0.3 and 0.5, and it needs to strictly meet the following conditions: < .
[0037] The reason why the criteria for cross-region deduplication is more lenient than those for intra-region deduplication is that the same physical target may be detected by two channels at different enhancement ratios in the mid-section and far-section boundary area. The size of the detection frame has a systematic deviation due to the difference in enhancement ratio, resulting in a naturally lower intersection-union ratio. If the strict IoU criterion for intra-region deduplication is still used, it is very easy to misidentify the same target that should be merged as two independent targets. Therefore, the center point distance is introduced. As an auxiliary judgment condition, when the distance between the center points of the two boxes is less than a preset threshold At that time, even if the IoU is slightly lower This can also be considered a duplicate target. This design is more robust to the problem of inconsistent frame dimensions caused by magnification differences at the boundary of areas.
[0038] Specifically, there are two options when merging duplicate targets: Retain the candidate box with the highest confidence score, or generate a new candidate box by weighting the coordinates and confidence scores of all duplicate candidate boxes. The weighting formula is as follows: (2); in, Represents the coordinate vector of the k-th candidate box , Let be the confidence score of the k-th candidate box, and Σ represent the summation over all duplicate candidate boxes. This weighted averaging method integrates information from multiple detection results into the final output box position, making it more robust than simply selecting the highest-confidence box.
[0039] This embodiment employs a two-stage deduplication strategy: strict deduplication within a single region and relaxed matching across regions. Specifically, internal deduplication addresses duplicate detections that may occur due to overlapping sliding windows within the same channel, while cross-regional deduplication resolves redundancy in the collaborative detection of targets at boundaries or overlapping areas across different channels. The combination of these two approaches ensures that the final result is a set of non-duplicate targets across the entire map. The cross-regional spatial deduplication and fusion process is as follows: Figure 8 As shown.
[0040] Based on the steps S110 to S160 above, this application simulated a small construction site scenario test. Table 1 shows a performance comparison between the method of this embodiment and existing methods in the detection of small targets at a distance. Compared with YOLOv8 (640 inputs) and RT-DETR (640 inputs), the method of this invention improves the recall rate of small targets from 52.3% and 60.8% to 82.7%, and the mAP from 58.6% and 64.2% to 79.4%, significantly reducing the number of missed detections at a distance, while the overall processing speed meets the requirements of real-time monitoring. Table 1 shows a performance comparison between the method of this embodiment and existing methods in the detection of small targets at a distance.
[0041]
[0042] This embodiment achieves multi-stage collaborative detection of targets across the entire smart construction site scenario under single-camera conditions. Targets at different distances are separated into different processing stages through spatial partitioning. Differentiated super-resolution enhancement for mid-range and far-range targets provides the detection network with appropriately scaled input. An improved detection model integrating DenseNet dense connections, Transformer global modeling, attention mechanisms, and multi-scale feature fusion enhances the feature extraction capability for small targets. Coordinate mapping unifies the multi-stage detection results to the same coordinate system, and two-level deduplication eliminates duplicate detections. A collaborative relationship is formed between the stages to jointly ensure complete coverage and accurate identification of targets across the entire image. This embodiment, by combining underlying algorithm reconstruction with top-level multi-stage partitioning processing, achieves key breakthroughs in small target detection bottlenecks, refined distance adaptation, and single-camera full-scene coverage. Reference Figure 7-8 , Figure 7 This is a schematic diagram of the structure of a multi-stage target detection system for a smart construction site, as described in some embodiments of this application. Figure 8This is a modular flowchart of a multi-stage target detection system for a smart construction site, as described in some embodiments of this application. This embodiment further illustrates the method in Embodiment 1 by detailing the module flow. The entire system 20 can be considered as a function parameterized by a deep neural network and image processing algorithms, directly mapping from a single frame of monitoring image to a final target list in a unified coordinate system. Internally, it consists of multiple cascaded functional modules, including an image acquisition module, an image partitioning module, a differential image enhancement module, a target detection module, a coordinate unification module, and a spatial deduplication and result fusion module. The following provides a detailed description of each module.
[0043] The image acquisition module 210 is used to acquire a single-frame monitoring image of the smart construction site at the current moment. After extracting the original RGB image, all channels retain their original colors for subsequent processing without grayscale conversion. For non-RGB format images such as YUV, they are first converted to RGB format before being sent to subsequent modules for processing. Its specific working method corresponds to step S110 in Embodiment 1.
[0044] Image partitioning module 220 is used to spatially partition a single frame of surveillance image to obtain non-overlapping front, middle, and far regions. Its specific partitioning rules correspond to step S120 in Embodiment 1, including the spatial definition, partitioning basis, and other details of the three regions. Figure 3 The correspondence has been explained in detail in Example 1.
[0045] The differential image enhancement module 230 is used to implement different enhancement strategies for the front region, middle region and far region. That is, the original resolution is preserved for the front region, about 1.5 times super-resolution is applied to the middle region and about 4 times super-resolution is applied to the far region. Its specific processing method corresponds to step S130 in Embodiment 1.
[0046] The target detection module 240 incorporates the improved target detection model described in step S140 of Embodiment 1. The structural feature of this model is that its DenseNet backbone network... Layer output features The feature maps are concatenated from the output feature maps of all preceding layers and then transformed by a composite transformation, which includes batch normalization (BN), ReLU activation, and 3×3 convolution, following formula (1). Its Transformer module performs global context modeling on multi-layer features by constructing Query, Key, and Value and using multi-head self-attention to calculate global positional dependencies. Its attention mechanism module performs adaptive weighting of features based on channel and spatial dimensions. Channel attention assigns different weights according to the importance of the convolution kernel channels, while spatial attention locates and enhances the image region where key small targets are located. Its multi-scale feature fusion structure generates P1, P2, and P3 feature layers to unify the detection standards for large, medium, and small targets. P1 is a high-resolution feature layer for small target detection, P3 is a deep semantic feature layer for medium and large target detection, and P2 is an intermediate layer that takes into account both large and small targets. This module performs direct overall detection on the front end, and uses a 1280×1280 sliding window to detect the middle and far ends block by block. The outer region of the enhanced image in the far end is cropped to eliminate boundary artifacts and background noise.
[0047] The coordinate unification module 250 is used to map and restore the coordinates of the preliminary detection results. Through a three-level transformation process of window coordinate restoration, scale inverse transformation and region offset superposition, all detection boxes are mapped to the original image coordinate system. Its specific process corresponds to step S150 in Example 1.
[0048] The spatial deduplication and result fusion module 260 performs deduplication by confidence level filtering and IoU deduplication within the region (in the preferred embodiment, the internal deduplication threshold). (0.5) and cross-region IoU / center point joint deduplication (in the preferred embodiment, the cross-region deduplication threshold is 0.5) A two-level deduplication strategy (between 0.3 and 0.5) is used to merge duplicate boxes according to the weighted formula (2) and output the final target list. The specific rules correspond to step S160 in Example 1.
[0049] The system described in this application can be deployed on edge computing devices or cloud servers at small-scale construction sites. Only one surveillance camera needs to be installed at the construction site; the real-time video stream it captures is transmitted via network to the computing device where the system is deployed. The processor in the computing device runs the aforementioned computer program, analyzes the video frame by frame, and outputs alarm information to the management personnel's terminal application in real time.
[0050] When faced with various challenges on the construction site, the system demonstrated its specific problem-solving mechanisms and effectiveness: To address the issue of missed detection of small targets in the distance, the system enhances the recall rate of small targets in the distance to over 82% through the synergistic effect of 4x super-resolution enhancement, DenseNet, and attention mechanisms. To address the issue of limited computing resources, the system employs a partitioning differentiation strategy. It directly detects large target areas in the front end to save resources, while concentrating computing resources on super-resolution and sliding window detection in the mid-to-far range. This approach effectively controls the overall computing load while improving detection accuracy. Regarding scene adaptability, due to the flexibility of region division (supporting fixed size and scale methods) and the global modeling capability of the model, the system can adapt to camera deployments with different tilt angles and viewing angles.
[0051] Please refer to schematic diagrams of conventional electronic devices in this field. Some embodiments of this application also provide an electronic device. The electronic device includes: a processor, a memory, a bus, and a communication interface, wherein the processor, communication interface, and memory are connected via the bus; the memory stores a computer program that can run on the processor, and when the processor runs the computer program, it executes the methods described above in this application. This electronic device can be any device with image processing requirements, such as an edge computing box, an industrial control computer, or a server.
[0052] The memory may include high-speed random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc.
[0053] The bus can be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. The memory is used to store the program, and the processor executes the program after receiving the execution instruction.
[0054] The processor may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed through integrated logic circuits in the processor's hardware or through software instructions. The processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application.
[0055] The electronic devices and methods provided in the embodiments of this application are based on the same inventive concept and have the same beneficial effects as the methods they employ, operate, or implement.
[0056] This application also provides a computer-readable storage medium corresponding to the method provided in the foregoing embodiments, wherein a computer program (i.e., a program product) is stored thereon, and the computer program executes the foregoing method when it is run by a processor.
[0057] The computer-readable storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks. In a specific application scenario, the computer-readable storage medium can be built into an edge computing device as part of the firmware; or it can be installed on the target device as a standalone software product through downloading or physical distribution, enabling existing hardware devices with only basic video capture capabilities to obtain the multi-stage target detection method and system for smart construction sites described in this invention after loading and executing the computer program on the storage medium.
[0058] The computer-readable storage medium provided in the above embodiments of this application and the method provided in the embodiments of this application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented by the applications stored therein.
[0059] It should be noted that the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0060] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0061] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and there may be other division methods in actual implementation. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the coupling or direct coupling or communication connection shown or discussed may be through some communication interface; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0062] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0063] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0064] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application, and they should all be covered within the scope of the claims and specification of this application.
Claims
1. A multi-stage target detection method for smart construction sites, characterized in that, Includes the following steps: Acquire a single frame monitoring image of the smart construction site at the current moment; The single-frame monitoring image is spatially divided to obtain non-overlapping front, middle and far regions. Differential image enhancement is performed on the front region, the middle region, and the far region; Based on a preset target detection model, feature extraction and target recognition are performed on the enhanced front region, the middle region and the far region of the image to obtain preliminary detection results; The preliminary detection results are mapped and restored to obtain the preliminary detection results with unified coordinates. The preliminary detection results after coordinate unification are spatially deduplicated and fused to obtain the final target detection results; Wherein, the front region is the central region of the image, the middle region is the remaining region in the lower half of the image after removing the portion overlapping with the front region, and the far region is the remaining region in the upper half of the image after removing the portion overlapping with the front region. The differential image enhancement for the front region, the middle region, and the far region includes: preserving the original resolution for the front region; performing super-resolution image enhancement at a first magnification for the middle region; and performing super-resolution image enhancement at a second magnification for the far region, wherein the second magnification is greater than the first magnification.
2. The method according to claim 1, characterized in that, The target detection model performs feature extraction and target recognition on the input image, specifically including: The backbone network with the DenseNet dense connection mechanism is used to extract features from the input image. By concatenating and reusing cross-layer features, a multi-layer initial feature map containing shallow detail information is generated. The multi-layer initial feature map is input into the Transformer module for global context modeling. The self-attention mechanism is used to calculate the long-distance dependency between different spatial locations and generate context-enhanced features. The attention mechanism module is used to adaptively weight the context enhancement features in the channel dimension and spatial dimension to enhance the feature representation of key small target regions and suppress background noise, thereby generating attention enhancement features. The attention enhancement features at different levels are upsampled and laterally connected and fused to generate multi-scale fusion feature layers that are adapted to the detection of large, medium and small targets respectively. The multi-scale fusion feature layer is input into the detection head to perform bounding box regression, category prediction, and confidence calculation.
3. The method according to claim 2, characterized in that, In the backbone network of the DenseNet dense connection mechanism, the first... Layer output features It is obtained by concatenating the output feature maps of all preceding layers and then performing a composite transformation.
4. The method according to claim 1, characterized in that, The step of mapping and restoring the preliminary detection results to coordinates specifically includes: Receive preliminary detection boxes from each region. Each detection box contains its coordinates in the local coordinate system, confidence level, category, and region information. For detection boxes from the middle and far regions, the local coordinates of the window are restored to the region coordinates in the enhanced image based on the offset of the sliding window in which they were generated. Based on the first magnification of the middle region and the second magnification of the far region, the scale inverse transformation is performed on the restored region coordinates, and the position offset of the region in the single frame monitoring image is superimposed, so that the coordinates of all detection boxes are uniformly mapped to the coordinate system of the single frame monitoring image.
5. The method according to claim 4, characterized in that, The step of performing spatial deduplication and fusion on all preliminary detection boxes after coordinate unification includes: For all detection boxes after coordinate unification, a preliminary screening is performed based on a preset confidence threshold, and detection boxes with confidence scores below the preset threshold, abnormal areas, or exceeding the legal range of the region are deleted. Deduplication within the execution area: For any two candidate boxes from the same area and of the same category, if their intersection-union ratio is greater than or equal to the preset internal deduplication threshold, they are determined to be duplicate targets and are merged. Perform cross-region deduplication: For any two candidate boxes from different regions and of the same category, if their intersection-union ratio is greater than or equal to the preset cross-region deduplication threshold, or if the distance between their center points is less than the preset distance threshold, they are determined to be duplicate detections of the same physical target and are merged. The internal deduplication threshold is greater than the cross-region deduplication threshold.
6. The method according to claim 5, characterized in that, When merging duplicate targets, the candidate box with the highest confidence is retained, or a weighted average of the coordinates and confidence of all duplicate candidate boxes is performed to generate a new candidate box.
7. The method according to claim 4, characterized in that, The sliding window has a size of 1280×1280 pixels; the first magnification is 1.5 times, and the second magnification is 4 times.
8. The method according to claim 1, characterized in that, The front area is defined using a fixed size or proportional method; The fixed size method is as follows: based on the center point of the image, a region of 1280×1280, 1024×1024 or 640×640 pixels is cropped out. The proportioning method is as follows: based on the center point of the image, crop out the central 1 / 2 region or the central 2 / 3 region.
9. A multi-stage target detection system for smart construction sites, characterized in that, include: The image acquisition module is used to acquire a single frame monitoring image of the smart construction site at the current moment; The image partitioning module is used to divide the single-frame monitoring image into spatial dimensions to obtain non-overlapping front, middle and far regions. A differential image enhancement module is used to perform differential image enhancement on the front region, the middle region, and the far region; The target detection module performs feature extraction and target recognition on the enhanced foreground, middle, and background regions of the image based on a preset target detection model to obtain preliminary detection results. The coordinate unification module is used to perform coordinate mapping and restoration on the preliminary detection results to obtain the preliminary detection results after coordinate unification. The spatial deduplication and result fusion module is used to perform spatial deduplication and fusion on the preliminary detection results after coordinate unification to obtain the final target detection result; Wherein, the front region is the central region of the image, the middle region is the remaining region in the lower half of the image after removing the portion overlapping with the front region, and the far region is the remaining region in the upper half of the image after removing the portion overlapping with the front region. The differential image enhancement for the front region, the middle region, and the far region includes: preserving the original resolution for the front region; performing super-resolution image enhancement at a first magnification for the middle region; and performing super-resolution image enhancement at a second magnification for the far region, wherein the second magnification is greater than the first magnification.
10. The system according to claim 9, characterized in that, The target detection model includes: The DenseNet backbone network is used to enable cross-layer feature reuse and prevent information loss of small targets in deep networks. The Transformer module, coupled to the output of the DenseNet backbone network, is used to perform global context modeling of multi-layer features. The attention mechanism module is used to adaptively weight the feature map in the spatial and channel dimensions to enhance the feature representation of key small target regions; The multi-scale feature fusion structure is used to fuse feature maps from different levels after they have been processed by the attention mechanism, so as to unify the detection standards for large, medium and small target scales.
