A method and system for measuring the residual length of tunnel blast holes based on key point detection

By using a lightweight neural network model for key point detection, the starting and ending coordinates of tunnel blast holes are directly regressed, solving the accuracy and efficiency problems of measuring the residual length of blast holes in tunnel construction and realizing high-precision, automated tunnel construction quality inspection.

CN121685613BActive Publication Date: 2026-04-21CHANGAN UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHANGAN UNIV
Filing Date
2026-02-10
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

In tunnel construction, existing technologies that rely on manual visual inspection combined with measuring tape to measure the residual length of tunnel blast holes suffer from problems such as missing directional information, distorted length measurements, difficulty in distinguishing overlapping blast holes, and inability to accurately locate the endpoints of blast holes. This results in low measurement efficiency and inconsistent results, making it difficult to meet the needs for real-time detection and feedback.

Method used

A key point detection-based method is adopted, which directly regresses the starting and ending coordinates of the residual blast hole through a lightweight neural network model. Combined with image correction and lightweight model inference, the method realizes automated measurement of the residual blast hole length. The actual line segment is selected by the line segment NMS algorithm and a quantitative report is generated.

Benefits of technology

It achieves centimeter-level high-precision (≤±5cm) measurement of blast hole residual length, maintains a high recall rate (≥90%) and a low false detection rate (<5%), improves measurement efficiency by nearly 10 times, generates objective and comparable digital inspection reports, and supports smart construction site management systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121685613B_ABST
    Figure CN121685613B_ABST
Patent Text Reader

Abstract

This invention relates to the field of tunnel engineering construction quality inspection and image recognition technology, specifically a method and system for measuring the residual length of tunnel blast holes based on key point detection. The method includes: first, inputting the acquired and corrected tunnel face image into a trained lightweight neural network model, outputting multiple sets of two key points and key point information for each residual blast hole. The two key points are the borehole opening end and the visible end end of the residual blast hole, and the key point information includes the x-coordinate, y-coordinate, and visibility confidence score of the key point; then, eliminating duplicate predictions of multiple predicted line segments through line segment decoding and the line segment NMS algorithm; finally, converting the pixel length into the actual physical length based on the scale conversion coefficient. This method adopts a key point detection paradigm, directly regressing the starting and ending coordinates of the residual blast hole to accurately calculate the residual length of the blast hole, solving the problems of low efficiency and strong subjectivity in manual measurement, and achieving automatic identification and measurement with centimeter-level accuracy in complex tunnel environments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of tunnel engineering construction quality inspection and image recognition technology, specifically to a method and system for measuring the residual length of tunnel blast holes based on key point detection. Background Technology

[0002] In tunnel boring and blasting (TBB) construction, the residual length of the blast holes around the working face after blasting is a key quantitative indicator for evaluating the effect of smooth blasting, controlling over-excavation and under-excavation, and assessing the stability of the surrounding rock. Currently, the traditional method of manual visual inspection combined with tape measure measurement is commonly used on construction sites. This method has the following inherent defects: 1. Lack of residual blast hole orientation information, resulting in distorted length measurement; 2. Difficulty in distinguishing overlapping blast holes, which are easily mistakenly merged; 3. Inability to accurately locate the endpoints of blast holes; 4. Geometric inconsistencies after orthogonal correction.

[0003] This traditional method results in extremely low measurement efficiency: a single comprehensive measurement takes as long as 30-60 minutes, which seriously restricts the progress of the construction cycle; at the same time, it leads to strong subjectivity and poor consistency: different testing personnel have different experience and judgment standards, resulting in large fluctuations in measurement results and a lack of comparability and credibility.

[0004] With the development of computer vision technology, some blast hole recognition schemes based on target detection have emerged. For example, an existing patent application (CN120219910 A) discloses a blast hole recognition method based on an improved YOLOv8 model, which improves the accuracy of blast hole localization by introducing deformable convolution and distance-constrained NMS. However, such methods can only locate and count blast holes, and cannot directly obtain the physical length of blast hole residue, which is the core of evaluating blasting quality. In addition, most existing models are not specifically optimized for extreme interferences such as dust, reflection, water seepage, and complex textures in tunnels, and their real-time inference performance on mobile devices is insufficient, making it difficult to meet the needs of "instant detection and instant feedback" on site. Therefore, there is an urgent need for a new solution that can automatically, accurately, and quickly measure and count the length of blast hole residue in complex field environments. Summary of the Invention

