Tunnel wall surface water leakage detection method and system

By segmenting the original tunnel wall image into sub-images and using the YOLOv11 neural network to identify water leakage areas, the image is expanded and recombined, solving the problems of low efficiency and insufficient accuracy in tunnel water leakage detection in existing technologies, and realizing rapid and accurate water leakage detection and intelligent decision support.

CN121482070APending Publication Date: 2026-02-06CHENGDU SHENGKAI CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511627174.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-07
Publication Date
2026-02-06

AI Technical Summary

Technical Problem

Existing tunnel leakage detection technologies are inefficient, struggle to accurately identify leakage areas of different forms, and have high computational redundancy, failing to meet the demands for efficient and accurate detection.

Method used

The original large-size tunnel wall image is segmented into several sub-images, and the YOLOv11 neural network is used for identification, expansion and reconstruction of the seepage area, calculation of the area of ​​the seepage point, and precise positioning and area calculation are achieved through image processing.

Benefits of technology

It enables rapid and accurate detection of tunnel water leakage, reduces the cost of manual inspection, improves detection efficiency and accuracy, and supports intelligent decision-making.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121482070A_ABST
    Figure CN121482070A_ABST
Patent Text Reader

Abstract

The invention provides a tunnel wall surface water leakage detection method and system. The method comprises the following steps: acquiring an original image of a to-be-detected tunnel wall; segmenting the collected original image of the tunnel wall to be detected into a plurality of sub-images; judging whether the subgraph contains leakage water or not; expanding the sub-graph containing the leakage water and then recombining the sub-graph to obtain a recombined image; and calculating the area of the water leakage points in the recombined image, and giving an alarm if the area of a certain water leakage point exceeds a threshold value. According to the invention, the position and area of leakage water can be rapidly identified, positioned, calculated and output, and the detection accuracy is high; the segmentation and accurate area calculation of tunnel wall leakage water can be realized based on an automatic inspection system, and the method is more efficient and accurate in quantization precision compared with a traditional mode.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of tunnel detection, and particularly relates to a tunnel wall surface water leakage detection method and system. BACKGROUND

[0002] As a key component of traffic and water conservancy projects, the structure of a tunnel is of great significance to safety. Water leakage on the surface of a tunnel wall is one of the common diseases. If it is not detected and treated in time, it may cause structural damage, shorten the service life, and even endanger safety. At present, tunnel water leakage detection relies on manual inspection, which is low in efficiency and labor-intensive, and is restricted by subjective factors of the inspectors and the tunnel environment (such as insufficient light and narrow space), and is prone to missed detection and misjudgment. At the same time, some existing automatic detection technologies, such as those based on traditional image processing algorithms, have difficulty in accurately identifying water leakage areas in the presence of complex background interference such as pipes, bolt holes, and shadows in tunnels, and cannot accurately quantify the area of water leakage. In addition, these technologies are not adaptable to different forms (point, line, and large area) of water leakage, and cannot meet the needs of efficient and accurate detection in actual projects.

[0003] The existing technology Chinese patent application CN202411283164.X discloses a tunnel water leakage detection method, which belongs to the technical field of tunnel detection. The method comprises the following steps: establishing a water leakage data set; constructing an initial water leakage semantic segmentation model, wherein the backbone network of the initial water leakage semantic segmentation model is an adaptive adjustment backbone network improved based on an EfficientNet-B0 network, the attention mechanism of an MBconv1 module in the adaptive adjustment backbone network is an scSE attention mechanism, and the convolution kernel of a sixth MBconv6 module is 1x1; based on the water leakage data set, the initial water leakage semantic segmentation model is trained, and an optimized water leakage semantic segmentation model after training is saved; and tunnel water leakage detection is performed by inputting tunnel image data to be detected into the optimized water leakage semantic segmentation model.

[0004] The above-mentioned existing technology relies on a complex feature module, has a large amount of floating point operation and high calculation redundancy, and thus has low efficiency for long-distance tunnel inspection. SUMMARY

[0005] The present application aims to provide a tunnel wall surface water leakage detection method and system, which partially solves or alleviates the above-mentioned deficiencies in the prior art, and can efficiently and accurately detect water leakage on the surface of a tunnel wall.

[0006] In order to solve the above-mentioned technical problems, the present application specifically adopts the following technical solutions: The first aspect of the present application is to provide a tunnel wall surface water leakage detection method, comprising: acquiring a raw image of a tunnel wall to be detected; The original image of the tunnel wall to be inspected is segmented into several sub-images; Determine if the subgraph contains water leakage; The sub-image containing the leaking water is expanded and then reassembled to obtain the reassembled image; Calculate the area of ​​the water seepage points in the reconstructed image, and trigger an alarm if the area of ​​a water seepage point exceeds a threshold.

