Tunnel lining appearance water leakage image detection method, device, system and product
By using an improved Yolov8 neural network, combined with the GSConv and C2f_AdditiveBlock modules, the problems of missed detection and false detection in the detection of apparent water leakage in railway tunnel linings are solved, and the detection accuracy and efficiency under complex lighting conditions are improved. This method is suitable for the automatic detection of apparent water leakage defects in railway tunnel linings.
Patent Information
- Application Number
- CN202510739245.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-04
- Publication Date
- 2025-10-31
AI Technical Summary
Existing image detection methods for apparent water leakage in railway tunnel linings suffer from problems such as missed detections, false detections, and inaccurate framing. In particular, accuracy is affected under complex lighting conditions, and some equipment is expensive, while data transmission and processing delays affect maintenance timeliness.
An improved Yolov8 neural network is adopted. By introducing the GSConv module and C2f_AdditiveBlock module into the backbone network and combining them with a large-size detection layer, the feature discrimination is improved, the false negative rate is reduced, and the recognition accuracy is increased, making it adaptable to complex lighting environments.
It significantly improves the accuracy and efficiency of water leakage detection under complex lighting conditions, reduces the amount of computation, and enhances the robustness and accuracy of the detection model, making it suitable for the automatic detection of apparent water leakage defects in railway tunnel linings.
Smart Images