[0005] To overcome the shortcomings of the prior art, the present invention aims to provide a method and system for measuring the residual length of tunnel blast holes based on key point detection. This method abandons the traditional rectangular box detection approach and innovatively adopts a key point detection paradigm to directly regress the starting and ending coordinates of each residual blast hole, thereby naturally and accurately calculating the residual length of the blast hole. The system integrates the entire process of image correction, lightweight model inference, result post-processing, data matching, and report generation, realizing integrated and automated processing from image input to quantitative report output.

[0006] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0007] Firstly, a method for measuring the residual length of tunnel blast holes based on key point detection includes the following steps:

[0008] S1. Acquire images of the tunnel face including blast hole residue and calibration plate, and obtain scale conversion coefficients after orthorectifying the tunnel face images;

[0009] S2. Input the orthorectified face image described in step S1 into the trained lightweight neural network model. The trained lightweight neural network model processes and outputs multiple sets of two key points and key point information for each residual blast hole. Each set of two key points is the opening end and the visible end of the residual blast hole. The key point information includes the x coordinate, y coordinate and visibility confidence of the key point.

[0010] S3. Connect the multiple sets of two key points of each residual blast hole described in step S2 to form multiple predicted line segments. Use the line segment NMS algorithm to perform non-maximum suppression on the multiple predicted line segments. Select the actual line segment of each residual blast hole from the multiple predicted line segments. The line segment NMS algorithm includes a dual judgment criterion based on the line segment IoU and the minimum distance d_min between the endpoints.

[0011] S4. Based on the scale conversion factor described in step S1, convert the pixel length of the actual line segment described in step S3 into the physical length l of the residual borehole. The formula for calculating the physical length l is as follows:

[0012] l=||p_tip-p_end||×mm_per_pixel

[0013] Where ||p_tip-p_end|| represents the pixel length of the actual line segment, and mm_per_pixel represents the scale conversion factor.

[0014] Furthermore, the orthorectification described in step S1 is achieved by identifying ArUco / CharUco markings or a physical scale of known size in the face image, calculating the homography matrix, and performing perspective transformation on the face image.

[0015] Furthermore, the backbone network of the lightweight neural network model described in step S2 is composed of GhostConv, DepwiseConv, or RepConv modules, the neck network uses lightweight PAN-Lite or BiFPN-Lite for multi-scale feature fusion, the detection head uses keypoint direct regression, and the trained lightweight neural network model outputs the object confidence, category confidence, and multiple sets of two key points and keypoint information for each residual blast hole.

[0016] Furthermore, the loss function of the lightweight neural network model described in step S2 is the total loss, and the formula for calculating the total loss is as follows:

[0017] L=Ldet+λ·Lkpt

[0018] Ldet = L_box + L_obj + L_cls

[0019] Lkpt=Σ_iw_i·Huber(Δx_i, Δy_i)+μ·(1-OKS_i)

[0020] Where L represents the total loss, Ldet represents the object detection loss, L_box represents the bounding box position error, L_obj represents whether an object is present, L_cls represents the class loss, Lkpt represents the keypoint loss, Lkpt is a weighted sum of Huber loss and a penalty term based on keypoint similarity OKS, and λ represents the distillation weight. Let i represent the i-th keypoint, (Δx_i, Δy_i) represent the deviation between the predicted coordinates and the true coordinates of the i-th keypoint, w_i represent the weight of the i-th keypoint, Huber(Δx_i, Δy_i) represents a regression loss that is milder than L2 and more stable than L1, and OKS_i represent the OKS similarity of the i-th keypoint. [0, 1], μ is used to control the weight of OKS in the total loss.

[0021] Furthermore, the non-maximum suppression condition in step S3 is as follows: for any two predicted line segments among the multiple predicted line segments, if the line segment IoU of any two predicted line segments is greater than γ or the minimum distance d_min between the endpoints is less than δ, then the line segment with lower confidence among the two predicted line segments is suppressed, where γ ∈ [0.1, 0.5] and δ ∈ [3, 10].

[0022] Furthermore, the lightweight neural network model trained in step S2 is obtained through the following steps: a lightweight neural network model is trained using a training distillation strategy, the lightweight neural network model trained using the training distillation strategy is subjected to quantization-perception training or post-training quantization to obtain a quantized lightweight neural network model, the weights of the quantized lightweight neural network model are converted to INT8 / INT4 precision, and further compressed using structured pruning to obtain a trained lightweight neural network model. The structured pruning involves: (1) channels of the output feature map of the convolutional layer, (2) the entire building block or layer in the backbone or neck of the network, (3) optional or auxiliary attention modules, and (4) individual weights inside the fully connected layer or convolutional kernel.

