A method for detecting water leakage in a tunnel

By constructing and training a semantic segmentation model of adaptive adjustment backbone network improved based on EfficientNet-B0 network, the problem of low tunnel leakage detection efficiency is solved, and automated and efficient detection effect is achieved.

CN118799791BInactive Publication Date: 2025-02-07CHINA UNIV OF MINING & TECH (BEIJING)
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411283164.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-13
Publication Date
2025-02-07
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the prior art, tunnel leakage detection relies on manual inspection, low efficiency and lack automated and efficient detection methods.

Method used

By establishing a leaky water data set, an initial leaky water semantic segmentation model of the adaptive adjustment backbone network improved by EfficientNet-B0 network is constructed, the model is trained and the optimization model is saved, and the image data to be detected is input to the optimization model for Test.

Benefits of technology

It realizes automated and efficient tunnel leakage detection, which can dynamically adjust the network structure to reduce model parameters and calculation costs, and improve detection accuracy and real-time performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118799791B_ABST
    Figure CN118799791B_ABST
Patent Text Reader

Abstract

The present application relates to a method for detecting water leakage in a tunnel, and to the technical field of tunnel detection. The method comprises: 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 the EfficientNet‑B0 network, wherein the attention mechanism of the MBconv1 module in the adaptive adjustment backbone network is the scSE attention mechanism, and the convolution kernel of the sixth MBconv6 module is 1×1; based on the water leakage data set, the initial water leakage semantic segmentation model is trained, and the trained optimized water leakage semantic segmentation model is saved; and the tunnel image data to be detected is input into the optimized water leakage semantic segmentation model to perform tunnel water leakage detection. The present application can be used to detect tunnel water leakage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of tunnel detection, and in particular to a method for detecting water leakage in a tunnel. Background Art

[0002] At present, the subway systems in many cities around the world have transitioned from the early large-scale construction stage to a new era with maintenance and management as the core. Tunnel water leakage, as one of the main forms of subway tunnel defects, can easily cause deformation, corrosion, spalling, weathering and other conditions of the concrete lining. This not only affects the safety of the tunnel structure, but may also damage electrical equipment and even affect the smooth operation of the entire subway system. Therefore, regular inspection and maintenance of the subway is an important prerequisite for extending its service life and preventing catastrophic risks.

[0003] Tunnel water leakage detection mostly relies on manual inspection, which has low efficiency. Therefore, there is an urgent need for an automated and efficient tunnel water leakage detection method. Summary of the invention

[0004] Based on this, it is necessary to provide a method for detecting tunnel water leakage in response to the above technical problems.

[0005] In a first aspect, a method for detecting water leakage in a tunnel is provided, the method comprising:

[0006] Establish a water leakage dataset;

[0007] An initial leakage water semantic segmentation model is constructed, wherein the backbone network of the initial leakage water semantic segmentation model is an adaptive adjustment backbone network improved based on the EfficientNet-B0 network, the attention mechanism of the MBconv1 module in the adaptive adjustment backbone network is the scSE attention mechanism, and the convolution kernel of the sixth MBconv6 module is 1×1;

[0008] Based on the leakage water dataset, the initial leakage water semantic segmentation model is trained, and the trained optimized leakage water semantic segmentation model is saved;

[0009] The image data of the tunnel to be detected is input into the optimized water leakage semantic segmentation model to perform tunnel water leakage detection.

[0010] As an optional implementation manner, the establishing of the water leakage data set includes:

[0011] Obtain images of water leakage in tunnels;

[0012] marking the water leakage area of ​​the tunnel water leakage image to determine the water leakage data;

[0013] The water leakage data is enhanced.

[0014] As an optional implementation manner, the data enhancement of the water leakage data includes:

[0015] Amplifying the water leakage data, wherein the data amplification method includes random angle rotation, cropping, mirroring and scaling;

[0016] Performing noise reduction processing on the water leakage data;

[0017] The water leakage data is subjected to equalization processing.

[0018] As an optional implementation, the initial leakage water semantic segmentation model also includes a feature enhancement module, and the feature enhancement module includes a dilated spatial convolutional pooling pyramid and a CBAM attention mechanism.

[0019] As an optional implementation, the method further includes:

[0020] The leakage water dataset is randomly allocated in proportion to determine a training set and a validation set.

[0021] As an optional implementation, the initial water leakage semantic segmentation model is trained based on the water leakage data set, and the trained optimized water leakage semantic segmentation model is saved, including:

