A neural network-based method for detecting tunnel leakage.
By combining the improved Unet neural network model with multi-source detection data, the accuracy problem of tunnel leakage detection in complex scenarios was solved, and efficient and accurate leakage detection was achieved.
Patent Information
- Application Number
- CN202510849582.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-24
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2045-06-24
AI Technical Summary
Existing tunnel leakage detection methods based on visible light images suffer from a significant drop in detection accuracy under uneven lighting, obstruction, or complex scenarios, and cannot effectively capture temperature anomalies and structural deformations in leakage areas.
An improved Unet neural network model is used, which combines infrared thermal imaging data, visible light image data and laser ranging data. Through depthwise separable convolution and padding convolution operations, redundant cross-layer connections are removed to generate multimodal input samples for the detection of water leakage areas.
It significantly improves the detection accuracy in low-light and obstructed scenarios, and can output the location, extent and severity of leakage in real time, meeting the timeliness requirements of tunnel inspection.
Smart Images

Figure CN120726327B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of tunnel water leakage detection technology, specifically to a tunnel water leakage detection method based on neural networks. Background Technology
[0002] Water leakage in tunnels, as one of the main forms of tunnel defects, not only affects the structural safety of tunnels but can also damage electrical equipment and even disrupt the smooth operation of the entire transportation system. Therefore, regular water leakage inspections of tunnels are an important prerequisite for extending their service life and preventing catastrophic risks.
[0003] In the prior art, such as the invention patent with application number 202411283164.X, a method for detecting water leakage in tunnels is proposed. This method is based on an improved EfficientNet-B0 network. It constructs an optimized semantic segmentation model for detection by adaptively adjusting the backbone network, using the scSE attention mechanism, and adjusting the convolution kernel size. However, this method mainly relies on visible light image data and cannot effectively capture temperature anomalies and structural deformations in the water leakage area. The detection accuracy drops significantly in tunnels with uneven lighting, occlusion, or complex scenes. Summary of the Invention
[0004] In view of the above-mentioned defects or deficiencies in the prior art, this application aims to provide a tunnel leakage detection method based on neural networks, which improves detection accuracy while ensuring detection timeliness; the detection method includes the following steps:
[0005] The improved Unet neural network model is obtained by replacing the standard convolutional layers in the Unet network with depthwise separable convolutional layers, using padded convolution operations, and removing redundant cross-layer connection structures in the Unet network.
[0006] Collect multi-source detection data inside the tunnel, including infrared thermal imaging data, visible light image data, and laser ranging data;
[0007] The multi-source detection data is preprocessed to obtain an input sample set, which includes temperature distribution images, visible light images, and depth images; wherein, all images in the input sample set have the same size.
[0008] The temperature distribution image, the visible light image, and the depth image in the input sample set are fused according to the channel dimension and input into the improved Unet neural network model to generate a binary segmentation mask with the same size as the visible light image.
[0009] By comprehensively analyzing the binarized segmentation mask, the actual location, leakage range, and severity of the leakage area within the tunnel can be obtained.
[0010] According to the technical solution provided in this application, the preprocessing of the multi-source detection data to obtain the input sample set includes the following steps:
[0011] The visible light image data is processed by color space conversion to separate the color features of the leaking water, thus obtaining a visible light image.
[0012] The infrared thermal imaging data is converted into a two-dimensional temperature distribution image with the same size as the visible light image.
[0013] The laser ranging data is used to generate a two-dimensional depth image with the same size as the visible light image by an interpolation algorithm.
[0014] According to the technical solution provided in this application, the step of fusing the temperature distribution image, the visible light image, and the depth image in the input sample set according to the channel dimension and inputting them into the improved Unet neural network model includes the following steps:
[0015] The input sample set is fused along the channel dimension to obtain a multi-channel input tensor;
[0016] The multi-channel input tensor is input into the improved Unet neural network model.
[0017] According to the technical solution provided in this application, after generating the binary segmentation mask, the method further includes the following steps:
[0018] Mark the target pixel coordinates of the water leakage area on the binarized segmentation mask.
[0019] According to the technical solution provided in this application, the comprehensive analysis of the binarized segmentation mask includes the following steps:
[0020] Based on the original three-dimensional data from laser ranging, the target pixel coordinates of the binarized segmentation mask are mapped to the three-dimensional space of the tunnel to obtain the actual location of the seepage area within the tunnel.
[0021] The number of pixels in the water leakage area in the binarized segmentation mask is counted, and the actual area of the leakage range is calculated by combining the scale parameters of the depth image.
[0022] The severity of leakage is assessed by fusing the gradient information of the temperature distribution image with the color depth of the visible light image.
[0023] According to the technical solution provided in this application, the step of separating the color features of the leaking water from the visible light image data through color space conversion includes the following steps:
[0024] After converting the visible light image data from RGB space to HSV space, a dual-color gamut mask, mask1 and mask2, are established through linear normalization. Mask1 corresponds to the purple and blue transition region mask, and mask2 corresponds to the blue region mask.
[0025] The purple region mask is obtained by performing a difference calculation on mask1-mask2, and the purple region mask is used as the leakage area mask. After morphological closing operation, a binary label is generated.
[0026] According to the technical solution provided in this application, the training process of the improved Unet neural network model includes:
[0027] The parameters are updated using a binary cross-entropy loss function and an RMSprop optimizer.
[0028] A dynamic learning rate adjustment strategy is introduced during training. When the Dice coefficient on the validation set does not increase for three consecutive epochs, the learning rate is reduced to 1 / 5 of the current value.
[0029] A multimodal training set was constructed by mixing labeled data from the HSV space with labeled data from the SAM model, with the input ratio of the two types of labeled data being 3:1.
[0030] According to the technical solution provided in this application, a mobile inspection robot is used to collect multi-source detection data within a tunnel, including:
[0031] The spatial alignment of the infrared thermal imager, visible light camera and laser rangefinder is achieved by using the 120° equal-angle layout of the disc servo robotic arm.
[0032] Establish a synchronous acquisition mechanism based on hardware trigger signals. When the laser rangefinder detects that the target distance is less than the first preset threshold, it synchronously triggers the infrared thermal imager and the visible light camera to expose.
[0033] In the data preprocessing stage, affine transformation is used to unify infrared thermal imaging data, visible light image data, and laser ranging data into the same spatial coordinate system.
[0034] According to the technical solution provided in this application, the process of fusing the gradient information of the temperature distribution image with the color depth of the visible light image to assess the severity of leakage includes the following steps:
[0035] Construct the temperature gradient matrix and the visible light color depth matrix;
[0036] Define a leakage index, which is related to the actual area of the leakage range;
[0037] If the leakage index is greater than or equal to the second preset threshold, it is determined to be a serious leakage; if the leakage index is greater than the third preset threshold but less than the second preset threshold, it is determined to be a moderate leakage; if the leakage index is less than or equal to the third preset threshold, it is determined to be a minor leakage.
[0038] According to the technical solution provided in this application, the method further includes constructing a physical feature constraint function for water leakage, wherein the physical feature constraint function includes temperature-depth correlation constraint and color-depth consistency constraint;
[0039] After generating the binary segmentation mask, the following steps are included:
[0040] The binarized segmentation mask is divided into 10×10 pixel grids, and the neural network confidence score and physical constraint compliance score are calculated simultaneously for each grid. The neural network confidence score is obtained from the output of the improved Unet neural network model, and the physical constraint compliance score is obtained from the seepage water physical feature constraint function.
[0041] The comprehensive analysis of the binarized segmentation mask includes the following steps:
[0042] If the deviation between the neural network confidence score and the physical constraint compliance score is less than or equal to a fourth preset threshold, then a comprehensive analysis is performed on the binarized segmentation mask.
[0043] Compared with existing technologies, the advantages of this application are as follows: This application replaces the standard convolution in the Unet network with depthwise separable convolution and removes redundant cross-layer connections, significantly reducing the number of model parameters and computational complexity. At the same time, it uses filled convolution to maintain the feature map resolution and improve the detection accuracy of small target leakage areas. In addition, by combining infrared thermal imaging (reflecting temperature anomalies), visible light images (surface texture), and laser ranging data (depth information), multimodal input samples are generated through adaptive stitching, which effectively enhances the model's ability to characterize leakage areas and improves the detection accuracy in low-light and occluded scenarios. Especially when the leakage edge is blurred, the segmentation accuracy is significantly better than the single data source method. The improved Unet network has a faster inference speed. Combined with binarized mask comprehensive analysis technology, it can output the leakage location, range, and severity in real time, meeting the timeliness requirements of tunnel inspection. Attached Figure Description
[0044] Figure 1 A schematic diagram of the steps of the tunnel leakage detection method based on neural networks provided in this application;
[0045] Figure 2 A schematic diagram of the structure of the improved Unet neural network model provided in this application;
[0046] The text labels in the image represent:
[0047] 1. Input the sample set; 2. 3. Depthwise separable convolutional layers with ReLU activation function; Max pooling layer; 4. Upsampling convolutional layer; 5. 6. Standard convolutional layer with ReLU activation function; 7. Skip connection layer; 8. Convolutional layer; 9. Binarization segmentation mask. Detailed Implementation
[0048] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings.
[0049] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0050] Example 1
[0051] As mentioned in the background section, to address the problems in the existing technology, this application proposes a method for detecting tunnel leakage based on neural networks, such as... Figure 1 As shown, it includes the following steps:
[0052] S1. Replace the standard convolutional layers in the Unet network with depthwise separable convolutional layers, use padding convolution operations, and remove redundant cross-layer connection structures in the Unet network to obtain an improved Unet neural network model.
[0053] Specifically, such as Figure 2 As shown, by replacing the two multi-channel 3×3 standard convolutions in each layer of the backbone of the traditional Unet network structure with 3×3 depthwise separable convolutions + ReLU activation function layer 2, the number of model parameters is reduced. The non-padded convolutions used in Unet are replaced with padded convolutions (3×3 standard convolutions + ReLU activation function layer 5) to ensure that the feature map size does not change during convolution operations. Max pooling layer 3 Upsampling convolutional layer 4, skip connection layer 6 Convolutional layer 7 ensures the output mask (binarized segmentation mask 8) is sized to match the input image. The first and second layer cross-layer connections, which are less relevant to the feature maps, are removed, further reducing the model's computational load and improving inference speed. Specifically, the number of output channels in the improved Unet neural network model is equal to the number of input mask categories, i.e., the number of categories in the multi-source detection data; this scheme can optionally use 3 channels.
[0054] Specifically, the original structure of the traditional Unet model takes an input image of 572×572 pixels, while the processed output feature map becomes 570×570 pixels, and the number of channels increases from 1 to 64. This indicates that 64 3×3 convolutional kernels are used for convolution operations. The improvement of the Unet neural network model lies in changing the input image patch size to 512×512 pixels and replacing the downsampling part with depthwise separable convolution, which means... Figure 2 All horizontal arrows in the downward process from the left represent depthwise separable convolutions to reduce the number of model parameters. The original non-padded convolutions were replaced with padded convolutions, meaning the horizontal dimension remained the same while the number of channels changed. This ensures the output mask size matches the input image size. The skip connection layers used for cross-layer connections in the two gray arrows above were removed. This process replaces complex late-stage feature fusion (such as feature pyramids) with early channel fusion, significantly improving real-time performance while maintaining accuracy, meeting the real-time inspection requirements of mobile robots.
[0055] Furthermore, the training process of the improved Unet neural network model includes:
[0056] The parameters are updated using a binary cross-entropy loss function and an RMSprop optimizer.
[0057] A dynamic learning rate adjustment strategy is introduced during training. When the Dice coefficient on the validation set does not increase for three consecutive epochs, the learning rate is reduced to 1 / 5 of the current value.
[0058] A multimodal training set was constructed by mixing labeled data from the HSV space with labeled data from the SAM model, with the input ratio of the two types of labeled data being 3:1.
[0059] Specifically, a data configuration file is created based on the location, number of categories, and category names of the tunnel water seepage image dataset; the model training parameters required for the model training process are then set.
[0060] (1) Number of training epochs: 150 training epochs.
[0061] (2) Batch Size: Based on the server configuration information, select 8 input images per batch.
[0062] (3) Loss function: Binary cross entropy is selected as the loss function when there is only a single class segmentation target.
[0063] (4) Optimizer: The root mean square propagation (RMSprop) method is selected as the optimizer for training the model and used for learning rate updates.
[0064] The improved Unet leakage detection model is initialized with weights. The confidence loss, classification loss and bounding box loss are calculated through forward propagation. The parameters in the network are updated through back propagation.
[0065] After training on the training set, the model is tested on the test set to evaluate its performance. The confusion matrix is the basis for calculating the metrics. When evaluating the model, the inference results are divided into four parts:
[0066] (1) True TP: The model predicts a positive example, and it is actually a positive example.
[0067] (2) False positives (FP): The model predicts a positive example, but it is actually a negative example.
[0068] (3) False negative example FN: The model predicts it to be a negative example, but it is actually a positive example.
[0069] (4) True counterexample TN: The model predicts a counterexample, but it is actually a counterexample.
[0070] The following evaluation indicators were adopted.
[0071] (1) The proportion of correct predictions in the total predicted values.
[0072] accuracy=(TP+TN) / (TP+FP+FN+TN)
[0073] (2) Precision: The probability that a certain category is correctly predicted in the model's preliminary results.
[0074] precision = TP / (TP + FP)
[0075] (3) Recall: The probability that a certain category is correctly predicted in the true value.
[0076] recall = TP / (TP + FN)
[0077] (4) F1 score: The harmonic mean of the model's precision and recall. In cases of imbalanced positive and negative samples, precision and recall may differ significantly. The F1 score takes both metrics into account to provide a more comprehensive evaluation of the model's performance.
[0078] F1 = 2 × TP / (2 × TP + FP + FN)
[0079] (5) Dice coefficient: The ratio of the intersection of the predicted result and the true value of the double model to the sum of the predicted result and the true value, used to measure the similarity of the image segmentation results.
[0080] Dice = 2 × TP / (TP + FN) + (TP + FP)
[0081] (6) Intersection over union (IoU): The ratio of the intersection to the union of the model's predicted results and the actual values, used to measure the accuracy of the segmentation results.
[0082] IoU = Dice / (2 - Dice)
[0083] Benchmark tests were conducted, including the following parameters: model size, number of model parameters, model computational cost, inference speed, and frame rate (fps).
[0084] This implementation can achieve: enhanced feature complementarity: through channel fusion, the network can simultaneously learn visible light texture, infrared temperature anomalies, and deep structural information, solving the problem of missed detection in scenarios such as occlusion and reflection caused by a single data source; optimized computational efficiency: compared with traditional complex multi-module feature fusion (such as spatial pyramid and CBAM), this solution directly fuses multi-source data at the input layer, reducing redundant computation within the network and improving inference speed; channel dimension fusion improves the segmentation accuracy (mIoU) of the model in scenarios with blurred edges of tunnel seepage.
[0085] The principle behind the model improvement is explained as follows: First, tunnel inspection robots need to process 4K high-resolution images (typical size 3840×2160) in real time. Traditional Unet suffers from latency when deployed on mobile devices. By replacing standard convolutional layers with depthwise separable convolutional layers and removing redundant cross-layer connections in the Unet network, the number of parameters is reduced by 82%. Depthwise separable convolution reduces the computational cost of a 3×3 convolution from C_in×C_out×9 to C_in×(1+9). Taking a typical layer with C_in=64 and C_out=128 as an example, the original computational cost is 64×128×9=73728. The resolution was reduced to 64×(9+1)=640 after the improvement, increasing the inference speed by 3.8 times. After removing the cross-layer connections of the first and second layers, the processing time for a single frame of a 1080P image was reduced from 230ms to 60ms, supporting real-time detection at 30fps (meeting the requirements of mobile video streaming). Secondly, tunnel leakage edges often exhibit blurred radial patterns (such as capillary seepage). Using filled convolution operations can improve edge segmentation accuracy while maintaining feature map resolution, increasing the intersection-union ratio (LOU) of 0.5mm-level microcracks from 0.62 to 0.79, and improving the D-splitter effect of water droplet-like edges. The ice coefficient is improved by 19% (0.83→0.98). In addition, spatial alignment can be guaranteed, the output mask is strictly mapped to the input image in a 1:1 ratio, the laser ranging coordinate matching error is reduced, and the spatial registration accuracy of multimodal data is high. Third, single sensors are susceptible to interference from the tunnel environment (such as strong light reflection and water mist interference). Through multimodal fusion improvement (five-channel input), interference can be resisted. Specifically, if the lighting is insufficient, the false detection rate is reduced by infrared compensation; if the wall reflects light, the false detection rate is reduced by depth verification; and if the surface is condensed, the false detection rate is reduced by temperature gradient filtering.
[0086] S2. Collect multi-source detection data in the tunnel, including infrared thermal imaging data, visible light image data, and laser ranging data;
[0087] Furthermore, a mobile inspection robot is used to collect multi-source detection data within the tunnel, including:
[0088] The spatial alignment of the infrared thermal imager, visible light camera and laser rangefinder is achieved by using the 120° equal-angle layout of the disc servo robotic arm.
[0089] Establish a synchronous acquisition mechanism based on hardware trigger signals. When the laser rangefinder detects that the target distance is less than the first preset threshold, it synchronously triggers the infrared thermal imager and the visible light camera to expose.
[0090] In the data preprocessing stage, affine transformation is used to unify infrared thermal imaging data, visible light image data, and laser ranging data into the same spatial coordinate system.
[0091] Specifically, the inspection robot comprises a tracked vehicle platform, a data acquisition structure, an equipment control and data processing structure, and a power supply structure. The data acquisition structure includes an infrared thermal imager, a visible light camera, a laser rangefinder, and a disc-mounted servo robotic arm. A disc-mounted servo robotic arm is fixedly connected to the top of the tracked vehicle platform. The infrared thermal imager, visible light camera, and laser rangefinder are evenly distributed on the disc of the servo robotic arm, with a rotation angle of 120° between the three detection devices. A servo core board is located on the underside of the tracked vehicle platform, used to assist in the control of the disc-mounted servo robotic arm. The equipment control and data processing structure is a laptop. The power supply structure is a lithium battery, fixed to the bottom plate of the tracked vehicle platform via a belt, and powered by a lithium battery connector, DC male / female connector, banana plug, and aviation connector. A communication interface is located on the laptop, which is connected to the infrared thermal imager, visible light camera, and laser rangefinder. The disc-shaped robotic arm can rotate in different directions via servo motors. The range limits and torque values of the servo motors' rotation angles are determined based on the required rotation angles and masses of the infrared thermal imager, visible light camera, and laser rangefinder. The operational range of the infrared thermal imager, visible light camera, and laser rangefinder is determined by the cross-sectional size of the shield tunnel lining and environmental conditions. A lithium battery is used, which is charged by the provided power adapter.
[0092] S3. The temperature distribution image, the visible light image, and the depth image in the input sample set 1 are fused according to the channel dimension and input into the improved Unet neural network model to generate a binary segmentation mask 8, the size of which is consistent with the visible light image.
[0093] Further, the step of fusing the temperature distribution image, the visible light image, and the depth image from the input sample set 1 according to the channel dimension and inputting them into the improved Unet neural network model includes the following steps:
[0094] The input sample set 1 is fused along the channel dimension to obtain a multi-channel input tensor;
[0095] The multi-channel input tensor is input into the improved Unet neural network model.
[0096] Optionally, visible light images (3-channel RGB) are used as the first 3 channels; infrared thermal imaging (single-channel temperature distribution) is used as the 4th channel; and depth images generated by laser ranging (single-channel) are used as the 5th channel. Finally, a 5-channel input tensor is generated and directly input into the network for end-to-end learning.
[0097] Specifically, the fusion process includes: First, data preprocessing and spatial alignment, including spatial coordinate system 1 and data format standardization. This involves mapping the three sets of data to the same coordinate system using affine transformation to achieve spatial coordinate system 1. The transformation matrix parameters are pre-calculated using a calibration board to ensure pixel-level alignment. In data format standardization, the visible light image's RGB channels are directly preserved, the infrared thermal imaging data undergoes linear temperature value normalization, and the laser ranging data is bilinearly interpolated to generate a depth map. Then, the temperature distribution image, visible light image, and depth image are fused along their respective channels. The fusion principle treats the three types of data as complementary features: visible light (3 channels): surface texture and color (RGB), infrared (1 channel): temperature anomalies (grayscale values), and depth (1 channel): surface geometry (depth values), resulting in a multi-channel input tensor. Next, this multi-channel input tensor is input into an improved Unet neural network model. The output layer generates a probability map using a sigmoid activation function, and binarization is performed at a threshold of 0.5.
[0098] S4. After adaptively stitching the input sample set 1, it is input into the improved Unet neural network model to generate a binary segmentation mask 8, the size of which is consistent with the visible light image.
[0099] S5. Perform a comprehensive analysis on the binarized segmentation mask 8 to obtain the actual location, leakage range, and severity of the leakage area within the tunnel.
[0100] In a preferred embodiment, the preprocessing of the multi-source detection data to obtain input sample set 1 includes the following steps:
[0101] The visible light image data is processed by color space conversion to separate the color features of the leaking water, thus obtaining a visible light image.
[0102] Furthermore, the step of separating the color features of the leaking water from the visible light image data through color space conversion includes the following steps:
[0103] After converting the visible light image data from RGB space to HSV space, a dual-color gamut mask, mask1 and mask2, are established through linear normalization. Mask1 corresponds to the purple and blue transition region mask, and mask2 corresponds to the blue region mask.
[0104] The purple region mask is obtained by performing a difference calculation on mask1-mask2, and the purple region mask is used as the leakage area mask. After morphological closing operation, a binary label is generated.
[0105] Specifically, visible light image data is acquired using an infrared camera. The seepage locations in the pre-processed tunnel seepage image data are then labeled using the Labelme annotation tool, resulting in the tunnel seepage image SAM dataset. The acquired raw images (visible light image data) are converted from the RGB color space to the HSV color space, separating hue, saturation, and brightness information. The converted HSV images undergo linear normalization to standardize pixel values to a predetermined range. A purple-blue transition region mask (mask1) and a blue transition region mask (mask2) are then separated, and the formula mask = mask1 - mask2 is used. The purple region was separated; the purple region represents the water seepage area, which was binarized into a black and white mask, resulting in the HSV dataset of tunnel water seepage images. Data augmentation was performed on the tunnel water seepage image data, including left-right flipping, rotation, vertical flipping, random cropping, small-block deformation, and shearing. A combination of these methods was used, with random cropping probability of 0.5, rotation probability of 0.8, left-right flipping probability of 0.8, vertical flipping probability of 0.3, small-block deformation probability of 0.6, and shearing probability of 0.5. A total of 1000 augmented images were generated during training. Based on 199 infrared image samples of tunnel water seepage defects, two different datasets were created using an auxiliary annotation method based on the Segment Anything Model and an automatic annotation method based on the HSV color space. Each dataset contained 1000 augmented images and 199 original images. The 1000 augmented images were randomly divided into a training set and a validation set at a 9:1 ratio, and all original images were used as the test set.
[0106] The infrared thermal imaging data is converted into a two-dimensional temperature distribution image with the same size as the visible light image.
[0107] The laser ranging data is used to generate a two-dimensional depth image with the same size as the visible light image by an interpolation algorithm.
[0108] In a preferred embodiment, after generating the binarized segmentation mask 8, the method further includes the following steps:
[0109] The target pixel coordinates of the water leakage area are marked on the binarized segmentation mask 8.
[0110] In a preferred embodiment, the comprehensive analysis of the binarized segmentation mask 8 includes the following steps:
[0111] Based on the original three-dimensional data from laser ranging, the target pixel coordinates of the binarized segmentation mask 8 are mapped to the three-dimensional space of the tunnel to obtain the actual location of the seepage area within the tunnel.
[0112] The number of pixels in the water leakage area in the binarized segmentation mask 8 is counted, and the actual area of the leakage range is calculated by combining the scale parameters of the depth image.
[0113] The severity of leakage is assessed by fusing the gradient information of the temperature distribution image with the color depth of the visible light image.
[0114] In a preferred embodiment, the process of fusing the gradient information of the temperature distribution image with the color depth of the visible light image to assess the severity of leakage includes the following steps:
[0115] Construct the temperature gradient matrix and the visible light color depth matrix;
[0116] Define a leakage index, which is related to the actual area of the leakage range;
[0117] If the leakage index is greater than or equal to the second preset threshold, it is determined to be a serious leakage; if the leakage index is greater than the third preset threshold but less than the second preset threshold, it is determined to be a moderate leakage; if the leakage index is less than or equal to the third preset threshold, it is determined to be a minor leakage.
[0118] For example, a suspected leak was found in a section of a subway tunnel. An inspection robot equipped with an infrared thermal imager, a visible light camera, and a laser rangefinder was used for detection. The visible light image was a 1024×768 resolution RGB image showing purple water stains on the tunnel wall. The infrared thermal imaging data showed the temperature distribution of the same area, with a resolution of 1024×768, indicating a temperature of 12℃ in the area (ambient temperature 18℃). The laser rangefinder data was 3D point cloud data containing the spatial coordinates (x, y, z) of each rangefinder point. The RGB image was converted to the HSV color space, and the hue (H), saturation (S), and lightness (V) channels were separated through linear normalization. A mask was defined for the purple-blue transition region (mask1: H∈[250, 280], S>0.5) and the blue region (mask2: H∈[200, 240], S>0.6). The difference mask was calculated: mask = mask1 - mask2, resulting in a binary mask for the purple region. Morphological closing operations (dilation + erosion) are performed on the mask to eliminate noise and smooth boundaries. The raw temperature data (matrix form) collected by the infrared sensor is converted into a grayscale temperature distribution map (1024×768) with the same size as the visible light image, where each pixel value corresponds to the temperature. The 3D point cloud data is then used to generate a 2D depth map (1024×768) with the same resolution as the visible light image, where each pixel value represents the distance (in meters). The depth map is aligned with the spatial coordinates of the visible light image. (Visible light image: Preservation) The original RGB three channels (1024×768×3) are retained. The temperature distribution map is used as the 4th channel (single-channel grayscale image), and the depth map is used as the 5th channel (single-channel grayscale image). The channels are stitched together to generate a 5-channel input tensor (1024×768×5). The 5-channel input tensor is input into the improved Unet model. The last layer outputs a probability map (1024×768) through the Sigmoid function. The threshold is set to 0.5 to generate a binary segmentation mask 8. All pixel coordinates (i, j) with a value of 1 are marked in the segmentation mask, such as (500, 300), (501, 300), etc. Based on the original 3D data of laser ranging, each marked pixel (i, j) in the mask is mapped to the tunnel space coordinates (x, y, z). Example: Pixel (500, 300) is mapped to the actual location (x=10.5m, y=3.2m, z=0m). The number of marked pixels in the mask is counted as 5000. Based on the depth map parameters (1 pixel = 0.01m2), the actual leakage area is calculated as 5000 × 0.01 = 50m2. Temperature gradient: The average temperature gradient of the leakage area is extracted as ΔT = 6℃ (ΔT = ambient temperature - leakage area temperature).Color Depth: The average saturation of the leaking area in the HSV space is extracted as S=0.8, and the leakage index is calculated as 0.6×ΔT+0.4×S=0.6×6+0.4×0.8=3.6+0.32=3.92. According to the judgment rules: severe leakage: ≥3.5, moderate leakage: 2.0~3.5, slight leakage: ≤2.0. The leakage level is judged as severe leakage.
[0119] Example 2
[0120] Based on Example 1, this implementation method further improves the detection accuracy, specifically as follows:
[0121] In a preferred embodiment, the method further includes constructing a physical characteristic constraint function for the leakage water, the physical characteristic constraint function including temperature-depth correlation constraint and color-depth consistency constraint;
[0122] After generating the binarized segmentation mask 8, the following steps are included:
[0123] The binarized segmentation mask 8 is divided into 10×10 pixel grids, and the neural network confidence score and physical constraint compliance score are calculated simultaneously for each grid. The neural network confidence score is obtained from the output of the improved Unet neural network model, and the physical constraint compliance score is obtained from the seepage water physical feature constraint function.
[0124] The comprehensive analysis of the binarized segmentation mask 8 includes the following steps:
[0125] If the deviation between the neural network confidence score and the physical constraint compliance score is less than or equal to the fourth preset threshold, then the binarized segmentation mask 8 is subjected to comprehensive analysis.
[0126] Specifically, a physical constraint verification module can be added to the decoder end of the improved Unet neural network model. The verification module is the physical feature constraint function. The temperature-depth correlation constraint is: establish a mathematical relationship between temperature gradient and surface depth based on the heat conduction equation. When the laser ranging data shows that the surface unevenness of the target is >5mm, the absolute value of the temperature gradient in the corresponding area is required to be ≥0.8℃ / cm. The color-depth consistency constraint is: define the inverse relationship between color saturation and surface roughness. When the blue channel value of the visible light image is >200 and the standard deviation of the depth data is <2mm, the leakage area judgment is forcibly activated. The physical constraint compliance score is related to the degree of compliance with the color rule (color-depth consistency constraint) and the temperature rule (temperature-depth correlation constraint). The temperature rule score is calculated as: |actual temperature gradient - 0.8| / 0.8 (the deviation ratio from the standard value). For example, if the measured temperature gradient of a certain area is 0.6℃ / cm, the score is 1 - |0.6-0.8| / 0.8 = 0.75. The color rule score is calculated as: blue channel value / 200 × (1 - depth standard deviation / 2). For example, if the blue value is 210 and the depth fluctuation is 1mm, the score is (210 / 200) × (1 - 1 / 2) = 1.05 × 0.5 = 0.525. Therefore, the average physical constraint compliance score is approximately 0.6. The neural network confidence score is derived from the predicted probability value (between 0 and 1) of each pixel output by the sigmoid function of the last layer of the neural network. For example, if the average probability of a certain area is 0.92, it means that the model is 92% confident that it is a leak. Then, the neural network confidence score is approximately 0.9. The deviation = |neural network confidence score - physical constraint compliance score| / (neural network confidence score + physical constraint compliance score) = 0.2 > 0.15 (15%), which triggers a review.
[0127] This implementation method eliminates false detections of areas that do not conform to the physical characteristics of leakage by using physical constraints. For example, an area might be falsely identified as a leak by the model due to light reflection (confidence level 0.9), but its depth data shows that the area is located inside the tunnel structure (physical score 0.1), with a deviation of 0.8 > the threshold of 0.2, so it is excluded. False detection correction: Areas with low confidence but conforming to physical constraints are subject to secondary verification. For example, a leakage area might have a model confidence level of 0.4 due to image blurring, but its temperature gradient matches the depth (physical score 0.9), with a deviation of 0.5 > the threshold, triggering manual review to avoid false detections.
[0128] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. The above descriptions are only preferred embodiments of this application. It should be noted that due to the limitations of written expression, while there are objectively infinite specific structures, those skilled in the art can make several improvements, modifications, or changes without departing from the principles of this invention, and can also combine the above technical features in an appropriate manner. These improvements, modifications, changes, or combinations, or the direct application of the inventive concept and technical solution to other situations without modification, should all be considered within the scope of protection of this application.
Claims
1. A neural network-based tunnel water leakage detection method, characterized in that, The method comprises the following steps: The standard convolution layer in the Unet network is replaced by a deep separable convolution layer, a padding convolution operation is adopted, and redundant cross-layer connection structures in the Unet network are deleted to obtain an improved Unet neural network model; Collecting multi-source detection data in the tunnel, wherein the multi-source detection data comprises infrared thermal imaging data, visible light image data and laser ranging data; Preprocessing the multi-source detection data to obtain an input sample set (1), wherein the input sample set (1) comprises a temperature distribution image, a visible light image and a depth image; wherein the sizes of the images in the input sample set (1) are consistent; Fusing the temperature distribution image, the visible light image and the depth image in the input sample set (1) in the channel dimension, inputting them into the improved Unet neural network model, and generating a binary segmentation mask (8) with a size consistent with the visible light image; Comprehensively analyzing the binary segmentation mask (8) to obtain the actual position, leakage range and leakage severity of the water leakage area in the tunnel; After the binary segmentation mask (8) is generated, the following steps are further included: Marking the target pixel coordinates of the water leakage area on the binary segmentation mask (8); The comprehensive analysis of the binary segmentation mask (8) comprises the following steps: Mapping the target pixel coordinates of the binary segmentation mask (8) to the three-dimensional space of the tunnel based on the original three-dimensional data of the laser ranging data to obtain the actual position of the water leakage area in the tunnel; Counting the number of pixels of the water leakage area in the binary segmentation mask (8), and combining the scale parameter of the depth image to calculate the actual area of the leakage range; Fusing the gradient information of the temperature distribution image and the color depth of the visible light image to evaluate the leakage severity; The fusion of the gradient information of the temperature distribution image and the color depth of the visible light image to evaluate the leakage severity comprises the following steps: Constructing a temperature gradient matrix and a visible light color depth matrix; Defining a leakage index related to the actual area of the leakage range; If the leakage index is greater than or equal to a second preset threshold, it is determined as severe leakage, if the leakage index is greater than a third preset threshold and less than the second preset threshold, it is determined as moderate leakage, and if the leakage index is less than or equal to the third preset threshold, it is determined as slight leakage. 2.The neural network-based tunnel water leakage detection method of claim 1, wherein: The preprocessing of the multi-source detection data to obtain the input sample set (1) comprises the following steps: Separating the water leakage color feature of the visible light image data through color space conversion to obtain a visible light image; Converting the infrared thermal imaging data into a two-dimensional temperature distribution image with a size consistent with that of the visible light image; Generating a two-dimensional depth image with a size consistent with that of the visible light image from the laser ranging data through an interpolation algorithm. 3.The neural network-based tunnel water leakage detection method of claim 1, wherein: The fusion of the temperature distribution image, the visible light image and the depth image in the input sample set (1) in the channel dimension and inputting them into the improved Unet neural network model comprise the following steps: The input sample set (1) is fused in the channel dimension to obtain a multi-channel input tensor; The multi-channel input tensor is input into the improved Unet neural network model. 4.The neural network-based tunnel water leakage detection method of claim 2, wherein: The visible light image data is separated from the color space conversion to obtain the leakage water color feature, including the following steps: After the visible light image data is converted from the RGB space to the HSV space, linear normalization processing is performed to establish mask1 and mask2 dual-color domain masks, wherein mask1 corresponds to a purple and blue transition region mask, and mask2 corresponds to a blue region mask; The purple region mask is obtained by difference calculation from mask1-mask2, and the purple region mask is used as a leakage water region mask, and a binary label is generated after morphological closing operation. 5.The neural network-based tunnel water leakage detection method of claim 1, wherein: The training process of the improved Unet neural network model includes: A binary cross-entropy loss function and an RMSprop optimizer are used for parameter updating; In the training process, a dynamic learning rate adjustment strategy is introduced, and when the Dice coefficient of the validation set does not improve for 3 consecutive epochs, the learning rate is reduced to 1 / 5 of the current value; By mixing the labeled data in the HSV space and the labeled data of the SAM model, a multi-modal training set is constructed, and the input proportion of the two types of labeled data is 3:
1. 6.The neural network-based tunnel water leakage detection method of claim 1, wherein: The mobile inspection robot is used to collect multi-source detection data in the tunnel, including: Through the 120° equiangular layout of the disc rudder mechanical arm, the spatial alignment of the infrared thermal imager, visible light camera and laser range finder is realized; A synchronous acquisition mechanism based on a hardware trigger signal is established, and when the laser range finder detects that the target distance is less than a first preset threshold, the infrared thermal imager and the visible light camera are triggered to expose synchronously; In the data preprocessing stage, the infrared thermal imaging data, visible light image data and laser ranging data are unified to the same spatial coordinate system through affine transformation. 7.The neural network-based tunnel leakage water detection method of claim 1, wherein: The method further includes constructing a physical feature constraint function of the leakage water, and the physical feature constraint function includes a temperature-depth correlation constraint and a color-depth consistency constraint. After the binary segmentation mask (8) is generated, the following steps are included: The binary segmentation mask (8) is divided into 10x10 pixel grids, and neural network confidence scores and physical constraint compliance scores are calculated for each grid, wherein the neural network confidence scores are obtained from the improved Unet neural network model, and the physical constraint compliance scores are obtained from the leakage water physical feature constraint function. The comprehensive analysis of the binary segmentation mask (8) includes the following steps: If the deviation between the neural network confidence score and the physical constraint compliance score is less than or equal to a fourth preset threshold, the binary segmentation mask (8) is comprehensively analyzed.
Citation Information
Patent Citations
Method for detecting water leakage of tunnel
CN118799791A
Image change detection method based on depth-separable convolution network
CN108846835A
Landslide identification method and device based on satellite data UNet network model
CN115131684A