[0023] Furthermore, the face image described in step S1 is generated by image stitching technology based on ORB feature point matching and RANSAC algorithm from multiple images with overlapping regions.

[0024] Furthermore, the measurement method also includes step S5: matching the physical length l of the residual blast hole described in step S4 and the x and y coordinates of the two key points described in step S2 with the preset blast hole information, calculating the blast hole residual rate of a single hole, a single ring, and the entire working face, and generating a quantitative statistical report.

[0025] Secondly, a system for measuring the residual length of tunnel blast holes based on key point detection includes:

[0026] Image acquisition and preprocessing module: Acquires images of the tunnel face including blast hole residue and calibration plate, and obtains scale conversion coefficients after orthorectifying the tunnel face images;

[0027] Intelligent recognition and measurement module: integrates the trained lightweight neural network model to complete the detection of two key points, actual line segment generation and physical length conversion for each residual blast hole;

[0028] Interactive correction module: Provides a graphical interface for users to verify and manually correct the identification results of each residual blast hole;

[0029] Data management and report generation module: used to store detection data, match design information, and automatically generate statistical reports containing the physical length, location, and residual rate of each residual borehole.

[0030] Thirdly, a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the measurement method; the computer-readable storage medium includes various media capable of storing program code, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a portable hard disk, a magnetic disk, or an optical disk.

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

[0032] 1. In the method of the present invention, multiple sets of two key points and key point information of residual blast holes are output in step S2, and the actual line segments of residual blast holes are obtained by filtering multiple predicted line segments using the line segment NMS algorithm in step S3. In principle, the secondary calculation error from the border to the length is avoided, and high-precision measurement at the centimeter level (≤±5cm) is achieved, while maintaining a high recall rate (≥90%) and a low false detection rate (<5%).

[0033] 2. In the method of the present invention, the lightweight neural network model used in step S2 is trained with a wide range of negative samples such as dust, reflection, water seepage, and crack interference. Combined with a robust keypoint loss function, it can still work stably in the extremely complex environment of the tunnel, thus solving the problem of poor adaptability of traditional vision methods.

[0034] 3. The method of the present invention can achieve a leap in the efficiency of residual blast hole length measurement, reducing the measurement time of a single working face from 30-60 minutes by manual labor to 3-6 minutes, improving efficiency by nearly 10 times, and greatly accelerating the construction cycle.

[0035] 4. In the method of the present invention, the whole process is digitized and traceable through step S5: electronic reports and digital archives in a unified format are automatically generated, making the test results objective, comparable and traceable, and seamlessly connected to the smart construction site management system, which helps the digital transformation of tunnel construction quality management.

[0036] In summary, this method adopts a key point detection paradigm to directly regress the starting and ending coordinates of each residual blast hole, thereby naturally and accurately calculating the residual length of the blast hole. The system integrates the entire process of image correction, lightweight model inference, result post-processing, data matching and report generation, realizing integrated and automated processing from image input to quantitative report output. Attached Figure Description

[0037] Figure 1 This is an overall flowchart of the method of the present invention.

[0038] Figure 2 This is a schematic diagram of the key point detection network structure in the lightweight neural network model of this invention.

[0039] Figure 3 This is a schematic diagram illustrating the principle of the NMS algorithm for line segments.

[0040] Figure 4 This is a schematic diagram of image orthorectification and scale conversion based on ArUco calibration. Detailed Implementation

[0041] The following is in conjunction with the appendix Figure 1 To be continued Figure 4 The present invention will be further described in detail below:

[0042] Firstly, such as Figure 1The diagram shows the overall flowchart of this method, which provides a method for measuring the residual length of tunnel blast holes based on key point detection. The method includes the following steps: S1. Image acquisition and correction: The tunnel face image is acquired using a mobile device camera and orthorectified. To eliminate perspective distortion and establish a mapping relationship between pixels and actual size, ArUco / CharUco calibration boards or physical rulers with known spacing are placed in the shooting scene. The ArUco / CharUco calibration board is an efficient tool for camera calibration, pose estimation, and augmented reality. The physical ruler can be a scale bar with precise graduations that is pre-placed in the image. The calibration object is identified by computer vision algorithms, the homography matrix is ​​calculated, the acquired tunnel face image is orthorectified, and the scale conversion factor of "millimeters per pixel" is obtained.

[0043] S2. Two key point detections: such as Figure 2 The diagram shows a key point detection network structure. The orthorectified face image described in step S1 is input into a pre-trained lightweight neural network model. After processing the orthorectified face image, the model outputs multiple sets of two key points and key point information for each residual borehole instance. The two key points are the borehole tip (x_tip, y_tip) and the visible end (x_end, y_end) of the residual borehole. The key point information includes the x-coordinate, y-coordinate, and visibility confidence of the key point.

