A tunnel defect recognition method and system based on a YOLO-Canny collaborative algorithm
Patent Information
- Application Number
- CN202610586755.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-29
- Publication Date
- 2026-08-28
AI Technical Summary
[0005]本申请提供一种基于YOLO-Canny协同算法的隧洞缺陷识别方法及系统,以至少解决现有方法存在人工检测效率低、YOLO算法边界定位精度不足、Canny算法无法自动识别缺陷类别且计算量大的技术问题
本申请提出了一种基于YOLO-Canny协同算法的隧洞缺陷识别方法及系统,所述方法包括:获取隧洞内部的结构图像;将所述图像输入至优化后的YOLO算法,输出目标缺陷的类别及边界框位置;根据所述边界框位置裁剪出目标区域,并将裁剪出的目标区域输入至改进的Canny边缘检测算法提取目标区域的边缘特征图;将化后的YOLO算法输出的包含边界框和类别标签的图像作为目标特征图,并将所述目标特征图与所述边缘特征图进行融合,得到融合特征图;基于所述融合特征图计算隧洞内部缺陷的几何参数,并输出隧洞内部缺陷类别及边界轮廓。本申请提出的技术方案,实现了由粗到精的协同识别,兼顾检测速度与边缘定位精度,可量化输出缺陷的面积、长度、宽度、周长及圆形度。
Smart Images

