A method for identifying rebar in tunnel shield sections based on image and deep learning
By combining image and deep learning technologies with adaptive edge detection and homography transformation, high-precision identification and safe drilling planning of shield tunnel segment reinforcement have been achieved, solving the problems of inaccurate positioning and high safety risks in existing technologies, and realizing rapid and safe identification and drilling of shield tunnel segment reinforcement.
Patent Information
- Application Number
- CN202611245353.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-17
- Publication Date
- 2026-11-17
AI Technical Summary
The positioning accuracy of existing technologies in tunnel segment drilling operations is greatly affected by human factors, resulting in high safety risks. There is a lack of systematic visual perception solutions, and existing non-destructive testing technologies have limitations, making it difficult to achieve rapid identification of tunnel segment reinforcement and safe drilling planning.
Using image-based and deep learning methods, the accurate extraction and repair of tunnel segment contours are achieved through adaptive edge detection and Hough transform. By combining homography transformation, the coordinate mapping relationship between the tunnel segment contours and the CAD design drawings of the reinforcing bars is established, and the distribution of reinforcing bars is visualized. Furthermore, the reliability of borehole obstacle avoidance is improved through safety margin modeling.
It enables rapid identification of steel reinforcement in tunnel lining segments and safe drilling planning, improves detection efficiency, reduces safety risks, and controls the mapping error within the range of 10~15mm, meeting the needs of engineering applications.
Smart Images