[0044] Furthermore, the lightweight neural network model employs a highly optimized lightweight architecture:

[0045] The backbone network consists of stacked high-efficiency convolutional modules such as GhostConv, DepwiseConv, or RepConv. The GhostConv module generates seemingly more feature maps with less computation. As a building block of the backbone network, it significantly reduces the computational complexity and storage footprint of the model, making it one of the preferred modules for achieving lightweight models. The DepwiseConv module decomposes the filtering and combination functions of standard convolution into two steps, which are performed separately. Traditional convolution completes "spatial filtering + channel combination" in one step, while depthwise separable convolution decouples them. Mathematically, it has been proven that it can achieve a significant reduction in computational cost with extremely low accuracy loss. The RepConv module is a reparameterizable convolutional module. Its core idea is to use a multi-branch structure to improve performance during training and to fuse multiple branches into a single branch during inference through structural reparameterization technology, thereby achieving extremely fast inference speed while maintaining high accuracy.

[0046] Neck network: PAN-Lite or BiFPN-Lite lightweight feature pyramids are used to achieve multi-scale feature fusion, enhancing the detection capability of traces of different sizes of boreholes. PAN-Lite or BiFPN-Lite achieves effective fusion of cross-scale features with minimal computational overhead, enabling simultaneous detection of objects of different sizes.

[0047] Detection head: Employs direct regression of key points.

[0048] For each instance of residual borehole prediction, the trained lightweight neural network model outputs an object confidence score, a class confidence score, and multiple sets of two key points and key point information. The two key points correspond to the borehole opening end and the visible end of the residual borehole, respectively. The key point information includes its x-coordinate, y-coordinate, and visibility confidence score.

[0049] Furthermore, the backbone network embeds the ECA-Lite lightweight attention mechanism, which greatly reduces the computational load while ensuring feature extraction capabilities.

[0050] S3. Line Segment Generation and Post-processing:

[0051] Line segment generation: Connect the multiple sets of two key points (the software automatically selects two key points) mentioned in step S2 to form multiple predicted line segments. Each predicted line segment is represented as s=(p_tip, p_end). The overall confidence of each predicted line segment is determined by the average of the object confidence, the category confidence, and the visibility confidence of the two key points: the overall confidence is obj×cls×mean(kpt_conf), where obj, cls, and mean represent the object confidence, the category confidence, and the average confidence of the key points, respectively.

[0052] Furthermore, to address the problem of overlapping predictions of multiple predicted line segments, the proposed line segment non-maximum suppression (NMS) algorithm includes a dual judgment criterion based on the line segment IoU and the minimum distance d_min between the endpoints. The line segment IoU represents the proportion of the length of the overlapping part of two line segments to their overall coverage length. Specifically, the line segment NMS algorithm works as follows: if the line segment IoU between any two predicted line segments is greater than the threshold γ, where γ ∈ [0.1, 0.5] pixels, or the minimum distance d_min between the endpoints of any two predicted line segments is less than the threshold δ, where δ ∈ [3, 10] pixels, then these two line segments are considered to represent the same predicted target, i.e., the actual residual blast hole. The line segment with the highest overall confidence among these two predicted line segments is retained, and the others are suppressed. The NMS algorithm processing of multiple predicted line segments is completed for each residual blast hole instance to obtain the actual line segment.

[0053] like Figure 3The diagram illustrates the principle of Line Segment NMS. The numbers 0.92, 0.85, and 0.78 represent the overall confidence scores of the three predicted line segments S1, S2, and S3, respectively. The calculation formula is: obj × cls × mean(kpt_conf). In the Line Segment NMS algorithm, all predicted line segments are first sorted from highest to lowest overall confidence score. Then, the line segment with the highest confidence score (S1) is compared with the remaining line segments (S2, S3). If the suppression condition (LineIoU > γ or d_min < δ) is met, the line segment with the lower confidence score is suppressed.

[0054] By decoding the two key points output by the trained lightweight neural network model into line segments, a dual-threshold NMS algorithm based on the geometric characteristics of line segments, namely the dual judgment criteria of line segment IoU and minimum distance between endpoints, is used to eliminate redundant line segment predictions that are too close or overlapped in space, ensuring that each borehole residual trace is represented by only one optimal line segment. This strategy is more suitable for deduplication of line segment structures than traditional box NMS.