[0007] Furthermore, the step of segmenting the acquired original image of the tunnel wall to be inspected into several sub-images includes: The number of sub-images for each original image segment is determined based on the size of the original image and the size of the sub-images. The coordinates of the pixels in the original image are determined based on the number and size of the sub-images. Segmentation is performed based on coordinate points.

[0008] Furthermore, using the formula: X = (i-1) s + u, Y=(j-1) s + v Calculate the coordinates of the sub-image pixels in the original image; where X is the horizontal coordinate in the original image, Y is the vertical coordinate in the original image, u is the horizontal coordinate of the sub-image pixel in the sub-image, v is the vertical coordinate of the sub-image pixel in the sub-image, i is the horizontal index of the sub-image in the original image, j is the vertical index of the sub-image in the original image, and s is the side length of the sub-image.

[0009] Furthermore, the YOLOv11 neural network is used to perform binary classification on the subgraph to determine whether the subgraph contains water leakage.

[0010] Furthermore, the steps of expanding and reassembling the subgraph containing the leaking water include: Expand a given original image into k sub-images in both the horizontal and vertical directions, centered on the sub-image containing the leaking water. The expanded sub-images in the original image are stitched and recombined. If there are overlapping parts, the overlapping parts are merged. If the sub-image exceeds the original image during expansion, it is filled with a preset filling image.

[0011] Furthermore, using the formula:

[0012] Calculate the pixel at a certain coordinate in the reconstructed image; where G i,j,k Let U be the image G, which is the result of k-layer expansion and reassembly centered on sub-images in row i and column j. i,j,k G is the horizontal coordinate in the original image. i,j,k(U,V) represents the image G i,j,k The pixel with coordinates (U, V) in the image G is the pixel in the image G. i,j,k In the vertical coordinates of the original image, I m,n Let s be the subgraph in row m and column n that participates in the splicing and recombination, where s is the side length of the subgraph, k is the number of expansion layers, p is the fill value, and n is the number of columns. x n is the number of subgraphs in a row. y The number of subgraphs in a sequence.

[0013] Furthermore, before calculating the area of ​​the leakage points in the reconstructed image, the size of the stitched and reconstructed image is standardized. Specific steps include: Calculate the scaling factor; Calculate the scaled image size using the scaling factor; Calculate the fill area; The target image is obtained by filling the image with a scaling factor and a fill area, and then scaling it.

[0014] Furthermore, before calculating the area of ​​the leakage points in the reconstructed image, the size of the stitched and reconstructed image is standardized. Specific steps include: Calculate the scaling factor; Calculate the scaled image size using the scaling factor; Calculate the fill area; The target image is obtained by filling the image with a scaling factor and a fill area, and then scaling it.

[0015] Furthermore, using the formula: r=min(W in / W, H in / H) Calculate the scaling factor; where r is the scaling factor, W is the width of the stitched and reassembled image, and H is the height of the stitched and reassembled image. in To calculate the area of ​​the leakage point, H is the required image width. in Image height required to calculate the area of ​​the leakage point; Using the formula:

[0016] Calculate the scaled image dimensions; where w is the scaled width and h is the scaled height; The method for calculating the fill area is to use the following formula: p_w=W in -w, p_h=H in -h Calculate the total fill height and width; where p_w is the total fill width and p_h is the total fill height; Using the formula:

[0017] Calculate the left, right, top, and bottom fill regions; where p_left is the left fill region, p_right is the right fill region, p_top is the top fill region, and p_bottom is the bottom fill region; Using formula

[0018] Calculate the pixel at a certain coordinate in the target image; where I'(x,y) is the pixel at coordinate (x,y) in the target image I'; O() is the pixel in the image after scaling with a scaling factor, x is the horizontal coordinate in the target image I', y is the vertical coordinate in the target image I', and p is the fill pixel value.

[0019] Furthermore, the steps for calculating the area of ​​the seepage points in the reconstructed image include: The YOLOv11 neural network was used to identify water leakage in the reconstructed image; Using the formula:

[0020] Statistical analysis was performed on the pixels identified as leaking water; where A represents the number of pixels in the leaking area, M(f,g) represents the value of the leaking water result at coordinates (f,g), and W... in To calculate the area of ​​the leakage point, H is the required image width. in The image height required to calculate the area of ​​the leakage point is given by f, where f is the horizontal coordinate in the reconstructed image and g is the vertical coordinate in the reconstructed image.

[0021] The present invention also provides a tunnel wall surface leakage detection system, comprising: The acquisition module is used to acquire the original image of the tunnel wall to be inspected; The segmentation module is used to segment the acquired original image of the tunnel wall to be detected into several sub-images; The judgment module is used to determine whether a sub-graph contains water leakage. The reconstruction module is used to expand and reconstruct the sub-image containing the water leakage to obtain the reconstructed image; The calculation module is used to calculate the area of ​​water seepage points in the reconstructed image. If the area of ​​a water seepage point exceeds a threshold, an alarm will be triggered.

