Intelligent detection method, device and equipment for tunnel water leakage image and storage medium
By introducing an attention module and a deep supervision network into the water leakage image detection model, the accuracy problem of water leakage detection in complex tunnel environments is solved, and efficient water leakage image recognition is achieved.
Patent Information
- Application Number
- CN202210998270.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-19
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2042-08-19
Smart Images

Figure CN115345859B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of tunnel water leakage detection technology, and in particular to an intelligent detection method, device, equipment and storage medium for tunnel water leakage images. Background Technology
[0002] With the development of underground engineering projects such as highway tunnels, subway tunnels, and integrated underground utility tunnels in my country, water leakage in tunnels has become one of the common problems in tunnels. Long-term water leakage can affect the operational safety of tunnels.
[0003] Currently, most tunnel leakage detection relies on manual inspections, which involve sending personnel periodically into the tunnel to conduct visual inspections or collect data using cameras. With the continuous development of information technology, computer vision methods are increasingly being used in tunnel leakage detection. Computer vision methods include traditional image processing and deep learning. Traditional image processing methods utilize thresholding, edge detection, and morphological analysis to detect and identify surface leakage problems in tunnels. Deep learning methods use multi-layered neural networks to extract multi-layered features from massive amounts of image data and continuously feed them into a network model. By training a specific network model, tasks such as classification, localization, and segmentation of input image data can be performed.
[0004] However, due to the complex environment and numerous interfering factors inside tunnels, manual inspections are not only easily affected by subjective factors but also inefficient and require a large amount of manpower. Currently, traditional computer vision methods struggle to overcome interference from low contrast of surface defects, uneven lighting, and severe background noise pollution in subway tunnels, making it impossible to accurately detect water leakage images in complex environments. Therefore, there is an urgent need for a method that can accurately detect water leakage images even in complex environments. Summary of the Invention
[0005] This invention provides an intelligent detection method, apparatus, device, and storage medium for tunnel water leakage images, to solve the problem that it is currently impossible to accurately detect water leakage images in complex environments.
[0006] In a first aspect, embodiments of the present invention provide an intelligent detection method for tunnel water leakage images, comprising:
[0007] Obtain multiple water leakage image samples from a preset sample library;
[0008] Each leak image sample is labeled to obtain a leak label map containing the labels;
[0009] Based on each water leakage image sample and its water leakage label map, a pre-built water leakage image detection model is trained to obtain a trained water leakage image detection model. The water leakage image detection model includes at least an encoder, a decoder that is hoppedly connected to the encoder, a central layer that connects the encoder and the decoder, and a deep supervision network module that is connected to the output of the decoder and the central layer respectively. Both the encoder and the decoder have attention modules, and the attention modules include multiple parallel convolutions with different dilation rates.
[0010] The trained water leakage image detection model is used to detect the water leakage images to be detected.
[0011] In one possible implementation, the attention module transforms a one-dimensional convolutional block of size k in the ECA module into multiple parallel convolutional blocks with different dilatations; and the output of the attention module in the decoder and the output of the central layer serve as inputs to the deep supervision network.
[0012] In one possible implementation, both the encoder and the decoder include multiple layers. Each layer of the encoder includes a sequentially connected convolutional block, an attention module, and a downsampling layer. Each layer of the decoder includes a sequentially connected nearest-neighbor upsampling layer, a convolutional block, and an attention module.
[0013] The central layer is used to connect the lowest level of the encoder and the highest level of the decoder;
[0014] A deep supervision network module is provided at the output of the central layer and at the output of each layer of the decoder. The deep supervision network module is used to predict the output of each layer of the decoder and use the output results for deep supervision learning.
[0015] In one possible implementation, a pre-built leak detection model is trained based on each leak image sample and its leak label map, including:
[0016] Based on the first segmentation result and the labeled leakage water tag map, the hybrid loss function of each level of the leakage water image detection model is adjusted; wherein, the first segmentation result is the prediction result obtained after the leakage water image sample is processed by the encoder, decoder and deep supervision network module of each level, and the hybrid loss function of each level includes the binary cross-entropy loss function and the Dice loss function.
[0017] The pre-constructed water leakage image detection model is trained based on the overall loss function of the water leakage image detection model, each water leakage image sample and its water leakage label map; wherein, the overall loss function is a linear combination of the hybrid loss functions of each layer.
[0018] In one possible implementation, the hybrid loss function l for each layer seg for:
[0019] l seg =αl bce +l dice ;
[0020] The overall loss function L is:
[0021]
[0022] Among them, l bce Let l be the binary cross-entropy loss function. dice Let M be the Dice loss function, M be the total number of layers in the deep supervised network module, m be a positive integer, and α be the scaling factor, where 0 < α < 1.
[0023] In one possible implementation, the hole rate of the attention modules at each level of the encoder and decoder is the same, and the hole rate of the attention modules at the first level of the encoder and decoder is different from the hole rates of the attention modules at other levels.
[0024] In one possible implementation, both the encoder and decoder comprise four layers. Each layer of the encoder comprises two sequentially connected convolutional blocks, an attention layer, and a downsampling layer. Each layer of the decoder comprises a sequentially connected nearest-neighbor upsampling layer, two convolutional blocks, and an attention module. The central layer comprises two convolutional blocks, each consisting of a 3×3 convolutional layer, a batch normalization layer, and a correction linear unit. The attention module comprises four parallel one-dimensional dilated convolutions. The dilation rate of the attention model in the first layer of both the encoder and decoder is (1,2,4,8), while the dilation rate of the attention model in the other layers is (1,4,8,16).
[0025] The deep supervised network module is called the Side Network, which is used to predict the output of each level of the decoder and use the output of each level of the decoder for deep supervised learning. The Side Network includes a 1×1 convolutional layer, a nearest neighbor upsampling layer, and a sigmoid function layer.
[0026] The output of the central layer and the feature maps generated by the nearest neighbor upsampling layers of each level of the decoder are used as inputs to the Side Network. The output of the last level of the decoder is processed by the Side Network to obtain the output of the water leakage image detection model.
[0027] Secondly, embodiments of the present invention provide an intelligent detection device for tunnel water leakage images, comprising:
[0028] The sample acquisition module is used to acquire multiple water leakage image samples from a preset sample library;
[0029] The labeling module is used to label each leak image sample to obtain a leak label map containing the labels;
[0030] The training model module is used to train a pre-built leakage image detection model based on each leakage image sample and its leakage label map to obtain a trained leakage image detection model. The leakage image detection model includes at least an encoder, a decoder with skip connections to the encoder, a central layer connecting the encoder and the decoder, and a deep supervision network module connected to the output of the decoder and the central layer respectively. Both the encoder and the decoder have attention modules, and the attention modules include multiple parallel convolutions with different dilation rates.
[0031] The detection module is used to detect the leak images to be detected based on the trained leak image detection model.
[0032] Thirdly, embodiments of the present invention provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method as described in the first aspect or any possible implementation of the first aspect.
[0033] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method as described in the first aspect or any possible implementation thereof.
[0034] This invention provides an intelligent detection method, apparatus, device, and storage medium for tunnel water leakage images. First, multiple water leakage image samples are acquired from a preset sample library. Then, each water leakage image sample is labeled to obtain a labeled water leakage tag map. Next, based on each water leakage image sample and its tag map, a pre-constructed water leakage image detection model is trained to obtain a trained water leakage image detection model. Finally, the trained water leakage image detection model is used to detect the water leakage image to be detected. In addition to existing encoders and decoders, the water leakage image detection model constructed in this invention also includes an attention module and a deep supervision network module. The attention module helps the water leakage image detection model effectively learn semantic features, and the deep supervision network module effectively improves the robustness of the water leakage image detection model, thereby enabling accurate detection of water leakage images in complex environments. Attached Figure Description
[0035] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0036] Figure 1 This is a flowchart illustrating the implementation of the intelligent detection method for tunnel water leakage images provided in this embodiment of the invention.
[0037] Figure 2 These are water leakage image samples and their corresponding label images provided in embodiments of the present invention;
[0038] Figure 3 This is a schematic diagram of the structure of the attention module provided in an embodiment of the present invention;
[0039] Figure 4 This is a schematic diagram of the structure of a water leakage image detection model provided in an embodiment of the present invention;
[0040] Figure 5 This is a comparison chart of detection results after adding different modules to the UNet network, provided by an embodiment of the present invention;
[0041] Figure 6 This is a comparison chart of the detection results of ACPA-Net provided in this embodiment of the invention and existing methods;
[0042] Figure 7 This is a comparison chart of the detection results of ACPA-Net provided in this embodiment of the invention and existing deep learning networks;
[0043] Figure 8 This is a schematic diagram of the structure of the intelligent detection device for tunnel water leakage images provided in an embodiment of the present invention;
[0044] Figure 9 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0045] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of the invention. However, those skilled in the art will understand that the invention can be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods are omitted so as not to obscure the description of the invention with unnecessary detail.
[0046] To make the objectives, technical solutions, and advantages of the present invention clearer, specific embodiments will be described below in conjunction with the accompanying drawings.
[0047] Tunnel water leakage detection can be treated as a pixel-level binary classification task, assigning label 1 to pixels in the leakage area and label 0 to pixels in the background area. When a water leakage image is input into a water leakage image detection model, the final output is an image with the same resolution as the input image but only one channel. The value of each pixel in this image represents the probability that the pixel location belongs to the leakage area. Therefore, it is expected that in the final output layer, pixels that truly belong to the leakage area will have a higher probability, while pixels belonging to the background area will have a lower probability. However, when detecting water leakage images in complex environments, due to interference such as uneven illumination and severe background noise, accurate detection of water leakage images in complex environments becomes impossible.
[0048] To address the problems of existing technologies, embodiments of the present invention provide an intelligent detection method, apparatus, device, and storage medium for tunnel water leakage images. The intelligent detection method for tunnel water leakage images provided by embodiments of the present invention will be described first below.
[0049] The executing entity of the intelligent detection method for tunnel water leakage images can be an intelligent detection device for tunnel water leakage images. This intelligent detection device can be an electronic device with a processor and memory, such as a mobile electronic device or a non-mobile electronic device. This embodiment of the invention does not impose specific limitations.
[0050] See Figure 1 The document illustrates a flowchart of the intelligent detection method for tunnel water leakage images provided in an embodiment of the present invention, which is described in detail below:
[0051] Step S110: Obtain multiple water leakage image samples from the preset sample library.
[0052] Because there are few publicly available datasets for detecting tunnel water leakage, this invention uses a self-made sample library for experiments. The images used to create the sample library were all captured by digital cameras from water leakage images in railway tunnels in various environments.
[0053] Step S120: Label each leakage image sample to obtain a leakage label map containing the labels.
[0054] Each water leakage image sample can be labeled using a label, with the target area showing water leakage labeled as 1 and the background area without water leakage labeled as 0. In this invention, 1370 image pairs were ultimately obtained through operations such as cropping and scaling. Due to GPU memory limitations, all images were scaled to 256×256 in this invention, with 1100 image pairs used for training and 270 image pairs used for testing.
[0055] like Figure 2 The image shows two sets of water seepage images and their corresponding labels. Columns 1 and 3 are the water seepage images, and columns 2 and 4 are the corresponding label images. As can be seen from the images, the tunnel environment is complex, with some seepage areas covered by pipes, cables, or shadows. Some artificial traces, moss, shadows, and other interfering objects with colors similar to the seepage areas make segmentation more difficult. Furthermore, some blurry and low-grayscale images exist in the water seepage image samples, which also poses a challenge to water seepage detection.
[0056] Step S130: Based on each water leakage image sample and its water leakage label image, train the pre-built water leakage image detection model to obtain the trained water leakage image detection model.
[0057] The water leakage image detection model includes at least an encoder, a decoder that is hopped to the encoder, a central layer that connects the encoder and the decoder, and a deep supervision network module that is connected to the output of the decoder and the central layer respectively. Both the encoder and the decoder have attention modules, and the attention modules include multiple parallel convolutions with different dilatations.
[0058] To obtain accurate segmentation results, water leakage image detection models need to acquire high-quality semantic features and sufficient spatial detail information. To obtain high-quality semantic features, water leakage image detection models typically downsample the feature maps during feature extraction. This operation not only reduces the feature map resolution and computational cost but also increases the network's receptive field. However, downsampling the feature maps results in a loss of spatial detail information. UNet integrates feature maps with similar resolution to the decoder from the encoder into the decoder via skip connections. By fusing features from the same level in the encoder, the decoder can fill in some missing detail information as the spatial resolution gradually increases. This invention, based on UNet, incorporates an attention module and a deep supervision network module.
[0059] In some implementations, the attention module transforms a one-dimensional convolutional block of size k in the ECA module into multiple parallel convolutional blocks with different dilatations; and the output of the attention module in the decoder and the output of the central layer serve as inputs to the deep supervision network.
[0060] In this embodiment, the attention module allows the water leakage image detection model to focus on the areas or targets that are more relevant, which is an effective way to improve detection accuracy. The ECA (Efficient Channel Attention) module replaces the two fully connected layers in the SE module with one-dimensional convolutions of size k. This allows for a direct correspondence between channels and their corresponding parameters, and also further reduces the number of parameters. The inventors found that the ECA module, using one-dimensional convolutions of size k, can only handle channel interactions between the k nearest channels, and cannot consider interactions between channels at greater distances, resulting in lower detection accuracy. For ease of subsequent explanation, the attention module used in this invention is named the ACPA (Atrous Channel Pyramid Attention) module. This module replaces the one-dimensional convolutions of size k in the ECA module with multiple parallel one-dimensional convolutions with different dilation rates, used for interactions between channels at greater distances across multiple scales.
[0061] The structure of the ACPA module is described in detail below. Figure 3 Here is a schematic diagram of the ACPA module:
[0062] A feature map F with height H, width W, and number of channels C are used as the input to this attention module, i.e., F∈R. H ×W×C It can be represented as F = [f1, f2, f3, ... f c ], where f i ∈R H×W Let F represent the feature map of the i-th channel. First, global average pooling (GAP) is used to aggregate the spatial feature information of the feature map F, at which point the feature vector F can be obtained. GAP ∈R 1×1×C The k-th element of this feature vector can be represented as follows:
[0063]
[0064] Where f k (i,j) represents the state in f k The value at coordinate (i,j) in F. To facilitate one-dimensional convolution operations, F... GAP Remove one dimension and get F GAP ∈R 4×C At this time, F GAP It is expressed as follows:
[0065] F GAP =[f GAP(1) ,f GAP(2) ,f GAP(3) ,...,fGAP(C) ];
[0066] Next, in order to enable interaction between feature map channels at multiple scales, F GAP The input is fed into four parallel one-dimensional dilated convolutions, whose dilation rates can be expressed as rates = (r1, r2, r3, r4) (for example, rates = (1, 4, 8, 12)). One-dimensional convolutions allow all channels to share the learned parameters, effectively enabling cross-channel interactions among K adjacent feature channels. Using four parallel one-dimensional dilated convolutions expands the cross-channel interaction of K adjacent channels to cross-channel interaction of K channels with multiple scale distances. Then, the results of these four parallel one-dimensional convolutions are summed element-wise to obtain Y∈R. 1×C Therefore, F GAP The entire process of inputting into parallel dilated convolution to obtain Y[i] can be represented by the following formula:
[0067]
[0068] In the above formula, w[k] represents the k-th element of the convolution kernel of length K. rates[j] represents the j-th dilatation rate in rates, and before convolution, rates[j]-1 zeros are inserted into F. GAP The two sides are adjusted to ensure that the resolution of the original feature map remains unchanged throughout the process. Finally, a sigmoid function is used to normalize Y to obtain the final channel attention map. Thus, all the above operations can be simply represented as follows:
[0069]
[0070] In the above formula, F represents the input of the entire ACPA module. Let F represent a one-dimensional dilated convolution with a dilation rate of rates[i] and a kernel length of K. GAP and σ represent the global average pooling layer and the sigmoid layer, respectively. The resulting channel attention weight map W can be used to assign different weights to each channel in F, thereby strengthening feature channels relevant to the target region and weakening feature channels unrelated to the target region. This operation is as follows:
[0071]
[0072] In the above formula, This means that the channel attention weight map W is multiplied element-wise with the input feature map F, but before this operation, each element in W needs to be expanded into a feature map with the same spatial dimension as F. This indicates the output of the entire ACPA module, where the information from each channel has been selectively amplified or suppressed by the ACPA module. This concludes all the operations of the ACPA module.
[0073] The ACPA module is a lightweight, pluggable module. In ACPA-Net, the ACPA module is inserted at the end of the two convolutional blocks in each step. Given an input X, the output Y of a step can be represented as:
[0074] Y = ACPA(ConvB(ConvB(X)));
[0075] ConvB represents a convolutional block, which consists of a 3×3 convolutional layer, a batch normalization layer, and a ReLU activation function.
[0076] In some implementations, to further improve detection accuracy, a deep supervised network module is used in the water leakage image detection model to make the model more discriminative. The deep supervised network module adds additional constraints to some layers of the water leakage image detection model, except for the last layer, which can improve convergence speed and network accuracy under certain conditions.
[0077] To utilize a deep supervised network module in the model, this invention incorporates a Side Network into the model's decoder. The Side Network predicts the output of each layer in the decoder and then uses these outputs for deep supervised learning. The Side Network consists of 1×1 convolutional layers, nearest neighbor upsampling layers, and sigmoid layers. The output of the central layer and the feature maps generated at each upsampling step in the decoder serve as inputs to the Side Network. First, 1×1 convolutions predict the results and produce the output. Then, except for the output of the last layer, all others are upsampled to the same resolution as the input image. Finally, the sigmoid layer provides the output of the Side Network, which is supervised by the label map.
[0078] In some implementations, both the encoder and decoder include multiple layers. Each layer of the encoder includes a sequentially connected convolutional block, an attention module, and a downsampling layer. Each layer of the decoder includes a sequentially connected nearest-neighbor upsampling layer, a convolutional block, and an attention module. A central layer connects the lowest layer of the encoder to the highest layer of the decoder. Deep supervision network modules are located at the output of the central layer and at the output of each layer of the decoder. These deep supervision network modules predict the output of each layer of the decoder and use the results for deep supervision learning.
[0079] In this embodiment, the hole rate of the attention modules at each level of the encoder and decoder can be the same, and the hole rate of the attention modules at the first level of the encoder and decoder is different from the hole rate of the attention modules at other levels.
[0080] The water leakage image detection model can include at least an encoder, a decoder that is hopped between the encoder and decoder, a central layer that connects the encoder and decoder, and a deep supervision network module that is connected to the output of the decoder and the central layer, respectively. Both the encoder and decoder contain attention modules. For ease of description, the water leakage image detection model constructed in this invention will be referred to as the ACPA-Net network.
[0081] Specifically, such as Figure 4 The ACPA-Net network structure shown has four layers for both the encoder and decoder. Each encoder layer consists of two sequentially connected convolutional blocks, an attention layer, and a downsampling layer. Each decoder layer consists of a sequentially connected nearest neighbor upsampling layer, two convolutional blocks, and an attention module. The central layer consists of two convolutional blocks, each containing a 3×3 convolutional layer, a batch normalization layer, and a calibration linear unit. The ACPA attention module consists of multiple parallel one-dimensional dilated convolutions. The deep supervision network module is the Side Network, which predicts the output of each decoder layer and uses the output of each decoder layer for deep supervised learning. The Side Network consists of a 1×1 convolutional layer, a nearest neighbor upsampling layer, and a sigmoid function layer. The output of the central layer and the feature maps generated by the nearest neighbor upsampling layers of each decoder layer are used as inputs to the Side Network. The output of the last decoder layer is processed by the Side Network to obtain the output of the water leakage image detection model. It should be noted that... Figure 4 In this context, "step" represents a level.
[0082] The attention module ACPA can be four parallel one-dimensional dilated convolutions, and the dilation rate of the first-level attention model of the encoder and decoder is (1,2,4,8), while the dilation rate of the attention model of other levels is (1,4,8,16).
[0083] In some implementations, the ACPA-Net constructed in this invention is based on the deep learning framework PyTorch 1.4.0, and the software platform used is PyCharm. Due to the limitation of GPU memory, the batch size for the entire training process is ultimately set to 4, and the optimizer chosen is RMSprop, with the initial learning rate set to 1×10⁻⁶. -4Momentum is 0.9, weight decay is 1×10⁻⁶. -8 In this embodiment, ReduceLROnPlateau is used as the learning rate adjustment strategy. If the loss does not decrease further after three training rounds, the existing learning rate is multiplied by 0.1. When the learning rate reaches 1×102... -8 After this, the learning rate will no longer decrease. Additionally, this embodiment employs an early termination mechanism. The total number of training rounds is set to 200, but the entire training process will terminate early if the F1-score on the validation set does not improve within 10 rounds.
[0084] All subsequent experiments described in this invention are based on the same training and test sets. In this embodiment, the network did not use pre-training in the experiments, but instead used Kaiming normal to initialize the parameters directly.
[0085] In some implementations, a loss function is introduced throughout the network supervision process to calculate the difference between the predicted output and the label map. Binary cross-entropy loss (BCE loss) and Dice-coefficient loss (Dice loss) are two commonly used loss functions in image detection. These two loss functions are pixel-level and region-level loss functions, respectively. The Dice coefficient is an important indicator of the quality of the segmentation results.
[0086] Using the Dice loss function directly optimizes the model towards the optimal Dice coefficient. As a region-dependent loss function, the Dice loss function performs well in scenarios with severe imbalance between positive and negative samples, but small targets in the training samples can cause instability in the loss during training. In contrast, the BCE loss function exhibits more stable performance. To improve the effectiveness of supervision, this embodiment of the invention utilizes the advantages of both the Dice and BCE loss functions to construct a hybrid loss function.
[0087] Based on the first segmentation result and the labeled leak water tag map, the hybrid loss function of each level of the leak water image detection model is adjusted. The first segmentation result is the prediction result obtained after the leak water image samples have been processed by the encoder, decoder, and deep supervision network module at each level. The hybrid loss function at each level includes a binary cross-entropy loss function and a Dice loss function.
[0088] Specifically, the mixing loss function for each layer is l seg for:
[0089] l seg=αl bce +l dice ;
[0090] l bce Let l be the binary cross-entropy loss function. dice Let α be the Dice loss function, and α be a scaling factor, where 0 < α < 1. The proportion of the BCE loss function in the mixed loss function can be adjusted. In subsequent experiments of this invention, α is set to 0.5. This invention uses the BCE loss function to smooth the gradient, and then uses the Dice loss function to make the network focus more on the foreground.
[0091] The overall loss function L of the water leakage image detection model is:
[0092]
[0093] M represents the total number of layers in the deep supervised network module, where m is a positive integer. The loss is calculated from the m-th output of the side network of the deep supervised network module.
[0094] To demonstrate the effectiveness of the hybrid loss function and analyze the sensitivity of parameter α within it, the performance of different loss functions on ACPA-Net was tested. The loss functions included BCE, Dice, and a hybrid loss function. These were denoted as "BCE", "DL", and "αBCE+DL", respectively. In "αBCE+DL", α was chosen to be 0.25, 0.5, 1, 1.5, and 2, respectively. Using the Dice loss function resulted in significant training fluctuations. Choosing the BCE loss function led to a more stable training process. Compared to the Dice loss, the hybrid loss function resulted in a more stable training process. More importantly, the hybrid loss function improved network performance compared to both the Dice and BCE losses. Notably, the closer α is to 1, the better the network performance. This means that when the proportion of BCE loss in the hybrid loss is closer to that of the Dice loss function, the network achieves better results.
[0095] In some implementations, in order to evaluate the performance of the model, it is necessary to use some evaluation metrics to evaluate the model in experiments.
[0096] The evaluation metrics used in this invention include: Precision, Recall, Intersection-over-Union (IoU), F1-score, and Accuracy. Precision, in this invention, represents the percentage of correctly predicted leak areas in the predicted results. Specifically, Precision represents the proportion of pixels correctly predicted as leak areas out of all pixels predicted as leak areas. Recall, or recall rate, represents the percentage of correctly predicted leak areas in the label image. Specifically, it refers to the proportion of pixels correctly predicted as leak areas out of all true leak areas in the label image. A high Precision or Recall alone does not necessarily indicate good model performance. Therefore, Precision and Recall are often used together to measure network effectiveness. The F1-score, mathematically expressed the same as the Dice coefficient, comprehensively considers both Precision and Recall.
[0097] A good model needs to find a balance between precision and recall, so the F1-score is a reliable metric for evaluating network performance. IoU is also an important metric, representing the intersection ratio between the leaky areas in the segmentation result and the leaky areas in the label map. Accuracy is defined as the percentage of correctly predicted pixels across all pixels, including both the leaky areas and the background.
[0098] Step S140: Detect the water leakage image to be detected based on the trained water leakage image detection model.
[0099] Once the leakage image detection model, namely the ACPA-Net network constructed in step S130, is trained, it can be used to detect the leakage images to be detected.
[0100] The intelligent detection method provided by this invention first acquires multiple water leakage image samples from a preset sample library. Then, each water leakage image sample is labeled to obtain a labeled water leakage tag map. Next, based on each water leakage image sample and its label map, a pre-constructed water leakage image detection model is trained to obtain a trained water leakage image detection model. Finally, the trained water leakage image detection model is used to detect the water leakage image to be detected. In addition to existing encoders and decoders, the water leakage image detection model constructed in this invention also includes an attention module and a deep supervision network module. The attention module helps the water leakage image detection model effectively learn semantic features, and the deep supervision network module effectively improves the robustness of the water leakage image detection model, thereby enabling accurate detection of water leakage images in complex environments.
[0101] The following is a series of comparative experiments conducted to verify the detection performance of the ACPA-Net network provided by this invention.
[0102] First, to verify the effectiveness of the attention module ACPA and the deep supervision network module Side Network in detecting water leakage images, this invention uses the UNet network as a baseline and compares its results with the output of the UNet network integrating the ACPA and deep supervision network modules. To ensure fairness, the batch size and learning rate are the same in the experiments of this invention. The experiments were conducted on the railway tunnel water leakage images provided in this invention. F1-score, IoU, and accuracy were used as evaluation metrics. The dilatancy rate of the ACPA module in the first layer of the encoder and decoder was set to (1, 2, 4, 8), and the dilatancy rate of the ACPA in other layers was set to (1, 4, 8, 16). The kernel length of the one-dimensional convolution was set to 3.
[0103] The experimental results are shown in Table 1, where "+ACPA" and "+ACPA+DS" represent integrating the ACPA module into UNet and further adding a deep supervised network module, respectively. Compared with UNet, the introduction of the ACPA module improved F1-score, IoU, and Accuracy by 1.55%, 2.1%, and 0.37%, respectively. In particular, when a deep supervised network module was further added to the model, the metrics F1-score, IoU, and Accuracy all achieved optimal values, at 90.75%, 83.62%, and 96.68%, respectively. Compared with the baseline network, the F1-score improved by 3.9%, and IoU and Accuracy also saw significant improvements.
[0104] Table 1. Effectiveness of the ACPA module and deep supervision network module on the model.
[0105] Method F1 score (%) IoU (%) Accuracy (%) UNet 86.85 77.86 95.43 +ACPA 88.4(1.55↑) 79.96(2.1↑) 95.80(0.37↑) +ACPA+DS 90.75(3.9↑) 83.62(5.76↑) 96.68(1.25↑)
[0106] Figure 5 The results are presented using the three methods described above, where GT (ground truth) is the labeled image. UNet yields poor results and is easily affected by noise, readily misidentifying low-grayscale interference objects such as pipes or shadows as areas of water leakage. From... Figure 5 It can be seen that the ACPA module significantly reduces the false recognition rate. This indicates that the ACPA module can help the network effectively learn better semantic feature representations. However, as... Figure 5As shown in the fourth line, the network is still affected by some noise, which causes the segmentation results to be discontinuous internally. However, by further adding a deep supervision strategy to the network, the results are further improved.
[0107] The model provided by this invention provides a more consistent representation of the leakage area in its predictions. The experiments demonstrate that the ACPA module helps the network extract effective features of the leakage area, and adding appropriate supervision to the layers before the network makes the network more robust and achieves a more consistent representation within the target region.
[0108] Secondly, to verify the effectiveness of the ACPA module for detecting water leakage images inside tunnels, this invention evaluated the performance of the proposed ACPA module and other attention modules using images of water leakage in railway tunnels. Based on the lightweight nature of the ACPA module, this invention compared it with four other similar lightweight modules, mainly including the SE module, CBAM module, spatial and channel SE (scSE) module, and ECA module. The UNet network incorporating deep supervised learning was used as the baseline network, denoted as "UNet_DS". Then, "+SE", "+CBAM", "+scSE", "+ECA", and "+ACPA" represent the addition of the SE, CBAM, scSE, ECA, and ACPA attention modules to the baseline network, respectively. The experimental results are shown in Table 2, where "ΔParam" represents the number of parameters added after adding the attention modules to the baseline network. It can be seen that the baseline network achieved better results after adding the attention modules, indicating that channel-to-channel interaction is necessary.
[0109] Table 2 Comparison of ACPA module with other attention modules
[0110] Methods F1 score (%) IoU (%) Accuracy (%) ΔParam UNet_DS 87.81 79.2 95.77 — +SE 89.68(1.87↑) 81.76(2.56↑) 96.17(0.40↑) 13.95K +CBAM 89.50(1.69↑) 81.69(2.49↑) 96.36(0.59↑) 30.28K +scSE 88.14(0.33↑) 79.77(0.57↑) 95.64(0.13↓) 110.30K +ECA 89.92(2.11↑) 82.39(3.19↑) 96.49(0.72↑) 24 +ACPA 90.75(2.94↑) 83.62(4.42↑) 96.68(0.91↑) 96
[0111] In the CBAM, scSE, and SE modules, feature channels are compressed in the fully connected layers to reduce the number of parameters and computation in the channel attention modules. This strategy results in an indirect rather than direct mapping between channels and weights. Notably, "+ECA" achieves comparable or even better performance than "+SE," "+CBAM," and "+scSE" with only a few additional parameters compared to the baseline network. This demonstrates that the strategy of avoiding feature channel compression in the ECA module can more effectively perform cross-channel interactions. As shown in Table 2, "+ACPA" has the best performance, outperforming "+ECA" by 0.83%, 1.23%, and 0.19% in F1-score, IoU, and Accuracy, respectively, despite adding only 72 more parameters. This result indicates that the parallel dilated convolutions used in the ACPA module can effectively perform channel interactions over longer distances.
[0112] Next, the ACPA-Net provided by this invention is compared with three existing image detection methods. The first, a traditional image segmentation method, is the representative threshold-based Otsu algorithm (OA). The second is a representative region growing algorithm (RGA) based on region segmentation. The third is the graph-based GrabCut algorithm. Table 3 lists the results of the different methods on the test set.
[0113] Table 3 Comparison results between ACPA-Net and existing methods
[0114] Methods F1 score (%) Recall (%) Precision (%) IoU (%) Accuracy (%) OA 48.69 97.67 34.32 33.84 63.30 RGA 63.09 73.76 63.64 48.40 82.11 GrabCut 89.29 90.68 88.75 81.34 96.25 ACPA-Net 90.75 90.47 91.56 83.62 96.68
[0115] As can be seen, except for Recall, all evaluation metrics predicted by OA and RGA are far lower than those obtained by the method proposed in this invention. Although OA achieved the highest Recall (97.67%), this is because OA struggles to automatically find a suitable threshold to separate the leaking area from the background. It tends to classify the background and leaking areas into the same category, resulting in a high Recall but very low Precision. Consequently, its F1-score, IoU, and Accuracy values are all relatively low. Overall, OA performs the worst, RGA outperforms OA, and GrabCut is the best performing of the three traditional image segmentation methods, far surpassing the other two. The method proposed in this invention outperforms all three traditional image segmentation methods.
[0116] Figure 6The image shows a comparison of the detection results of ACPA-Net and existing methods. It is clear from the image that ACPA-Net achieves better detection results, while the image segmentation results of existing methods are easily affected by various factors. Figure 6 As seen in the third line, due to the influence of reflection, existing image segmentation methods produce many holes in the water seepage area, and RGA can only segment a small portion of the water seepage area. For images under low-light conditions, such as... Figure 6 In the last line, RGA and OA algorithms struggle to distinguish between foreground and background. Compared to the first two methods, GrabCut offers superior performance, but it requires manual interaction during segmentation—specifically, manually selecting the leaking area and appropriately marking incorrectly predicted regions. GrabCut trades manual interaction for better segmentation results, making it less efficient and still inferior to the method proposed in this invention. In contrast, as a data-driven deep learning approach, the method proposed in this invention offers higher efficiency and better robustness than traditional image segmentation methods.
[0117] Finally, the ACPA-Net provided by this invention was compared with existing detection methods based on deep learning networks, including PSPNet, DeepLabv3, DeepLabv3+, LinkNet, and SFNet. Due to the small dataset size, ResNet-18 was used as the feature extraction network in the experiments, and all of the above networks were pre-trained on the ImageNet dataset, which can reduce overfitting to some extent and improve model performance and accuracy. Table 4 shows the comparison results of the method of this invention with the above five deep learning methods on evaluation metrics.
[0118] Table 4. Detection comparison results between ACPA-Net and existing deep learning networks.
[0119] Method Param F1 score (%) Recall (%) Precision (%) IOU (%) Accuracy (%) PSPNet 11.51M 87.42 88.17 87.57 78.24 95.63 DeepLabv3 15.90M 88.84 88.66 89.85 80.53 95.73 DeepLabv3+ 12.33M 88.37 89.89 87.98 79.82 95.83 LinkNet 11.66M 89.32 88.65 91.11 81.5 96.25 SFNet 13.75M 90.02 90.05 90.77 82.46 96.51 Ours 4.32M 90.75 90.47 91.56 83.62 96.68
[0120] As shown in Table 4, PSPNet yields the worst results. In contrast, LinkNet, with a similar number of parameters to PSPNet, achieves significantly better results. SFNet's results are slightly lower than the method described in this invention. The model described in this invention has the fewest parameters and also exhibits optimal performance across other metrics.
[0121] Figure 7The image shows a comparison of the detection results between ACPA-Net and existing deep learning networks. The edges of the leaking water area in the image predicted by PSPNet are relatively coarse, and PSPNet cannot effectively distinguish between the pipe and the leaking water area. The results indicate that the pyramid pooling module (PPM) proposed in PSPNet for multi-scale context modeling is not suitable for leaking water segmentation in complex environments. DeepLabv3 and DeepLabv3+ use dilated convolutions to maintain and increase the network's receptive field while preserving image resolution in the encoder, and then use the ASPP module to capture multi-scale contextual information. Figure 7 As can be seen, DeepLabv3 and DeepLabv3+ show a slight improvement over PSPNet, but their predictions still exhibit poor edge detail in the leakage areas. Figure 7 As shown in the first row, DeepLabv3 and DeepLabv3+ struggle to make accurate predictions in low-light environments. LinkNet, SFNet, and the proposed ACPA-Net supplement some detailed information by fusing feature maps from the encoder. Furthermore, SFNet aligns two adjacent feature maps by predicting the flow field using a FlowAlignment Module (FAM). Therefore, the boundaries of the target regions predicted by LinkNet, SFNet, and ACPA-Net are clearer and more accurate than those of PSPNet, DeepLabv3, and DeepLabv3+ mentioned above. Compared to other methods, the proposed ACPA-Net still achieves better results. Figure 7 As seen in the first two lines, the other five deep learning-based prediction results contain severely misclassified regions. However, by employing the ACPA module and deep supervision strategies, the method of this invention successfully achieves the most accurate segmentation results. The ACPA module helps the network strengthen useful feature channels and suppress useless feature channels. This helps the network learn stronger feature representations of the leakage area. Skip connections between the encoder and decoder can enhance some details of the image by recovering local spatial information. Deep supervision can effectively improve the robustness of the network and also enable a more consistent representation within the target region. The method proposed in this invention... Figure 7 In the later rows, it still achieved better detection results than other methods.
[0122] The ACPA-Net model for leak detection provided by this invention, by adding the attention module ACPA, can effectively perform multi-scale, long-distance cross-channel interactions, helping to suppress useless features and strengthen useful features, thus helping the network learn stronger feature representations of the leak area, and with fewer parameters. The addition of a deep supervised network module can effectively improve the network's robustness and obtain more consistent representations within the target area. Furthermore, the experimental results show that the ACPA-Net model for leak detection provided by this invention has more accurate detection performance in complex environments.
[0123] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0124] Based on the intelligent detection method for tunnel water leakage images provided in the above embodiments, the present invention also provides a specific implementation of a detection device applied to the intelligent detection method for tunnel water leakage images. Please refer to the following embodiments.
[0125] like Figure 8 As shown, an intelligent detection device 800 for detecting tunnel water leakage images is provided, comprising:
[0126] The sample acquisition module 810 is used to acquire multiple water leakage image samples from a preset sample library;
[0127] The labeling module 820 is used to label each leakage image sample to obtain a leakage label map containing the labels;
[0128] The training model module 830 is used to train a pre-built leakage image detection model based on each leakage image sample and its leakage label map to obtain a trained leakage image detection model. The leakage image detection model includes at least an encoder, a decoder that is skipped to the encoder, a central layer that connects the encoder and the decoder, and a deep supervision network module that is connected to the output of the decoder and the central layer respectively. Both the encoder and the decoder have attention modules, and the attention modules include multiple parallel convolutions with different dilation rates.
[0129] The detection module 840 is used to detect the leaking water image to be detected based on the trained leaking water image detection model.
[0130] In one possible implementation, the attention module transforms a one-dimensional convolutional block of size k in the ECA module into multiple parallel convolutional blocks with different dilatations; and the output of the attention module in the decoder and the output of the central layer serve as inputs to the deep supervision network.
[0131] In one possible implementation, both the encoder and the decoder include multiple layers. Each layer of the encoder includes a sequentially connected convolutional block, an attention module, and a downsampling layer. Each layer of the decoder includes a sequentially connected nearest-neighbor upsampling layer, a convolutional block, and an attention module.
[0132] The central layer is used to connect the lowest level of the encoder and the highest level of the decoder;
[0133] A deep supervision network module is provided at the output of the central layer and at the output of each layer of the decoder. The deep supervision network module is used to predict the output of each layer of the decoder and use the output results for deep supervision learning.
[0134] In one possible implementation, the training model module 830 is used to adjust the hybrid loss function of each level of the leakage image detection model based on the first segmentation result and the labeled leakage label map; wherein, the first segmentation result is the prediction result obtained after the leakage image sample is processed by the encoder, decoder and deep supervision network module of each level, and the hybrid loss function of each level includes the binary cross-entropy loss function and the Dice loss function;
[0135] The pre-constructed water leakage image detection model is trained based on the overall loss function of the water leakage image detection model, each water leakage image sample and its water leakage label map; wherein, the overall loss function is a linear combination of the hybrid loss functions of each layer.
[0136] In one possible implementation, the hybrid loss function l for each layer seg for:
[0137] l seg =αl bce +l dice ;
[0138] The overall loss function L is:
[0139]
[0140] Among them, l bce Let l be the binary cross-entropy loss function. dice Let M be the Dice loss function, M be the total number of layers in the deep supervised network module, m be a positive integer, and α be the scaling factor, where 0 < α < 1.
[0141] In one possible implementation, the hole rate of the attention modules at each level of the encoder and decoder is the same, and the hole rate of the attention modules at the first level of the encoder and decoder is different from the hole rates of the attention modules at other levels.
[0142] In one possible implementation, both the encoder and decoder comprise four layers. Each layer of the encoder comprises two sequentially connected convolutional blocks, an attention layer, and a downsampling layer. Each layer of the decoder comprises a sequentially connected nearest-neighbor upsampling layer, two convolutional blocks, and an attention module. The central layer comprises two convolutional blocks, each consisting of a 3×3 convolutional layer, a batch normalization layer, and a correction linear unit. The attention module comprises four parallel one-dimensional dilated convolutions. The dilation rate of the attention model in the first layer of both the encoder and decoder is (1,2,4,8), while the dilation rate of the attention model in the other layers is (1,4,8,16).
[0143] The deep supervised network module is called the Side Network, which is used to predict the output of each level of the decoder and use the output of each level of the decoder for deep supervised learning. The Side Network includes a 1×1 convolutional layer, a nearest neighbor upsampling layer, and a sigmoid function layer.
[0144] The output of the central layer and the feature maps generated by the nearest neighbor upsampling layers of each level of the decoder are used as inputs to the Side Network. The output of the last level of the decoder is processed by the Side Network to obtain the output of the water leakage image detection model.
[0145] Figure 9 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. For example... Figure 9 As shown, the electronic device 9 in this embodiment includes: a processor 90, a memory 91, and a computer program 92 stored in the memory 91 and executable on the processor 90. When the processor 90 executes the computer program 92, it implements the steps in the above-described embodiments of the intelligent detection method for tunnel water leakage images, for example... Figure 1 Steps 110 to 140 are shown. Alternatively, when the processor 30 executes the computer program 32, it implements the functions of each module in the above-described device embodiments, for example... Figure 8 The functions of modules 810 to 840 are shown.
[0146] For example, the computer program 92 can be divided into one or more modules, which are stored in the memory 91 and executed by the processor 90 to complete the present invention. The one or more modules can be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program 92 in the electronic device 9. For example, the computer program 92 can be divided into... Figure 8 Modules 810 to 840 are shown.
[0147] The electronic device 9 may include, but is not limited to, a processor 90 and a memory 91. Those skilled in the art will understand that... Figure 9 This is merely an example of electronic device 9 and does not constitute a limitation on electronic device 9. It may include more or fewer components than shown, or combine certain components, or different components. For example, the electronic device may also include input / output devices, network access devices, buses, etc.
[0148] The processor 90 may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0149] The memory 91 can be an internal storage unit of the electronic device 9, such as a hard disk or memory. The memory 91 can also be an external storage device of the electronic device 9, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, the memory 91 can include both internal and external storage units of the electronic device 9. The memory 91 is used to store the computer program and other programs and data required by the electronic device. The memory 91 can also be used to temporarily store data that has been output or will be output.
[0150] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0151] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0152] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0153] In the embodiments provided by this invention, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0154] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0155] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. An intelligent detection method for tunnel water leakage images, characterized in that, include: Obtain multiple water leakage image samples from a preset sample library; Each leak image sample is labeled to obtain a leak label map containing the labels; Based on each leak image sample and its leak label map, a pre-built leak image detection model is trained to obtain a trained leak image detection model. The leak image detection model includes at least an encoder, a decoder with skip connections to the encoder, a central layer connecting the encoder and the decoder, and deep supervision network modules connected to the outputs of the decoder and the central layer, respectively. Both the encoder and the decoder include attention modules, each comprising multiple parallel convolutions with different dilation rates. The attention module transforms a one-dimensional convolutional block of size k in the ECA module into a... The deep supervision network is replaced by multiple parallel convolutional blocks with different dilatation rates. The outputs of the attention modules in the decoder and the outputs of the central layer serve as the inputs to the deep supervision network. A deep supervision network module is provided at the output of the central layer and at the output of each level of the decoder. The deep supervision network module is used to predict the output of each level of the decoder and uses the output results for deep supervision learning. The dilatation rates of the attention modules at each level of the encoder and the decoder are the same, and the dilatation rates of the attention modules at the first level of the encoder and the decoder are different from the dilatation rates of the attention modules at other levels. The trained water leakage image detection model is used to detect the water leakage image to be detected.
2. The intelligent detection method as described in claim 1, characterized in that, Both the encoder and the decoder include multiple layers. Each layer of the encoder includes a sequentially connected convolutional block, an attention module, and a downsampling layer. Each layer of the decoder includes a sequentially connected nearest neighbor upsampling layer, a convolutional block, and an attention module. The central layer is used to connect the lowest level of the encoder and the highest level of the decoder.
3. The intelligent detection method as described in claim 2, characterized in that, The process of training a pre-built leakage image detection model based on each leakage image sample and its leakage label image includes: Based on the first segmentation result and the labeled leakage water tag map, the hybrid loss function of each level of the leakage water image detection model is adjusted; wherein, the first segmentation result is the prediction result obtained after the leakage water image sample is processed by the encoder, the decoder and the deep supervision network module at each level, and the hybrid loss function at each level includes the binary cross-entropy loss function and the Dice loss function. The pre-constructed leakage image detection model is trained based on the overall loss function of the leakage image detection model, each leakage image sample and its leakage label map; wherein, the overall loss function is a linear combination of the hybrid loss functions of each layer.
4. The intelligent detection method as described in claim 3, characterized in that, The hybrid loss function of each layer l seg for: l seg =α l bce + l dice ; The overall loss function L is: L=(1 / M) ; Among them, the l bce The binary cross-entropy loss function is... l dice Let M be the Dice loss function, M be the total number of layers in the deep supervision network module, m be a positive integer, and α be a scaling factor, where 0 < α < 1.
5. The intelligent detection method as described in claim 1, characterized in that, Both the encoder and the decoder comprise four layers. Each layer of the encoder includes two sequentially connected convolutional blocks, an attention layer, and a downsampling layer. Each layer of the decoder includes a sequentially connected nearest neighbor upsampling layer, two convolutional blocks, and an attention module. The central layer comprises two convolutional blocks, each consisting of a 3×3 convolutional layer, a batch normalization layer, and a calibration linear unit. The attention module comprises four parallel one-dimensional dilated convolutions. The dilation rate of the attention model in the first layer of both the encoder and the decoder is (1, 2, 4, 8), while the dilation rate of the attention model in other layers is (1, 4, 8, 16). The deep supervised network module is a Side Network, which is used to predict the output of each level of the decoder and use the output of each level of the decoder for deep supervised learning; wherein, the Side Network includes a 1×1 convolutional layer, a nearest neighbor upsampling layer and a sigmoid function layer; The output of the central layer and the feature map generated by the nearest neighbor upsampling layer of each level of the decoder are used as the input of the Side Network. The output of the last level of the decoder is processed by the Side Network to obtain the output result of the water leakage image detection model.
6. An intelligent detection device for tunnel water leakage images, characterized in that, include: The sample acquisition module is used to acquire multiple water leakage image samples from a preset sample library; The labeling module is used to label each leak image sample to obtain a leak label map containing the labels; A training model module is used to train a pre-built leakage image detection model based on each leakage image sample and its leakage label map, resulting in a trained leakage image detection model. The leakage image detection model includes at least an encoder, a decoder with skip connections to the encoder, a central layer connecting the encoder and the decoder, and deep supervision network modules connected to the outputs of the decoder and the central layer, respectively. Both the encoder and the decoder include attention modules, each comprising multiple parallel convolutions with different dilation rates. The attention module is a module that integrates a k-th convolutional layer from the ECA module. The 3D convolutional block is transformed into multiple parallel convolutional blocks with different dilatation rates; the output of the attention module in the decoder and the output of the central layer serve as the input of the deep supervision network; a deep supervision network module is provided at the output of the central layer and at the output of each level of the decoder, the deep supervision network module is used to predict the output of each level of the decoder, and the output results are used for deep supervision learning; the dilatation rate of the attention modules at each level of the encoder and the decoder is the same, and the dilatation rate of the attention module at the first level of the encoder and the decoder is different from the dilatation rate of the attention modules at other levels; The detection module is used to detect the leaking water image to be detected based on the trained leaking water image detection model.
7. An electronic device, characterized in that, The method includes a memory and a processor, the memory being used to store a computer program, and the processor being used to call and run the computer program stored in the memory to perform the method as described in any one of claims 1 to 5.
8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 5.