[0055] S4. Scale conversion and length calculation: Using the scale conversion coefficient obtained in step S1, the pixel length of the actual line segment after NMS processing in step S3 is converted into the physical length l: l = ||p_tip - p_end|| × mm_per_pixel, where ||p_tip - p_end|| represents the pixel length of the actual line segment, and mm_per_pixel represents the scale conversion coefficient.

[0056] Furthermore, the measurement method also includes step S5: data matching and statistical report generation: the physical length l and location information (i.e., the x and y coordinates of two key points) of each residual blast hole instance obtained in step S4 are automatically or semi-automatically matched with the blast hole layout information in the blasting design drawings, and the residual length, average residual length on the design section, residual rate and other indicators of each blast hole are automatically calculated. The residual rate is the ratio of the residual length to the design length, and structured statistical reports and visualization charts can be generated according to different dimensions of "hole-ring-surface".

[0057] Furthermore, the training of the lightweight neural network model described in step S2 employs several optimization strategies:

[0058] The loss function design should satisfy the following formula:

[0059] L=Ldet+λ·Lkpt

[0060] Ldet = L_box + L_obj + L_cls

[0061] Lkpt=Σ_iw_i·Huber(Δx_i, Δy_i)+μ·(1-OKS_i)

[0062] Where L represents the total loss, Ldet is the object detection loss, L_box represents the box position error, L_obj represents whether an object is present, L_cls represents the class loss, Lkpt is the keypoint loss, which combines the Huber loss (regressing coordinates) and OKS loss (evaluating keypoint similarity), and λ is the distillation weight. Weights are adjusted for invisible keypoints; i represents the i-th keypoint, (Δx_i, Δy_i) represents the deviation between the predicted coordinates and the true coordinates of the i-th keypoint, w_i represents the weight of the i-th keypoint (e.g., the orifice end can have a higher weight), Huber(Δx_i, Δy_i) represents a regression loss that is milder than L2 and more stable than L1. With small errors, it resembles squared loss, encouraging more precise calculations; with large errors, it resembles absolute value loss, less sensitive to outliers, and OKS_i represents the OKS similarity of the i-th keypoint. Between [0, 1], the closer to 1, the more accurate the position. μ is used to control the weight of OKS in the total loss.

[0063] Model Lightweighting: Knowledge distillation is employed to allow a more powerful teacher model to guide the training of a lightweight student model. After training, Post-Training Quantization (PTQ) is used. The distribution of activation values ​​in each layer is statistically analyzed using a calibration dataset. Per-channel INT8 quantization is performed on convolutional layer weights, and per-tensor INT8 quantization is performed on activation values, converting the model into an efficient fixed-point integer format. Furthermore, structured pruning is implemented. Based on the importance score of the BN layer scaling factor, the output channels of the GhostConv / RepConv modules in the backbone network and the feature fusion channels in the PAN-Lite neck network are sorted and pruned, with a global channel pruning rate of 40%. After pruning, the model is fine-tuned to restore accuracy. Through quantization and pruning, the model size can be compressed to approximately 25% of its original size, achieving a 2-3x improvement in inference speed on mobile devices while ensuring a detection accuracy (mAP) loss of less than 2%.

[0064] Secondly, a system for implementing the measurement method is provided, comprising:

[0065] Image acquisition and preprocessing module: responsible for calling the camera, image acquisition, calibration object recognition and image orthorectification, specifically acquiring images of the tunnel face including residual traces of blast holes and calibration plates, and obtaining scale conversion coefficients after orthorectifying the tunnel face images;

[0066] Intelligent recognition and measurement module: Built-in lightweight key point detection model after training, completes image reasoning, detection of two key points, generation of actual line segments and conversion of physical length;

[0067] Interactive correction module: Provides a graphical interface for users to verify and manually correct the identification results of each residual blast hole;

[0068] Data management and report generation module: used to store inspection data, match design information, and automatically generate statistical reports containing the physical length, location, and residual rate of each residual blast hole; it can store the identification results in a structured manner in a local database, support matching with the design BIM model, and generate inspection reports in Word / PDF format with one click.

[0069] Furthermore, the measurement system also includes a cloud collaboration module: it supports synchronizing detection data to a cloud server to achieve multi-project data aggregation, remote model updates, and macro-data analysis.

[0070] Example:

[0071] Taking the quality inspection of a railway tunnel after smooth blasting of Class II surrounding rock as an example, the measurement method of this invention is used, and the specific process is as follows:

[0072] 1. On-site preparation: Fix an ArUco calibration plate with a side length of 200mm at a stable position on one side of the working face, such as... Figure 4 The diagram shown is a schematic of ArUco calibration.