[0022] Beneficial effects: This invention segments a large original image into several sub-images before inputting them into a YOLOv11 neural network for recognition. This ensures that the images do not lose features and are not too large, which would reduce training and processing speed. Then, by expanding the acquisition range and reconstructing the complete region, leakage areas that might be segmented by sub-image boundaries, such as linear leakage spanning sub-images or large-area diffuse leakage, are restored to their complete spatial form, providing a foundation for subsequent accurate segmentation and area calculation. Before calculating the area, the input image is resized to solve the image stretching problem caused by inconsistent aspect ratios after stitching, resulting in more accurate calculation of the leakage area.

[0023] Based on the above solution, the present invention has the following advantages: 1. Rapid detection and localization. The segmentation network algorithm can quickly identify areas of water leakage in tunnels, and image processing can be used to accurately locate defects, reducing the time and cost of manual inspection.

[0024] Improved detection efficiency: Currently, segmentation networks can process large amounts of tunnel image data more efficiently, meeting the needs of leakage detection in complex environments such as subway tunnels.

[0025] 2. Supports intelligent decision-making. The algorithm uses high-precision segmentation results to provide a scientific basis for tunnel maintenance and management, helping decision-makers to quickly formulate maintenance plans.

[0026] 3. Reduce labor costs. The system reduces reliance on manual inspections through automated detection, thereby lowering the labor costs for tunnel maintenance. Attached Figure Description

[0027] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. In all the drawings, similar elements or parts are generally identified by similar reference numerals. The elements or parts in the drawings are not necessarily drawn to scale. Obviously, the drawings described below are some embodiments of the present invention, and those skilled in the art can obtain other drawings based on these drawings without any creative effort.

[0028] Figure 1 This is a flowchart of Embodiment 1 of the present invention; Figure 2 This is a structural diagram of Embodiment 2 of the present invention. Detailed Implementation

[0029] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0030] In this document, suffixes such as "module," "part," or "unit" used to denote elements are used only for the purpose of illustrative purposes and have no specific meaning in themselves. Therefore, "module," "part," or "unit" may be used interchangeably.

[0031] In this document, the terms "upper," "lower," "inner," "outer," "front," "rear," "one end," and "the other end," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the present invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the present invention. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0032] In this document, unless otherwise explicitly specified and limited, the terms "installed," "equipped with," "connected," etc., should be interpreted broadly. For example, "connection" can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection, a direct connection, or an indirect connection through an intermediate medium; it can be a connection within two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.

[0033] In this document, "and / or" includes any and all combinations of one or more of the listed related items.

[0034] In this article, "multiple" means two or more, that is, it includes two, three, four, five, etc.

[0035] Example 1: like Figure 1 As shown, the present invention provides a method for detecting water leakage on the surface of a tunnel wall, the specific steps of which include: S1 acquires the original image of the tunnel wall to be inspected.

[0036] In this embodiment, the specific steps for acquiring images of the tunnel wall to be detected include: The S11 places several cameras on the inspection robot so that the combined field of view of all the cameras can cover the central corner of the tunnel to be inspected.

[0037] The tunnel cross-section is typically circular / horseshoe-shaped, with the bottom being the ground surface, eliminating the need for leak detection. The central angle from the top of the tunnel wall to the bottom edges on both sides is 270°. Therefore, in this embodiment, six cameras are used, evenly distributed circumferentially, with each camera having a field of view of at least 45°. With a single camera's 45° field of view, the six cameras, without overlap, cover a total of 6 × 45° = 270°, precisely covering the effective area of ​​the tunnel wall.

[0038] Six cameras are evenly arranged around the inspection robot, with the lenses facing a 270° area on the tunnel wall, that is, from 0° at the top to 135° on both sides, avoiding the 90° area at the bottom of the ground.

[0039] S12 is the camera number, and records the correspondence between each camera and the central angle of the tunnel to be detected.

[0040] Specifically, each camera is assigned a unique number, such as Camera_01 to Camera_06, and its corresponding central angle range is recorded. For example, in a clockwise direction, Camera_01 corresponds to 0-45°, Camera_02 corresponds to 45-90°, and so on. When water leakage is detected in a sub-map, the camera number is directly associated with its corresponding central angle range to determine the specific location of the leakage point in the tunnel circumference. For example, Camera_03 corresponds to 90°-135°, which is the upper left half of the tunnel, providing a circumferential positioning basis for subsequent maintenance.

[0041] Of course, the above is an ideal situation. In reality, the fields of view of adjacent cameras will overlap to some extent to avoid missing scans.

[0042] The S13 uses the encoder to trigger the camera to capture data at each preset acquisition interval.