[0022] Setting training parameters, including maximum learning rate, minimum learning rate, momentum parameter, learning rate scheduling method, number of iterations, iteration batch, and optimizer;

[0023] Define the loss function;

[0024] Inputting the training set into the initial water leakage semantic segmentation model, and performing training according to the number of iterations and the iteration batch based on a preset deep learning framework;

[0025] For each iteration, the training set loss is determined according to the water leakage area prediction result data output by the current iteration batch and the loss function, and the parameters of the initial water leakage semantic segmentation model are adjusted according to the optimization rules corresponding to the optimizer;

[0026] When the number of iterations is reached, the training is terminated and the trained optimized water leakage semantic segmentation model is saved.

[0027] As an optional implementation, the loss function is a DFloss loss function based on a balanced category weight of a Diceloss loss function and a Focalloss loss function.

[0028] As an optional implementation, the preset deep learning framework is the PyTorch2.0.1 deep learning framework.

[0029] As an optional implementation, the training according to the number of iterations and the iteration batch includes:

[0030] According to the number of iterations and the iteration batch, extracting features of the training set through an encoder of the adaptively adjusted backbone network;

[0031] The extracted features are processed by the decoder of the adaptive adjustment backbone network to output the water leakage area prediction result data.

[0032] As an optional implementation manner, the initial water leakage semantic segmentation model is trained based on the water leakage data set, and after the trained optimized water leakage semantic segmentation model is saved, the method further includes:

[0033] The optimized water leakage semantic segmentation model is evaluated by accuracy index and efficiency index.

[0034] As an optional implementation, the accuracy indicators include average intersection-over-union ratio, average pixel accuracy and F1 index, and the efficiency indicators include model parameters, image processing speed and floating point numbers.

[0035] The present application provides a method for detecting water leakage in a tunnel. The technical solution provided by the embodiment of the present application brings at least the following beneficial effects: the method includes: establishing a water leakage data set; constructing an initial water leakage semantic segmentation model, the backbone network of the initial water leakage semantic segmentation model is an adaptive adjustment backbone network improved based on the EfficientNet-B0 network, the attention mechanism of the MBconv1 module in the adaptive adjustment backbone network is the scSE attention mechanism, and the convolution kernel of the sixth MBconv6 module is 1×1; based on the water leakage data set, the initial water leakage semantic segmentation model is trained, and the trained optimized water leakage semantic segmentation model is saved; the tunnel image data to be detected is input into the optimized water leakage semantic segmentation model to perform tunnel water leakage detection. The embodiment of the present application can dynamically adjust the network structure according to the characteristics of the data set, and significantly reduce the model parameter amount and computational cost while ensuring the detection performance. By introducing the feature enhancement module, the feature extraction capability is enhanced, the global context information is considered and the extraction of key features is strengthened. By optimizing the loss function, DFLoss is proposed, which can alleviate the problem of category imbalance and improve the accuracy of water leakage detection, especially for small samples and areas with unclear features. In the decoder design, a step-by-step upsampling strategy is adopted to achieve effective fusion of multi-scale features, promote the flow of gradients in the network, and improve the local optimization capability of the model, thereby improving the reasoning speed and meeting the needs of real-time detection. Semantic segmentation technology can be used to classify each pixel, which means that the specific shape and boundaries of the water leakage area can be accurately located and identified. For problems such as tunnel water leakage that require clear positioning and comprehensive coverage, semantic segmentation provides more detailed and accurate detection results.

[0036] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0038] Figure 1 A flow chart of a method for detecting water leakage in a tunnel provided in an embodiment of the present application;

[0039] Figure 2 A flowchart of a method for establishing a water leakage data set provided in an embodiment of the present application;

[0040] Figure 3A flowchart of another method for establishing a water leakage data set provided in an embodiment of the present application;

[0041] Figure 4 A schematic diagram of the structure of a feature enhancement module provided in an embodiment of the present application;

[0042] Figure 5 A schematic diagram of the structure of a CBAM attention mechanism provided in an embodiment of the present application;

[0043] Figure 6 A schematic diagram of the structure of an example of a water leakage semantic segmentation model provided in an embodiment of the present application;

[0044] Figure 7 A flowchart of a method for establishing a water leakage data set provided in an embodiment of the present application;

[0045] Figure 8 A flowchart of a model training method provided in an embodiment of the present application;

[0046] Fig. 9 A flowchart of an example of a method for detecting water leakage in a tunnel provided in an embodiment of the present application. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0048] The following will describe in detail a method for detecting water leakage in a tunnel provided by an embodiment of the present application in combination with a specific implementation manner. Figure 1 A flow chart of a method for detecting water leakage in a tunnel provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the specific steps are as follows:

[0049] Step 101, establishing a water leakage data set.

[0050] In implementation, water leakage data can be obtained by querying public data sources and manual inspections, and a water leakage dataset can be established based on the water leakage data. Multi-source data collection helps to obtain diverse and comprehensive water leakage data to improve the generalization ability of the model.

[0051] As an optional implementation, Figure 2 A flowchart of a method for establishing a leakage water dataset provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, in step 101, a leakage water dataset is established, and the specific steps are as follows:

[0052] Step 201, obtaining a tunnel water leakage image.

[0053] In implementation, water leakage data can be obtained by querying public data sources and manual inspections, among which the manual inspection method is to use a high-resolution camera or special detection equipment to capture images of the interior of the tunnel and obtain original image data containing water leakage. For example, 1,000 images of the interior of the tunnel are collected, of which 200 are water leakage pictures containing obvious water leakage areas. The collected water leakage pictures may include water leakage forms such as point leakage, linear leakage and large-area leakage, and may also include pipes, bolt holes, lighting, wires and cables, water supply and drainage pipes, shadows and other interferences that affect image segmentation. The water leakage pictures may also have the problem of overall light imbalance. The characteristics of these water leakage pictures can restore the actual application scenarios of tunnel engineering.

[0054] Step 202: annotate the water leakage area of ​​the tunnel water leakage image to determine the water leakage data.

[0055] In implementation, the water leakage area can be manually labeled on the original image. The labeling tool can use an open source labeling tool such as Labelme to generate image data with water leakage area labels.

[0056] Step 203: perform data enhancement on the water leakage data.

[0057] In implementation, in actual tunnel projects, the positions, angles, and sizes of water leakage areas are varied. In order to enrich the acquired water leakage data and make the model have good generalization and robustness, the water leakage data can be enhanced.

[0058] As an optional implementation, Figure 3 A flowchart of another method for establishing a water leakage data set provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, the specific steps of performing data enhancement on the leakage water data in step 203 are as follows:

[0059] Step 301, amplify the water leakage data, and the data amplification methods include random angle rotation, cropping, mirroring and scaling.

[0060] In implementation, the Augmentor library can be used to achieve data augmentation through random angle rotation, cropping, mirroring and scaling, such as randomly rotating the image from 0° to 360° to obtain water leakage data at different angles, or randomly cropping 20% ​​to 50% of the image area, flipping the image horizontally or vertically, and scaling the image by 0.8 to 1.2 times.

[0061] Step 302: performing noise reduction processing on the water leakage data.

[0062] In implementation, a noise reduction method such as a Gaussian filter may be used to reduce the noise of the image.

[0063] Step 303, performing equalization processing on the water leakage data.

[0064] In implementation, the brightness and contrast of the image can be adjusted by means such as the adaptive histogram equalization method to make the brightness distribution of the image more uniform.

[0065] As an optional implementation, the leakage water dataset may be randomly allocated in proportion to determine a training set and a validation set.

[0066] In implementation, the training set and validation set are used for model training and model performance evaluation, respectively. A test set can also be divided to test the model before training to avoid model operation errors. The embodiment of the present application divides the training set, validation set, and test set into 8:1:1 ratios.

[0067] Step 102, construct an initial leakage water semantic segmentation model. The backbone network of the initial leakage water semantic segmentation model is an adaptive adjustment backbone network improved based on the EfficientNet-B0 network. The attention mechanism of the MBconv1 module in the adaptive adjustment backbone network is the scSE attention mechanism, and the convolution kernel of the sixth MBconv6 module is 1×1.

[0068] In the implementation, the adaptive adjustment backbone network AS-EfficientNet is improved based on the EfficientNet-B0 network. In the EfficientNet-B0 network, the scSE attention mechanism is used to replace the original channel attention mechanism SENet in the MBconv1 module. The scSE attention mechanism consists of two parts: cSE and sSE. It adds spatial attention on the basis of SEnet. The sSE module is used to learn the importance of each point in the spatial dimension. The scSE attention combines the channel attention and spatial attention of SEnet. By adding the outputs of the two, a feature representation that considers both the channel and spatial dimensions is obtained. In addition, the convolution kernel 2×2 of the sixth MBconv6 module in the EfficientNet-B0 network is changed to 1×1, thereby preventing the image features from being over-compressed while maintaining the effective extraction of features. AS-EfficientNet can dynamically adjust its own structure according to the characteristics of the water leakage dataset, thereby optimizing the model parameter configuration while ensuring the detection performance, significantly reducing the computational cost and improving the inference speed.

