Tunnel anchor rod quantity digital detection method and system
By combining image acquisition and an improved YOLOv11 model with adaptive image enhancement and training strategies, the problem of low efficiency and poor accuracy in traditional manual detection of tunnel anchor bolt counts has been solved, achieving efficient, accurate, and safe detection of tunnel anchor bolt counts.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HUBEI HIGHWAY ENG CONSULTANTS SUPERVISION CENT
- Filing Date
- 2025-12-31
- Publication Date
- 2026-05-05
AI Technical Summary
Traditional methods for manually detecting the number of tunnel anchor bolts are inefficient, labor-intensive, inaccurate, and pose safety risks, failing to meet the demands of modern tunnel engineering for efficient, precise, and safe quality control.
Panoramic images of tunnel anchor bolts are acquired using image acquisition equipment. The number of anchor bolts is detected using a block-based adaptive image enhancement algorithm and an improved YOLOv11 target detection model. The model is trained by combining geometric prior constraints, brightness adaptive sample weighting, and local occlusion enhancement strategies to achieve real-time recognition and statistics.
It significantly improves the efficiency and accuracy of anchor bolt quantity detection, reduces missed and incorrect detections, lowers the safety risks for inspection personnel, and achieves efficient, accurate, and safe quality control of the number of tunnel anchor bolts.
Smart Images