[0043] An encoder is a sensor that can record the motion information of a device in real time. In this embodiment, the encoder is installed on the moving mechanism of the inspection robot, such as its wheels. The encoder provides the system with precise position information by recording the movement distance or rotation angle of the device. Its working principle is based on photoelectric or electromagnetic induction. For example, a photoelectric encoder generates pulse signals when the device moves, and the movement distance or rotation angle of the device can be calculated by counting the pulses.

[0044] The preset acquisition interval is determined based on factors such as the accuracy requirements of tunnel inspection and the movement speed of the inspection robot. For example, if high-precision inspection of the tunnel wall is required, the preset acquisition interval may be set relatively small to ensure that a sufficient number of tunnel wall images are acquired. Specifically, if the inspection robot moves inside the tunnel at a certain speed, the camera is triggered to acquire images when the encoder detects that the device has moved a preset distance (e.g., 10 cm) or rotated a certain angle (corresponding to a certain range on the tunnel wall). This ensures that appropriate image data can be obtained at different locations on the tunnel wall, avoiding the omission of important water leakage areas due to an excessively large acquisition interval, or the generation of a large amount of redundant data due to an excessively small acquisition interval.

[0045] When the distance or angle recorded by the encoder reaches the preset acquisition interval, the encoder sends a trigger signal to the system. Upon receiving this signal, the system controls the camera to acquire images.

[0046] This invention does not limit the specific means of acquiring the original images of the tunnel wall, as long as the tunnel wall images that can be used in subsequent processes can be obtained.

[0047] S2 divides the original image of the tunnel wall to be inspected into several sub-images.

[0048] In this embodiment, the original large-scale image of the leaking water is an 8K image, i.e., a tunnel wall image with a resolution of 8192*4460, and a pixel precision of 0.2mm. This ensures accurate identification of the actual area of ​​the leak and guarantees detection effectiveness. Because the original image is large and contains many detailed features of the leaking water defect, directly scaling the image would lose a significant amount of these details. Therefore, it is not possible to reduce the original image to a suitable size for network training by directly scaling the image.

[0049] At the same time, the original 8192*4460 image cannot be used directly when training the neural network model used to identify whether there is water leakage. The image is too large and will occupy a lot of GPU memory. Not only will the training speed be slow, but the inference speed in the actual use will also become very slow, making it difficult to meet the requirements of engineering applications.

[0050] To avoid the aforementioned problems, this embodiment divides the original image into several sub-images, ensuring that the images neither lose features nor become excessively large. The steps for dividing the acquired tunnel wall image to be detected into several sub-images include: S21 determines the number of sub-images to be segmented for each original image based on the size of the original image and the size of the sub-images, and quantifies the segmentation scale.

[0051] Let the original image size be W×H (e.g., width W = 8192 pixels, height H = 4460 pixels), and the sub-image size be s×s, i.e., side length s pixels, such as s = 640 pixels, used to adapt to the subsequent binary classification neural network. To ensure that all areas of the original image are covered, including areas with edges less than s, the number of sub-images in both the horizontal and vertical directions needs to be rounded up.

[0052] Specifically, the number of horizontal subgraphs , This is the floor sign. For example, when W=8192 and s=640, ; Number of vertical subgraphs For example, when H=4460 and s=640, The original image is ultimately segmented into n x ×n y There are 13 × 8 = 104 sub-images in the example above. If a large image is directly input into the model (such as YOLOv11), the detection accuracy will decrease due to computational overload and reduced feature resolution. By segmenting into small sub-images, the model input can be adapted while preserving the detailed features of local areas.

[0053] S22 determines the coordinates of the pixels of each sub-image in the original image based on the number and size of the sub-images, and establishes a position mapping.

[0054] To subsequently reconstruct the original image from the subimage, a coordinate mapping relationship between subimage pixels and original image pixels needs to be established. Specifically, let: The subgraph is indexed i in the horizontal direction (i∈[1,n)). x The vertical index is j (j∈[1,n)). y The pixel coordinates inside the subimage are (u,v) (u∈[0,s)). 1],v∈[0,s [1], that is, the horizontal and vertical relative positions within the sub-image). The absolute coordinates of this pixel in the original image are then determined using the formula: X = (i-1) s + u. Y=(j-1) s + v Calculate; where X is the horizontal coordinate in the original image, Y is the vertical coordinate in the original image, u is the horizontal coordinate of the sub-image pixel in the sub-image, v is the vertical coordinate of the sub-image pixel in the sub-image, i is the horizontal index of the sub-image in the original image, j is the vertical index of the sub-image in the original image, and s is the side length of the sub-image. For example, the pixel u=100, v=200 in the sub-image in the 2nd row and 3rd column has the coordinates X=(2 1) × 640 + 100 = 740, Y = (3 1)×640+200=1480.

[0055] S23 is divided based on coordinate points.

[0056] Based on the coordinate mapping in step S22, cropping and filling operations are performed on the original image.