[0069] As an optional implementation, the initial leaky water semantic segmentation model also includes a feature enhancement module, which includes a dilated spatial convolutional pooling pyramid and a CBAM attention mechanism.

[0070] In implementation, Figure 4 A structural diagram of a feature enhancement module provided in an embodiment of the present application is shown in FIG. Figure 4 As shown in the figure, the input feature map f is processed by 5 parallel operations of the dilated spatial convolutional pooling pyramid, including 1×1 convolution conv, 3×3 convolution conv, dilation rate Rate 6, 3×3 convolution conv, dilation rate Rate 12, 3×3 convolution conv, dilation rate Rate 18, and image pooling. The combination of operation processing obtains the feature map F and passes it to CBAM. The dilated spatial convolutional pooling pyramid uses dilated convolution for feature extraction, which can increase the receptive field and extract multi-scale local detail information without downsampling, increasing the number of parameters and calculations. The adaptive mean pooling can extract global features, so that the network helps to maintain the integrity and continuity of the image when processing semantic segmentation tasks. It not only considers the global context information, but also further improves the segmentation accuracy of the model by strengthening the extraction of key features. Figure 5 A schematic diagram of the structure of a CBAM attention mechanism provided in an embodiment of the present application is shown in FIG. Figure 5 As shown in the figure, the feature map F is processed by maximum pooling and average pooling in the channel dimension. The pooled features are combined through a shared multi-layer perceptron and a sigmoid activation function, and the generated channel attention map Mc is multiplied with the original feature map F to obtain F'. The feature map F' is processed by maximum pooling and average pooling in the spatial dimension. The pooled features are concatenated and passed through a convolutional layer, and then through a sigmoid activation function. The generated spatial attention map Ms is multiplied with the feature map F' to obtain the final output feature map F''.

[0071] As an optional implementation, Figure 6 A schematic diagram of the structure of an example of a water leakage semantic segmentation model provided in an embodiment of the present application, such as Figure 6As shown in the figure, in the encoder part, the input image size is 224×224×3. After a series of convolutional layers and residual blocks, the size of the feature map gradually decreases, the number of channels gradually increases, and the feature map size becomes 14×14×256. The feature enhancement module processes the feature map and outputs the enhanced feature map. The feature maps output by different layers of the encoder are spliced ​​with the feature maps in the decoder through jump connections. The feature maps are fused through the enhancement block to generate feature maps of sizes 28×28×256, 56×56×256, and 112×112×256. The decoder part upsamples the feature map and gradually restores it to the same size as the input image. Finally, the output image is generated by the dual feature fusion method. Among them, the horizontal striped squares represent convolutional layers, batch normalization, and ReLU activation. The diagonal striped squares represent residual blocks. White squares represent S-MBConv layers, and spotted squares represent enhancement blocks. Dashed squares represent upsampling. Dashed arrows represent jump connections, and black arrows represent channel splicing. The cross circle represents the dual feature fusion method.

[0072] Step 103: Based on the leakage water dataset, the initial leakage water semantic segmentation model is trained, and the trained optimized leakage water semantic segmentation model is saved.

[0073] In the implementation, based on the leakage water dataset, the initial leakage water semantic segmentation model is trained, and the trained optimized leakage water semantic segmentation model is saved.

[0074] As an optional implementation, Figure 7 A flowchart of a method for establishing a leakage water dataset provided in an embodiment of the present application is shown in FIG. Figure 7 As shown, in step 103, based on the leakage water dataset, the initial leakage water semantic segmentation model is trained, and the specific steps of saving the trained optimized leakage water semantic segmentation model are as follows:

[0075] Step 701, setting training parameters, which include maximum learning rate, minimum learning rate, momentum parameter, learning rate scheduling method, number of iterations, iteration batch and optimizer.