Figure CN121437513B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of tunnel concealed engineering detection technology, and in particular to a digital detection method and system for the number of tunnel anchor bolts. Background Technology
[0002] In tunnel construction, anchor bolts serve as crucial support components for rock stability and structural safety. Their quantity, distribution, and density directly impact the overall stress state and long-term stability of the tunnel. Traditional inspection methods rely on manual counting and ruler measurement, which is not only inefficient and labor-intensive but also significantly affected by the tunnel environment. Inspection personnel must enter the tunnel with lighting, ranging, and recording equipment to identify and record the location of each anchor bolt individually. The high dust levels, uneven lighting, confined space, and numerous construction interferences within the tunnel further complicate manual inspection, making it time-consuming, labor-intensive, and costly. Furthermore, the results are highly subjective and inaccurate, often resulting in missed or incorrect detections, especially in areas with dense anchor bolt concentrations or dim lighting, where manual counting errors are significant. Simultaneously, the harsh environment of tunnels, including high humidity and noise, poses a threat to the health of inspection personnel and presents significant operational safety risks. Therefore, traditional manual inspection methods can no longer meet the demands of modern tunnel engineering for efficient, accurate, and safe quality control.
[0003] With the development of artificial intelligence technology, computer vision and deep learning have been widely applied in the field of engineering inspection. Computer vision acquires target images or videos through image acquisition equipment, and then processes, analyzes, and understands them through algorithms to achieve functions such as target recognition, localization, measurement, and defect detection. The emergence of convolutional neural networks in deep learning has driven the development of computer vision technology. These networks utilize large amounts of labeled data to train deep neural network models, automatically learning to extract complex image features, achieving recognition accuracy and robustness that surpasses traditional image processing methods. In the field of civil engineering, deep learning-based computer vision technology has been successfully applied to bridge crack detection, tunnel lining defect identification, and pavement damage assessment, laying a technical foundation for research on digital inspection of tunnel anchor bolt quality. Summary of the Invention
[0004] To address the shortcomings of existing technologies, this invention provides a method and system for digitally detecting the number of tunnel anchor bolts.
[0005] To achieve the above objectives, in a first aspect, this invention provides a method for digitally detecting the number of tunnel anchor bolts. The method includes the following steps: acquiring panoramic images of the tunnel arch along the tunnel centerline using an image acquisition device; preprocessing the panoramic images of the tunnel anchor bolts using a block-adaptive image enhancement algorithm to obtain an enhanced detail image of the anchor bolt area; annotating the enhanced detail image of the anchor bolt area to obtain an original dataset; constructing a model dataset based on the original dataset; constructing an improved target detection model for the tunnel environment; training and optimizing the improved target detection model using the model dataset to obtain an anchor bolt quantity detection model; and performing real-time identification and statistics of tunnel anchor bolts based on the anchor bolt quantity detection model to achieve digital detection of the number of tunnel anchor bolts. This invention constructs a complete digital detection process for the number of anchor bolts, replacing traditional manual detection, effectively avoiding safety risks caused by the harsh tunnel environment, significantly improving the efficiency and accuracy of anchor bolt quantity detection, reducing missed detections and false detections, and meeting the high-efficiency, accurate, and safe quality control requirements of modern tunnel engineering.
[0006] Optionally, the step of acquiring images of the tunnel arch along the tunnel centerline using an image acquisition device to obtain a panoramic image of the tunnel anchor bolts includes: arranging uniform white light or using natural light as supplementary lighting conditions at the tunnel face; fixing an industrial tablet as the image acquisition device to the tunnel centerline and vertically photographing the tunnel arch using the industrial tablet; automatically acquiring three consecutive frames of images of the tunnel arch at each detection point and selecting the optimal frame; and automatically storing the optimal frame according to the section number to obtain a panoramic image of the tunnel anchor bolts. This invention, by standardizing lighting conditions, shooting angles, and optimal frame selection, effectively reduces metal reflections, motion blur, and dust interference, ensuring that the acquired panoramic image of the anchor bolts is unobstructed, has high contrast, and controllable distortion, providing stable and reliable high-quality input data for subsequent preprocessing and model detection.
[0007] Optionally, the step of using a block-based adaptive image enhancement algorithm to preprocess the panoramic image of the tunnel anchor bolt to obtain an enhanced image of anchor bolt region details includes: dividing the panoramic image of the tunnel anchor bolt into multiple sub-blocks of the same size; using an improved Gaussian filtering method to estimate the illumination composition of the sub-blocks; performing local histogram equalization on the sub-blocks to adjust the image contrast and obtain a locally equalized image; combining the illumination composition and the locally equalized image, using the block-based adaptive image enhancement algorithm to estimate the reflection composition of the sub-blocks; performing Gaussian smoothing on the reflection composition to introduce smoothing constraints to obtain the enhancement result of the sub-blocks; and combining the enhancement results to obtain the enhanced image of anchor bolt region details. This invention, through block-based adaptive adjustment and multi-step optimization, balances overexposure in strong light and loss of information in dark areas, enhances key details such as anchor bolt ends and threads, suppresses artifacts and noise, significantly improves image quality, provides clear feature support for subsequent anchor bolt identification, and adapts to the complex lighting environment of tunnel scenes.
[0008] Optionally, the step of annotating the anchor bars in the enhanced detail image of the anchor bar region to obtain the original dataset, and constructing the model dataset based on the original dataset, includes: selecting the anchor bars in the enhanced detail image of the anchor bar region and adding anchor bar markers, generating an XML file containing bounding box coordinates and category information to obtain the original dataset; and randomly dividing the original dataset into training, validation, and test sets according to a certain ratio as the model dataset. This invention uses professional annotation tools and scientific data partitioning ratios to ensure accurate annotation of the original dataset and a reasonable structure of the model dataset. This ensures the reliability of the training data and improves the model training effect and generalization ability through the division of labor among the training, validation, and test sets, laying a data foundation for model optimization.
[0009] Optionally, the step of constructing an improved target detection model for the tunnel environment includes: optimizing the structure of the YOLOv11 model to obtain an optimized YOLOv11 model based on the target detection requirements of the tunnel environment; and using the optimized YOLOv11 model as the improved target detection model. This invention, based on the YOLOv11 model and specifically optimized for tunnel scenarios, overcomes the performance limitations of general models in scenarios such as uneven tunnel lighting and dense small targets, exhibiting stronger scene adaptability and providing high-performance model architecture support for subsequent accurate detection of anchor bolt counts.
[0010] Optionally, the structural optimization of the YOLOv11 model includes: introducing a lightweight channel attention module into the backbone network, introducing a weighted bidirectional feature pyramid network structure into the neck network, and adding a small target detection branch into the detection head. This invention, through targeted optimization of the backbone network, neck network, and detection head, enhances channel feature response, multi-scale feature fusion, and small target detection capabilities, effectively solving the problems of insufficient anchor bolt feature extraction and easy loss of small targets in tunnel environments, thereby improving the accuracy and stability of the model's detection.
[0011] Optionally, the step of training and optimizing the improved target detection model using the model dataset to obtain the anchor bolt quantity detection model includes: constructing a model improvement training strategy by combining a geometric prior constraint loss term, a brightness adaptive sample weighting strategy, a local occlusion enhancement module, and a hierarchical loss adaptive weighting strategy; and obtaining the anchor bolt quantity detection model by combining the model dataset and the improved target detection model based on the model improvement training strategy. This invention integrates multiple training optimization strategies, enabling the detection model to fully learn the geometric distribution, illumination adaptation, and anti-occlusion characteristics of tunnel anchor bolts, effectively compensating for the insufficient training samples and detection defects caused by the complexity of the scene in the tunnel environment, significantly reducing the false negative and false positive rates, and improving the practicality of the model.
[0012] Optionally, the model improvement training strategy includes: introducing the geometric prior constraint loss term based on the distribution pattern of tunnel anchor bolts, and jointly optimizing it with the original detection loss term to form the total loss function; the brightness adaptive sample weighting strategy includes calculating the average brightness of each image sample in the model dataset and dynamically adjusting the sample loss weights; randomly generating a rectangular occlusion mask based on the local occlusion enhancement module, and superimposing the anchor bolt region detail enhancement image and the rectangular occlusion mask to generate enhanced samples; for the small target detection branch, designing the hierarchical loss adaptive weighting strategy to assign loss weights to detection layers of different scales. This invention optimizes positioning accuracy through geometric constraints, enhances dark area detection through brightness weighting, improves anti-interference ability through occlusion enhancement, optimizes small target recognition through hierarchical weighting, and achieves synergistic effects of multiple strategies to comprehensively cover the core pain points of tunnel detection, enabling the model to maintain high robustness and detection accuracy even in complex scenarios.
[0013] Optionally, the real-time identification and counting of tunnel anchors based on the anchor quantity detection model to achieve digital detection of the number of tunnel anchors includes: deploying the anchor quantity detection model on an industrial tablet for real-time detection, automatically marking detection frames and counting the number of anchors; and generating a digital anchor detection report after the detection is completed, including detection time, location information, detection images, and quantity statistics. This invention deploys the model on an industrial tablet for real-time detection, which is convenient and responsive, automatically generates a detection report containing key information, reduces the operational difficulty for inspection personnel, achieves traceability of detection results, and significantly improves the intelligence of tunnel anchor detection and the efficiency of engineering management.
[0014] Secondly, this invention provides a digital detection system for the number of tunnel anchor bolts. The system executes the digital detection method for the number of tunnel anchor bolts provided by this invention. The system includes an input device, an output device, a processor, and a memory, which are interconnected. The memory stores a computer program, which includes program instructions, and the processor is configured to call the program instructions. This invention, through high-performance hardware, stably operates the digital detection method for the number of tunnel anchor bolts, achieving full automation from image acquisition to report generation, ensuring efficient and accurate detection, and providing reliable hardware support for tunnel anchor bolt detection. Attached Figure Description
[0015] Figure 1 This is a flowchart of a method for digitally detecting the number of tunnel anchor bolts according to an embodiment of the present invention;
[0016] Figure 2 This is a comparison diagram of the effects of the block-based adaptive image enhancement algorithm before and after processing according to an embodiment of the present invention;
[0017] Figure 3 This is a schematic diagram of the network architecture of the anchor bolt quantity detection model according to an embodiment of the present invention;
[0018] Figure 4 This is a framework diagram of a digital detection system for the number of tunnel anchor bolts according to an embodiment of the present invention;
[0019] Figure 5 This is a schematic diagram of the module of the digital detection system for the number of tunnel anchor bolts according to an embodiment of the present invention. Detailed Implementation
[0020] Specific embodiments of the present invention will now be described in detail. It should be noted that the embodiments described herein are for illustrative purposes only and are not intended to limit the invention. In the following description, numerous specific details are set forth in order to provide a thorough understanding of the invention. However, it will be apparent to those skilled in the art that these specific details are not necessary to practice the invention. In other instances, well-known circuits, software, or methods have not been specifically described to avoid obscuring the invention.
[0021] Throughout this specification, references to "an embodiment," "an embodiment," "an example," or "an example" mean that a particular feature, structure, or characteristic described in connection with that embodiment or example is included in at least one embodiment of the invention. Therefore, the phrases "in an embodiment," "in an embodiment," "an example," or "an example" appearing in various places throughout the specification do not necessarily refer to the same embodiment or example. Furthermore, specific features, structures, or characteristics can be combined in one or more embodiments or examples in any suitable combination and / or sub-combination. Moreover, those skilled in the art will understand that the illustrations provided herein are for illustrative purposes and are not necessarily drawn to scale.
[0022] Please see Figure 1 One embodiment of the present invention provides a method for digitally detecting the number of tunnel anchor bolts, the method comprising the following steps:
[0023] S1. Using image acquisition equipment, images of the tunnel arch are acquired along the tunnel centerline to obtain panoramic images of the tunnel anchor bolts.
[0024] In this embodiment, a dedicated image acquisition method for anchor bolt inspection is proposed to address issues such as insufficient lighting, dust interference, and image distortion at the tunnel site. A uniform white light of ≥300lx or supplemental natural light is applied at the tunnel face as the image acquisition lighting condition to reduce strong reflections from the metal ends and improve detail clarity. The inspection personnel hold an industrial tablet (image acquisition device) fixed to the tunnel centerline and use a wide-angle lens to vertically capture the entire tunnel arch, ensuring that the anchor bolt ends, pads, and threads are all included in the image with controllable distortion. At each inspection point, the industrial tablet automatically performs three consecutive frame acquisitions (3 consecutive 48MP images per point), and a built-in sharpness evaluation algorithm selects the optimal frame to reduce the impact of motion blur and dust interference on inspection accuracy. Finally, according to the section number, all the optimal frames in the acquired images are automatically stored to obtain a panoramic image of the tunnel anchor bolts, ensuring a one-to-one correspondence between the input data and subsequent inspection results. The above image acquisition methods can obtain unobstructed, forward-facing, high-contrast high-definition images of anchor bolts in complex tunnel construction environments, providing a stable and reliable input foundation for subsequent lightweight detection models.
[0025] S2. The panoramic image of the tunnel anchor bolt is preprocessed using a block-based adaptive image enhancement algorithm to obtain an image with enhanced details in the anchor bolt area.
[0026] In this embodiment, to address the problems of strong light and dark areas coexisting in the tunnel environment, blurred anchor bolt edges, and interference from metal reflections, a block-adaptive improvement method is proposed based on the traditional multi-scale Retinex algorithm with color restoration (MSRCR) to construct an improved Retinex algorithm as a block-adaptive image enhancement algorithm.
[0027] Specifically, the block-based adaptive enhancement method includes: First, dividing the panoramic image of the tunnel anchor bolts into sub-blocks by region, estimating the illumination components of each sub-block, thereby achieving adaptive adjustment to local illumination differences. During image enhancement, local histogram equalization is combined to improve contrast, and smoothing constraints are introduced to suppress over-enhancement and artifact generation, ensuring that the enhanced image maintains a balance between brightness and detail.
[0028] Furthermore, based on the characteristic requirements of the anchor bolt detection task, feature-guided optimization was performed on the enhancement results, focusing on enhancing the edge texture of the metal end and threaded area, making it easier to identify in subsequent YOLOv11 detection. This not only significantly improved the overall quality and detail discernibility of the tunnel image, but also formed an integrated optimization process with the target detection model, effectively solving the problems of low detection accuracy and poor robustness of existing technologies under complex lighting conditions in tunnels.
[0029] In this embodiment, image preprocessing includes the following steps:
[0030] Firstly, regarding image segmentation, the input image (panoramic image of tunnel anchor bolts) is segmented into multiple blocks of size [missing information]. The sub-blocks, each satisfying the following relationship:
[0031]
[0032] in, For sub-blocks, A panoramic image of the tunnel anchor bolts. Two-dimensional spatial coordinates, The coordinates of the top-left corner of the sub-block. Let be the side length of the sub-block.
[0033] Second, illumination estimation: For each sub-block, an improved Gaussian filtering method is used to estimate the illumination components, satisfying the following relationship:
[0034]
[0035] in, The illumination composition of the sub-block, Indicates Gaussian blur, is a sub-block, and is the standard deviation of the Gaussian filter.
[0036] It should be noted that the standard deviation of the Gaussian filter is used to control the smoothness of the lighting.
[0037] Third, local histogram equalization is performed on each sub-block of the image to adjust the image contrast and make the local enhancement effect more balanced, satisfying the following relationship:
[0038]
[0039] in, For locally equalized images, This indicates contrast-limited adaptive histogram equalization. For sub-blocks.
[0040] It should be noted that the Contrast Limited Adaptive Histogram Equalization (CLAHE) algorithm is used for histogram equalization of each sub-block to improve local image details.
[0041] Fourth, the reflection component is estimated. After obtaining the illumination component and the locally equalized image, the reflection component is estimated using the improved Retinex algorithm, satisfying the following relationship:
[0042]
[0043] in, As a reflective component, For sub-blocks, The illumination composition of the sub-block, This is a locally equalized image.
[0044] By estimating the reflective components, we can enhance the details of the reflective components while avoiding the effects of uneven illumination.
[0045] Fifth, smoothing constraints: To further reduce the impact of artifacts and noise, smoothing constraints are introduced to ensure the smoothness of the enhanced image, satisfying the following relationship:
[0046]
[0047] in, The result of enhancing the sub-blocks, Indicates Gaussian smoothing operation. As a reflective component, For smoothing parameters.
[0048] It should be noted that Gaussian smoothing can remove over-enhanced artifacts.
[0049] Sixth, the final enhanced image is obtained by combining the enhancement results of all sub-blocks, and the final image is used as the anchor region detail enhancement image, satisfying the following relationship:
[0050]
[0051] in, Enhance the image details in the anchor bolt area. For the index variable of the sub-block, This is the result of enhancing the sub-block.
[0052] The resulting enhanced image (anchor bolt area detail enhancement image) has higher image quality and is especially suitable for complex scenes with low contrast and uneven lighting, such as tunnel anchor bolt detection.
[0053] In this embodiment, an adaptive illumination compensation function is introduced. By processing the image in blocks, the over-enhancement and insufficient contrast problems caused by global illumination estimation are effectively avoided. Regarding detail enhancement, the block-based adaptive image enhancement algorithm, combined with local histogram equalization and reflectance enhancement, can excellently preserve image details, making it particularly suitable for small target detection, such as anchor bolt ends. Furthermore, by introducing smoothing constraints, the algorithm significantly reduces artifacts and noise during the enhancement process, thereby ensuring the naturalness and high quality of the image.
[0054] Please see Figure 2 The image shows a comparison of the effects before and after processing by the block-based adaptive image enhancement algorithm. Figure 2 The image above shows the interior of the tunnel before processing. At this time, the anchor bolt markings on the tunnel rock wall surface are affected by ambient light and rock wall texture, resulting in relatively blurred details, insufficient clarity and contrast of the markings, and low recognition of anchor bolt positions and parameters. Figure 2 The image below is processed by the improved Retinex algorithm. The texture of the tunnel rock wall is clearer, the contrast of the anchor marks (including numerical labels and anchor area outlines) is significantly improved, and the details are more prominent. It can more accurately present the distribution location and associated parameters of the anchors, which is convenient for subsequent digital identification and statistics of the number of tunnel anchors. It intuitively demonstrates the role of the improved Retinex algorithm in optimizing the visual information of tunnel detection.
[0055] S3. Anchor bar annotation is performed on the enhanced detail image of the anchor bar area to obtain the original dataset, and the model dataset is constructed based on the original dataset.
[0056] In this embodiment, on the anchor region detail-enhanced image obtained after processing with the improved Retinex algorithm, each anchor is manually selected and labeled as an "anchor" using an image annotation tool (LabelImg). This generates an eXtensible Markup Language (XML) file containing bounding box coordinates and category information, which serves as the original dataset. The annotation results are verified by professionals to ensure accuracy. Subsequently, the original dataset is randomly divided into training, validation, and test sets in a 7:2:1 ratio to serve as the model dataset, used for model training, performance evaluation, and final testing, respectively.
[0057] S4. Construct an improved target detection model for the tunnel environment, and train and optimize the improved target detection model using the model dataset to obtain an anchor bolt number detection model.
[0058] Specifically, S4 includes the following steps:
[0059] S41. Develop an improved target detection model for tunnel environments.
[0060] In this embodiment, during the target detection stage, to address the issue of small anchor bolt targets being easily lost in tunnel environments, the YOLOv11 model structure is optimized to obtain an optimized YOLOv11 model as an improved target detection model. This includes: First, introducing a lightweight EfficientChannel Attention (ECA) module into the Backbone Network to enhance information interaction between channels and improve the response intensity to key features; Second, adjusting the Neck Network layer to introduce a Bidirectional Feature Pyramid Network (BiFPN) structure to achieve efficient fusion of multi-scale features, strengthen the transmission of small target features between high and low layer features, and significantly improve the detection stability and accuracy in complex lighting and dense target scenes; Third, adding a small target detection branch with stride=4 to the Detection Head layer.
[0061] S42. The improved target detection model is trained and optimized using the model dataset to obtain the anchor bolt number detection model.
[0062] In this embodiment, the existing YOLOv11 model has the advantages of high speed and high accuracy in conventional target detection tasks. However, in tunnel environments, it still suffers from problems such as uneven illumination, blurred end details, and local occlusion, leading to missed detections and false detections in anchor bolt detection. To address this, after enhancing and calibrating the tunnel anchor bolt images, an improved training method is proposed, combining a geometric prior constraint loss term, a brightness adaptive sample weighting strategy, a local occlusion enhancement module, and a hierarchical loss adaptive weighting strategy, tailored to the characteristics of the tunnel scene. Based on this improved training strategy, the optimized YOLOv11 model is used for detection training to obtain the anchor bolt quantity detection model.
[0063] Specifically, model improvement training strategies include:
[0064] First, considering the regular row and column distribution of anchor bolts in the tunnel arch, a geometric prior constraint loss term is introduced during the training phase to improve positioning accuracy by utilizing the arrangement pattern of the anchor bolts. Let the coordinates of the center point of the detection frame be... The ideal coordinates of the center line of the row and column are Then, define the geometric prior constraint loss term, satisfying the following relationship:
[0065]
[0066] in, For geometric prior constraint loss terms, This represents the total number of anchor bolts. For the anchor bolt, The constraint weights are for the row direction. The constraint weights are for the column direction. The coordinates of the center point of the detection box. The coordinates of the center line of the ideal row and column.
[0067] Furthermore, the geometric prior constraint loss term is jointly optimized with the original detection loss term to form the total loss function, which satisfies the following relationship:
[0068]
[0069] in, For the total loss function, For the original detection loss items, For balance coefficient, This is the geometric prior constraint loss term.
[0070] It should be noted that by using the geometric prior constraint loss term, the model can automatically align the geometric distribution of the anchor bolts during training, reducing false detections caused by noise background or concrete texture.
[0071] Second, to address the issue of uneven brightness distribution in training samples caused by uneven tunnel illumination, a brightness-adaptive sample weighting strategy is proposed.
[0072] During training, the average brightness of each image sample is calculated, and the sample loss weights are dynamically adjusted to satisfy the following relationship:
[0073]
[0074] in, For sample loss weights, This is the brightness adjustment coefficient. The average brightness of the image samples. The maximum brightness value in the training set.
[0075] Specifically, the sample loss weights are applied to the overall loss calculation, satisfying the following relationship:
[0076]
[0077] in, For the overall loss, The total number of samples in a training batch. For the sample index variable in the batch, For sample loss weights, This is the original loss value.
[0078] It should be noted that by using a brightness-adaptive sample weighting strategy, dark area samples (low-brightness images) are given higher weights during training, enabling the model to learn features more fully in uneven lighting environments, thereby significantly improving the accuracy of dark area anchor detection.
[0079] Third, to improve the robustness of the model to situations where some anchor bolts are blocked by cables, equipment, or concrete in actual tunnels, a local occlusion enhancement module was designed.
[0080] Specifically, during the training data generation phase, the local occlusion enhancement module randomly generates rectangular occlusion masks that conform to the anchor bolt size ratio. These masks are then overlaid on the anchor bolt region detail enhancement image obtained after processing with the improved Retinex algorithm to generate enhanced samples, satisfying the following relationship:
[0081]
[0082] in, To enhance the sample, Enhance the image details in the anchor bolt area. This represents a pixel-by-pixel multiplication operation. For rectangular occlusion mask, Fill the background with an image of random brightness.
[0083] It should be noted that the local occlusion enhancement module simulates actual occlusion scenarios without changing the overall image structure, effectively improving the model's detection robustness in complex construction environments.
[0084] Fourth, to address the difficulty in detecting small targets such as anchor bolt ends and threads, a small target prediction branch with stride=4 was added to the detection head of YOLOv11, and a hierarchical loss adaptive weight strategy was designed.
[0085] Specifically, the hierarchical loss adaptive weighting strategy assigns loss weights to detection layers of different scales, satisfying the following relationship:
[0086]
[0087]
[0088] in, The total loss of the detection head, The step size of the feature map. For the first The loss weights of the scale detection layer For the first The original loss value of the scale detection layer, For the index variable of the scale set, Let be the i-th step size value in the scale set.
[0089] It should be noted that the hierarchical weighting method of the hierarchical loss adaptive weight strategy enables the small target detection branch (stride=4 layers) to obtain higher gradient updates in the early stage of training, which helps the model to focus on learning the fine-grained features of the anchor end.
[0090] Please see Figure 3The diagram illustrates the network architecture of the anchor bolt quantity detection model. It takes a 640×640 panoramic image of tunnel anchor bolts in three primary colors (Red, Green, Blue, RGB) as input. Image quality is optimized through an image preprocessing module (including Illumination Enhancement, Adaptive Histogram Equalization (CLAHE), noise suppression, and normalization). The backbone network is then formed by an improved cross-stage partial connection Darknet network, comprising: Convolutional Layer (Conv) + Batch Normalization (BN) + Sigmoid Linear Unit (SiLU), an improved Cross Stage Partial (CSP) module composed of n CSP basic units (CSPBlock), and a lightweight channel attention mechanism (Lightweight Squeeze-and-Excitation, Light-SE) module to complete multi-scale feature extraction (P3, P4, P5). Finally, the network passes through a re-parameterizable VGG-style network. The VGG-style network (RepVGG) uses a structure-optimized convolutional layer with reparameterizable convolution (RepConv) to achieve structural reparameterization, balancing detection accuracy and lightweight performance. A BiFPN feature fusion layer then uses a bidirectional pyramid structure to perform multi-scale feature weighting and enhance channel attention. Feature parsing is then achieved by a decoupled detection head (classification branch and regression branch). Finally, the output module processes the data with non-maximum suppression (NMS) to output bounding boxes and automatically count the number and location of anchor bolts, completing the digital identification and statistics of the number of tunnel anchor bolts.
[0091] S5. Based on the anchor bolt quantity detection model, the tunnel anchor bolts are identified and counted in real time to realize the digital detection of the number of tunnel anchor bolts.
[0092] In this embodiment, the trained anchor bolt quantity detection model is optimized using model quantization technology and then deployed on an industrial tablet at the tunnel site. The tablet's camera captures real-time images of the arch, and the model automatically identifies and locates the anchor bolts, displaying the rendered results with detection boxes in real-time on the interface, while simultaneously counting the number of anchor bolts. After the inspection is completed, a structured inspection report is automatically generated. The report fully records the inspection time, on-site GPS location information, on-site images marked with detection boxes, and the anchor bolt quantity statistics. The report can be exported as an Excel or PDF file for easy archiving and analysis, thus achieving a fully digital closed loop from on-site inspection to report output.
[0093] Please see Figure 4 In one optional embodiment, the present invention provides a digital detection system for the number of tunnel anchor bolts. The system includes an input device, an output device, a processor, and a memory, all interconnected. The memory stores a computer program comprising program instructions. The processor is configured to invoke the program instructions to execute specific steps as described in the relevant embodiments of the digital detection method for the number of tunnel anchor bolts provided by the present invention. The digital detection system for the number of tunnel anchor bolts provided by the present invention has a complete structure, is objective and stable, and improves the overall applicability and practical application capability of the present invention.
[0094] Please see Figure 5 The diagram illustrates the modules of a digital detection system for the number of tunnel anchor bolts. The system includes: first, an image acquisition module to acquire the images required for detection; next, an image preprocessing module to optimize image quality using an improved block-adaptive Retinex algorithm; then, a feature optimization and annotation module to process image features; next, a model training and optimization module (based on an improved YOLOv11) to train and fine-tune the model; finally, based on the optimized model, a model deployment and detection module to conduct actual detection; and finally, the system outputs the corresponding detection report and anchor bolt quantity statistics.
[0095] In summary, this invention provides a digital detection method and system for the number of tunnel anchor bolts. First, a panoramic image of the tunnel arch is acquired using an industrial tablet computer along the tunnel centerline. A block-based adaptive image enhancement algorithm is then used to address uneven lighting and improve image details. Next, anchor bolts are labeled on the enhanced image, and a dataset is constructed. The YOLOv11 model is optimized for the tunnel environment: an attention mechanism is introduced into the backbone network, a weighted bidirectional feature pyramid is used in the neck region, and a small target detection branch is added in the head region. Simultaneously, geometric constraints, adaptive brightness weighting, and occlusion enhancement strategies are incorporated during training to improve model robustness. Finally, the model is deployed to a field terminal to achieve real-time anchor bolt identification, counting, and digital report generation, improving the detection efficiency and accuracy of tunnel anchor bolts. This invention is easy to understand, computationally simple, requires minimal workload, and is suitable for engineering applications, providing a theoretical foundation and technical support for the further development of tunnel concealed engineering detection technology.
[0096] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them. Although the present invention 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 therein. 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 the present invention, and they should all be covered within the scope of the claims and specification of the present invention.
Claims
1. A method for digitally detecting the number of tunnel anchor bolts, characterized in that, Includes the following steps: Using image acquisition equipment, images of the tunnel arch are acquired along the tunnel centerline to obtain panoramic images of the tunnel anchor bolts. The panoramic image of the tunnel anchor bolt is preprocessed using a block-based adaptive image enhancement algorithm to obtain an image with enhanced details in the anchor bolt region. An anchor bar annotation is performed on the enhanced detail image of the anchor bar region to obtain the original dataset, and a model dataset is constructed based on the original dataset. An improved target detection model is constructed for the tunnel environment. The improved target detection model is then trained and optimized using the model dataset to obtain an anchor bolt number detection model. Based on the anchor bolt quantity detection model, the tunnel anchor bolts are identified and counted in real time, realizing the digital detection of the number of tunnel anchor bolts. The process of acquiring panoramic images of the tunnel arch along the tunnel centerline using an image acquisition device includes: Uniform white light or natural light supplementation can be used as the lighting conditions for image acquisition at the tunnel face. An industrial tablet is fixed to the centerline of the tunnel as the image acquisition device, and the tunnel arch is photographed vertically through the industrial tablet; At each detection point, the industrial tablet automatically acquires three consecutive frames of images of the tunnel arch and selects the optimal frame. The optimal frame is automatically stored according to the section number to obtain a panoramic image of the tunnel anchor bolt; The step of using a block-based adaptive image enhancement algorithm to preprocess the panoramic image of the tunnel anchor bolt to obtain an image with enhanced details in the anchor bolt region includes: The panoramic image of the tunnel anchor bolt is divided into multiple sub-blocks of the same size; An improved Gaussian filtering method is used to estimate the illumination composition of the sub-block. The sub-blocks are subjected to local histogram equalization to adjust the image contrast and obtain a locally equalized image. Combining the illumination components and the local equalization image, the reflection components of the sub-blocks are estimated using the block-based adaptive image enhancement algorithm; Gaussian smoothing is applied to the reflection component to introduce a smoothing constraint, thereby obtaining the enhanced result of the sub-block; The enhancement results are combined to obtain the enhanced detail image of the anchor bolt area; The improved target detection model for tunnel environments includes: To address the target detection requirements in the tunnel environment, the YOLOv11 model was structurally optimized to obtain an optimized YOLOv11 model. The YOLOv11 optimized model is used as the improved target detection model; The structural optimization of the YOLOv11 model includes: A lightweight channel attention module is introduced into the backbone network, a weighted bidirectional feature pyramid network structure is introduced into the neck network, and a small target detection branch is added to the detection head. The step of training and optimizing the improved target detection model using the model dataset to obtain the anchor bar number detection model includes: A model is constructed to improve the training strategy by combining geometric prior constraint loss term, brightness adaptive sample weighting strategy, local occlusion enhancement module and hierarchical loss adaptive weighting strategy. Based on the improved training strategy, the anchor bolt number detection model is obtained by combining the model dataset and the improved target detection model. The model improvement training strategy includes: Based on the distribution law of tunnel anchor bolts, the geometric prior constraint loss term is introduced, and combined with the original detection loss term for joint optimization to form the total loss function; The geometric prior constraint loss term satisfies the following relationship: in, For geometric prior constraint loss terms, This represents the total number of anchor bolts. For the anchor bolt, The constraint weights are for the row direction. The constraint weights are for the column direction. The coordinates of the center point of the detection box. The coordinates of the ideal row and column center lines; The total loss function satisfies the following relationship: in, For the total loss function, For the original detection loss items, For balance coefficient, This is the loss term for geometric prior constraints; The brightness adaptive sample weighting strategy includes calculating the average brightness of each image sample in the model dataset and dynamically adjusting the sample loss weights. The sample loss weights satisfy the following relationship: in, For sample loss weights, This is the brightness adjustment coefficient. The average brightness of the image samples. The maximum brightness value in the training set; Based on the local occlusion enhancement module, a rectangular occlusion mask is randomly generated, and the enhanced image of the anchor bolt area detail is superimposed with the rectangular occlusion mask to generate an enhanced sample; The enhanced samples satisfy the following relationship: in, To enhance the sample, Enhance the image details in the anchor bolt area. This represents a pixel-by-pixel multiplication operation. For rectangular occlusion mask, Fill the image with a background of random brightness; For the small target detection branch, the hierarchical loss adaptive weight strategy is designed to assign loss weights to detection layers of different scales; The loss weights satisfy the following relationship: in, The total loss of the detection head, The step size of the feature map. For the first The loss weights of the scale detection layer For the first The original loss value of the scale detection layer, For the index variable of the scale set, The first in the scale set Each step size value.
2. The method for digitally detecting the number of tunnel anchor bolts according to claim 1, characterized in that, The process of annotating the anchor bolts in the enhanced detail image of the anchor bolt region yields the original dataset. A model dataset is then constructed based on this original dataset, including: The anchors in the enhanced detail image of the anchor region are selected by bounding box and anchor markers are added to generate an XML file containing bounding box coordinates and category information to obtain the original dataset. The original dataset is randomly divided into training, validation, and test sets according to a certain ratio to form the model dataset.
3. The method for digitally detecting the number of tunnel anchor bolts according to claim 1, characterized in that, The method of real-time identification and counting of tunnel anchors based on the anchor quantity detection model to achieve digital detection of the number of tunnel anchors includes: The anchor bolt quantity detection model is deployed on an industrial tablet for real-time detection, automatically marking detection boxes and counting the number of anchor bolts. After the inspection is completed, a digital inspection report of the anchor bolts is generated, including the inspection time, location information, inspection images, and quantity statistics.
4. A digital detection system for the number of tunnel anchor bolts, characterized in that, The system includes an input device, an output device, a processor, and a memory, which are interconnected. The memory stores a computer program, which includes program instructions. The processor is configured to invoke the program instructions to execute the digital detection method for the number of tunnel anchor bolts as described in any one of claims 1-3.
Citation Information
Patent Citations
Small target detection method based on deep learning
CN116612292A
Target detection method and system in dark and dusty environment
CN119904621A
Deep learning target detection and counting optimization method in low-light environment
CN120599197A