[0057] For a subgraph that completely covers the original image (i.e., a non-edge subgraph), directly extract the subgraph from the original image that extends from (i... 1)s,(j 1) Generate a subgraph of size s×s from the region from (s) to (is, js); For edge sub-images, i.e., sub-images whose edge regions of the original image are less than s, after cropping the existing region of the original image, padding is done with a fill value p, such as black or white, or the mean of the edge pixels of the original image, to make it s×s, ensuring that all sub-images have the same size.

[0058] S3 determines whether the subgraph contains water leakage.

[0059] In this embodiment, the determination of water leakage is mainly accomplished through the YOLOv11 neural network.

[0060] The YOLOv11 neural network training process involves collecting and training cropped image slices. Based on their different features, these slices are categorized into normal images and leaky images for training. Since the majority of the actual tunnel walls are free of leaks, while the leaky areas are relatively small, and given the numerous types of equipment within the tunnel walls, a rather extreme 9:1 data ratio is used for training to balance the amount of data (normal to leaky). This approach aims to minimize false alarms caused by image cropping while ensuring sufficient data volume.

[0061] To test and train the model, a large dataset of water leakage can be prepared initially, currently primarily from publicly available datasets. While these publicly available datasets differ slightly from real-world application scenarios, the multi-source data collection strategy helps obtain diverse and comprehensive image data, improving the model's generalization ability. The current dataset contains water leakage images of point leaks, linear leaks, and large-area leaks; the images also contain interfering elements that affect image segmentation, such as pipes, bolt holes, lighting fixtures, electrical wires and cables, water supply and drainage pipes, and shadows. Furthermore, the dataset will be expanded by incorporating results collected from actual field applications.

[0062] The YOLOv11 inference process involves inputting sliced ​​images into a trained network to determine the extent of water leakage. After the network classifies an area as a leakage zone, it continues to output data.

[0063] The YOLOv11 neural network is existing technology, and its principles and network architecture will not be elaborated upon in this invention. It is also understood that other graph binary classification networks can be used to identify whether water leakage is present, such as previous YOLO models YOLOv7 and YOLOv8, and Faster R-CNN. It is understood that the model used to identify water leakage is not the focus of this invention.

[0064] S4 expands and reassembles the sub-image containing the leaking water to obtain the reassembled image.

[0065] The purpose of this step is to expand the collection range and reconstruct the complete area, restoring the leakage areas that may be divided by subgraph boundaries, such as linear leakage across subgraphs and large-area diffuse leakage, into a complete spatial form, thus providing a basis for subsequent accurate segmentation and area calculation.

[0066] Specifically, the steps of expanding and then reorganizing the subgraph containing the water leakage include: S41 extends a sub-image from a certain original image, centered on the sub-image containing the water seepage, by k layers in both the horizontal and vertical directions.

[0067] When segmenting subgraphs, some leak edges are assigned to separate subgraphs. However, due to their inconspicuous features, they are easily missed by the neural network. To avoid this problem, this step expands each subgraph identified as containing leaks, allowing potentially missed leak edges to be incorporated into the subgraph through expansion.

[0068] Assume the horizontal index of the sub-image containing the leaking water in the original image is i, and the vertical index is j; the number of expansion layers is k. k is a hyperparameter that can be set according to the possible diffusion range of the leak and the recognition accuracy of the model. For example, k=1 means expanding by 1 layer, and k=2 means expanding by 2 layers.

[0069] The expanded subgraph range is: horizontally from i There are 2k+1 subgraphs from k to i+k; the vertical direction starts from j There are 2k+1 subgraphs from k to j+k, forming a (2k+1)×(2k+1) subgraph matrix. When k=1, it is a 3×3 matrix, and when k=2, it is a 5×5 matrix.

[0070] S42 stitches and reassembles the expanded sub-images in the original image. If there are overlapping parts, the overlapping parts are merged. If the sub-image exceeds the original image during expansion, it is filled with a preset filling image.

[0071] The purpose of this step is to solve the problems of spatial continuity and size consistency in sub-map splicing, so as to provide complete and regular input for subsequent water leakage area segmentation and area calculation.

[0072] When a subgraph is expanded, the expansion of adjacent subgraphs may result in overlapping regions after expansion. In addition, if a subgraph containing leakage is close to the edge of the original image, after expanding k layers, some subgraph positions will exceed the actual subgraph range of the original image (i.e., there is no corresponding subgraph in the original image).

[0073] Therefore, if overlap occurs during the stitching and recombination process, deduplication is necessary. When a sub-image expands beyond the original image, a preset fill image is used; p can be set according to the scenario.

[0074] More specifically, this embodiment utilizes the formula:

[0075] Calculate the pixel at a certain coordinate in the reconstructed image; where G i,j,k Let U be the image G, which is the result of k-layer expansion and reassembly centered on sub-images in row i and column j. i,j,k G is the horizontal coordinate in the original image. i,j,k (U,V) represents the image G i,j,k The pixel with coordinates (U, V) in the image G is the pixel in the image G. i,j,k In the vertical coordinates of the original image, I m,n Let s be the subgraph in row m and column n that participates in the splicing and recombination, where s is the side length of the subgraph, k is the number of expansion layers, p is the fill value, and n is the number of columns. x n is the number of subgraphs in a row. y The number of subgraphs in a sequence.