[0076] In implementation, before model training, the maximum learning rate, minimum learning rate and momentum can be set first. Among them, setting the maximum learning rate can make the model parameters update quickly, thereby speeding up the training speed, and preventing falling into the local optimal solution, so as to find a better global optimal solution. However, if the learning rate is set too high, the training will be unstable and even unable to converge. Therefore, it is necessary to find a suitable maximum value. The maximum learning rate is set to 0.0005 in the embodiment of the present application. The minimum learning rate is used to help the model to make fine adjustments in the later stages of training, so that it is closer to the global optimal solution, prevent overfitting, and improve stability. The embodiment of the present application sets the minimum learning rate of 0.000005. Setting the momentum parameter can help the model to converge to the optimal solution faster, especially in the initial stage of training. By utilizing the accumulation of previous gradients, the number of iterations can be reduced, the optimization path can be smoothed, and the training stability can be improved. The embodiment of the present application sets the momentum parameter to 0.9. During the training process, this application adopts the cosine annealing decay method. The learning first rises and then falls. When rising, a linear rise is adopted, and when falling, a cosine function is adopted. The Adam optimizer can be used for parameter iterative optimization. For example, the number of iterations is 150 times and the batch size is 16. The model will be trained on the entire training set for 150 cycles. Each cycle includes a complete training set traversal. At each parameter update, 16 sample data are used for calculation, that is, each gradient calculation and parameter update is based on the average result of 16 samples.

[0077] Step 702, define a loss function.

[0078] In implementation, the purpose of defining the loss function is to evaluate the current model using the validation set data and the loss function after each training cycle or every few training cycles.

[0079] As an optional implementation, the loss function of the embodiment of the present application is a DFloss loss function based on the balanced category weights of the Diceloss loss function and the Focalloss loss function. The expression of the loss function is as follows:

[0080] ;

[0081] ;

[0082] ;

[0083] in, ε is a smoothing term used to ensure the stability of the calculation. TP For a real example, FN is a false negative example, FP For a false positive example, P t is the predicted probability, is the category weight, with a value between [0, 1]. γ is a modulation factor, and its value is between [0, 5]. In the embodiment of the present application, γ is 2.

[0084] As an optional implementation, the specific method of using the validation set data and loss function to evaluate the current model is to input the validation set data into the current model, perform forward propagation, calculate the model's prediction results, and calculate the error between the model's prediction results and the true label of the validation set according to the pre-defined loss function, which is the loss function value on the validation set. Record the validation set loss function value at the end of each training cycle to determine whether overfitting or underfitting occurs. If the loss function value on the validation set is constantly decreasing, it means that the performance of the model on the validation set is improving. If the loss function value on the validation set starts to rise after a certain point, and the loss function value on the training set continues to decrease, it may mean that the model begins to overfit the training set. Training parameters such as learning rate and momentum can be adjusted according to the changes in the validation set loss function value.

[0085] Step 703: Input the training set into the initial water leakage semantic segmentation model, and perform training based on a preset deep learning framework according to the number of iterations and iteration batches.

[0086] In the implementation, the training set data is input into the initial leaky water semantic segmentation model, where the training set contains data samples and their corresponding labels for training the model. Specific deep learning frameworks such as TensorFlow and PyTorch are used, which provide tools and libraries for building, training, and evaluating deep learning models. During the training process, the initial leaky water semantic segmentation model will traverse the training set according to the number of iterations and iteration batches. At the end of each traversal, the model parameters will be updated once.

[0087] As an optional implementation, the preset deep learning framework is the PyTorch2.0.1 deep learning framework.

[0088] As an optional implementation, Figure 8 A flowchart of a model training method provided in an embodiment of the present application is shown in FIG. Figure 8 As shown, the specific steps of training according to the number of iterations and iteration batches in step 703 are as follows:

[0089] Step 801, extracting features of the training set by adaptively adjusting the encoder of the backbone network according to the number of iterations and the iteration batch.

[0090] In implementation, during model training, the training set is divided into multiple batches according to the iteration batch, and multiple complete traversals are performed according to the preset number of iterations. The encoder is responsible for extracting high-level features of the input data. It usually consists of multiple convolutional layers and pooling layers to gradually compress the input data and extract important features. During the training process, the adaptive adjustment backbone network can adaptively adjust the parameters of the encoder based on the loss function and gradient information, so that it can extract useful features more effectively. In each sample, the training data is input into the encoder, and the encoder extracts feature representations. These feature representations will be passed to the decoder for further processing.

[0091] Step 802, process the extracted features by adaptively adjusting the decoder of the backbone network and output the water leakage area prediction result data.

[0092] In the implementation, the decoder is another part of the adaptive adjustment backbone network, which is responsible for restoring the feature representation extracted by the encoder to an output of the same size as the input data. For semantic segmentation tasks, the decoder usually includes upsampling layers and deconvolution layers to restore spatial resolution. The decoder receives the feature representation extracted by the encoder and processes it to output prediction result data. In the leaky water semantic segmentation task, the prediction result data can be the probability of each pixel belonging to the leaky water area.