Figure CN123118485A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent detection technology in tunnel construction, specifically to a method for identifying steel reinforcement in tunnel shield sections based on image and deep learning. Background Technology
[0002] With the rapid development of urban rail transit and underground space engineering, shield tunneling has been widely used in subway tunnel construction due to its advantages such as high construction efficiency and minimal disturbance to the surrounding environment. Shield tunnels typically use precast concrete segments as the lining structure. During subsequent construction phases such as the installation of electromechanical equipment and the fixing of auxiliary structures, drilling operations are often required on the surface of the segments. Because the internal reinforcement of the segments is highly concealed, has complex arrangements, and diverse types, drilling operations have significant uncertainties. Misdirected drilling or incorrect reinforcement insertion will directly affect the structure's load-bearing capacity, durability, and service life. Localized damage to shield segment components may trigger a redistribution of structural stress, thereby weakening the overall load-bearing capacity of the lining structure. In severe cases, it may even induce progressive failure, adversely affecting the safety of the tunnel structure.
[0003] Currently, in engineering practice, tunnel segment drilling operations mostly rely on a combination of manual experience and rebar scanners, which generally presents the following problems: 1. Positioning accuracy is greatly affected by human factors: Inconsistent manual operation leads to low construction efficiency, and data interpretation depends on the experience of construction personnel. Insufficient lighting and limited operating platform space further reduce drilling accuracy. 2. High safety risks: During construction, manual drilling operations are unstable. When the impact drill bit comes into contact with the rebar, it is very easy to get stuck or cause worker injury. 3. Limitations of existing non-destructive testing technologies: Although ground penetrating radar (GPR) can be used for rebar detection, there is a contradiction between the detection depth and rebar resolution, and the equipment is expensive and complex to operate. Ultrasonic and microwave technologies also have applicability issues. 4. Lack of systematic visual perception solutions: Existing research on rebar recognition based on machine vision focuses on the identification and evaluation of exposed or indirectly detectable rebar, and rarely applies the results of visual perception directly to construction decisions for concealed rebar structures (such as tunnel segments), especially lacking a systematic method for using appearance information for drilling avoidance planning.
[0004] On the other hand, the distribution of reinforcing steel bars inside tunnel segments is usually clearly defined in CAD drawings during the design phase, and this design data contains important prior structural information. If the appearance information of the tunnel segments can be effectively mapped to the CAD data of the reinforcing steel bars based on visual perception, it is hoped that safe planning of borehole locations can be achieved even when the reinforcing steel bars cannot be directly observed. However, visual images and CAD data differ significantly in their representation and coordinate systems, and the mapping process is highly dependent on the accuracy of the tunnel segment outline information. Therefore, this problem is highly complex in practical applications.
[0005] Therefore, there is an urgent need for a method that can integrate visual perception with prior information from steel reinforcement CAD to achieve rapid identification of steel reinforcement in tunnel lining segments and safe drilling planning. Summary of the Invention
[0006] In view of this, the present invention provides a method for identifying rebar in tunnel shield segments based on image and deep learning. It achieves automatic identification of segment type through an improved target detection model, accurate extraction and repair of segment contour through adaptive edge detection and Hough transform, establishes coordinate mapping relationship between segment contour and rebar CAD design drawing through homography transformation to visualize rebar distribution, and improves the reliability of borehole obstacle avoidance through safety margin modeling.
[0007] To achieve the above objectives, the technical solution of the present invention is as follows:
[0008] A method for identifying rebar in tunnel shield sections based on image and deep learning, the key of which includes the following steps:
[0009] Step S1: Construct a rebar recognition system. This system includes an image acquisition module, an image processing module, a tunnel segment recognition module, a contour extraction and repair module, a rebar mapping module, and a borehole planning module. The image acquisition module includes an industrial camera and lighting equipment to acquire images of shield tunnel segments at the tunnel construction site. The image processing module is connected to the image acquisition module and is used to perform distortion correction and contrast enhancement on the acquired images. The tunnel segment recognition module is connected to the image processing module and has a built-in adaptive feature-enhanced target detection model to identify the shield tunnel segment type and output the detection box coordinates. The contour extraction and repair module is connected to the tunnel segment recognition module and is used to extract the tunnel segment contour and repair any missing contours. The rebar mapping module is connected to the contour extraction and repair module and has a built-in rebar CAD design database corresponding to the tunnel segment type, used to map the rebar distribution to the image coordinate system through homography transformation.
[0010] Step S2, Image Acquisition and Distortion Correction: An industrial camera is used to acquire images of shield tunnel segments at the tunnel construction site. The industrial camera is calibrated based on a planar calibration plate to obtain the intrinsic parameter matrix and lens distortion parameters of the industrial camera. Radial and tangential distortion corrections are performed on the original image using inverse mapping to obtain geometrically corrected segment images.
[0011] Step S3, Shield tunnel segment type identification: The corrected image is input into the target detection model after adaptive feature enhancement for segment type identification. The target detection model embeds an adaptive feature enhancement module in the feature extraction layer of the YOLO network. The adaptive feature enhancement module includes a spatial context module and a feature refinement module. The spatial context module and the feature refinement module are used to enhance spatial context information and perform dynamic reweighting of channel features, respectively, and output the segment type identification result and the detection box coordinates.
[0012] Step S4, Region of Interest Extraction and Contour Detection: Establish a scoring function, the formula is as follows,
[0013]
[0014] Among them, B i For the i-th detection box, w i For the detection frame width, h i For height, c i For confidence level, d i R is the Euclidean distance from the center of the detection box to the center of the image, A̅ is the radius of the central region, α, β, and γ are weighting coefficients; the detection box with the highest score is selected as the central tube segment based on the detection box coordinates and the scoring function, and its boundary is expanded outward by a specified ratio to obtain the complete region of interest; the adaptive Canny edge detection algorithm is used to extract the edge of the tube segment from the image of the region of interest to obtain the initial contour of the tube segment.
[0015] Step S5, Segment contour repair: The initial contour is detected by probabilistic Hough transform, the straight segments are clustered and least squares fitted according to the direction angle, and the complete segment contour is reconstructed by calculating the intersection points of the straight lines and approximating the convex hull polygon.
[0016] Step S6, Reinforcing bar CAD data mapping: Based on the identified segment type, call the corresponding reinforcing bar CAD design drawing, establish the mapping relationship between CAD drawing coordinates and image coordinates through homography transformation, and project the reinforcing bar distribution onto the image coordinate system in combination with lens distortion correction parameters;
[0017] Step S7, Safety Margin Modeling and Rebar Distribution Output: Morphological expansion is performed on the mapped rebar projection area to convert potential mapping errors into safety redundancy, and the rebar distribution visualization result containing safety margin is output.
[0018] The aforementioned structure utilizes a non-contact vision solution to replace manual point-by-point detection, enabling rebar identification without physical contact with tunnel segments, reducing operational risks and improving inspection efficiency. Through target detection and localization combined with defect contour repair, it can adapt to scenarios with damaged tunnel segment boundaries and complex environments, stably outputting complete segment contours. By integrating segment type recognition with CAD rebar design data, it achieves visualization of the location of invisible rebar within the segment through coordinate mapping. Morphological expansion is used to construct a safety margin, offsetting the error risks of coordinate mapping, and the output results can be directly used as a basis for drilling avoidance construction.
[0019] Preferably, in step S3, the spatial context module expands the receptive field by dilated convolution to obtain multi-scale spatial context information and weights spatial features through an attention mechanism; the feature refinement module dynamically reweights the features in the channel dimension and maps and compresses the features through convolutional embedding layers to strengthen key features and suppress redundant information; after the adaptive feature enhancement module is embedded into the C3K2 module of the YOLO network, it adaptively enhances the feature layers at the three scales of P3, P4, and P5, while improving the expressive power of shallow detail features and deep semantic features.
[0020] Preferably, in step S4, the adaptive Canny edge detection algorithm is as follows: first, contrast-limited adaptive histogram equalization is performed on the region of interest image to enhance contrast, and bilateral filtering is used to remove noise; in the gradient calculation stage, a multi-scale Sobel operator is used to calculate the gradient magnitude, wherein the multi-scale Sobel operator is a combination of 3×3 and 5×5 scale Sobel operators to enhance the sensitivity to edges at different scales; based on the statistical characteristics of the gradient image, the dual thresholds of the Canny algorithm are automatically calculated: the high threshold is taken as a specified multiple of the gradient mean plus the standard deviation, and the low threshold is taken as a specified proportion of the high threshold;
[0021] After edge detection is completed, morphological dilation and erosion operations are used to improve edge quality. Broken edges are connected based on gradient direction similarity and spatial proximity. Isolated edge segments with lengths below a preset threshold are removed. The contour with the largest perimeter is extracted and polygon approximation is performed using the Douglas-Peucker algorithm.
[0022] As a preferred method: In step S5, the probabilistic Hough transform is used to accumulate the voting values of edge points in the parameter space, and an adaptive detection threshold is set to extract a set of line segments; line segments with a length greater than 15% of the minimum image size are retained, and clustered according to the direction angle. Line segments with an angle difference of less than 10° are grouped together, and each group is fitted into a straight line using the least squares method; straight lines in the horizontal and vertical directions are selected to construct the contour, and diagonal line segments are introduced to supplement the number of straight lines when the number of straight lines is insufficient; corner points are obtained by calculating the intersection of straight lines, and the complete quadrilateral contour is reconstructed by combining the convex hull algorithm and the polygon approximation method.
[0023] Preferably, in step S6, the homography transformation process is as follows: Let the coordinates of the steel reinforcement CAD design drawing be (x, y), and the corresponding coordinates of the captured image be (u, v). The two satisfy the homography transformation relationship:
[0024]
[0025] Where H is a 3×3 homography matrix, (u',v',w') are homogeneous coordinates, and the final image coordinates are (u,v) = (u' / w', v' / w'). By combining homography transformation with lens distortion correction parameters, a complete coordinate mapping model from the steel reinforcement CAD drawing to the captured image is established, realizing the accurate projection of the steel reinforcement distribution in the image coordinate system.
[0026] Preferably, in step S7, a morphological expansion operation is performed on the mapped steel bar lines. The expansion radius is determined according to the statistical distribution of the steel bar mapping error, and the potential spatial positioning error is equivalently mapped to geometric safety redundancy. The area outside the expanded steel bar area is a safe drilling area, and the boundary of the expanded steel bar is used as an avoidance constraint when planning the drilling position.
[0027] Preferably, the industrial camera in the image acquisition module has a resolution of not less than 1920×1080 pixels, and the industrial camera uses a wide-angle lens with a field of view covering the entire area of a single tube segment.
[0028] Preferably, the target detection model in the segment identification module has no more than 20M parameters, an inference speed of no less than 200FPS, and the identification categories include three segment types: A-type standard block, B-type adjacent block, and K-type wedge block.
[0029] Preferably, the rebar mapping position error of the rebar mapping module is no more than 15mm, and the expansion radius of the safety margin model is 10~20mm.
[0030] Preferably, the rebar recognition system also includes a control system, which includes a signal acquisition module, a motion control module, and a data processing module. The signal acquisition module is used to control the image acquisition parameters of the industrial camera, the motion control module is used to drive the motion positioning of the camera gimbal, and the data processing module is used to perform the entire process of image distortion correction, segment recognition, contour repair, rebar mapping, and borehole planning.
[0031] Compared with the prior art, the beneficial effects of the present invention are:
[0032] The image-based and deep learning-based rebar identification method for tunnel shield segments provided by this invention enables rapid identification of rebar distribution without physical contact with the segments, significantly improving detection efficiency and reducing safety risks. By embedding an AFE adaptive feature enhancement module into YOLO, high-precision real-time identification of three types of shield segments (A, B, and K) is achieved, with a Recall of 0.816, an F1-Score of 0.830, a mAP@0.5 score of 0.929, and an inference speed of 215 FPS. Addressing the common problem of segment boundary defects in tunnel environments, a contour repair method based on Hough transform and geometric constraints is proposed, exhibiting strong robustness to different segment types and defect forms. Through homography transformation combined with distortion correction, accurate mapping from rebar CAD data to visual images is achieved, with mapping errors mainly controlled within the range of 10-15 mm, meeting engineering application requirements. Morphological dilatation modeling with a safety margin effectively reduces the risk of rebar misjudgment due to mapping deviations, and field drilling verification shows that all boreholes successfully avoided rebar areas. Attached Figure Description
[0033] Figure 1 The flowchart shows a method for identifying rebar in tunnel shield sections based on image and deep learning.
[0034] Figure 2 A diagram of the AFE-YOLO segment recognition model architecture;
[0035] Figure 3 The diagram shows the process of extracting and repairing the tunnel segment outline, where (a) is the original tunnel segment image (with boundary defects), (b) is the adaptive Canny edge detection result, (c) is the Hough transform line detection result, (d) is the repaired complete outline, and (e)~(g) are the repair effects of three tunnel segment types A, B, and K, respectively.
[0036] Figure 4 This is a schematic diagram of the principle of CAD data mapping for reinforcing bars based on homography transformation, where (a) is the CAD design drawing of reinforcing bars, (b) is the homography transformation mapping process, and (c) is the mapping result and safety margin.
[0037] Figure 5 The mapping results for three types of shield tunnel segments and reinforcement identification are shown, where (a) is type A segment (standard block / rectangle), (b) is type B segment (adjacent block / right trapezoid), and (c) is type K segment (wedge block / isosceles trapezoid). Detailed Implementation
[0038] The present invention will be further described below with reference to the embodiments and accompanying drawings.
[0039] A method for identifying rebar in tunnel shield sections based on image and deep learning includes the following steps:
[0040] Step S1: Construct a rebar recognition system. This system includes an image acquisition module, an image processing module, a tunnel segment recognition module, a contour extraction and repair module, a rebar mapping module, and a borehole planning module. The image acquisition module includes an industrial camera and lighting equipment to acquire images of shield tunnel segments at the tunnel construction site. In this embodiment, the industrial camera has a resolution of no less than 1920×1080 pixels and uses a wide-angle lens, with a field of view covering the entire area of a single tunnel segment. The image processing module is connected to the image acquisition module and is used to perform distortion correction and contrast enhancement on the acquired images. The tunnel segment recognition module is connected to the image processing module and has a built-in adaptive feature-enhanced target detection model to identify the shield tunnel segment type and output the detection box coordinates. The target detection model has no more than 20M parameters, an inference speed of no less than 200FPS, and recognizes three tunnel segment types: Type A standard blocks, Type B adjacent blocks, and Type K wedge blocks. The contour extraction and repair module is connected to the tunnel segment recognition module and is used to extract the tunnel segment contour and repair any missing contours. The rebar mapping module is connected to the contour extraction and repair module, and has a built-in CAD design database of rebars corresponding to the segment types. It is used to map the rebar distribution to the image coordinate system through homography transformation. In this embodiment, the rebar mapping position error is no greater than 15mm. The rebar recognition system also includes a control system, which includes a signal acquisition module, a motion control module, and a data processing module. The signal acquisition module controls the image acquisition parameters of the industrial camera, the motion control module drives the camera gimbal's motion positioning, and the data processing module performs the entire process of image distortion correction, segment recognition, contour repair, rebar mapping, and borehole planning.
[0041] Step S2, Image Acquisition and Distortion Correction: An industrial camera is used to acquire images of the tunnel lining segments at the tunnel construction site. The industrial camera is calibrated using a planar calibration plate to obtain its intrinsic parameter matrix and lens distortion parameters. Inverse mapping is then used to correct radial and tangential distortion in the original image, resulting in a geometrically corrected image of the segment. Because wide-angle lenses are prone to radial and tangential distortion under close-range imaging conditions, straight lines in the image become bent, causing geometric distortion and affecting the accuracy of rebar position estimation and hole location measurement. Therefore, in the image preprocessing stage, a camera calibration method based on a planar calibration plate is used. Images of the calibration plate are acquired from multiple perspectives to estimate the camera's intrinsic parameter matrix and lens distortion parameters, and inverse mapping is used to correct the original image. After distortion correction, the geometric structure of the image is effectively restored, providing more accurate visual input for subsequent segment detection, edge extraction, and contour reconstruction.
[0042] Step S3, Shield Tunnel Segment Type Identification: Shield tunnel segments are divided into three types: Type A standard blocks are rectangular, Type B adjacent blocks are right-angled trapezoids, and Type K wedge blocks are isosceles trapezoids. The corrected image is input into the adaptive feature enhancement target detection model (AFE-YOLO) for segment type identification. The target detection model embeds an adaptive feature enhancement module in the feature extraction layer of the YOLO network. The adaptive feature enhancement module (AFE) includes a spatial context module (SCM) and a feature refinement module (FRM). The spatial context module and the feature refinement module are used to enhance spatial context information and dynamically reweight channel features, respectively, outputting the segment type identification result and the detection box coordinates. Specifically, the SCM expands the receptive field through dilated convolutions to obtain multi-scale spatial context information and enhances the ability to acquire spatial context information by weighting spatial features through an attention mechanism. The FRM dynamically reweights channel features and maps and compresses features through convolutional embedding layers, strengthening key features and suppressing redundant information. The convolutional embedding (CE) within the module uses 1×1 convolutions to map and compress features, reducing computational complexity while preserving key semantic information. Embedding the AFE module into YOLO's C3K2 module enables adaptive enhancement of multi-scale features such as P3, P4, and P5, while simultaneously improving the expressive power of shallow detail features and deep semantic features, thereby enhancing the localization accuracy and classification performance of object detection.
[0043] Step S4, Region of Interest Extraction and Contour Detection: Establish a scoring function, the formula is as follows,
[0044] (1)
[0045] In equation (1), B i For the i-th detection box, w i For the detection frame width, h i For height, c i For confidence level, d i R is the Euclidean distance from the center of the detection box to the center of the image, R is the radius of the central region, A̅ is the average area of all detection boxes, and α, β, and γ are weighting coefficients, where α = 0.4, β = 0.4, and γ = 0.2.
[0046] To address the issue of multiple tunnel segments coexisting in panoramic tunnel images, a target detection model is first used to obtain the bounding boxes for all shield tunnel segments in the image. Based on the center position, width, height, and confidence score of the bounding boxes, a scoring function S(Bi) is designed to automatically select the segment at the center of the image. The bounding box Bc with the highest score is selected as the center segment based on the bounding box coordinates and the scoring function, and its boundary is expanded outward by a specified proportion to obtain the complete region of interest, i.e., the ROI region.
[0047] (2)
[0048] Where, x c y c Let w be the coordinates of the center of the detection box. c h is the width of the central segment detection frame. c The height of the central segment inspection frame is δ = 0.08 × max(w c ,h c The value represents the boundary expansion amount, ensuring that the edge of the tunnel segment is completely contained within the Region of Interest (ROI). An adaptive Canny edge detection algorithm is used to extract the edges of the tunnel segments from the ROI image, obtaining the initial contour of the tunnel segments.
[0049] The adaptive Canny edge detection algorithm is as follows: First, contrast-limited adaptive histogram equalization (CLAHE) is applied to the region of interest image to enhance contrast, followed by bilateral filtering to remove noise. In the gradient calculation stage, the multi-scale Sobel operator is used to calculate the gradient magnitude, as shown in the following formula:
[0050] (3)
[0051] The multi-scale Sobel operator is a combination of 3×3 and 5×5 scale Sobel operators, where S represents the Sobel operator. Specifically, S3 and S5 represent the gradients calculated by the 3×3 and 5×5 Sobel operators, respectively. This design enhances the algorithm's sensitivity to edges at different scales. Based on the statistical characteristics of the gradient image, the Canny algorithm automatically calculates two thresholds: the high threshold is a specified multiple of the gradient mean plus the standard deviation, and the low threshold is a specified proportion of the high threshold.
[0052] (4)
[0053] (5)
[0054] Where μ and σ are the mean and standard deviation of the gradient magnitude, respectively.
[0055] After edge detection, morphological dilation and erosion operations are used to improve edge quality. Broken edges are connected based on gradient direction similarity (angle difference < 15°) and spatial proximity (distance < 10 pixels). Isolated edge segments with a length less than a preset threshold are removed, i.e., isolated edge segments with a length less than 20 pixels. The contour with the largest perimeter is extracted as the main contour, and the Douglas-Peucker algorithm is applied for polygon approximation.
[0056] Step S5, Segment Contour Repair: Addressing the issue of missing edges in the shield tunnel segment contour, the initial contour is repaired using a probabilistic Hough transform to detect straight line segments. These segments are then clustered and fitted using their orientation angles. The complete segment contour is then reconstructed approximately using line intersection points and convex hull polygons. Specifically, for the input binary contour image I(x,y)∈{0,1}, the probabilistic Hough transform is used to accumulate the voting values of edge points in the parameter space (ρ,θ).
[0057] (6)
[0058] Where δ(·) is the Dirac function, and line segments satisfying H(ρ,θ)>Th are extracted. An adaptive threshold adjustment strategy is used to extract the set of line segments.
[0059] (7)
[0060] Among them, T h To determine the detection threshold, the set of detected line segments is denoted as L={li}. Line segments with a length greater than 15% of the minimum image size are retained, i.e., line segments with a length satisfying len_i>0.15×min(W,H). Clustering is performed based on direction angle, grouping line segments with an angle difference less than 10° together. Each group is fitted to a straight line using the least squares method. Horizontal and vertical lines are prioritized for contour construction. When the number of lines is insufficient, diagonal line segments are introduced to supplement them. Corner points are obtained by calculating the intersection points of lines, and the complete quadrilateral contour is reconstructed using a combination of convex hull algorithm and polygon approximation method.
[0061] Step S6, Reinforcing Steel CAD Data Mapping: Based on the identified segment type, the corresponding reinforcing steel CAD design drawing is retrieved. There is a planar perspective transformation relationship between the reinforcing steel CAD drawing and the actual image. A mapping relationship between the CAD drawing coordinates and the image coordinates is established through homography transformation. The homography transformation process is as follows: Let the coordinates of the reinforcing steel distribution map be (x, y), and the corresponding captured image coordinates be (u, v). Both satisfy the homography transformation relationship:
[0062] (8)
[0063] Where H=[h ij The image is a 3×3 homography matrix, where (u', v', w') are homogeneous coordinates, and the final image coordinates are (u, v) = (u' / w', v' / w'). By combining lens distortion correction parameters, the rebar distribution is projected onto the image coordinate system. By integrating homography transformation with lens distortion correction parameters, a complete coordinate mapping model from the rebar CAD drawing to the captured image is established, achieving accurate projection of the rebar distribution into the image coordinate system. The complete coordinate mapping model from the rebar distribution map to the captured image is as follows:
[0064] (9)
[0065] in, Represents the homography transformation matrix. This represents the camera distortion coefficient.
[0066] Step S7, Safety Margin Modeling and Rebar Distribution Output: To address the comprehensive mapping errors (including camera calibration errors, segment attitude deviations, and local non-planarity) that may arise between the rebar CAD drawings and actual photographed images during homography transformation and lens distortion correction, a safety margin modeling method based on morphological dilation is introduced to morphologically dilate the mapped rebar projection area. This method converts potential mapping errors into safety redundancy by dilating the rebar lines at an appropriate scale. Specifically, the mapped rebar lines undergo morphological dilation, with the dilation radius determined based on the statistical distribution of rebar mapping errors. The dilation radius for safety margin modeling is 10-20 mm, effectively mapping potential spatial positioning errors into geometric safety redundancy. The area outside the dilated rebar region is designated as a safe drilling area, and the dilated rebar boundary is used as an obstacle avoidance constraint during drilling location planning. In subsequent drilling location planning and obstacle avoidance decisions, this conservative constraint reduces the risk of rebar misjudgment due to mapping deviations, improving the overall robustness and safety of the system. The final output is a visualized rebar distribution result containing the safety margin, providing a basis for drilling location planning.
[0067] Based on this, the advantages of this method are as follows:
[0068] 1. Non-contact rapid identification: Using machine vision and deep learning methods, the distribution of steel bars can be quickly identified without physical contact with the pipe segments, which greatly improves detection efficiency and reduces safety risks.
[0069] 2. High-precision tunnel segment type identification: By embedding the AFE adaptive feature enhancement module in YOLO, high-precision real-time identification of three types of shield tunnel segments (A, B, and K) is achieved, with a Recall of 0.816, an F1-Score of 0.830, an mAP@0.5 score of 0.929, and an inference speed of 215 FPS.
[0070] 3. Robust contour repair capability: To address the common problem of segment boundary defects in tunnel environments, a contour repair method based on Hough transform and geometric constraints is proposed, which has strong robustness to different types of segments and different defect forms.
[0071] 4. High-precision rebar mapping: Through homography transformation combined with distortion correction, accurate mapping of rebar CAD data to visual images is achieved. The mapping error is mainly controlled within the range of 10~15mm, meeting the needs of engineering applications.
[0072] 5. Safety margin assurance: By using morphological expansion modeling to ensure safety margin, the risk of misjudging rebar due to mapping deviation is effectively reduced. On-site drilling verification shows that all boreholes successfully avoided the rebar area.
[0073] The following will provide specific implementation examples based on three typical shield tunnel segment construction scenarios and comparative experimental data.
[0074] Example 1: Reinforcement Identification and Drilling Planning for Type A Segment (Standard Block)
[0075] The object being tested in this embodiment is a type A shield tunnel segment (standard block) of a subway tunnel section, with a rectangular shape. The segment dimensions are: width 1500mm and height 1200mm. The internal reinforcement of the segment is arranged in an orthogonal grid, with longitudinal reinforcement spacing of 150mm and transverse reinforcement spacing of 200mm. The coaxiality tolerance requires that the distance from the borehole center to the edge of the reinforcement be no less than 20mm. Image acquisition is performed using an MV-EB435i industrial camera with a resolution of 1920×1080, mounted on a tunnel construction trolley, at a shooting distance of approximately 1.5m.
[0076] Step S1: Camera calibration is performed using a checkerboard calibration board to obtain the intrinsic parameter matrix and distortion coefficients. Distortion correction is then applied to the acquired images, effectively restoring the linear structures within the images.
[0077] Step S2: Input the corrected image into the AFE-YOLO model. The model outputs the detection result of type A pipe segment with a confidence level of 0.95 and the detection box covers the main area of the pipe segment.
[0078] Step S3: Select the central tube segment based on the scoring function, and expand the boundary by 8% to obtain the ROI. After performing CLAHE enhancement and bilateral filtering on the ROI image, adaptive Canny edge detection is used to extract the tube segment edges to obtain the initial contour.
[0079] Step S4: Due to a local defect on the left boundary of the segment, Hough transform was used for contour repair. Four main straight lines (upper, lower, left, and right boundaries) were detected. The defective part on the left boundary was completed by extending the straight line, resulting in a continuous and complete contour after repair.
[0080] Step S5: Call the CAD design drawing of the reinforcing steel corresponding to the type A segment and establish coordinate mapping through homography transformation.
[0081] Step S6: Perform morphological expansion on the mapped reinforcement (expansion radius 15mm) to generate a reinforcement distribution map including safety margins. Plan the drilling locations within the safety area and output the coordinates of 5 drilling holes.
[0082] Experimental results: The error in the position of the rebar mapping was 12mm~16mm, with an average of 16mm. Field drilling verification showed that all 5 holes successfully avoided the rebar, and the distance from the center of the hole to the nearest rebar was 12~19mm.
[0083] Example 2: Reinforcement Identification and Drilling Planning for Type B Segment (Adjacent Block)
[0084] The object being tested in this embodiment is a type B shield tunnel segment (adjacent block) in a subway tunnel section. It is a right-angled trapezoid with an upper base width of 1200mm, a lower base width of 1500mm, and a height of 1200mm. The spacing of the internal reinforcing bars is the same as that of the type A segment.
[0085] Step S1 is the same as in Example 1.
[0086] Step S2: The AFE-YOLO model outputs the detection results of the B-type tube segment with a confidence level of 0.91.
[0087] Step S3 is the same as in Example 1.
[0088] Step S4: The upper and right boundaries of the B-type segment are missing. Three main straight lines (lower boundary, left boundary, and upper boundary extension) are detected using Hough transform. The missing corner points are recovered by calculating the intersection points of these lines, and the complete outline is reconstructed after polygon approximation.
[0089] Steps S5-S6 are the same as in Example 1, where the CAD drawing of the B-type segment is called for mapping.
[0090] Experimental results: The error in the position of the rebar mapping was 11mm~18mm, with an average of 15.25mm. Field drilling verification showed that all four boreholes successfully avoided the rebar, and the distance from the borehole center to the nearest rebar was 14~18mm.
[0091] Example 3: Reinforcement Identification and Drilling Planning for K-Type Segment (Wedge Block)
[0092] The object under test in this embodiment is a K-type shield tunnel segment (wedge-shaped block) in a subway tunnel section. It is an isosceles trapezoid with an upper base width of 1100mm, a lower base width of 1500mm, and a height of 1200mm. The internal steel bars of the segment are arranged at non-equidistant intervals according to the trapezoidal shape.
[0093] Step S1 is the same as in Example 1.
[0094] Step S2: The AFE-YOLO model outputs the detection results of the K-type tube segment with a confidence level of 0.88.
[0095] Step S3 is the same as in Example 1.
[0096] Step S4: The left and upper boundaries and key corner points of the K-type tube segment are severely damaged. Two main straight lines (lower and right boundaries) were detected using Hough transform. The left and upper boundaries were supplemented by diagonal line segments. The complete isosceles trapezoidal contour was reconstructed by combining the convex hull algorithm.
[0097] Steps S5-S6 are the same as in Example 1, where the K-type segment CAD drawing is called for mapping.
[0098] Experimental results: The error in the position of the rebar mapping was 10mm~19mm, with an average of 15.75mm. Field drilling verification showed that all four boreholes successfully avoided the rebar, and the distance from the borehole center to the nearest rebar was 11~19mm.
[0099] Example 4: Performance Comparison of Different Detection Models
[0100] To verify the superiority of the AFE-YOLO model, comparative experiments were conducted on the same dataset (2432 images of tunnel boring machine segments, divided into training / validation / test sets in an 8:1:1 ratio) and the same hardware platform (AMD Ryzen 9 7945HX, RTX 4060 Laptop GPU). The dataset includes three classes of tunnel segments: A, B, and K, covering various lighting conditions, shooting distances, and viewing angles. The comparison results are shown in Table 1 below:
[0101] Table 1 Performance Comparison of Different Detection Models
[0102] Model Recall Precision F1-Score mAP@0.5 mAP@0.5:0.95 Number of parameters (M) FPS YOLOv8 0.744 0.820 0.791 0.820 0.568 29.42 136 YOLOv9 0.751 0.826 0.797 0.813 0.593 66.71 121 YOLOv11 0.762 0.847 0.801 0.901 0.601 43.64 194 SSD 0.706 0.753 0.726 0.843 0.518 56.85 69 RetinaNet 0.797 0.835 0.812 0.894 0.597 94.52 51 Faster R-CNN 0.794 0.849 0.807 0.892 0.584 152.69 16 AFE-YOLO 0.816 0.850 0.830 0.929 0.609 18.52 215
[0103] The results show that AFE-YOLO outperforms all comparison models in terms of Recall (0.816), F1-Score (0.830), and mAP@0.5 (0.929), while having the lowest number of parameters (18.52M) and the fastest inference speed (215 FPS). Five-fold cross-validation further confirms the model's stability and robustness.
[0104] Example 5: Comprehensive Mapping Error Statistics for Three Segment Types
[0105] Four sets of drilling verification experiments were conducted on each of the three types of tunnel segments (A, B, and K), and the distance from the borehole center to the nearest reinforcing bar was recorded. The statistical results are shown in Table 2 below:
[0106] Table 2. Statistical Table of Mapping Errors for Three Types of Pipe Segments
[0107] Experiment number Type A segment (mm) Type B segment (mm) K-type segment (mm) 1 15 18 11 2 12 14 16 3 19 13 17 4 18 16 19 mean 16 15.25 15.75
[0108] The results show that all boreholes successfully avoided the rebar area, and the distance from the borehole center to the nearest rebar was greater than 10mm, meeting the construction safety requirements. The rebar mapping error was mainly distributed in the range of 10~15mm, and the mapping error could be effectively covered by setting a safety margin expansion radius of 15mm.
[0109] In summary, each core component of the technical solution of this invention is specifically designed to address the particular working conditions and technical challenges of tunnel construction. The fusion of target detection technology with prior CAD data of reinforcing steel bars for the indirect identification of concealed reinforcing steel bars in shield tunnel segments solves the problem of aligning visual coordinates with CAD coordinates. The introduction of the adaptive feature enhancement module is a targeted design to address the impact of special factors such as dust and lighting changes in the tunnel environment on segment identification; the collaborative working mechanism of its spatial context module and feature refinement module requires in-depth feature engineering analysis. Furthermore, segment contour restoration is elevated from an image post-processing step to a geometrically solvable recovery method. This shift in understanding means that contour restoration is no longer simply edge completion, but a crucial step in ensuring the accuracy of subsequent homography transformation.
[0110] Finally, it should be noted that the above description is merely a preferred embodiment of the present invention. Those skilled in the art, under the guidance of the present invention, can make various similar representations without departing from the spirit and claims of the present invention, and such modifications all fall within the protection scope of the present invention.
Claims
1. A method for identifying reinforcing bars in tunnel shield sections based on image and deep learning, characterized in that, Includes the following steps: Step S1: Construct a rebar recognition system. This system includes an image acquisition module, an image processing module, a tunnel segment recognition module, a contour extraction and repair module, a rebar mapping module, and a borehole planning module. The image acquisition module includes an industrial camera and lighting equipment to acquire images of shield tunnel segments at the tunnel construction site. The image processing module is connected to the image acquisition module and is used to perform distortion correction and contrast enhancement on the acquired images. The tunnel segment recognition module is connected to the image processing module and has a built-in adaptive feature-enhanced target detection model to identify the shield tunnel segment type and output the detection box coordinates. The contour extraction and repair module is connected to the tunnel segment recognition module and is used to extract the tunnel segment contour and repair any missing contours. The rebar mapping module is connected to the contour extraction and repair module and has a built-in rebar CAD design database corresponding to the tunnel segment type, used to map the rebar distribution to the image coordinate system through homography transformation. Step S2, Image Acquisition and Distortion Correction: An industrial camera is used to acquire images of shield tunnel segments at the tunnel construction site. The industrial camera is calibrated based on a planar calibration plate to obtain the intrinsic parameter matrix and lens distortion parameters of the industrial camera. Radial and tangential distortion corrections are performed on the original image using inverse mapping to obtain geometrically corrected segment images. Step S3, Shield tunnel segment type identification: The corrected image is input into the target detection model after adaptive feature enhancement for segment type identification. The target detection model embeds an adaptive feature enhancement module in the feature extraction layer of the YOLO network. The adaptive feature enhancement module includes a spatial context module and a feature refinement module. The spatial context module and the feature refinement module are used to enhance spatial context information and perform dynamic reweighting of channel features, respectively, and output the segment type identification result and the detection box coordinates. Step S4, Region of Interest Extraction and Contour Detection: Establish a scoring function, the formula is as follows, Among them, B i For the i-th detection box, w i For the detection frame width, h i For height, c i For confidence level, d i R is the Euclidean distance from the center of the detection box to the center of the image, A̅ is the radius of the central region, α, β, and γ are weighting coefficients; the detection box with the highest score is selected as the central tube segment based on the detection box coordinates and the scoring function, and its boundary is expanded outward by a specified ratio to obtain the complete region of interest; the adaptive Canny edge detection algorithm is used to extract the edge of the tube segment from the image of the region of interest to obtain the initial contour of the tube segment. Step S5, Segment contour repair: The initial contour is detected by probabilistic Hough transform, the straight segments are clustered and least squares fitted according to the direction angle, and the complete segment contour is reconstructed by calculating the intersection points of the straight lines and approximating the convex hull polygon. Step S6, Reinforcing bar CAD data mapping: Based on the identified segment type, call the corresponding reinforcing bar CAD design drawing, establish the mapping relationship between CAD drawing coordinates and image coordinates through homography transformation, and project the reinforcing bar distribution onto the image coordinate system in combination with lens distortion correction parameters; Step S7, Safety Margin Modeling and Rebar Distribution Output: Morphological expansion is performed on the mapped rebar projection area to convert potential mapping errors into safety redundancy, and the rebar distribution visualization result containing safety margin is output.
2. The method for identifying rebar in tunnel shield sections based on image and deep learning according to claim 1, characterized in that: In step S3, the spatial context module expands the receptive field through dilated convolution to obtain multi-scale spatial context information and weights spatial features through an attention mechanism; the feature refinement module dynamically reweights the features in the channel dimension and maps and compresses the features through convolutional embedding layers to enhance key features and suppress redundant information; the adaptive feature enhancement module, after embedding the C3K2 module of the YOLO network, adaptively enhances the feature layers at the P3, P4, and P5 scales, while improving the expressive power of shallow detail features and deep semantic features.
3. The method for identifying rebar in tunnel shield sections based on image and deep learning according to claim 1, characterized in that: In step S4, the adaptive Canny edge detection algorithm is as follows: first, contrast-limited adaptive histogram equalization is performed on the region of interest image to enhance contrast, and bilateral filtering is used to remove noise. In the gradient calculation stage, the gradient magnitude is calculated using a multi-scale Sobel operator, which is a combination of 3×3 and 5×5 scale Sobel operators to enhance the sensitivity to edges at different scales. Based on the statistical characteristics of the gradient image, the dual thresholds of the Canny algorithm are automatically calculated: the high threshold is taken as a specified multiple of the gradient mean plus the standard deviation, and the low threshold is taken as a specified proportion of the high threshold. After edge detection is completed, morphological dilation and erosion operations are used to improve edge quality. Broken edges are connected based on gradient direction similarity and spatial proximity. Isolated edge segments with lengths below a preset threshold are removed. The contour with the largest perimeter is extracted and polygon approximation is performed using the Douglas-Peucker algorithm.
4. The method for identifying rebar in tunnel shield sections based on image and deep learning according to claim 1, characterized in that: In step S5, the probabilistic Hough transform is used to accumulate the voting values of edge points in the parameter space, and an adaptive detection threshold is set to extract the set of line segments; Line segments with a length greater than 15% of the minimum image size are retained and clustered according to their direction angles. Line segments with an angle difference of less than 10° are grouped together, and each group is fitted to a straight line using the least squares method. Straight lines in the horizontal and vertical directions are selected to construct the contour. When the number of straight lines is insufficient, diagonal line segments are introduced to supplement them. Corner points are obtained by calculating the intersection of straight lines, and the complete quadrilateral contour is reconstructed by combining the convex hull algorithm and polygon approximation method.
5. The method for identifying rebar in tunnel shield sections based on image and deep learning according to claim 1, characterized in that: In step S6, the homography transformation process is as follows: Let the coordinates of the steel reinforcement CAD design drawing be (x, y), and the corresponding coordinates of the captured image be (u, v). The two satisfy the homography transformation relationship: Where H is a 3×3 homography matrix, (u',v',w') are homogeneous coordinates, and the final image coordinates are (u,v) = (u' / w',v' / w'). By combining homography transformation with lens distortion correction parameters, a complete coordinate mapping model from the steel reinforcement CAD drawing to the captured image is established, realizing the accurate projection of the steel reinforcement distribution in the image coordinate system.
6. The method for identifying rebar in tunnel shield sections based on image and deep learning according to claim 1, characterized in that: In step S7, a morphological expansion operation is performed on the mapped steel bar lines. The expansion radius is determined according to the statistical distribution of the steel bar mapping error, and the potential spatial positioning error is equivalently mapped to geometric safety redundancy. The area outside the expanded steel bar area is a safe drilling area, and the boundary of the expanded steel bar is used as an avoidance constraint when planning the drilling position.
7. The method for identifying rebar in tunnel shield sections based on image and deep learning according to claim 1, characterized in that: The industrial camera in the image acquisition module has a resolution of no less than 1920×1080 pixels and uses a wide-angle lens, with a field of view covering the entire area of a single tube segment.
8. The method for identifying rebar in tunnel shield sections based on image and deep learning according to claim 1, characterized in that: The target detection model in the segment identification module has no more than 20M parameters, an inference speed of no less than 200FPS, and the identification categories include three segment types: A-type standard block, B-type adjacent block, and K-type wedge block.
9. The method for identifying rebar in tunnel shield sections based on image and deep learning according to claim 1, characterized in that: The rebar mapping position error of the rebar mapping module is no more than 15mm, and the expansion radius of the safety margin model is 10~20mm.
10. The method for identifying rebar in tunnel shield sections based on image and deep learning according to claim 1, characterized in that: The rebar recognition system also includes a control system, which comprises a signal acquisition module, a motion control module, and a data processing module. The signal acquisition module is used to control the image acquisition parameters of the industrial camera, the motion control module is used to drive the motion positioning of the camera gimbal, and the data processing module is used to perform the entire process of image distortion correction, segment recognition, contour repair, rebar mapping, and borehole planning.