[0076] In the above formula, max(1,i) k) and min(n) x (i+k) Ensure that the horizontal subgraph index m does not exceed the total number of horizontal subgraphs n of the original image. x Similarly, the vertical subgraph index n does not exceed n y This ensures I m,n It is a sub-image that actually exists or can be filled in the original image.

[0077] In the formula, Umods transforms the global horizontal coordinates U of the reconstructed image into a sub-image I. m,n The horizontal relative coordinates inside the subimage. Similarly, Vmods are converted to vertical relative coordinates inside the subimage. The final pixel value equals the subimage I. m,n The pixel values ​​at the internal relative coordinates enable continuous pixel transfer during multi-subgraph stitching.

[0078] By expanding and stitching, the water seepage points in the original image can be isolated without loss of image quality. This solves both the problem of neural networks being unable to use large images and the recognition errors caused by insufficient image clarity in subsequent processes.

[0079] S5 calculates the area of ​​water seepage points in the reconstructed image. If the area of ​​a water seepage point exceeds a threshold, an alarm is triggered.

[0080] In this embodiment, the neural network used to identify water leakage in the sub-image in step S3 is YOLOv11, and the neural network used to calculate the area of ​​water leakage points in the reconstructed image in this step is also YOLOv11.

[0081] YOLOv11 sets the input size to 640*640. However, since the stitched and reconstructed image is (m*640)*(n*640), where m and n are not fixed, directly inputting the image into the network using image scaling without adjustment will cause problems with the image's aspect ratio, thus affecting the network's segmentation accuracy of the water seepage image. Therefore, the input image needs to be resized before area calculation. Specific steps include: S51 calculates the scaling factor.

[0082] The scaling factor is the ratio by which the original image is scaled to the target size. To ensure that the aspect ratio remains unchanged, the smaller value between the width scaling ratio and the height scaling ratio is taken.

[0083] The reconstructed image has a width of W and a height of H; in this embodiment, the target image has a width of W. in =640, height is H in =640. Then, using the formula: r=min(W in / W, H in / H) Calculate the scaling factor; where r is the scaling factor, W is the width of the stitched and reassembled image, and H is the height of the stitched and reassembled image. in To calculate the area of ​​the leakage point, H is the required image width. in Image height required to calculate the area of ​​the leakage point.

[0084] For example, if the reconstructed image size is 2000×1500 and the target size is 640×640, then 640 / 2000=0.32, 640 / 1500≈0.427, r=0.32, thus ensuring that the width is first reduced to 640, and the height is scaled to 1500×0.32=480, and then filled to 640.

[0085] By using a smaller scaling ratio, the image can be shrunk to the target size boundary in the width or height dimension first, and then filled with padding in the other dimension that does not fill the target size, thus maintaining the original aspect ratio.

[0086] S52 uses a scaling factor to calculate the scaled image size.

[0087] The reconstructed image exhibits variations in effective area size due to differences in the central subimage's position. Directly stretching it to the target size, such as 640×640, would distort the leakage area, leading to severely inaccurate area calculations. This step, prioritizing aspect ratio, scales the reconstructed image to an intermediate size not exceeding the target size, preparing for subsequent padding to the target dimensions. Specifically, the formula is:

[0088] Calculate the scaled image size; where w is the scaled width and h is the scaled height.

[0089] For example, the reconstructed image has dimensions W = 2000 pixels, H = 1500 pixels, and an aspect ratio of 4:3; the target image has dimensions W... in =640 pixels, H in =640 pixels; scaling factor r=0.32. Therefore, the scaled size is: The scaled image is 640×480, which meets the target width, but the height is insufficient. Subsequent steps will calculate the top and bottom fill areas to complete the height to 640.

[0090] S53 calculates the filled area.

[0091] After scaling in step S52, the image size is w×h, such as 640×480 in the example, but the target size is W. in ×H in That is, 640×640. At this point, the image contains blank areas that do not fill the target size, which need to be filled with padding pixels.

[0092] The purpose of this step is to keep the leaking area centered in the image and avoid spatial position deviations in subsequent detection due to fill offset.

[0093] Specifically, the first method for calculating the fill area is to use the formula: p_w=W in -w, p_h=H in -h Calculate the total fill height and width; where p_w is the total fill width and p_h is the total fill height.

[0094] For example, W in =640, w=640, then p_w=0; if Hin =640, h=480, then p_h=640 480 = 160.

[0095] Then use the formula:

[0096] Calculate the left, right, top, and bottom fill regions; where p_left is the left fill region, p_right is the right fill region, p_top is the top fill region, and p_bottom is the bottom fill region.