[0093] Step 704, for each iteration, the training set loss is determined according to the water leakage area prediction result data and loss function output by the current iteration batch, and the parameters of the initial water leakage semantic segmentation model are adjusted according to the optimization rules corresponding to the optimizer.

[0094] In the implementation, at each iteration, the training set is divided into several samples, and the initial leaky water semantic segmentation model performs a forward propagation and a backward propagation on each sample. In the forward propagation stage, the model predicts the current sample and generates a prediction result. Then, the error between the prediction result and the true label is calculated through the loss function (such as DiceLoss, FocalLoss or their combination DFLoss), that is, the training set loss. The loss of each sample in each iteration is summarized as the overall training loss of the current iteration. Use an optimizer (such as the Adam optimizer) to adjust the model parameters according to the loss function value and its corresponding gradient, and according to the rules of the optimization algorithm (such as learning rate, momentum, etc.) to minimize the loss function.

[0095] Step 705, when the number of iterations is reached, the training is terminated and the trained optimized water leakage semantic segmentation model is saved.

[0096] In practice, the training process ends when the model completes the preset number of iterations on the entire training set. The trained model parameters and structure are saved for subsequent prediction or further fine-tuning on actual data.

[0097] As an optional implementation, after step 103, the method further includes performing accuracy index evaluation and efficiency index evaluation on the optimized water leakage semantic segmentation model.

[0098] In implementation, the evaluation of the optimized water leakage semantic segmentation model includes two aspects, namely, accuracy index evaluation and efficiency index evaluation.

[0099] As an optional implementation, the accuracy indicators include average intersection-over-union ratio, average pixel accuracy and F1 index, and the efficiency indicators include model parameters, image processing speed and floating point numbers.

[0100] In implementation, when evaluating the optimized water leakage semantic segmentation model, it is usually measured from two aspects: accuracy index and efficiency index. Accuracy indicators include average intersection-over-union, average pixel accuracy and F1 index. Among them, the average intersection-over-union is the ratio of the intersection and union of the predicted result and the true label. For multi-class problems, the average intersection-over-union (mIoU) is the average of the intersection-over-union (IoU) of all categories. For each category, its IoU is calculated and the average of all categories is taken. mIoU measures the overall accuracy of the model in the segmentation task. The higher the value, the better the segmentation effect of the model in each category. The calculation method of mIoU is as follows:

[0101] ;

[0102] Among them, i represents the true value, j represents the predicted value, and p ii It means predicting i as i, p ij It means predicting i as j.

[0103] Pixel accuracy is the ratio of correctly classified pixels to the total number of pixels. Mean pixel accuracy is the average of the pixel accuracy of all categories. For each category, its pixel accuracy is calculated and the average of all categories is taken. Mean pixel accuracy can measure the accuracy of the model in the pixel-by-pixel classification task. The higher the value, the better the classification effect of the model on each pixel. The calculation method of mean pixel accuracy mPA is as follows:

[0104] ;

[0105] Among them, i represents the true value, j represents the predicted value, and p ii It means predicting i as i, p ij It means predicting i as j.

[0106] The F1 index is the harmonic mean of precision and recall, which can better reflect the performance of the model, especially in the case of class imbalance. The calculation formula of the F1 index is as follows:

[0107] ;

[0108] ;

[0109] ;

[0110] Among them, TP represents the correctly classified positive samples, FP represents the misclassified negative samples, and FN represents the misclassified positive samples. The F1 index comprehensively considers the accuracy of the model. precision and recall R Recall , a higher value indicates that the model has a better balanced performance in correctly classifying positive examples and covering all positive examples.

[0111] The efficiency index includes model parameters, image processing speed and floating point numbers. Model parameters are weights and biases that need to be learned and adjusted in the model. The number of model parameters affects the complexity and storage requirements of the model. The fewer the number of parameters, the lighter the model is, and it is suitable for resource-constrained devices. The image processing speed is the time required for the model to process the input image and output the prediction result, usually expressed in the number of frames processed per second or the processing time per image (milliseconds or seconds). The image processing speed affects the real-time performance and application experience of the model. The faster the processing speed, the faster the response of the model in practical applications. Floating point operations are the number of floating point operations required by the model in a forward propagation process. It is used to measure the computational complexity of the model. The fewer the number of operations, the lower the computational resource requirements of the model, and it is suitable for low-power devices. In terms of accuracy index evaluation, the embodiment of the present application measures the accuracy and performance of the model in the task of semantic segmentation of water leakage by the average intersection ratio, average pixel accuracy and F1 index. In terms of efficiency index evaluation, the computational complexity, real-time performance and resource requirements of the model are measured by the number of model parameters, image processing speed and floating point operations. By combining these indicators, the performance and practicality of the optimized water leakage semantic segmentation model can be comprehensively evaluated to ensure that the model not only performs well in accuracy but also meets application requirements in terms of efficiency.