[0073] 2. Image acquisition: The inspection personnel use a ruggedized tablet computer with the system's APP installed to take photos of the working face, including the ArUco calibration plate and all remaining blast holes. If the cross-section is large, multiple overlapping photos are taken along an S-shaped path.

[0074] 3. Preprocessing and correction: The APP automatically detects the ArUco calibration board, calculates the homography matrix, performs orthorectification on the image, and calculates the current image resolution as 0.4mm / pixel. If there are multiple photos, ORB feature matching and stitching are performed first to generate a panoramic orthorectified image. This image stitching technology is suitable for situations where a single face image cannot cover the entire face.

[0075] 4. Intelligent recognition and measurement: The corrected image is input into the trained local lightweight key point detection model. The model completes inference in about 1 second and outputs key point pairs of hundreds of gun hole traces.

[0076] 5. Result Processing and Display: After the system performs line segment NMS, it calculates the length based on the scale factor; for example, if the pixel distance between a pair of key points is 375, then the actual residual length is 375 × 0.4 = 150 mm = 15 cm; all detected boreholes and their length information are superimposed and displayed on the tablet screen in real time.

[0077] 6. Interaction and Report Generation: Quality inspectors quickly browse the system and find a false positive for water seepage. They then click to delete the false positive on the screen. After confirming that everything is correct, they click "Generate Report". The system automatically matches the design borehole number and generates a report: "60 boreholes were inspected this period, with an average residual length of 18.2cm, a design length of 80cm, and an average residual rate of 22.8%", along with a color illustration. The report is automatically saved and uploaded to the project management platform.

[0078] In intelligent recognition and measurement, the relevant parameters of the trained local lightweight keypoint detection model are set as follows:

[0079] (1) Specific configuration of lightweight neural network model:

[0080] Backbone: A lightweight backbone consisting of GhostConv-Blocks is used, specifically configured in 4 stages with output channels of 32, 64, 96 and 192 respectively. An EcA-Lite attention module is embedded after each GhostConv-Block to improve feature representation capabilities.

[0081] Neck network: Employs a lightweight PAN-Lite structure to perform top-down and bottom-up feature fusion on the three mesoscale feature layers (64, 96, and 192 channels respectively) output by the backbone network;

[0082] The detection head uses a keypoint direct regression method. For each prediction instance, it outputs a bounding box (4-dimensional), an object confidence (1-dimensional), a class confidence (1-dimensional, this task only has the "residual gun hole" class), and information on two keypoints (each keypoint contains x-coordinate, y-coordinate, and visibility confidence, for a total of 6 dimensions).

[0083] (2) Key parameters of the training loss function:

[0084] The total loss function is L = L_det + λ·L_kpt

[0085] Among them, the distillation weight λ=1.0, which balances the target detection loss and the key point loss;

[0086] Key point loss L_kpt=Σ_iw_i·Huber(Δx_i, Δy_i)+μ·(1-OKS_i)

[0087] Among them, the key point weight w_i: the weight of the tip is set to 1.2, and the weight of the visible end is set to 0.8, in order to emphasize the accuracy of the tip positioning;

[0088] OKS loss weight μ=0.8;

[0089] In the object detection loss L_det, the bounding box regression uses CIoU Loss, and the classification loss uses cross-entropy loss.

[0090] (3) Threshold of line segment NMS algorithm:

[0091] The line segment IoU threshold γ = 0.25;

[0092] Minimum distance threshold between endpoints δ = 5 (pixels);

[0093] When two predicted line segments satisfy either LineIoU>0.25 or d_min<5 (pixels), they are determined to be the same target, and the one with the lower overall confidence is suppressed.

[0094] (4) Example of calculating the comprehensive confidence level of a line segment:

[0095] The overall confidence level is obj×cls×mean(kpt_conf).

[0096] Example numerical values: Suppose the model outputs the following for a specific example of residual borehole prediction:

[0097] The object confidence score is obj = 0.95.

[0098] Category confidence cls = 0.98 (probability of belonging to the "residual borehole" category);

[0099] The visibility confidence scores for the two keypoints are: kpt_conf_tip at the orifice end = 0.90 and kpt_conf_end at the visible end = 0.85. Therefore, the average keypoint confidence score is mean(kpt_conf) = (0.90 + 0.85) / 2 = 0.875.

[0100] The overall confidence level of the predicted line segment for this example is: 0.95 × 0.98 × 0.875 = 0.817.

[0101] (5) Model lightweighting post-processing parameters:

[0102] Quantization: Post-training quantization (PTQ) was used to convert model weights to INT8 precision and activation values ​​to UINT8 precision. Quantization parameters were determined using 500 calibration images.

[0103] Pruning: The channels of convolutional layers in the backbone and neck networks are structurally pruned with a target global pruning rate of 30%. After pruning, fine-tuning is performed for 3 epochs to restore accuracy.

[0104] Final model: The quantized and pruned model is approximately 3.2MB in size. On a tablet with a Qualcomm Snapdragon 865 processor, the average inference time for processing a 1280x1280 pixel image is approximately 850 milliseconds.

[0105] (6) Interaction and report generation:

[0106] Quality inspectors quickly reviewed the identification results and found a false positive line segment caused by water seepage and reflection. This false positive occurred partly due to the robust design of the loss function for keypoint location regression during model training: we adopted a composite loss of L_kpt=Σ_iw_i·Huber(Δx_i,Δy_i)+μ·(1-OKS_i), where:

[0107] Key point weight w_i: The tip is set to 1.2 and the end is set to 0.8 to emphasize the accuracy of the tip positioning;

[0108] OKS loss weight μ: set to 0.8 to strengthen the constraint on keypoint similarity;

[0109] Total loss weight λ: set to 1.0, used to balance the target detection loss L_det and the keypoint loss L_kpt;

[0110] Although the model was trained with a large number of negative samples containing water seepage and reflection, and has strong robustness under the constraints of the aforementioned loss function, false detections may still occur under individual extreme interference. The quality inspector then clicked to delete the false alarm line segment on the interactive interface. After confirming that all identification results were correct, the inspector clicked "Generate Report". The system automatically matched the measurement results with the designed borehole information and generated a structured report: "60 peripheral eyes were detected in this phase, with an average residual length of 18.2cm, a designed length of 80cm, and an average residual rate of 22.8%", and attached a color map of the working face with annotations. The report was automatically saved locally and uploaded to the project management platform, completing the full-process digital archiving of this inspection.

[0111] The working principle of this invention is as follows:

[0112] This method first eliminates geometric errors in the face image through image correction. Then, it utilizes a trained lightweight neural network to intelligently perceive key points of the boreholes. Specifically, the corrected image is input into the trained lightweight key point detection neural network, which analyzes image features pixel by pixel and directly regresses the coordinates and visibility confidence of two key points for each residual borehole instance—the borehole opening end and the visible end end. It also provides target existence and category confidence, achieving intelligent conversion from image to structured key point data. Subsequently, multiple pairs of two key points output by the model are connected to form multiple predicted line segments representing borehole traces. Each line segment has a comprehensive confidence score and a comprehensive... The confidence level is jointly determined by the confidence levels of the target, category, and key points. To address the problem of repeated predictions of the same borehole, an innovative line segment NMS algorithm is adopted: based on the dual geometric criteria of line segment IoU and minimum endpoint distance, line segments that are excessively overlapping or close in space are filtered out, and only the line segment with the highest confidence level is retained as the final representation of the borehole. This step ensures the correspondence of "one borehole, one line segment" and ensures the uniqueness of detection through geometric post-processing. Then, the physical length of the residual borehole is accurately converted according to the calibration relationship. Finally, it is fused with the design information to generate a quantitative report, thereby transforming the traditional subjective and inefficient manual measurement into an objective, automatic, and digital intelligent detection process.

Claims

1. A method for measuring the residual length of tunnel blast holes based on key point detection, characterized in that, Includes the following steps: S1. Acquire images of the tunnel face including blast hole residue and calibration plate, and obtain scale conversion coefficients after orthorectifying the tunnel face images; S2. Input the orthorectified face image described in step S1 into the trained lightweight neural network model. The trained lightweight neural network model processes and outputs multiple sets of two key points and key point information for each residual blast hole. Each set of two key points is the opening end and the visible end of the residual blast hole. The key point information includes the x coordinate, y coordinate and visibility confidence of the key point. S3. Connect the multiple sets of two key points of each residual blast hole described in step S2 to form multiple predicted line segments. Use the line segment NMS algorithm to perform non-maximum suppression on the multiple predicted line segments. Filter out the actual line segment of each residual blast hole from the multiple predicted line segments. The line segment NMS algorithm includes a dual judgment criterion based on the line segment IoU and the minimum distance d_min between the endpoints. S4. Based on the scale conversion factor described in step S1, convert the pixel length of the actual line segment described in step S3 into the physical length l of the residual borehole. The formula for calculating the physical length l is as follows: l=||p_tip-p_end||×mm_per_pixel Where ||p_tip-p_end|| represents the pixel length of the actual line segment, and mm_per_pixel represents the scale conversion factor.