Figure CN122656986A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of water conservancy and hydropower engineering inspection technology, and in particular to a method and system for tunnel defect identification based on the YOLO-Canny collaborative algorithm. Background Technology
[0002] Tunnels, pressure steel pipes, and other water conservancy and hydropower facilities are constantly exposed to underwater or high-humidity environments. These conditions, coupled with factors such as water erosion, pressure changes, and corrosive media, make their internal structures prone to various defects. Common defect types include tunnel wall depressions and bulges, tunnel wall corrosion, weld surface cracks and undercuts, stiffening ring deformation and cracking, concrete spalling and leakage around grouting holes, manhole cover deformation and rust penetration, and concrete voids around pressure steel pipes. Failure to detect and address these defects promptly can lead to structural failure and safety accidents.
[0003] Currently, tunnel defect detection mainly relies on manual visual inspection, sonar imaging, or manual interpretation of videos captured by underwater robots. Manual interpretation of large numbers of images is time-consuming and labor-intensive, making rapid detection difficult. Furthermore, the results depend on personnel experience, lack standardized criteria, and are prone to missed detections or misjudgments. For weak-edge defects such as microcracks and corrosion boundaries, manual interpretation struggles to accurately locate and quantify them. Traditional methods fail to output geometric parameters such as defect area, length, and perimeter, hindering subsequent maintenance decisions.
[0004] Deep learning-based object detection algorithms, such as the YOLO series, have been gradually introduced into the field of industrial defect detection. They offer advantages such as high detection speed and end-to-end processing, quickly locating target regions in images and outputting categories. However, their boundary localization accuracy for small targets and weak-edge defects is limited, making it difficult to meet the needs of precise surveying. Traditional edge detection algorithms, such as Canny, can extract sub-pixel-level continuous edges with high localization accuracy, but they are computationally intensive and cannot automatically identify defect categories, making them unsuitable for practical engineering needs when used alone. Therefore, there is an urgent need to propose a tunnel defect identification scheme that can solve the above problems. Summary of the Invention
[0005] This application provides a tunnel defect identification method and system based on the YOLO-Canny collaborative algorithm, which at least solves the technical problems of low efficiency of manual inspection, insufficient boundary positioning accuracy of the YOLO algorithm, and the inability of the Canny algorithm to automatically identify defect categories and large computational load in existing methods.
[0006] The first aspect of this application proposes a tunnel defect identification method based on the YOLO-Canny collaborative algorithm, the method comprising:
[0007] Obtain structural images of the tunnel interior; The image is input into the optimized YOLO algorithm, which outputs the category and bounding box location of the target defect; The target region is cropped based on the bounding box position, and the cropped target region is input into the improved Canny edge detection algorithm to extract the edge feature map of the target region; The image containing bounding boxes and class labels output by the YOLO algorithm is used as the target feature map, and the target feature map is fused with the edge feature map to obtain the fused feature map; The geometric parameters of internal defects in the tunnel are calculated based on the fused feature map, and the categories and boundary contours of internal defects in the tunnel are output.
[0008] Preferably, the categories of the target defects include: Tunnel wall deformation, tunnel wall corrosion, weld defects, stiffening ring damage, grouting hole abnormalities, manhole cover damage, and concrete voids around the pressure steel pipe; The deformation of the cavity wall includes: depressions and / or bulges; The corrosion of the cavity wall includes: rust and / or coating peeling; The weld defects include: surface cracks and / or undercut; The stiffening ring damage includes: deformation and / or cracking; The abnormalities of the grouting holes include: spalling and / or leakage of concrete around the grouting holes; Damage to the manhole cover includes: cover deformation and / or rust penetration.
[0009] Furthermore, the fusion includes: Within the cropped target area, the sub-image of the corresponding target region in the target feature map output by the YOLO algorithm, which includes bounding boxes and category labels, is summed pixel-by-pixel with the edge feature map extracted by the Canny algorithm, according to adaptive weight coefficients, to obtain the fused feature map.
[0010] Furthermore, the adaptive weighting coefficient ranges from 0.3 to 0.7.
[0011] Furthermore, the step of inputting the cropped target region into the improved Canny edge detection algorithm to extract the edge feature map of the target region includes: An adaptive Gaussian filter is used to denoise the cropped target region; Calculate the gradient magnitude and gradient direction of each pixel in the denoised image; Non-maximum suppression is used to refine the gradient magnitude image while preserving local maxima; An improved Otsu algorithm is used to determine the high threshold and the low threshold. The improved Otsu algorithm calculates the inter-class variance after cropping and smoothing the gradient magnitude histogram, determines the high threshold based on the inter-class variance, and then multiplies the high threshold by a preset coefficient to obtain the low threshold. Based on the high threshold and low threshold, a dual threshold detection is performed on the image after non-maximum suppression. Pixels with gradient magnitudes higher than the high threshold are marked as strong edges, pixels with gradient magnitudes lower than the low threshold are suppressed, and pixels in between are marked as weak edges. Weak edges are connected, weak edges connected to strong edges are preserved, isolated weak edges are suppressed, and the edge feature map of the target region is output.
[0012] Furthermore, the geometric parameters include: area, maximum length, maximum width, perimeter, and circularity; Among them, roundness is used to determine the shape of the defect. When the roundness is equal to 1, it is judged as a bulge; otherwise, it is judged as a depression or irregular corrosion.
[0013] Furthermore, the method also includes: The recognition results are evaluated using the mean of average accuracy and edge localization error; The identification results include: the type of defects inside the tunnel and the boundary contour.
[0014] The second aspect of this application proposes a tunnel defect identification system based on the YOLO-Canny collaborative algorithm, comprising: The acquisition module is used to acquire structural images of the inside of the tunnel; The input module is used to input the image into the optimized YOLO algorithm and output the category and bounding box location of the target defect; The extraction module is used to crop out the target region according to the bounding box position, and input the cropped target region into the improved Canny edge detection algorithm to extract the edge feature map of the target region; The fusion module is used to take the image containing bounding boxes and class labels output by the YOLO algorithm as the target feature map, and fuse the target feature map with the edge feature map to obtain a fused feature map; The calculation module is used to calculate the geometric parameters of internal defects in the tunnel based on the fused feature map, and output the category and boundary contour of internal defects in the tunnel.
[0015] A third aspect of this application provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, it implements the method described in the first aspect embodiment.
[0016] A fourth aspect of this application provides a computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the method described in the first aspect.
[0017] The technical solutions provided by the embodiments of this application have at least the following beneficial effects: This application proposes a method and system for tunnel defect identification based on the YOLO-Canny collaborative algorithm. The method includes: acquiring a structural image of the tunnel interior; inputting the image into an optimized YOLO algorithm to output the category and bounding box position of the target defect; cropping the target region according to the bounding box position and inputting the cropped target region into an improved Canny edge detection algorithm to extract the edge feature map of the target region; using the image containing the bounding box and category label output by the optimized YOLO algorithm as the target feature map, and fusing the target feature map with the edge feature map to obtain a fused feature map; calculating the geometric parameters of the tunnel interior defect based on the fused feature map, and outputting the category and boundary contour of the tunnel interior defect. The technical solution proposed in this application achieves coarse-to-fine collaborative identification, balancing detection speed and edge localization accuracy, and can quantify the output of the defect's area, length, width, perimeter, and circularity.
[0018] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0019] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein: Figure 1 This is a flowchart illustrating a tunnel defect identification method based on the YOLO-Canny collaborative algorithm according to an embodiment of this application; Figure 2 This is a structural diagram of a tunnel defect identification system based on the YOLO-Canny collaborative algorithm according to an embodiment of this application. Detailed Implementation
[0020] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.
[0021] This application proposes a method and system for tunnel defect identification based on the YOLO-Canny collaborative algorithm. The method includes: acquiring a structural image of the tunnel interior; inputting the image into an optimized YOLO algorithm to output the category and bounding box position of the target defect; cropping a target region based on the bounding box position and inputting the cropped target region into an improved Canny edge detection algorithm to extract the edge feature map of the target region; using the image containing the bounding box and category label output by the optimized YOLO algorithm as the target feature map, and fusing the target feature map with the edge feature map to obtain a fused feature map; calculating the geometric parameters of the tunnel interior defect based on the fused feature map, and outputting the tunnel interior defect category and boundary contour. The technical solution proposed in this application achieves coarse-to-fine collaborative identification, balancing detection speed and edge localization accuracy, and can quantify the output of the defect's area, length, width, perimeter, and circularity.
[0022] The following description, with reference to the accompanying drawings, illustrates a method and system for identifying tunnel defects based on the YOLO-Canny collaborative algorithm, according to embodiments of this application.
[0023] Example 1 Figure 1 This is a flowchart illustrating a tunnel defect identification method based on the YOLO-Canny collaborative algorithm according to an embodiment of this application. Figure 1 As shown, the method includes: Step 1: Obtain structural images of the tunnel interior; It should be noted that an underwater robot equipped with a high-definition camera module can be used to obtain images of the interior of the water diversion tunnel.
[0024] Step 2: Input the image into the optimized YOLO algorithm to output the category and bounding box location of the target defect; In this embodiment of the disclosure, the categories of the target defects include: Tunnel wall deformation, tunnel wall corrosion, weld defects, stiffening ring damage, grouting hole abnormalities, manhole cover damage, and concrete voids around the pressure steel pipe; The deformation of the cavity wall includes: depressions and / or bulges; The corrosion of the cavity wall includes: rust and / or coating peeling; The weld defects include: surface cracks and / or undercut; The stiffening ring damage includes: deformation and / or cracking; The abnormalities of the grouting holes include: spalling and / or leakage of concrete around the grouting holes; Damage to the manhole cover includes: cover deformation and / or rust penetration.
[0025] It should be noted that the optimized YOLO algorithm was pre-trained on multiple images labeled with various tunnel defects. The training images covered different lighting conditions, different shooting angles, and different degrees of defects.
[0026] Step 3: Crops out the target region based on the bounding box position, and inputs the cropped target region into the improved Canny edge detection algorithm to extract the edge feature map of the target region; In this embodiment of the disclosure, the step of inputting the cropped target region into the improved Canny edge detection algorithm to extract the edge feature map of the target region includes: An adaptive Gaussian filter is used to denoise the cropped target region; Calculate the gradient magnitude and gradient direction of each pixel in the denoised image; Non-maximum suppression is used to refine the gradient magnitude image while preserving local maxima; An improved Otsu algorithm is used to determine the high threshold and the low threshold. The improved Otsu algorithm calculates the inter-class variance after cropping and smoothing the gradient magnitude histogram, determines the high threshold based on the inter-class variance, and then multiplies the high threshold by a preset coefficient to obtain the low threshold. Based on the high threshold and low threshold, a dual threshold detection is performed on the image after non-maximum suppression. Pixels with gradient magnitudes higher than the high threshold are marked as strong edges, pixels with gradient magnitudes lower than the low threshold are suppressed, and pixels in between are marked as weak edges. Weak edges are connected, weak edges connected to strong edges are preserved, isolated weak edges are suppressed, and the edge feature map of the target region is output.
[0027] It should be noted that, taking the eroded area of the cavity wall as an example, a rectangular region with pixel coordinates of 540 to 720 in the x-direction and 320 to 470 in the y-direction is cropped out. This cropped region is then input into the improved Canny edge detection algorithm, and the specific steps are as follows: (1) Adaptive Gaussian filtering is used to denoise the cropped area. The Gaussian kernel size is automatically adjusted to 5×5 according to the local variance of the image.
[0028] (2) Calculate the gradient magnitude and gradient direction of each pixel in the denoised image, and use the Sobel operator as the gradient operator.
[0029] (3) Non-maximum suppression is used to refine the gradient magnitude image. Search along the gradient direction, retain local maximum points, and suppress non-edge points.
[0030] (4) The improved Otsu algorithm was used to determine the high and low thresholds. Specifically, the gradient magnitude histogram was clipped to remove outliers at both ends, then smoothed, the inter-class variance was calculated, and the gradient value that maximized the inter-class variance was selected as the high threshold. The high threshold was multiplied by 0.5 to obtain the low threshold. The calculated high threshold was 85 and the low threshold was 42.
[0031] (5) Perform double threshold detection on the image after non-maximum suppression based on the high threshold of 85 and the low threshold of 42: pixels with gradient magnitude higher than 85 are marked as strong edges, pixels with gradient magnitude lower than 42 are suppressed, and pixels between 42 and 85 are marked as weak edges.
[0032] (6) Perform edge connection on weak edges: retain weak edges that are connected to strong edges within 8 neighborhoods, suppress isolated weak edges, and finally output a binary edge feature map.
[0033] Step 4: Use the image containing bounding boxes and class labels output by the YOLO algorithm as the target feature map, and fuse the target feature map with the edge feature map to obtain the fused feature map; In this embodiment of the disclosure, the fusion includes: Within the cropped target area, the sub-image of the corresponding target region in the target feature map output by the YOLO algorithm, which includes bounding boxes and category labels, is summed pixel-by-pixel with the edge feature map extracted by the Canny algorithm, according to adaptive weight coefficients, to obtain the fused feature map.
[0034] It should be noted that the fusion formula is as follows: i and j are pixel coordinates. This is a sub-map of the target feature map output by YOLO. The edge feature map extracted by Canny. These are adaptive weighting coefficients.
[0035] It should be noted that the adaptive weighting coefficient ranges from 0.3 to 0.7.
[0036] It should be noted that within the cropped target area, the sub-image of the corresponding target region in the target feature map output by the YOLO algorithm (containing bounding boxes and class labels) is summed pixel-by-pixel with the edge feature map extracted by the Canny algorithm, using an adaptive weighting coefficient, to obtain the fused feature map. In this embodiment, the adaptive weighting coefficient α is trained to a value of 0.45, and the fusion formula is: .
[0037] It should be noted that, The adaptive weighting coefficients (learned through training, with values ranging from [0.3, 0.7]) are used to achieve complementarity between target semantic features and edge geometric features. This fully leverages the speed advantage of the YOLO algorithm in target detection and the accuracy advantage of the Canny algorithm in edge detection, enabling comprehensive and accurate identification of features such as cracks, blockages, and corrosion inside tunnel pipelines. The collaborative algorithm improves edge detection accuracy, provides more accurate edge localization, and enhances the continuity and integrity of edges.
[0038] Step 5: Calculate the geometric parameters of the internal defects of the tunnel based on the fused feature map, and output the category and boundary contour of the internal defects of the tunnel.
[0039] In this embodiment of the disclosure, the geometric parameters include: area, maximum length, maximum width, perimeter, and circularity; Among them, roundness is used to determine the shape of the defect. When the roundness is equal to 1, it is judged as a bulge; otherwise, it is judged as a depression or irregular corrosion.
[0040] It should be noted that, taking the corroded area of the cave wall as an example: Area: The eroded area covers approximately 4280 pixels, and the actual area is approximately 0.35 square meters after conversion based on the image resolution.
[0041] Maximum length: The longest eroded area extends horizontally, with a length of approximately 85 pixels, which is about 28 centimeters.
[0042] Maximum width: The maximum vertical width of the eroded area is approximately 52 pixels, which is approximately 17 centimeters.
[0043] Perimeter: The outline length of the eroded area is approximately 312 pixels, which is approximately 1.02 meters.
[0044] Circularity: Calculated using the formula C = 4πA / P², where A = 4280 and P = 312, resulting in C ≈ 0.55. Since the circularity is less than 1, it is determined to be an irregular corrosion area.
[0045] The final output includes the defect category and precise boundary contour. For cavity wall corrosion defects, the output defect category is "cavity wall corrosion," and a binary image of the precise boundary contour of the corrosion area is also output, along with quantization parameters including area of 0.35 square meters, maximum length of 28 centimeters, maximum width of 17 centimeters, perimeter of 1.02 meters, circularity of 0.55, and confidence level of 0.92. The output results are overlaid on the original image and stored in the database for reference in subsequent maintenance decisions.
[0046] In this embodiment of the disclosure, the method includes: The recognition results are evaluated using the mean of average accuracy and edge localization error; The identification results include: the type of defects inside the tunnel and the boundary contour.
[0047] It should be noted that the mean average accuracy (mAP) and edge localization error (EPE) are used to evaluate the recognition results. Testing in this embodiment showed that the mean average accuracy reached 0.91, and the edge localization error was 1.2 pixels. Compared to using the YOLO algorithm alone, which resulted in a mean average accuracy of 0.85 and an edge localization error of 3.5 pixels, the edge localization accuracy of this invention is improved by approximately 66%, while retaining the defect classification capability of the YOLO algorithm.
[0048] The formula for calculating the mean precision (mAP) is as follows:
[0049] In the formula, K is the total number of defect categories, and A The average accuracy of the k-th type of defect; The formula for calculating edge positioning error (EPE) is as follows:
[0050] In the formula, N is the total number of edge points. To detect the coordinates of edge points, These are the coordinates of the actual edge points. It should be noted that when processing tunnel images containing defects such as cracks and leaks, the collaborative algorithm can clearly detect and calculate the area of defects (such as the area of the corrosion zone), the maximum length / width (such as the length of the crack), the perimeter, and the roundness (to determine bulges or depressions), providing more accurate information for the maintenance and repair of underwater tunnels.
[0051] In summary, the tunnel defect identification method based on the YOLO-Canny collaborative algorithm proposed in this embodiment achieves coarse-to-fine collaborative identification, balancing detection speed and edge positioning accuracy, and can quantitatively output the area, length, width, perimeter, and circularity of defects.
[0052] Example 2 Figure 2 This is a structural diagram of a tunnel defect identification system based on the YOLO-Canny collaborative algorithm according to an embodiment of this application, as shown below. Figure 2 As shown, the system includes: Acquisition module 100 is used to acquire structural images of the inside of the tunnel; The input module 200 is used to input the image into the optimized YOLO algorithm and output the category and bounding box position of the target defect; It should be noted that the categories of the target defects include: Tunnel wall deformation, tunnel wall corrosion, weld defects, stiffening ring damage, grouting hole abnormalities, manhole cover damage, and concrete voids around the pressure steel pipe; The deformation of the cavity wall includes: depressions and / or bulges; The corrosion of the cavity wall includes: rust and / or coating peeling; The weld defects include: surface cracks and / or undercut; The stiffening ring damage includes: deformation and / or cracking; The abnormalities of the grouting holes include: spalling and / or leakage of concrete around the grouting holes; Damage to the manhole cover includes: cover deformation and / or rust penetration.
[0053] The extraction module 300 is used to crop out the target region according to the bounding box position, and input the cropped target region into the improved Canny edge detection algorithm to extract the edge feature map of the target region; The fusion module 400 is used to take the image containing bounding boxes and category labels output by the YOLO algorithm as the target feature map, and fuse the target feature map with the edge feature map to obtain a fused feature map; The calculation module 500 is used to calculate the geometric parameters of internal defects in the tunnel based on the fused feature map, and output the category and boundary contour of internal defects in the tunnel.
[0054] It should be noted that the geometric parameters include: area, maximum length, maximum width, perimeter, and circularity; Among them, roundness is used to determine the shape of the defect. When the roundness is equal to 1, it is judged as a bulge; otherwise, it is judged as a depression or irregular corrosion.
[0055] In this embodiment of the disclosure, the fusion module 400 is further configured to: Within the cropped target area, the sub-image of the corresponding target region in the target feature map output by the YOLO algorithm, which includes bounding boxes and category labels, is summed pixel-by-pixel with the edge feature map extracted by the Canny algorithm, according to adaptive weight coefficients, to obtain the fused feature map.
[0056] It should be noted that the adaptive weighting coefficient ranges from 0.3 to 0.7.
[0057] In this embodiment of the disclosure, the extraction module 300 is further configured to: An adaptive Gaussian filter is used to denoise the cropped target region; Calculate the gradient magnitude and gradient direction of each pixel in the denoised image; Non-maximum suppression is used to refine the gradient magnitude image while preserving local maxima; An improved Otsu algorithm is used to determine the high threshold and the low threshold. The improved Otsu algorithm calculates the inter-class variance after cropping and smoothing the gradient magnitude histogram, determines the high threshold based on the inter-class variance, and then multiplies the high threshold by a preset coefficient to obtain the low threshold. Based on the high threshold and low threshold, a dual threshold detection is performed on the image after non-maximum suppression. Pixels with gradient magnitudes higher than the high threshold are marked as strong edges, pixels with gradient magnitudes lower than the low threshold are suppressed, and pixels in between are marked as weak edges. Weak edges are connected, weak edges connected to strong edges are preserved, isolated weak edges are suppressed, and the edge feature map of the target region is output.
[0058] In this embodiment of the disclosure, the computing module 500 is further configured to: The recognition results are evaluated using the mean of average accuracy and edge localization error; The identification results include: the type of defects inside the tunnel and the boundary contour.
[0059] In summary, the tunnel defect identification system based on the YOLO-Canny collaborative algorithm proposed in this embodiment achieves coarse-to-fine collaborative identification, balancing detection speed and edge positioning accuracy, and can quantitatively output the area, length, width, perimeter, and circularity of defects.
[0060] Example 3 To implement the above embodiments, this disclosure also proposes an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, it implements the method described in Embodiment 1.
[0061] Example 4 To implement the above embodiments, this disclosure also proposes a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in Embodiment 1.
[0062] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0063] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.
[0064] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.
Claims
1. A tunnel defect identification method based on the YOLO-Canny collaborative algorithm, characterized in that, The method includes: Obtain structural images of the tunnel interior; The image is input into the optimized YOLO algorithm, which outputs the category and bounding box location of the target defect; The target region is cropped based on the bounding box position, and the cropped target region is input into the improved Canny edge detection algorithm to extract the edge feature map of the target region; The image containing bounding boxes and class labels output by the YOLO algorithm is used as the target feature map, and the target feature map is fused with the edge feature map to obtain the fused feature map; The geometric parameters of internal defects in the tunnel are calculated based on the fused feature map, and the categories and boundary contours of internal defects in the tunnel are output.
2. The method as described in claim 1, characterized in that, The categories of the target defects include: Tunnel wall deformation, tunnel wall corrosion, weld defects, stiffening ring damage, grouting hole abnormalities, manhole cover damage, and concrete voids around the pressure steel pipe; The deformation of the cavity wall includes: depressions and / or bulges; The corrosion of the cavity wall includes: rust and / or coating peeling; The weld defects include: surface cracks and / or undercut; The stiffening ring damage includes: deformation and / or cracking; The abnormalities of the grouting holes include: spalling and / or leakage of concrete around the grouting holes; Damage to the manhole cover includes: cover deformation and / or rust penetration.
3. The method as described in claim 2, characterized in that, The fusion includes: Within the cropped target area, the sub-image of the corresponding target region in the target feature map output by the YOLO algorithm, which includes bounding boxes and category labels, is summed pixel-by-pixel with the edge feature map extracted by the Canny algorithm, according to adaptive weight coefficients, to obtain the fused feature map.
4. The method as described in claim 3, characterized in that, The adaptive weighting coefficient has a value range of 0.3 to 0.
7.
5. The method as described in claim 4, characterized in that, The step of inputting the cropped target region into the improved Canny edge detection algorithm to extract the edge feature map of the target region includes: An adaptive Gaussian filter is used to denoise the cropped target region; Calculate the gradient magnitude and gradient direction of each pixel in the denoised image; Non-maximum suppression is used to refine the gradient magnitude image while preserving local maxima; An improved Otsu algorithm is used to determine the high threshold and the low threshold. The improved Otsu algorithm calculates the inter-class variance after cropping and smoothing the gradient magnitude histogram, determines the high threshold based on the inter-class variance, and then multiplies the high threshold by a preset coefficient to obtain the low threshold. Based on the high threshold and low threshold, a dual threshold detection is performed on the image after non-maximum suppression. Pixels with gradient magnitudes higher than the high threshold are marked as strong edges, pixels with gradient magnitudes lower than the low threshold are suppressed, and pixels in between are marked as weak edges. Weak edges are connected, weak edges connected to strong edges are preserved, isolated weak edges are suppressed, and the edge feature map of the target region is output.
6. The method as described in claim 5, characterized in that, The geometric parameters include: area, maximum length, maximum width, perimeter, and circularity; Among them, roundness is used to determine the shape of the defect. When the roundness is equal to 1, it is judged as a bulge; otherwise, it is judged as a depression or irregular corrosion.
7. The method as described in claim 6, characterized in that, The method further includes: The recognition results are evaluated using the mean of average accuracy and edge localization error; The identification results include: the type of defects inside the tunnel and the boundary contour.
8. A tunnel defect identification system based on the YOLO-Canny collaborative algorithm, characterized in that, The system includes: The acquisition module is used to acquire structural images of the inside of the tunnel; The input module is used to input the image into the optimized YOLO algorithm and output the category and bounding box location of the target defect; The extraction module is used to crop out the target region according to the bounding box position, and input the cropped target region into the improved Canny edge detection algorithm to extract the edge feature map of the target region; The fusion module is used to take the image containing bounding boxes and class labels output by the YOLO algorithm as the target feature map, and fuse the target feature map with the edge feature map to obtain a fused feature map; The calculation module is used to calculate the geometric parameters of internal defects in the tunnel based on the fused feature map, and output the category and boundary contour of internal defects in the tunnel.
9. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor, when executing the program, implements the method as described in any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-7.