[0112] Step 104 , inputting the image data of the tunnel to be detected into the optimized water leakage semantic segmentation model to perform tunnel water leakage detection.

[0113] In the implementation, the image data of the tunnel to be detected is input into the trained optimized water leakage semantic segmentation model to perform tunnel water leakage detection.

[0114] As an optional implementation method, the embodiment of the present application also provides an evaluation table for comparative experiments with other models. The comparative models take HRnet, PSPnet, Segformer and Unet as examples, and conduct comparative experiments as baseline detection models (based on data enhancement and preprocessed data sets). The model is comprehensively evaluated from the accuracy index and efficiency index, as shown in Table 1:

[0115] Table 1

[0116]

[0117] In terms of detection accuracy: Compared with DeepLabV3+, HRnet, Segformer and Unet, the PSPnet model has the highest segmentation accuracy in water leakage detection. The Segformer model uses a lightweight multi-layer perceptron as a decoder, which greatly reduces the number of model parameters and has the smallest number of parameters compared to other models; but the model requires a large amount of data for training and is prone to overfitting on small data sets. The mIoU, mPA and mFscore values ​​of the model in the embodiment of the present application are 90.72%, 95.19% and 95.06%, respectively. The model parameter volume is 6.421M, the inference speed reaches 0.011s, the FPS reaches 98.947f / s, and the calculation amount is 39.079G. Comprehensive accuracy indicators and efficiency indicators, the encoder-decoder structure proposed in this paper has significant advantages over the currently commonly used semantic segmentation model.

[0118] As an optional implementation, Fig. 9 A flowchart of an example of a method for detecting water leakage in a tunnel provided in an embodiment of the present application is shown in FIG. Fig. 9 As shown in the figure, use a camera to take an image of water leakage, import the image into a computer for processing, use the Labelme tool to annotate the water leakage area, and perform data enhancement on the annotated water leakage data to increase the diversity and quantity of the data set. Training model encoder part: input the original image, use the encoder part of the deep learning network to extract features. Decoder part: use the decoder part to process the extracted features and generate the prediction results of the water leakage area. Model training and evaluation: by comparing the prediction results and the real annotations, calculate the performance indicators of the model. Among them, the yellow area can represent false positives (FalsePositives, FP), and the blue area represents false negatives (FalseNegatives, FN). The color difference is not shown in the figure. Plot the curves of training loss and validation loss with the iteration round to observe the training effect of the model. By calculating the false positives, false negatives, true positives (TruePositives, TP), true negatives (TrueNegatives, TN) and other indicators of the model, the accuracy and effect of the model are evaluated.

[0119] The embodiment of the present application provides a method for detecting water leakage in a tunnel, the method comprising: establishing a water leakage data set; constructing an initial water leakage semantic segmentation model, the backbone network of the initial water leakage semantic segmentation model is an adaptive adjustment backbone network based on the EfficientNet-B0 network improvement, the attention mechanism of the MBconv1 module in the adaptive adjustment backbone network is the scSE attention mechanism, and the convolution kernel of the sixth MBconv6 module is 1×1; based on the water leakage data set, the initial water leakage semantic segmentation model is trained, and the optimized water leakage semantic segmentation model after training is saved; the image data of the tunnel to be detected is input into the optimized water leakage semantic segmentation model for tunnel water leakage detection. The embodiment of the present application can dynamically adjust the network structure according to the characteristics of the data set, while ensuring the detection performance, significantly reducing the model parameter amount and computational cost. By introducing the feature enhancement module, the feature extraction capability is enhanced, the global context information is considered and the extraction of key features is strengthened, and by optimizing the loss function, DFLoss is proposed, which can alleviate the problem of class imbalance and improve the accuracy of water leakage detection, especially for small samples and areas with unclear features. In the decoder design, a step-by-step upsampling strategy is adopted to achieve effective fusion of multi-scale features, promote the flow of gradients in the network, and improve the local optimization ability of the model, thereby increasing the reasoning speed and meeting the needs of real-time detection. Semantic segmentation technology can classify each pixel, which means that the specific shape and boundaries of the water leakage area can be accurately located and identified. For problems such as tunnel water leakage that require clear positioning and comprehensive coverage, semantic segmentation provides more detailed and accurate detection results.