[0097] For example, continuing from the previous text p_h=160, but , p_bottom=160 80 = 80.

[0098] The scaled image needs to be padded with 80 pixels at the top and bottom, and finally vertically centered in the target image.

[0099] S54 uses a scaling factor and a fill area to fill the image and then scales it to obtain the target image.

[0100] The scaling factor and the position and size of the padding region were calculated in the previous steps. The purpose of this step is to process the stitched and reconstructed image using the scaling factor and the position and size of the padding region to obtain the target image for input to the subsequent neural network. Specifically, using the formula...

[0101] Calculate the pixel at a certain coordinate in the target image; where I'(x,y) is the pixel at coordinate (x,y) in the target image I'; O() is the pixel in the image after scaling with a scaling factor, x is the horizontal coordinate in the target image I', y is the vertical coordinate in the target image I', and p is the fill pixel value.

[0102] When p_left≤x <W in pright, and p_top≤y <H in When p_bottom is used, it indicates that the pixel is within the valid area of ​​the non-filled region. .

[0103] That is, pixel (x, y) belongs to the area occupied by the scaled intermediate image. The offset of left and top padding is eliminated by x_pleft and y_ptop, then divided by the scaling factor r, mapped to the corresponding coordinates of the intermediate image, and finally the value is taken as the pixel value of the intermediate image.

[0104] When (x,y) does not meet the valid region condition, I′(x,y)=p. The pixel value is directly set to the preset fill value p. The purpose is to complete the image to a uniform size W. in ×H in Meanwhile, the pixel values ​​of the filled area and the effective area are significantly different. For example, if gray is used for filling, it can be distinguished from dark-colored leakage water, thus avoiding the subsequent detection model from misjudging the filled area as leakage water.

[0105] In short, the purpose of the above steps is to transform an image of size (n*640)*(k*640) into an image of size (n*640)*(n*640). Then, scaling the image to 640*640 maximizes the consistency of the image's dimensions and minimizes information loss, thus making it suitable as input for the subsequent neural network.

[0106] In this embodiment, YOLOv11 is still used to identify water leakage in the target image. It is the same neural network used for water leakage identification in the sub-image in step S3, and will not be described again here. After identification, the formula is used:

[0107] Statistical analysis was performed on the pixels identified as leaking water; where A represents the number of pixels in the leaking area, M(f,g) represents the value of the leaking water result at coordinates (f,g), and W... in To calculate the area of ​​the leakage point, H is the required image width. in The image height required to calculate the area of ​​the leakage point is given by f, where f is the horizontal coordinate in the reconstructed image and g is the vertical coordinate in the reconstructed image.

[0108] The above formula iterates through all pixels of the target image using a double loop, first in the vertical direction (f) and then in the horizontal direction (g). If pixel (f,g) is a leaking area, M(f,g)=1, and it is included in the summation; if pixel (f,g) is not a leaking area, M(f,g)=0, and it does not contribute to the summation. The final summation result A is the total number of pixels in the leaking area.

[0109] After calculating the total number of pixels in the leaking area, the system compares it with a threshold. If the number exceeds the threshold, an alarm is triggered. Additionally, the system merges the number of leaking pixels obtained from adjacent original images to prevent a leaking point from being split into two parts, both of which are below the threshold and thus missed.

[0110] Example 2: like Figure 2 As shown, the present invention also provides a tunnel wall surface leakage detection system, comprising: The acquisition module is used to acquire the original image of the tunnel wall to be inspected; The segmentation module is used to segment the acquired original image of the tunnel wall to be detected into several sub-images; The judgment module is used to determine whether a sub-graph contains water leakage. The reconstruction module is used to expand and reconstruct the sub-image containing the water leakage to obtain the reconstructed image; The calculation module is used to calculate the area of ​​water seepage points in the reconstructed image. If the area of ​​a water seepage point exceeds a threshold, an alarm will be triggered.

[0111] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0112] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a computer terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0113] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims. All of these forms are within the protection scope of the present invention.

Claims

1. A method for detecting water leakage on the surface of a tunnel wall, characterized in that... include: Acquire raw images of the tunnel wall to be inspected; The original image of the tunnel wall to be inspected is segmented into several sub-images; Determine if the subgraph contains water leakage; The sub-image containing the leaking water is expanded and then reassembled to obtain the reassembled image; Calculate the area of ​​the water seepage points in the reconstructed image, and trigger an alarm if the area of ​​a water seepage point exceeds a threshold.

2. The method for detecting water leakage on the surface of a tunnel wall according to claim 1, characterized in that... The steps for segmenting the acquired original image of the tunnel wall to be inspected into several sub-images include: The number of sub-images for each original image segment is determined based on the size of the original image and the size of the sub-images. The coordinates of the pixels in the original image are determined based on the number and size of the sub-images. Segmentation is performed based on coordinate points.