2. The measurement method as described in claim 1, characterized in that, The orthorectification described in step S1 is achieved by identifying ArUco / CharUco markings or physical scales of known size in the face image, calculating the homography matrix, and performing perspective transformation on the face image.

3. The measurement method as described in claim 1, characterized in that, The backbone network of the lightweight neural network model described in step S2 consists of GhostConv, DepwiseConv, or RepConv modules. The neck network uses lightweight PAN-Lite or BiFPN-Lite for multi-scale feature fusion. The detection head uses direct regression of key points. The trained lightweight neural network model outputs the object confidence, category confidence, and multiple sets of two key points and key point information for each residual blast hole.

4. The measurement method as described in claim 1, characterized in that, The loss function of the lightweight neural network model described in step S2 is the total loss, and the formula for calculating the total loss is as follows: L=Ldet+λ·Lkpt Ldet = L_box + L_obj + L_cls Lkpt=Σ_iw_i·Huber(Δx_i,Δy_i)+μ·(1-OKS_i) Where L represents the total loss, Ldet represents the object detection loss, L_box represents the bounding box position error, L_obj represents whether an object is present, L_cls represents the class loss, Lkpt represents the keypoint loss, Lkpt is a weighted sum of Huber loss and a penalty term based on keypoint similarity OKS, and λ represents the distillation weight. Let i represent the i-th keypoint, (Δx_i, Δy_i) represent the deviation between the predicted coordinates and the true coordinates of the i-th keypoint, w_i represent the weight of the i-th keypoint, Huber(Δx_i, Δy_i) represents a regression loss that is milder than L2 and more stable than L1, and OKS_i represent the OKS similarity of the i-th keypoint. [0, 1], μ is used to control the weight of OKS in the total loss.

5. The measurement method as described in claim 1, characterized in that, The non-maximum suppression condition in step S3 is as follows: for any two predicted line segments among the multiple predicted line segments, if the line segment IoU of any two predicted line segments is greater than γ or the minimum distance between the endpoints d_min is less than δ, then the line segment with lower confidence among the two predicted line segments is suppressed, where γ ∈ [0.1, 0.5] and δ ∈ [3, 10].

6. The measurement method as described in claim 1, characterized in that, The lightweight neural network model trained in step S2 is obtained through the following steps: a lightweight neural network model is trained using a training distillation strategy, and a quantized lightweight neural network model is obtained by performing quantization-perception training or post-training quantization on the lightweight neural network model trained using the training distillation strategy, the weights of the quantized lightweight neural network model are converted to INT8 / INT4 precision, and further compressed using structured pruning to obtain the trained lightweight neural network model. The structured pruning involves: (1) channels of the output feature map of the convolutional layer, (2) the entire building block or layer in the backbone or neck of the network, (3) optional or auxiliary attention modules, and (4) individual weights inside the fully connected layer or convolutional kernel.

7. The measurement method as described in claim 1, characterized in that, The face image described in step S1 is generated by image stitching technology based on ORB feature point matching and RANSAC algorithm from multiple images with overlapping regions.

8. The measurement method as described in claim 1, characterized in that, It also includes step S5: matching the physical length l of the residual blast hole described in step S4 and the x and y coordinates of the two key points described in step S2 with the preset blast hole information, calculating the blast hole residual rate of a single hole, a single ring and the entire working face, and generating a quantitative statistical report.

9. A system based on the measurement method according to any one of claims 1 to 8, characterized in that, include: Image acquisition and preprocessing module: Acquires images of the tunnel face including blast hole residue and calibration plate, and obtains scale conversion coefficients after orthorectifying the tunnel face images; Intelligent recognition and measurement module: integrates the trained lightweight neural network model to complete the detection of two key points, actual line segment generation and physical length conversion for each residual blast hole; Interactive correction module: Provides a graphical interface for users to verify and manually correct the identification results of each residual blast hole; Data management and report generation module: used to store detection data, match design information, and automatically generate statistical reports containing the physical length, location, and residual rate of each residual borehole.

10. A computer-readable storage medium storing a computer program thereon, characterized in that, When the computer program is executed by a processor, it implements the measurement method as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Tunnel face blast hole identification method based on YOLOv8

    CN120219910A

  • Automatic half-hole ratio calculation method based on three-dimensional scanning point clouds

    CN107644119A

  • Method and apparatus for detecting 3D position of pedestrian, and vehicle-mounted terminal

    WO2020237942A1