[0120] It should be understood that although Figures 1 to 3 , Figure 7 and Figure 8 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figures 1 to 3 , Figure 7 and Figure 8 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.

[0121] It can be understood that the same / similar parts between the various embodiments of the above method in this specification can refer to each other, and each embodiment focuses on the differences from other embodiments. For related points, please refer to the description of other method embodiments.

[0122] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0123] It should also be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data for analysis, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0124] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0125] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0126] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A method for detecting water leakage in a tunnel, characterized in that: The method comprises: Establish a water leakage dataset; An initial leakage water semantic segmentation model is constructed, wherein the backbone network of the initial leakage water semantic segmentation model is an adaptive adjustment backbone network improved based on the EfficientNet-B0 network, the attention mechanism of the MBconv1 module in the adaptive adjustment backbone network is the scSE attention mechanism, and the convolution kernel of the sixth MBconv6 module is 1×1; Based on the leakage water dataset, the initial leakage water semantic segmentation model is trained, and the trained optimized leakage water semantic segmentation model is saved; Inputting the tunnel image data to be detected into the optimized water leakage semantic segmentation model to perform tunnel water leakage detection; The initial leakage water semantic segmentation model also includes a feature enhancement module, which includes a dilated spatial convolutional pooling pyramid and a CBAM attention mechanism; The parallel operation processing of the dilated spatial convolutional pooling pyramid includes 1×1 convolution, 3×3 convolution with a dilation rate of 6, 3×3 convolution with a dilation rate of 12, 3×3 convolution with a dilation rate of 18, and image pooling; The initial leakage water semantic segmentation model also includes an encoder and a decoder, wherein the feature maps output by different layers of the encoder are concatenated with the feature maps in the decoder through a jump connection, and the decoder is used to upsample the feature maps and restore them to the same size as the input image; The method further comprises: The leakage water data set is randomly allocated in proportion to determine a training set and a validation set; The method of training the initial water leakage semantic segmentation model based on the water leakage data set and saving the trained optimized water leakage semantic segmentation model includes: Setting training parameters, including maximum learning rate, minimum learning rate, momentum parameter, learning rate scheduling method, number of iterations, iteration batch, and optimizer; Define the loss function; Inputting the training set into the initial water leakage semantic segmentation model, and performing training according to the number of iterations and the iteration batch based on a preset deep learning framework; For each iteration, the training set loss is determined according to the water leakage area prediction result data output by the current iteration batch and the loss function, and the parameters of the initial water leakage semantic segmentation model are adjusted according to the optimization rules corresponding to the optimizer; When the number of iterations is reached, the training is terminated and the trained optimized water leakage semantic segmentation model is saved; The training according to the number of iterations and the iteration batch includes: According to the number of iterations and the iteration batch, extracting features of the training set through an encoder of the adaptively adjusted backbone network; The extracted features are processed by the decoder of the adaptive adjustment backbone network to output the water leakage area prediction result data.

2. The method according to claim 1, characterized in that The establishing of the leakage water data set comprises: Obtain images of water leakage in tunnels; marking the water leakage area of ​​the tunnel water leakage image to determine the water leakage data; The water leakage data is enhanced.

3. The method according to claim 2, characterized in that The step of performing data enhancement on the water leakage data comprises: Amplifying the water leakage data, wherein the data amplification method includes random angle rotation, cropping, mirroring and scaling; Performing noise reduction processing on the water leakage data; The water leakage data is subjected to equalization processing.

4. The method according to claim 1, characterized in that: The loss function is a DFloss loss function that balances category weights based on the Diceloss loss function and the Focalloss loss function.

5. The method according to claim 1, characterized in that The preset deep learning framework is the PyTorch2.0.1 deep learning framework.

6. The method according to claim 1, characterized in that After the initial water leakage semantic segmentation model is trained based on the water leakage data set and the trained optimized water leakage semantic segmentation model is saved, the method further includes: The optimized water leakage semantic segmentation model is evaluated by accuracy index and efficiency index.

7. The method according to claim 6, characterized in that The accuracy indicators include average intersection-over-union ratio, average pixel accuracy and F1 index, and the efficiency indicators include model parameters, image processing speed and floating point numbers.

Citation Information

Patent Citations

  • Tunnel chipping or water seepage detection and measurement method based on dual-depth learning model

    CN112488119A