3. The method for detecting water leakage on the surface of a tunnel wall according to claim 2, characterized in that... Using the formula: X = (i-1) s + u, Y=(j-1) s + v Calculate the coordinates of the sub-image pixels in the original image; where X is the horizontal coordinate in the original image, Y is the vertical coordinate in the original image, u is the horizontal coordinate of the sub-image pixel in the sub-image, v is the vertical coordinate of the sub-image pixel in the sub-image, i is the horizontal index of the sub-image in the original image, j is the vertical index of the sub-image in the original image, and s is the side length of the sub-image.

4. The method for detecting water leakage on the surface of a tunnel wall according to claim 1, characterized in that: The YOLOv11 neural network is used to perform binary classification on the subgraph to determine whether the subgraph contains water leakage.

5. The method for detecting water leakage on the surface of a tunnel wall according to claim 1, characterized in that... The steps of expanding and then reassembling the subgraph containing the leaking water include: Expand a given original image by k sub-images in both the horizontal and vertical directions, centered on the sub-image containing the water seepage. The expanded sub-images in the original image are stitched and recombined. If there are overlapping parts, the overlapping parts are merged. If the sub-image exceeds the original image during expansion, it is filled with a preset filling image.

6. The method for detecting water leakage on the surface of a tunnel wall according to claim 5, characterized in that... Using the formula: Calculate the pixel at a certain coordinate in the reconstructed image; where G i,j,k Let U be the image G, which is the result of k-layer expansion and reassembly centered on sub-images in row i and column j. i,j,k G is the horizontal coordinate in the original image. i,j,k (U,V) represents the image G i,j,k The pixel with coordinates (U, V) in the image G is the pixel in the image G. i,j,k In the vertical coordinates of the original image, I m,n Let s be the subgraph in row m and column n that participates in the splicing and recombination, where s is the side length of the subgraph, k is the number of expansion layers, p is the fill value, and n is the number of columns. x n is the number of subgraphs in a row. y The number of subgraphs in a sequence.

7. The method for detecting water leakage on the surface of a tunnel wall according to claim 1, characterized in that... Before calculating the area of ​​water seepage points in the reconstructed image, the size of the stitched and reconstructed image is standardized. The specific steps include: Calculate the scaling factor; Calculate the scaled image size using the scaling factor; Calculate the fill area; The target image is obtained by filling the image with a scaling factor and a fill area, and then scaling it.

8. The method for detecting water leakage on the surface of a tunnel wall according to claim 7, characterized in that... Using the formula: r=min(W in / W, H in / H) Calculate the scaling factor; where r is the scaling factor, W is the width of the stitched and reassembled image, and H is the height of the stitched and reassembled image. in To calculate the area of ​​the leakage point, H is the required image width. in Image height required to calculate the area of ​​the leakage point; Using the formula: Calculate the scaled image dimensions; where w is the scaled width and h is the scaled height; The method for calculating the fill area is to use the following formula: p_w=W in -w, p_h=H in -h Calculate the total fill height and width; where p_w is the total fill width and p_h is the total fill height; Using the formula: Calculate the left, right, top, and bottom fill regions; where p_left is the left fill region, p_right is the right fill region, p_top is the top fill region, and p_bottom is the bottom fill region; Using formula Calculate the pixel at a certain coordinate in the target image; where I'(x,y) is the pixel at coordinate (x,y) in the target image I'; O() is the pixel in the image after scaling with a scaling factor, x is the horizontal coordinate in the target image I', y is the vertical coordinate in the target image I', and p is the fill pixel value.

9. The method for detecting water leakage on the surface of a tunnel wall according to claim 1, characterized in that... The steps for calculating the area of ​​the seepage points in the reconstructed image include: The YOLOv11 neural network was used to identify water leakage in the reconstructed image; Using the formula: Statistical analysis was performed on the pixels identified as leaking water; where A represents the number of pixels in the leaking area, M(f,g) represents the value of the leaking water result at coordinates (f,g), and W... in To calculate the area of ​​the leakage point, H is the required image width. in The image height required to calculate the area of ​​the leakage point is given by f, where f is the horizontal coordinate in the reconstructed image and g is the vertical coordinate in the reconstructed image.

10. A tunnel wall surface leakage detection system, characterized in that... include: The acquisition module is used to acquire the original image of the tunnel wall to be inspected; The segmentation module is used to segment the acquired original image of the tunnel wall to be detected into several sub-images; The judgment module is used to determine whether a sub-graph contains water leakage. The reconstruction module is used to expand and reconstruct the sub-image containing the water leakage to obtain the reconstructed image; The calculation module is used to calculate the area of ​​water seepage points in the reconstructed image. If the area of ​​a water seepage point exceeds a threshold, an alarm will be triggered.

Citation Information

Patent Citations

  • Method for detecting water leakage of tunnel

    CN118799791A