Figure CN120877087A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of tunnel lining apparent leakage detection technology, and in particular to a method, equipment, system and product for detecting apparent leakage in tunnel lining images. Background Technology
[0002] Railway tunnels are a key component of modern transportation infrastructure, playing a vital role in ensuring the smooth and safe operation of railway transport. They not only shorten geographical distances and improve transport efficiency but also promote economic exchange and development between regions. The good operational condition of railway tunnels is directly related to the reliability and safety of railway transport. However, during long-term use, various problems may arise in tunnel linings, among which apparent water leakage is a relatively common and significant issue.
[0003] Methods for detecting apparent water leakage in railway tunnel linings mainly include traditional manual inspection and inspection based on modern technology. Traditional manual inspection involves workers entering the tunnel and using visual observation and simple tools (such as flashlights, reading microscopes, and measuring tapes) to locate the leakage and assess its severity. This method heavily relies on the experience and subjective nature of the inspectors, resulting in low efficiency and a high risk of missed or misjudgments. Furthermore, manual inspection carries certain safety risks. Image-based detection methods for apparent water leakage in railway tunnel linings, based on modern technology, utilize various advanced equipment and technologies, such as infrared thermal imaging and high-definition cameras combined with image recognition algorithms. Infrared thermal imaging can detect potential leakage areas by detecting temperature differences on the lining surface, as the temperature at leakage points is usually different from the surrounding normal lining area. High-definition cameras can acquire clear images of the tunnel lining, which are then analyzed using image recognition algorithms to extract features related to leakage, such as wetting marks, the shape and color of water stains, thereby achieving automatic detection and location of leakage. Detection methods based on modern technology offer numerous advantages. For example, it can significantly improve detection efficiency, quickly cover large areas of tunnel lining, and reduce detection time. Moreover, the detection results are more objective and accurate, reducing interference from human factors and improving the reliability of defect identification. Furthermore, it enables digital storage and management of data, facilitating subsequent analysis and tracking. With the continuous development and advancement of technology, these modern detection technologies are being used more and more widely in the detection of apparent leakage in railway tunnel linings, providing strong support for ensuring the safe operation of railway tunnels.
[0004] However, while existing image-based methods for detecting apparent water leakage in railway tunnel linings have made some progress, several problems remain. For example, the accuracy of some image recognition-based algorithms is affected under complex lighting conditions, leading to false positives or false negatives; the high cost of some detection equipment limits their widespread application on certain railway lines; and some detection methods suffer from delays in data transmission and processing, failing to provide timely feedback of detection results and impacting the timeliness of maintenance work. These problems require further research and solutions to continuously improve the technical level and application effectiveness of image-based detection for apparent water leakage in railway tunnel linings. Summary of the Invention
[0005] This invention provides a method, equipment, system, and product for detecting apparent water leakage in tunnel lining images, in order to solve the problems affecting the accuracy of detection, such as missed detections, false detections, and inaccurate outlining, in the process of detecting apparent water leakage in tunnel lining images.
[0006] In a first aspect, embodiments of the present invention provide a method for detecting apparent water leakage in tunnel lining images, including:
[0007] Acquire images of apparent water leakage in the target tunnel lining;
[0008] The apparent water leakage image of the target tunnel lining is input into a pre-trained detection model based on an improved Yolov8 neural network to detect the apparent water leakage image and obtain the detection result.
[0009] The improved Yolov8 neural network includes a backbone network, a neck network, and a detection head network. The Conv module in the backbone network is replaced with a GSConv module, and the C2f module in the backbone network is replaced with a C2f_AdditiveBlock module. There are five groups of combined modules formed by the GSConv and C2f_AdditiveBlock modules in the backbone network. The neck network includes three upsampling modules and three downsampling modules. The upsampling modules include a C2 module, a Concat module, and an Upsample module. The downsampling modules include a Conv module, a Concat module, and a C2 module. The detection head network includes four Detect modules.
[0010] Specifically, the C2f_AdditiveBlock module in the second group of combined modules is connected to the Concat module in the first group of upsampling modules; the C2f_AdditiveBlock module in the third group of combined modules is connected to the Concat module in the second group of upsampling modules; the C2f_AdditiveBlock module in the fourth group of combined modules is connected to the Concat module in the third group of upsampling modules; the SPPF module in the backbone network is connected to the Upsample module in the third group of upsampling modules and the Concat module in the third group of downsampling modules, respectively; the C2 module in the first group of upsampling modules is connected to the Conv module in the first group of downsampling modules and the first Detect module in the detection head network, respectively; the C2 module in the first group of downsampling modules is connected to the second Detect module in the detection head network; the C2 module in the second group of downsampling modules is connected to the third Detect module in the detection head network; and the C2 module in the third group of downsampling modules is connected to the fourth Detect module in the detection head network.
[0011] In one possible implementation, the GSConv module includes: a Conv module, a DWConv module, a Concat module, and a Shuffle module;
[0012] The input of the Conv module is used as the input of the GSConv module. The output of the Conv module is connected to the input of the DWConv module and the input of the Concat module, respectively. The output of the DWConv module is also connected to the input of the Concat module. The output of the Concat module is connected to the input of the Shuffle module. The output of the Shuffle module is used as the output of the GSConv module.
[0013] In one possible implementation, the C2f_AdditiveBlock module includes: two Conv modules, a Split module, at least one AdditiveBlock module, and a Concat module;
[0014] The first Conv module, the Split module, each AdditiveBlock module, the Concat module, and the second Conv module are connected in series. The Split module and each AdditiveBlock module are also connected to the Concat module.
[0015] In one possible implementation, the AdditiveBlock module includes: the LocalIntegration module, the norm1 module, the AdditiveTokenMixer module, the norm2 module, and the Mlp_CASVIT module;
[0016] The LocalIntegration module, the norm1 module, the AdditiveTokenMixer module, the norm2 module, and the Mlp_CASVIT module are connected in series.
[0017] In one possible implementation, the LocalIntegration module includes: three Conv modules, a norm3 module, and a first activation function module;
[0018] The first Conv module, the norm3 module, the second Conv module, the first activation function module, and the third Conv module are connected in series.
[0019] In one possible implementation, the Mlp_CASVIT module includes: two Conv modules, a second activation function module, and two Dropout modules;
[0020] The first Conv module, the second activation function module, the first Dropout module, the second Conv module, and the second Dropout module are connected in series.
[0021] In one possible implementation, the training process of the detection model based on the improved Yolov8 neural network includes:
[0022] Obtain sample images showing apparent water leakage defects in the tunnel lining;
[0023] The sample images are classified and labeled according to the size and shape of the apparent water leakage defects in the tunnel lining, and a dataset in YOLO format is created.
[0024] Image augmentation is performed on the YOLO format dataset, and the augmented dataset is randomly divided into training set, validation set and test set;
[0025] The training set, the validation set, and the test set are input into the improved Yolov8 neural network for training, resulting in a trained detection model based on the improved Yolov8 neural network.
[0026] In a second aspect, embodiments of the present invention provide a tunnel lining apparent leakage image detection device, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method described in the first aspect or any possible implementation of the first aspect.
[0027] Thirdly, embodiments of the present invention provide a tunnel lining apparent leakage image detection system, including the tunnel lining apparent leakage image detection device as described in the second aspect above, and also including an image acquisition module and a data transmission module;
[0028] The image acquisition module is communicatively connected to the tunnel lining apparent leakage image detection device through the data transmission module.
[0029] The image acquisition module is used to acquire images of apparent water leakage in the target tunnel lining in real time and send the images of apparent water leakage in the target tunnel lining to the data transmission module.
[0030] The data transmission module is used to send the apparent water leakage image of the target tunnel lining to the apparent water leakage image detection device of the tunnel lining.
[0031] Fourthly, embodiments of the present invention provide a computer program product, including a computer program that, when executed by a processor, implements the method described in the first aspect or any possible implementation thereof.
[0032] In this embodiment of the invention, by setting the GSConv module and C2f_AdditiveBlock module in the improved Yolov8 neural network, and introducing the GSConv lightweight convolution and additive self-attention mechanism, the detection model based on the improved Yolov8 neural network can effectively improve the feature discrimination under complex lighting conditions. Furthermore, the backbone network of the improved Yolov8 neural network has five sets of combined modules consisting of the GSConv module and the C2f_AdditiveBlock module, while the neck network has three sets each of upsampling and downsampling modules, and the detection head network has four Detect modules. This forms a large-size detection layer, which expands the receptive field, reduces the false negative rate in large-scale leakage areas, and improves the average accuracy of leakage image recognition. It demonstrates good detection performance for apparent leakage defects in railway tunnel linings under complex environments such as low light intensity. Attached Figure Description
[0033] Figure 1 This is a flowchart illustrating the implementation of the tunnel lining apparent leakage image detection method provided in this embodiment of the invention.
[0034] Figure 2This is a schematic diagram of the structure of the improved Yolov8 neural network provided in an embodiment of the present invention;
[0035] Figure 3 This is a schematic diagram of the structure of the GSConv module provided in an embodiment of the present invention;
[0036] Figure 4 This is a schematic diagram of the structure of the C2f_AdditiveBlock module provided in an embodiment of the present invention;
[0037] Figure 5 This is a schematic diagram of the AdditiveBlock module provided in an embodiment of the present invention;
[0038] Figure 6 This is a schematic diagram of the LocalIntegration module provided in an embodiment of the present invention;
[0039] Figure 7 This is a schematic diagram of the AdditiveTokenMixer module provided in an embodiment of the present invention;
[0040] Figure 8 This is a schematic diagram of the structure of the Mlp_CASVIT module provided in an embodiment of the present invention;
[0041] Figure 9 This is a schematic diagram of the ablation experiment results provided in an embodiment of the present invention;
[0042] Figure 10 This is a comparative diagram of the original image, the initial detection result of YOLOv8, and the detection result after YOLO improvement provided in the embodiments of the present invention;
[0043] Figure 11 This is a schematic diagram of the structure of the tunnel lining apparent leakage image detection device provided in an embodiment of the present invention;
[0044] Figure 12 This is a schematic diagram of the tunnel lining apparent leakage image detection device provided in an embodiment of the present invention;
[0045] Figure 13 This is a schematic diagram of the tunnel lining apparent leakage image detection system provided in an embodiment of the present invention;
[0046] Figure 14 This is a schematic diagram illustrating the writing environment and running environment provided in an embodiment of the present invention. Detailed Implementation
[0047] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0048] See Figure 1The document illustrates a flowchart of the implementation of the tunnel lining apparent leakage image detection method provided in an embodiment of the present invention, which is described in detail below:
[0049] Step 101: Obtain an image of apparent water leakage in the target tunnel lining.
[0050] Among them, the apparent water leakage image of the target tunnel lining is the image that needs to be detected for apparent water leakage defects. For example, the apparent water leakage image of the target tunnel lining can be acquired by an area array camera.
[0051] Step 102: Input the apparent water leakage image of the target tunnel lining into the pre-trained detection model based on the improved Yolov8 neural network to detect the apparent water leakage image and obtain the detection results.
[0052] The improved Yolov8 neural network includes a backbone network, a neck network, and a detection head network. The Conv module in the backbone network is replaced with the GSConv module, and the C2f module is replaced with the C2f_AdditiveBlock module. There are five sets of combined modules consisting of the GSConv and C2f_AdditiveBlock modules in the backbone network. The neck network includes three upsampling modules and three downsampling modules. The upsampling modules include the C2 module, the Concat module, and the Upsample module. The downsampling modules include the Conv module, the Concat module, and the C2 module. The detection head network includes four Detect modules.
[0053] Specifically, the C2f_AdditiveBlock module in the second group of combined modules is connected to the Concat module in the first group of upsampling modules; the C2f_AdditiveBlock module in the third group of combined modules is connected to the Concat module in the second group of upsampling modules; the C2f_AdditiveBlock module in the fourth group of combined modules is connected to the Concat module in the third group of upsampling modules; the SPPF module in the backbone network is connected to the Upsample module in the third group of upsampling modules and the Concat module in the third group of downsampling modules, respectively; the C2 module in the first group of upsampling modules is connected to the Conv module in the first group of downsampling modules and the first Detect module in the detection head network, respectively; the C2 module in the first group of downsampling modules is connected to the second Detect module in the detection head network; the C2 module in the second group of downsampling modules is connected to the third Detect module in the detection head network; and the C2 module in the third group of downsampling modules is connected to the fourth Detect module in the detection head network.
[0054] The improved Yolov8 neural network structure diagram in this embodiment is as follows: Figure 2As shown, it includes the Backbone network, the Neck network, and the Head network.
[0055] The Backbone network comprises, in sequence, the following modules: the first layer GSConv module, the second layer GSConv module and the second layer C2f_AdditiveBlock module (also known as the first group of combined modules), the third layer GSConv module and the third layer C2f_AdditiveBlock module (also known as the second group of combined modules), the fourth layer GSConv module and the fourth layer C2f_AdditiveBlock module (also known as the third group of combined modules), the fifth layer GSConv module and the fifth layer C2f_AdditiveBlock module (also known as the fourth group of combined modules), the sixth layer GSConv module and the sixth layer C2f_AdditiveBlock module (also known as the fifth group of combined modules), and the sixth layer SPPF module.
[0056] The Neck network comprises, in sequence, an Upsample module (layer 6 to layer 5), a Concat module (layer 5), and a C2 module (layer 5), corresponding to the third group of upsampling modules. The Upsample module (layer 5 to layer 4), a Concat module (layer 4), and a C2 module (layer 4) corresponding to the second group of upsampling modules. The Upsample module (layer 4 to layer 3), a Concat module (layer 3), and a C2 module (layer 3) corresponding to the first group of upsampling modules. The Conv module (layer 3 to layer 4), a Concat module (layer 4), and a C2 module (layer 4) corresponding to the first group of downsampling modules. The Conv module (layer 4 to layer 5), a Concat module (layer 5), and a C2 module (layer 5) corresponding to the second group of downsampling modules. The Conv module (layer 5 to layer 6), a Concat module (layer 6), and a C2 module (layer 6) corresponding to the third group of downsampling modules.
[0057] The SPPF module is connected to the Upsample module passed from layer 6 to layer 5. The Concat module in layer 5 concatenates the output features of the Upsample module passed from layer 6 to layer 5 with the output features of the C2f_AdditiveBlock module in layer 6 and then inputs them into the C2 module in layer 5. The Concat module in layer 4 concatenates the output features of the Upsample module passed from layer 5 to layer 4 with the output features of the C2f_AdditiveBlock module in layer 5 and then inputs them into the C2 module in layer 4. The Concat module in layer 3 concatenates the output features of the Upsample module passed from layer 4 to layer 3 with the output features of the C2f_AdditiveBlock module in layer 4 and then inputs them into the C2 module in layer 3. The C2 module in layer 3 is connected to the Conv module passed from layer 3 to layer 4. The Concat module in layer 4 concatenates the output features of the Conv module passed from layer 3 to layer 4 with the output features of the C2 module in layer 4 and then inputs them into the C2 module in layer 4. The Concat module in layer 5 concatenates the output features of the Conv module passed from layer 4 to layer 5 with the output features of the C2 module in layer 5 and then inputs them into the C2 module in layer 5. The Concat module in the sixth layer concatenates the output features of the Conv module passed from the fifth layer to the sixth layer with the output features of the SPPF module in the sixth layer, and then inputs them into the C2 module in the sixth layer. The output features of the C2 modules in the third, fourth, fifth, and sixth layers are respectively input into the corresponding detect module network layers.
[0058] In this embodiment, the Backbone network incorporates the C2f_AdditiveBlock module for spatial and channel interactions, improving the average accuracy (mAP50) to 90.4%, and increasing the mAP50-95 accuracy by 2.4%. Within the 50-95% IOU threshold range, the average accuracy is improved by 2.4 percentage points, while reducing the computational cost (GFLOPs) to 7.9. The additive self-attention module improves average accuracy while achieving lower GFLOPs. The addition of a lightweight GSConv module makes the fusion and transmission of features at different levels more efficient, reducing redundant information and unnecessary computation, thus improving overall detection efficiency and accuracy.
[0059] The Neck network also incorporates a large-size target detection layer, changing its original connection method. By increasing the receptive field, it can capture a wider range of contextual information in the image, improving the accuracy of detecting apparent water leakage images of tunnel linings in complex environments.
[0060] Optionally, the GSConv module may include: the Conv module, the DWConv module, the Concat module, and the Shuffle module.
[0061] The input of the Conv module is used as the input of the GSConv module. The output of the Conv module is connected to the input of the DWConv module and the input of the Concat module. The output of the DWConv module is also connected to the input of the Concat module. The output of the Concat module is connected to the input of the Shuffle module. The output of the Shuffle module is used as the output of the GSConv module.
[0062] The GSConv module structure in this embodiment is as follows: Figure 3 As shown, a cascaded structure is formed by standard convolutional layers (i.e., Conv modules) and depthwise separable convolutional layers (i.e., DWConv modules), achieving cross-channel information interaction through a channel shuffling mechanism. For example, the core process first uses a 1×1 standard convolutional layer to compress the number of input feature channels to half the number of output channels. Then, a 5×5 depthwise separable convolutional layer is used to extract spatial information from the compressed features, and further, grouped convolution operations significantly reduce computational parameters. In the feature fusion stage, the output features of the two convolutional layers are concatenated along the channel dimension, and tensor dimension reconstruction and permutation operations are used to achieve feature recombination between channels, forming a channel fusion effect similar to an interleaved arrangement. This design, while retaining the feature representation capabilities of standard convolution, achieves a balance between computational efficiency and feature fusion capability through the synergistic effect of depthwise separable convolution and channel shuffling.
[0063] The aforementioned GSConv module can be divided into three parts: a dual-path feature processing architecture, a channel interaction enhancement unit, and a dynamic feature reorganization mechanism. The dual-path architecture includes a parallel 1×1 standard convolutional basic feature extraction branch and a 5×5 grouped convolutional deep feature mining branch. The channel interaction enhancement unit achieves multi-scale feature fusion through cross-layer channel splicing and dimensionality transformation. The dynamic feature reorganization mechanism employs tensor dimensionality reshaping and permutation strategies, dynamically reorganizing channel grouping information through a "split-transform-merge" process. These three components work together to achieve a balanced optimization of feature representation capability and computational efficiency.
[0064] Optionally, the C2f_AdditiveBlock module may include: two Conv modules, a Split module, at least one AdditiveBlock module, and a Concat module.
[0065] The first Conv module, the Split module, each AdditiveBlock module, the Concat module, and the second Conv module are sequentially connected in series. The Split module and each AdditiveBlock module are also connected to the Concat module.
[0066] Optionally, the AdditiveBlock module may include: the LocalIntegration module, the norm1 module, the AdditiveTokenMixer module, the norm2 module, and the Mlp_CASVIT module.
[0067] The LocalIntegration module, norm1 module, AdditiveTokenMixer module, norm2 module, and Mlp_CASVIT module are connected in series.
[0068] Optionally, the LocalIntegration module may include: three Conv modules, a norm3 module, and a first activation function module.
[0069] The first Conv module, the norm3 module, the second Conv module, the first activation function module, and the third Conv module are connected in series.
[0070] Optionally, the Mlp_CASVIT module may include: two Conv modules, a second activation function module, and two Dropout modules.
[0071] The first Conv module, the second activation function module, the first Dropout module, the second Conv module, and the second Dropout module are connected in series.
[0072] The C2f_AdditiveBlock module structure in this embodiment is as follows: Figure 4As shown, the C2f_AdditiveBlock module comprises a cross-stage feature fusion framework (C2f), an additive feature enhancement module (AdditiveBlock), and their sub-functional units, connected sequentially. It achieves multi-scale feature collaborative optimization through a hierarchical residual architecture. Based on a cross-stage partial connection (CSP) framework, this module deeply integrates local perception and global attention mechanisms while preserving the characteristics of gradient multi-path propagation. Its core processing flow first enhances spatial details through a local feature integration module (LocalIntegration), which employs a lightweight inverted bottleneck structure and utilizes grouped convolutions to extract local contextual information. Subsequently, the features are batch-normalized and input to an additive token mixer (AdditiveTokenMixer), where the query vector and key vector are calibrated using a spatial-channel dual-path attention mechanism. Additive interaction replaces traditional dot-product attention, reducing computational complexity while achieving global dependency modeling. Finally, a fully convolutional feedforward network (Mlp_CASVIT) expands the channel dimension and completes the nonlinear transformation. The outputs of each submodule can be fused step-by-step through triple residual connections, and combined with a stochastic deep regularization strategy to improve training stability, forming a progressive feature optimization path of "local enhancement - global interaction - channel expansion". This design effectively combines the inductive bias of convolutional operations with the dynamic modeling capability of attention mechanisms, and is suitable for application scenarios in dense prediction tasks that are sensitive to details and require long-term contextual reasoning.
[0073] Among them, such as Figure 5 As shown, the AdditiveBlock module includes the LocalIntegration module, norm1 module, AdditiveTokenMixer module, norm2 module, and Mlp_CASVIT module connected in sequence.
[0074] In this embodiment, the C2f_AdditiveBlock module inherits from the C2f class. Its core function is to construct a sequence containing multiple AdditiveBlocks for in-depth processing and fusion of input features. During the initialization phase of the C2f_AdditiveBlock module, it receives important parameters such as the number of input channels, the number of output channels, and the number of modules. Based on these parameters, the module instantiates each AdditiveBlock and stores them in a list m. These AdditiveBlock modules will process the input features sequentially, forming a cascaded feature processing flow.
[0075] The AdditiveBlock module, as the fundamental building block of the C2f_AdditiveBlock module, integrates several key sub-modules, demonstrating a high degree of sophistication. During the initialization of AdditiveBlock, the LocalIntegration module is instantiated first. This module is primarily responsible for local perception tasks, employing a series of carefully designed convolution, normalization, and activation operations (e.g., ...). Figure 6 The 1×1Conv module, Norm3 module, 3×3Conv module, ReLU activation function module, and 1×1Conv module shown are used. The LocalIntegration module performs dimensionality reduction, feature extraction, and dimensionality increase on the features of the input dimension. This series of operations helps to capture the local structural information of the image, enhances the expressive power of the features, and provides an important foundation for subsequent feature processing.
[0076] Next, the normalization layer norm1 normalizes the features processed by the LocalIntegration module. This operation is crucial in deep learning, as it accelerates model convergence, improves training efficiency, makes the model more stable during training, and reduces problems such as vanishing or exploding gradients.
[0077] Next is the AdditiveTokenMixer module, which is the core component of the AdditiveBlock module and undertakes the key task of implementing the convolutional additive self-attention mechanism. For example... Figure 7 As shown, this module uses the nn.Conv2d operation to map the input features into a query vector Q, a key vector K, and a value vector V. Subsequently, the SpatialOperation and ChannelOperation modules are used to perform spatial and channel dimension operations on the query vector Q and key vector K, respectively. These operations aim to extract key features and calculate attention weights. By summing the processed features and multiplying them by the value vector V, followed by projective convolution proj, and finally outputting the result through Conv, the AdditiveTokenMixer module achieves efficient feature fusion and attention calculation, enabling the model to focus more on important feature regions.
[0078] The information integration capability of the convolutional additive self-attention mechanism lies in the interaction of multiple information types. Based on this, the similarity function can be defined as the sum of the context of the query vector Q and the key vector K:
[0079]
[0080] in This represents a context mapping function that contains basic information interactions. The advantage of this generalization is that it is not limited by manual context design and can potentially be implemented through convolutional operations. In this paper, we simply use... Specifically, this is implemented using sigmoid-based channel attention C(·) and spatial attention S(·). Therefore, the output of the AdditiveBlock module can be expressed as:
[0081]
[0082] Here, Γ(·) represents the linear transformation used to integrate contextual information.
[0083] The features processed by the AdditiveTokenMixer module will then be normalized again by the normalization layer norm2 to ensure the stability and consistency of the features.
[0084] These features are then fed into the Mlp_CASVIT module. Mlp_CASVIT is a multilayer perceptron module, such as... Figure 8 As shown, the Mlp_CASVIT module consists of two 1×1 Convs, the GELU activation function, and a random deactivation layer (Dropout). This module further enhances the discriminative power of features through a series of nonlinear transformations and dimensionality adjustments, resulting in better separability between features of different categories.
[0085] In this embodiment, the C2f_AdditiveBlock module constructs a multi-layered feature processing system by sequentially stacking multiple AdditiveBlock modules. Each AdditiveBlock module further extracts and fuses features based on the previous one, from capturing local information to calculating global attention and then to nonlinear transformations, gradually building a more representative feature representation. This hierarchical structural design enables the C2f_AdditiveBlock module to fully mine the potential information in complex image data, providing high-quality feature input for subsequent tasks such as image classification and object detection. In this way, it is expected to significantly improve the performance of the entire model in relevant computer vision tasks, providing stronger technical support for the application of deep learning in the image field.
[0086] Optionally, the training process for the detection model based on the improved Yolov8 neural network may include:
[0087] Obtain sample images showing apparent water leakage defects in the tunnel lining.
[0088] The sample images were classified and labeled according to the size and shape of the apparent water leakage defects in the tunnel lining, and a dataset in YOLO format was created.
[0089] Image augmentation is performed on the YOLO format dataset, and the augmented dataset is randomly divided into training, validation, and test sets.
[0090] The training set, validation set, and test set are input into the improved Yolov8 neural network for training, resulting in a trained detection model based on the improved Yolov8 neural network.
[0091] For example, a sample image with apparent water leakage defects on the surface of the tunnel lining can be captured by a tunnel intelligent scanning device (e.g., an area array camera). The tunnel intelligent scanning device is equipped with a high-resolution camera that can take a comprehensive picture of the tunnel lining surface and clearly capture the details of the tunnel lining surface.
[0092] For example, images can be classified based on features such as the size and shape of apparent water leakage defects in tunnel linings. The MakeSense annotation tool can then be used to annotate the classified images, creating a YOLO-formatted dataset. The annotations can include the spatial location and type attributes of the leakage's bounding box. Classifying images based on features such as the size and shape of the leakage allows for better analysis and handling of leakage problems.
[0093] For example, to improve the generalization ability of the algorithm, various data augmentation operations can be performed on the YOLO format dataset, including image rotation and translation. For instance, through data augmentation, the dataset can be expanded to 2022 images. The augmented dataset is then divided into training, validation, and test sets in a 7:2:1 ratio, specifically 1415 images for training, 405 images for validation, and 202 images for the test set. The randomized allocation of the training, validation, and test sets effectively avoids errors and enhances its generalization ability.
[0094] For example, training, validation, and test sets can be input into the improved YOLOv8 algorithm for training. The training and validation sets are used to optimize the parameters of the improved YOLOv8 algorithm to reduce the prediction error rate, and the test set evaluates the generalization ability and performance of the trained and validated improved YOLOv8 algorithm, enabling the algorithm to accurately identify and classify apparent leakage in tunnel linings.
[0095] For example, after training, the improved YOLOv8 algorithm weight file can be uploaded to the detection system, followed by the image of the tunnel water leakage to be detected. The improved YOLOv8 algorithm can then be used to detect and identify apparent water leakage in the tunnel lining. The detection results are displayed on the detection system screen. This process significantly improves the algorithm's performance in practical applications, providing strong technical support for tunnel operation, maintenance, and safety management. It helps to promptly detect and repair apparent water leakage in the tunnel lining, ensuring the safety and smooth operation of tunnel rail transit.
[0096] Evaluation metrics for algorithms include detection performance and complexity. Detection performance metrics can include precision (P), recall (R), and average precision (mAP). Complexity metrics are divided into time complexity and space complexity. Time complexity is measured in floating-point operations (GFLOPs), while space complexity is measured by the number of parameters and the amount of space the algorithm uses. The formulas for the detection performance metrics are as follows:
[0097]
[0098] Figure 9 The results of the ablation experiment are shown. (By...) Figure 9 It can be seen that the combination of the lightweight convolutional GSConv module, the C2f_AdditiveBlock module and the newly added large-scale detection head (p6) significantly improved mAP50 by 2.2%, mAP50-95 by 3.0%, and reduced GFLOPs by 0.5%. Figure 10 This diagram illustrates a comparison of the original image, the initial YOLOv8 detection results (i.e., the detection results based on the detection model trained with the original YOLOv8), and the improved YOLO detection results (i.e., the detection results based on the detection model trained with the improved YOLOv8). Figure 10 As shown in (a), (b), and (c), the detection model trained based on the improved YOLOv8 has a higher average accuracy. This embodiment improves average accuracy while achieving lower GFLOPs by performing spatial and channel interactions, based on an additive self-attention module. It also makes the fusion and transmission of features at different levels more efficient, reducing redundant information and unnecessary computation, thus improving overall detection efficiency and accuracy. The improved YOLOv8 outperforms the initial YOLOv8 in both performance and efficiency, demonstrating stronger learning capabilities and detection efficiency.
[0099] This embodiment introduces the C2f_AdditiveBlock and GSConv modules, and adds a large-size target detection layer. The improved algorithm achieves an mAP50 of up to 92.0%, while reducing the model computational cost (GFLOPs) to 7.5. The improved YOLOv8 algorithm weight file is uploaded to the tunnel leakage detection system, and then the apparent leakage image of the tunnel lining to be detected is uploaded to the detection system. The improved YOLOv8 algorithm is used to detect and identify the apparent leakage image of the tunnel lining. The algorithm of this invention outperforms other algorithms applied in the field of target detection in practical engineering. It demonstrates higher efficiency and accuracy in the detection of apparent leakage in tunnel lining images. Compared with the target detection methods commonly used in existing engineering fields, it significantly improves the ability to identify leakage areas in complex environments by optimizing feature extraction and fusion mechanisms, and enhances the robustness of the algorithm while reducing the false detection rate.
[0100] 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.
[0101] The following are device embodiments of the present invention. For details not described in detail, please refer to the corresponding method embodiments described above.
[0102] Figure 11 A schematic diagram of the tunnel lining apparent leakage image detection device provided in an embodiment of the present invention is shown. For ease of explanation, only the parts related to the embodiment of the present invention are shown, and are described in detail below:
[0103] like Figure 11 As shown, the tunnel lining apparent water leakage image detection device includes: acquisition module 111 and detection module 112.
[0104] The acquisition module 111 is used to acquire images of apparent water leakage in the target tunnel lining.
[0105] The detection module 112 is used to input the apparent water leakage image of the target tunnel lining into a pre-trained detection model based on an improved Yolov8 neural network to detect the apparent water leakage image and obtain the detection result.
[0106] The improved Yolov8 neural network includes a backbone network, a neck network, and a detection head network. The Conv module in the backbone network is replaced with the GSConv module, and the C2f module is replaced with the C2f_AdditiveBlock module. There are five sets of combined modules consisting of the GSConv and C2f_AdditiveBlock modules in the backbone network. The neck network includes three upsampling modules and three downsampling modules. The upsampling modules include the C2 module, the Concat module, and the Upsample module. The downsampling modules include the Conv module, the Concat module, and the C2 module. The detection head network includes four Detect modules.
[0107] Specifically, the C2f_AdditiveBlock module in the second group of combined modules is connected to the Concat module in the first group of upsampling modules; the C2f_AdditiveBlock module in the third group of combined modules is connected to the Concat module in the second group of upsampling modules; the C2f_AdditiveBlock module in the fourth group of combined modules is connected to the Concat module in the third group of upsampling modules; the SPPF module in the backbone network is connected to the Upsample module in the third group of upsampling modules and the Concat module in the third group of downsampling modules, respectively; the C2 module in the first group of upsampling modules is connected to the Conv module in the first group of downsampling modules and the first Detect module in the detection head network, respectively; the C2 module in the first group of downsampling modules is connected to the second Detect module in the detection head network; the C2 module in the second group of downsampling modules is connected to the third Detect module in the detection head network; and the C2 module in the third group of downsampling modules is connected to the fourth Detect module in the detection head network.
[0108] In one possible implementation, the GSConv module includes: a Conv module, a DWConv module, a Concat module, and a Shuffle module; the input of the Conv module is used as the input of the GSConv module, the output of the Conv module is connected to the input of the DWConv module and the input of the Concat module respectively, the output of the DWConv module is also connected to the input of the Concat module, the output of the Concat module is connected to the input of the Shuffle module, and the output of the Shuffle module is used as the output of the GSConv module.
[0109] In one possible implementation, the C2f_AdditiveBlock module includes: two Conv modules, a Split module, at least one AdditiveBlock module, and a Concat module; the first Conv module, the Split module, each AdditiveBlock module, the Concat module, and the second Conv module are sequentially connected in series, and the Split module and each AdditiveBlock module are also connected to the Concat module.
[0110] In one possible implementation, the AdditiveBlock module includes: LocalIntegration module, norm1 module, AdditiveTokenMixer module, norm2 module, and Mlp_CASVIT module; the LocalIntegration module, norm1 module, AdditiveTokenMixer module, norm2 module, and Mlp_CASVIT module are connected in series.
[0111] In one possible implementation, the LocalIntegration module includes: three Conv modules, a norm3 module, and a first activation function module; the first Conv module, the norm3 module, the second Conv module, the first activation function module, and the third Conv module are connected in series.
[0112] In one possible implementation, the Mlp_CASVIT module includes: two Conv modules, a second activation function module, and two Dropout modules; the first Conv module, the second activation function module, the first Dropout module, the second Conv module, and the second Dropout module are connected in series.
[0113] In one possible implementation, the training process of the detection model based on the improved Yolov8 neural network includes:
[0114] Obtain sample images showing apparent water leakage defects in the tunnel lining.
[0115] The sample images were classified and labeled according to the size and shape of the apparent water leakage defects in the tunnel lining, and a dataset in YOLO format was created.
[0116] Image augmentation is performed on the YOLO format dataset, and the augmented dataset is randomly divided into training, validation, and test sets.
[0117] The training set, validation set, and test set are input into the improved Yolov8 neural network for training, resulting in a trained detection model based on the improved Yolov8 neural network.
[0118] Figure 12 This is a schematic diagram of the tunnel lining apparent leakage image detection device provided in an embodiment of the present invention. Figure 12 As shown, the tunnel lining apparent leakage image detection device 12 of this embodiment includes a processor 120 and a memory 121. The memory 121 stores a computer program 122. When the processor 120 executes the computer program 122, it implements the steps in the above-described method embodiments. Alternatively, when the processor 120 executes the computer program 122, it implements the functions of each module / unit in the above-described device embodiments.
[0119] For example, the computer program 122 may be divided into one or more modules / units, which are stored in the memory 121 and executed by the processor 120 to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program 122 in the tunnel lining apparent leakage image detection device 12.
[0120] The tunnel lining apparent leakage image detection device 12 may include, but is not limited to, a processor 120 and a memory 121. Those skilled in the art will understand that... Figure 12 This is merely an example of the tunnel lining apparent leakage image detection device 12 and does not constitute a limitation on the tunnel lining apparent leakage image detection device 12. It may include more or fewer components than shown, or combine certain components, or different components. For example, the tunnel lining apparent leakage image detection device 12 may also include input / output devices, network access devices, buses, etc.
[0121] The processor 120 can 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. The general-purpose processor can be a microprocessor or any conventional processor.
[0122] The memory 121 can be an internal storage unit of the tunnel lining apparent leakage image detection device 12, such as a hard disk or RAM of the tunnel lining apparent leakage image detection device 12. The memory 121 can also be an external storage device of the tunnel lining apparent leakage image detection device 12, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the tunnel lining apparent leakage image detection device 12. Furthermore, the memory 121 can include both internal and external storage units of the tunnel lining apparent leakage image detection device 12. The memory 121 is used to store the computer program 122 and other programs and data required by the tunnel lining apparent leakage image detection device 12. The memory 121 can also be used to temporarily store data that has been output or will be output.
[0123] For the sake of simplicity and clarity, only the above-described functional modules / units are used as examples. In practical applications, the functions described above can be assigned to different functional modules / units as needed. These modules / units can be implemented in hardware, software, or a combination of both.
[0124] This invention also provides a tunnel lining apparent water leakage image detection system, which includes the aforementioned tunnel lining apparent water leakage image detection device, and further includes an image acquisition module and a data transmission module.
[0125] The image acquisition module is connected to the tunnel lining apparent leakage image detection equipment via the data transmission module.
[0126] The image acquisition module is used to acquire images of apparent water leakage in the target tunnel lining in real time and send these images to the data transmission module.
[0127] The data transmission module is used to send the apparent water leakage image of the target tunnel lining to the tunnel lining apparent water leakage image detection equipment.
[0128] In this embodiment, the image acquisition module (i.e., the scanning device or tunnel array camera) collects real-time image data of water leakage in the tunnel surface lining. It is equipped with a high-resolution camera to ensure excellent image quality, adapt to different lighting conditions in the tunnel, meet the needs of complex environments such as insufficient light in railway tunnels, and capture clear and detailed tunnel images.
[0129] Data transmission module: It can establish a reliable data transmission channel between the tunnel surface array camera and the tunnel lining apparent leakage image detection equipment through wireless communication technology, and transmit image data to the tunnel lining apparent leakage image detection equipment in real time for processing and analysis.
[0130] Tunnel lining apparent water leakage image detection equipment: Using the improved YOLOv8 algorithm, it classifies and identifies tunnel lining apparent water leakage image data, calculates the average accuracy of different types of leakage, and provides feedback on identification results and average accuracy, etc., for staff to confirm and make maintenance decisions.
[0131] like Figure 13 As shown, this embodiment uses an intelligent movable container as the basic carrier, equipped with four sets of area array cameras to acquire images of apparent water leakage in the tunnel lining. The image acquisition module acquires the water leakage images according to the steps described above. The server trains the target detection algorithm based on the improved YOLOv8 algorithm. After training, an improved YOLOv8 algorithm weight file is obtained, and then the improved YOLOv8 algorithm weight file is transmitted to the detection system. The intelligent 3D tunnel detection device interacts with the server and the detection system through the data transmission module, enabling the detection of apparent water leakage in the tunnel lining using the improved YOLOv8 algorithm.
[0132] For example, the writing environment and the runtime environment can be as follows: Figure 14 As shown.
[0133] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0134] 1. This invention fully utilizes the flexibility of tunnel array cameras on tunnel tracks to acquire real-time image data of apparent water leakage in tunnel linings. Leveraging the high robustness of deep learning models, it achieves efficient tunnel water leakage detection under complex environments with varying lighting conditions. This method can efficiently complete data acquisition and analysis during railway downtime, significantly shortening detection time. It is applicable to different scenarios, including before and after tunnel commissioning, achieving efficient and accurate image detection of tunnel water leakage.
[0135] 2. This invention designs a lightweight convolutional GSConv module to replace the original conventional convolution. This lightweight convolution not only makes the fusion and transmission of features at different levels more efficient, reducing redundant information and unnecessary computation, but also improves the overall detection efficiency and accuracy, thereby reducing resource consumption and effectively solving the problems of missed detections and false detections.
[0136] 3. This invention designs a lightweight AdditiveBlock module and integrates it into the C2f module. This module performs spatial and channel interactions, and improves average accuracy while achieving lower GFLOPs based on the additive self-attention module, thereby improving the leakage detection capability and reducing false and false detection rates.
[0137] 4. This invention achieves a significant improvement in average accuracy while maintaining computational resource constraints, simultaneously reducing false positive and false negative rates, and enhancing the overall performance of the detection system. By constructing a standardized data interface through a structured data conversion mechanism, it provides operational information support for on-site maintenance personnel, effectively reducing the need for manual verification and improving system reliability.
[0138] This invention also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the methods described in the above-described method embodiments.
[0139] This invention also provides a computer program product, including a computer program. When the computer program is executed by a processor, it implements the methods described in the above-described method embodiments.
[0140] Computer programs include computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. Computer-readable media can include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.
[0141] In the above embodiments, the descriptions of each embodiment have their own emphasis. Parts not detailed or described in a particular embodiment can be referred to in the relevant descriptions of other embodiments. Unless otherwise specified or in conflict with logic, the terminology and / or descriptions between different embodiments are consistent and can be referenced interchangeably. Technical features in different embodiments can be combined to form new embodiments based on their inherent logical relationships.
[0142] 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. A method for detecting apparent water leakage in tunnel lining using images, characterized in that, include: Acquire images of apparent water leakage in the target tunnel lining; The apparent water leakage image of the target tunnel lining is input into a pre-trained detection model based on an improved Yolov8 neural network to detect the apparent water leakage image and obtain the detection result. The improved Yolov8 neural network includes a backbone network, a neck network, and a detection head network. The Conv module in the backbone network is replaced with a GSConv module, and the C2f module in the backbone network is replaced with a C2f_AdditiveBlock module. There are five groups of combined modules formed by the GSConv and C2f_AdditiveBlock modules in the backbone network. The neck network includes three upsampling modules and three downsampling modules. The upsampling modules include a C2 module, a Concat module, and an Upsample module. The downsampling modules include a Conv module, a Concat module, and a C2 module. The detection head network includes four Detect modules. Specifically, the C2f_AdditiveBlock module in the second group of combined modules is connected to the Concat module in the first group of upsampling modules; the C2f_AdditiveBlock module in the third group of combined modules is connected to the Concat module in the second group of upsampling modules; the C2f_AdditiveBlock module in the fourth group of combined modules is connected to the Concat module in the third group of upsampling modules; the SPPF module in the backbone network is connected to the Upsample module in the third group of upsampling modules and the Concat module in the third group of downsampling modules, respectively; the C2 module in the first group of upsampling modules is connected to the Conv module in the first group of downsampling modules and the first Detect module in the detection head network, respectively; the C2 module in the first group of downsampling modules is connected to the second Detect module in the detection head network; the C2 module in the second group of downsampling modules is connected to the third Detect module in the detection head network; and the C2 module in the third group of downsampling modules is connected to the fourth Detect module in the detection head network.
2. The method for detecting apparent water leakage in tunnel lining according to claim 1, characterized in that, The GSConv module includes: a Conv module, a DWConv module, a Concat module, and a Shuffle module; The input of the Conv module is used as the input of the GSConv module. The output of the Conv module is connected to the input of the DWConv module and the input of the Concat module, respectively. The output of the DWConv module is also connected to the input of the Concat module. The output of the Concat module is connected to the input of the Shuffle module. The output of the Shuffle module is used as the output of the GSConv module.
3. The method for detecting apparent water leakage in tunnel lining according to claim 1, characterized in that, The C2f_AdditiveBlock module includes: two Conv modules, a Split module, at least one AdditiveBlock module, and a Concat module; The first Conv module, the Split module, each AdditiveBlock module, the Concat module, and the second Conv module are connected in series. The Split module and each AdditiveBlock module are also connected to the Concat module.
4. The method for detecting apparent water leakage in tunnel lining according to claim 3, characterized in that, The AdditiveBlock module includes: LocalIntegration module, norm1 module, AdditiveTokenMixer module, norm2 module, and Mlp_CASVIT module; The LocalIntegration module, the norm1 module, the AdditiveTokenMixer module, the norm2 module, and the Mlp_CASVIT module are connected in series.
5. The method for detecting apparent water leakage in tunnel lining according to claim 4, characterized in that, The LocalIntegration module includes: three Conv modules, a norm3 module, and a first activation function module; The first Conv module, the norm3 module, the second Conv module, the first activation function module, and the third Conv module are connected in series.
6. The method for detecting apparent water leakage in tunnel lining according to claim 4, characterized in that, The Mlp_CASVIT module includes: two Conv modules, a second activation function module, and two Dropout modules; The first Conv module, the second activation function module, the first Dropout module, the second Conv module, and the second Dropout module are connected in series.
7. The method for detecting apparent water leakage in tunnel lining according to claim 1, characterized in that, The training process of the detection model based on the improved Yolov8 neural network includes: Obtain sample images showing apparent water leakage defects in the tunnel lining; The sample images are classified and labeled according to the size and shape of the apparent water leakage defects in the tunnel lining, and a dataset in YOLO format is created. Image augmentation is performed on the YOLO format dataset, and the augmented dataset is randomly divided into training set, validation set and test set; The training set, the validation set, and the test set are input into the improved Yolov8 neural network for training, resulting in a trained detection model based on the improved Yolov8 neural network.
8. A device for detecting apparent water leakage in tunnel lining using images, characterized in that, It includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method as described in any one of claims 1 to 7.
9. A tunnel lining apparent water leakage image detection system, characterized in that, The tunnel lining apparent leakage image detection device as described in claim 8 further includes an image acquisition module and a data transmission module; The image acquisition module is communicatively connected to the tunnel lining apparent leakage image detection device through the data transmission module. The image acquisition module is used to acquire images of apparent water leakage in the target tunnel lining in real time and send the images of apparent water leakage in the target tunnel lining to the data transmission module. The data transmission module is used to send the apparent water leakage image of the target tunnel lining to the apparent water leakage image detection device of the tunnel lining.
10. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the method as described in any one of claims 1 to 7.