A tunnel lining waterlogging segmentation method and system based on a computer vision model

By combining deep convolutional neural networks with multi-scale attention and global context modeling, the problems of segmentation accuracy and efficiency in tunnel water stain detection are solved, achieving clear water stain region segmentation and parameter calculation, and supporting efficient and accurate tunnel defect assessment.

CN121305565BActive Publication Date: 2026-04-28BEIJING MUNICIPAL ENG RES INST +1
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING MUNICIPAL ENG RES INST
Filing Date
2025-12-15
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Existing tunnel water stain detection methods lack segmentation accuracy and stability in complex backgrounds, making it difficult to distinguish between high-risk and low-risk water stains. Furthermore, traditional detection processes have high computational overhead, making it difficult to meet the requirements of high-throughput and low-latency detection.

Method used

Using a deep convolutional neural network as the backbone, combined with a channel-space multi-scale attention structure and global context modeling, clear segmentation and parameter calculation of water stain areas are achieved through multi-level feature extraction and stepwise upsampling.

Benefits of technology

It improves the discriminative power of water stain areas and the consistency of segmentation results, reduces the rate of missed detection of small water stains, and enhances detection efficiency and accuracy, providing a reliable data foundation for tunnel defect assessment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121305565B_ABST
    Figure CN121305565B_ABST
Patent Text Reader

Abstract

The application discloses a tunnel lining waterlogging segmentation method and system based on a computer vision model, and the method comprises the following steps: acquiring a tunnel lining image and performing image enhancement preprocessing; inputting the preprocessed image into a deep convolutional neural network of a semantic segmentation network to perform multi-level feature extraction; setting a channel-space multi-scale attention structure in the skip connection of the encoder and the decoder, jointly modeling the feature map and attention weighting to obtain multi-scale features; introducing a global context modeling structure at the bottleneck position between the encoder and the decoder to perform global perception processing to obtain high-level features; adopting a step-by-step upsampling and feature fusion strategy to fuse and reconstruct the features of each layer, and outputting a waterlogging segmentation mask. Through the technical scheme of the application, layered expression of the waterlogging target and complex background in the tunnel lining scene is realized, the discrimination and segmentation effect of the waterlogging area are improved, and the coherence and consistency of the waterlogging area segmentation result are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image analysis technology, and in particular to a method for segmenting water stains in tunnel lining based on a computer vision model, and a system for segmenting water stains in tunnel lining based on a computer vision model. Background Technology

[0002] As a critical infrastructure in rail and road transportation, tunnels are subjected to high humidity, high stress, and complex environmental loads over long periods, making their lining structures prone to defects such as water leakage, condensation, and water stain spread. The distribution, size, and morphological characteristics of water stains are usually closely related to the water pressure behind the lining, the operational status of the drainage system, and the degree of concrete deterioration, and are one of the important indicators for assessing the durability and operational safety of tunnel structures. Operating units need to identify potential hazards and develop differentiated maintenance strategies based on water stain information on the lining surface. This requires the detection system to not only locate water stains but also provide stable and reliable quantitative parameters for subsequent water stain classification and risk assessment.

[0003] Currently, the detection of water stains in tunnels still relies primarily on manual inspections, supplemented by images of the lining acquired by vehicle-mounted or fixed acquisition systems. For automated analysis of image data, the industry has begun to adopt deep learning-based object detection or semantic segmentation methods to identify water stain areas. However, existing solutions generally suffer from two shortcomings: firstly, some methods only output the bounding box information of the water stains, failing to obtain fine pixel-level contours; secondly, even with general semantic segmentation networks, under complex backgrounds such as drastic changes in tunnel lighting, obstruction by ancillary facilities, rust stains, and dirt interference, water stain boundaries are prone to blurring and breakage, small water stains are easily missed, and non-water stain areas may be missegmented as water stain areas. Due to insufficient accuracy and stability of the segmentation results, parameters such as the area, perimeter, and morphology of water stains calculated based on the segmentation results fluctuate significantly, making it difficult to support fine-grained classification of the degree of water stain erosion. This leads to detection systems often tending to "treat all visible water stains equally" in practical applications, failing to distinguish between high-risk water stains requiring intensive treatment and minor water stains with minimal short-term impact, thus increasing false alarm rates and unnecessary maintenance workload.

[0004] Meanwhile, tunnel projects often involve long distances and frequent inspections, with a single inspection generating hundreds of thousands or even millions of lining image slices. This places high demands on the inference efficiency and end-to-end processing capabilities of the detection system. Traditional multi-stage detection processes based on target detection frameworks such as R-CNN require sequential completion of multiple steps, including candidate region generation, feature extraction, classification, and post-processing. This results in a complex overall structure and high computational cost, making it difficult to process large-scale tunnel image data in a timely manner and meet the high-throughput, low-latency detection requirements of engineering scenarios. Summary of the Invention

[0005] To address the aforementioned problems, this invention provides a method for water stain segmentation in tunnel lining based on a computer vision model. It employs a deep convolutional neural network as the backbone encoder to perform multi-level feature extraction, achieving hierarchical representation of water stain targets at different scales and complex background information in the tunnel lining scene. By setting a channel-space multi-scale attention structure in the skip connections between the encoder and decoder, it highlights key features of the water stain region and suppresses background interference features. This improves the discriminative power of the water stain region while preserving fine-grained spatial details, achieving pixel-level segmentation with clearer water stain boundaries and a lower false negative rate for small water stain regions. Furthermore, by introducing a global context modeling structure based on a self-attention mechanism at the bottleneck position between the encoder and decoder, the coherence and consistency of the water stain region segmentation results are improved. Through a progressive upsampling and feature fusion strategy, global semantic information and local fine structural information are simultaneously introduced during the gradual restoration of spatial resolution.

[0006] To achieve the above objectives, the present invention provides a method for water stain segmentation in tunnel lining based on a computer vision model, comprising:

[0007] Acquire tunnel lining images and perform image enhancement preprocessing on the tunnel lining images to obtain preprocessed images;

[0008] The preprocessed image is input into the encoder of the semantic segmentation network. The encoder uses a deep convolutional neural network as its backbone to perform multi-level feature extraction on the preprocessed image, resulting in multiple feature maps of different scales.

[0009] In the skip connection between the encoder and the decoder of the semantic segmentation network, a channel-space multi-scale attention structure is set up to jointly model and weight the feature maps of multiple different scales in the channel dimension and the spatial dimension to obtain attention-enhanced multi-scale features.

[0010] At the bottleneck position between the encoder and the decoder, a global context modeling structure based on a self-attention mechanism is introduced to perform global perception processing on the high-level feature map from the encoder, thereby obtaining high-level features after global perception processing.

[0011] The high-level features processed by global perception are used as input to the decoder, and a top-down progressive upsampling and feature fusion strategy is adopted to fuse and reconstruct the attention-enhanced multi-scale features with the features of each layer of the decoder, and output a water stain segmentation mask with the same size as the preprocessed image. The water stain segmentation mask is used to represent the water stain area in the tunnel lining.

[0012] In the above technical solution, preferably, the specific process of performing image enhancement preprocessing on the tunnel lining image includes:

[0013] The tunnel lining image is subjected to aspect ratio jitter and scale jitter based on geometric transformation. The aspect ratio jitter range is ±0.3, and the scaling ratio of the scale jitter is sampled between 0.25 and 2.

[0014] The image size is adjusted by bicubic interpolation after dithering, and the corresponding label mask is adjusted synchronously by nearest neighbor interpolation.

[0015] The processed image is randomly translated into a canvas of the target size, and then horizontally flipped with a preset probability.

[0016] Based on photometric transformation, the tunnel lining image is subjected to hue shift, saturation shift, and brightness shift in the HSV color space to enhance the contrast between the water stain area and the tunnel background. The hue shift range is ±0.1, the saturation shift range is ±0.7, and the brightness shift range is ±0.3.

[0017] In the above technical solution, preferably, the encoder of the semantic segmentation network uses a deep convolutional neural network structure based on ResNet50, comprising:

[0018] Convolutional layers for initial feature extraction of the preprocessed image and max pooling layers for downsampling the initial features;

[0019] And four residual stages connected in sequence, each residual stage includes a preset number of Bottleneck residual blocks, each Bottleneck residual block includes a 1×1 convolutional dimensionality reduction convolutional layer, a 3×3 convolutional feature extraction convolutional layer and a 1×1 convolutional dimensionality increase convolutional layer connected in sequence, and the input and output of each Bottleneck residual block are added through residual connection;

[0020] The first residual stage includes 3 Bottleneck residual blocks, the second residual stage includes 4 Bottleneck residual blocks, the third residual stage includes 6 Bottleneck residual blocks, and the fourth residual stage includes 3 Bottleneck residual blocks. The four residual stages output multi-level feature maps with different scales and number of channels, which are processed by the channel-space multi-scale attention structure and the global context modeling structure.

[0021] In the above technical solution, preferably, the channel-space multi-scale attention structure is arranged along the skip connection path between the encoder and the decoder, and is used to process three feature maps of different scales output from the first residual stage to the third residual stage in the backbone of the deep convolutional neural network, respectively. The channel-space multi-scale attention structure includes:

[0022] The three feature maps with different scales are concatenated at the channel level along the channel dimension to obtain a fused feature map.

[0023] The fused feature map is input into the multi-scale spatial attention submodule, and multi-scale spatial attention modeling is performed on the fused feature map in the multi-scale spatial attention submodule to generate a spatial attention weight map.

[0024] The fused feature map is weighted based on the spatial attention weight map to obtain attention-enhanced top-level features, mid-level features, and bottom-level features;

[0025] The top-level features, mid-level features, and bottom-level features are input to the upsampling layers of the decoder through corresponding skip connections, thereby supplementing spatial detail information during the upsampling process.

[0026] In the above technical solution, preferably, the global context modeling structure is set at the bottleneck position of the semantic segmentation network and connected to the output feature maps of at least two residual stages in the deepest layer of the encoder;

[0027] The global context modeling structure includes a global perception module built on the Transformer architecture. The global perception module performs global context modeling based on a self-attention mechanism on the output feature maps of the at least two residual stages to generate a first high-level feature map and a second high-level feature map after global perception processing.

[0028] The second high-level feature map processed by global perception serves as the initial input feature map of the decoder in the top-down stepwise upsampling and feature fusion strategy. The first high-level feature map processed by global perception is input to the first upsampling stage of the decoder through a skip connection, and is fused with the bottom-level features processed by the channel-space multi-scale attention structure in the first upsampling stage.

[0029] In the above technical solution, preferably, the decoder of the semantic segmentation network adopts a step-by-step upsampling structure, including a first upsampling module, a second upsampling module, a third upsampling module, and a fourth upsampling module connected in sequence, wherein:

[0030] The first upsampling module upsamples the second high-level feature map and fuses it with the bottom-level feature map.

[0031] The second upsampling module continues to upsample based on the features output by the first upsampling module, and performs feature fusion with the mid-level features;

[0032] The third upsampling module upsamples the features output by the second upsampling module and fuses them with the top-level features.

[0033] The fourth upsampling module continues to upsample based on the features output by the third upsampling module, and further refines the segmentation boundary of the water stain region under the spatial detail constraints provided by the top-level features, and outputs a feature map for generating the water stain segmentation mask.

[0034] In the above technical solution, preferably, after outputting the water stain segmentation mask, the following is also included:

[0035] The location range of at least one water stain region in the tunnel lining image is determined based on the water stain segmentation mask.

[0036] Based on the pixel set corresponding to each water stain region in the water stain segmentation mask, calculate the area, perimeter and / or morphological parameters of the water stain region;

[0037] Based on the comparison between the area of ​​the water stain region and the preset area threshold, as well as the morphological parameters, the degree of erosion of the water stain region is evaluated, and the water stain evaluation result is output.

[0038] In the above technical solution, preferably, the semantic segmentation network adopts a semantic segmentation model built based on deep learning, and the semantic segmentation model is one of SegFormer, U-Net, HRNet or DeepLab v3+.

[0039] This invention also proposes a tunnel lining water stain segmentation system based on a computer vision model, which applies the tunnel lining water stain segmentation method using a computer vision model disclosed in any of the above technical solutions, including:

[0040] An image preprocessing module is used to acquire tunnel lining images and perform image enhancement preprocessing on the tunnel lining images to obtain preprocessed images;

[0041] The multi-feature extraction module is used to input the preprocessed image into the encoder of the semantic segmentation network. The encoder uses a deep convolutional neural network as the backbone to perform multi-level feature extraction on the preprocessed image to obtain multiple feature maps of different scales.

[0042] The attention enhancement module is used to set up a channel-space multi-scale attention structure in the skip connection between the encoder and the decoder of the semantic segmentation network, and to jointly model and weight the feature maps of multiple different scales in the channel dimension and the spatial dimension to obtain attention-enhanced multi-scale features.

[0043] The context modeling module is used to introduce a global context modeling structure based on a self-attention mechanism at the bottleneck position between the encoder and the decoder, and to perform global perception processing on the high-level feature map from the encoder to obtain the high-level features after global perception processing.

[0044] The upsampling fusion module is used to take the high-level features processed by global perception as the input of the decoder, and adopts a top-down stepwise upsampling and feature fusion strategy to fuse and reconstruct the attention-enhanced multi-scale features with the features of each layer of the decoder, and outputs a water stain segmentation mask with the same size as the preprocessed image. The water stain segmentation mask is used to represent the water stain area in the tunnel lining.

[0045] In the above technical solution, preferably, the tunnel lining water stain segmentation system based on computer vision models further includes a water stain assessment module, specifically used for:

[0046] The location range of at least one water stain region in the tunnel lining image is determined based on the water stain segmentation mask.

[0047] Based on the pixel set corresponding to each water stain region in the water stain segmentation mask, calculate the area, perimeter and / or morphological parameters of the water stain region;

[0048] Based on the comparison between the area of ​​the water stain region and the preset area threshold, as well as the morphological parameters, the degree of erosion of the water stain region is evaluated, and the water stain evaluation result is output.

[0049] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0050] (1) By introducing image enhancement preprocessing at the input end of the tunnel lining image and sending the preprocessed image into an encoder with a deep convolutional neural network as the backbone to perform multi-level feature extraction, the hierarchical expression of water stain targets and complex background information at different scales in the tunnel lining scene is realized. Under conditions such as strong light, shadow, pipeline occlusion, and rust spots, the feature representation foundation is still relatively stable, which provides support for the accuracy and robustness of subsequent segmentation results.

[0051] (2) By setting a channel-space multi-scale attention structure in the skip connection between the encoder and the decoder, the feature maps of multiple different scales are jointly modeled and attention-weighted in the channel dimension and spatial dimension, which realizes the highlighting of features related to water stains and the suppression of background interference features. Thus, in the decoding stage, the discriminability of water stains can be improved while preserving fine-grained spatial details, and the pixel-level segmentation effect with clearer water stain boundaries and lower false negative rate of small water stain areas can be achieved.

[0052] (3) By introducing a global context modeling structure based on self-attention mechanism at the bottleneck position between the encoder and the decoder, the high-level feature map from the encoder is processed globally, and the long-distance dependency relationship within the overall structure of the tunnel lining is modeled. This effectively alleviates the problem that water stains are prone to breakage, adhesion or confusion with adjacent stains when relying only on local convolution features, and improves the coherence and consistency of water stain segmentation results from the global context level.

[0053] (4) By using the high-level features processed by global perception as the input of the decoder, and adopting a top-down stepwise upsampling and feature fusion strategy, the attention-enhanced multi-scale features and the features of each layer of the decoder are fused and reconstructed at multiple resolution levels. This achieves the simultaneous introduction of global semantic information and local fine structure information during the gradual restoration of spatial resolution. Finally, the output is a water stain segmentation mask with the same size as the preprocessed image. This ensures the segmentation accuracy and boundary details while facilitating the quantitative calculation of parameters such as water stain area and morphology based directly on the mask, providing a reliable data foundation for the automated assessment of tunnel water stain diseases. Attached Figure Description

[0054] Figure 1 This is a flowchart illustrating a method for segmenting water stains in tunnel lining based on a computer vision model, as disclosed in one embodiment of the present invention.

[0055] Figure 2 This is a schematic diagram of the model architecture of a deep convolutional neural network disclosed in one embodiment of the present invention;

[0056] Figure 3 This is a schematic diagram of the overall model architecture for water stain area segmentation disclosed in one embodiment of the present invention. Detailed Implementation

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

[0058] The present invention will now be described in further detail with reference to the accompanying drawings:

[0059] like Figure 1 As shown, a method for segmenting water stains in tunnel lining based on a computer vision model according to the present invention includes:

[0060] Images of the tunnel lining are acquired by image acquisition equipment deployed inside the tunnel, and image enhancement preprocessing combining geometric transformation and photometric transformation is performed on the tunnel lining images to obtain preprocessed images.

[0061] The preprocessed image is input into the encoder of the semantic segmentation network. The encoder can use a deep convolutional neural network based on ResNet50 as the backbone. The preprocessed image is downsampled and multi-level feature extraction is performed through initial convolutional layers, pooling layers and multi-level residual stages to obtain feature maps of different scales. Among them, the shallow feature maps retain higher spatial resolution and edge details, while the deep feature maps have stronger semantic expression capabilities.

[0062] In the skip connection between the encoder and the decoder of the semantic segmentation network, a channel-space multi-scale attention structure is set up to jointly model and weight the feature maps of the above multiple scales in the channel dimension and the spatial dimension, so as to obtain multi-scale features enhanced by attention.

[0063] Furthermore, at the bottleneck position between the encoder and decoder, a global context modeling structure based on a self-attention mechanism is introduced to perform global perception processing on the high-level feature map from the encoder, thereby obtaining high-level features processed by global perception.

[0064] On the decoder side, high-level features processed by global perception are used as input to the decoder. A top-down, stepwise upsampling and feature fusion strategy is adopted. At each upsampling stage, attention-enhanced multi-scale features are fused with features from different layers of the decoder at different resolutions for reconstruction. The final output is a water stain segmentation mask with the same size as the preprocessed image. This water stain segmentation mask provides the pixel-level location distribution of water stain regions in the tunnel lining and can be directly used for subsequent quantitative analysis of water stain morphology and area.

[0065] In this implementation, multi-level convolutional feature extraction, channel-spatial multi-scale attention enhancement, and global context modeling based on a self-attention mechanism are integrated within the same network framework. This allows the model to focus on water stain details at different scales while also utilizing global information about the overall tunnel structure. Compared to segmentation models that only use traditional U-Net or a single convolutional backbone, this implementation demonstrates clearer pixel-level segmentation boundaries for water stain areas and a lower false negative rate for small water stain areas under scenarios such as complex lighting, pipeline occlusion, and rust obfuscation. The overall segmentation accuracy and robustness are significantly improved, providing a high-quality input mask for subsequent tunnel defect assessment.

[0066] In the above embodiments, preferably, the specific process of image enhancement preprocessing for tunnel lining images includes:

[0067] First, the tunnel lining image is subjected to aspect ratio jitter and scale jitter based on geometric transformation. The aspect ratio jitter range is ±0.3, and the scaling ratio of the scale jitter is randomly sampled between 0.25 and 2.

[0068] The image size is adjusted by bicubic interpolation for the jittered image, and the corresponding label mask is adjusted synchronously by nearest neighbor interpolation to ensure the consistency of pixel-level labels.

[0069] The processed image is randomly shifted to a canvas of the target size, and then horizontally flipped with a preset probability to simulate different shooting positions and perspectives in a tunnel scene.

[0070] Subsequently, based on photometric transformation, the tunnel lining image was subjected to hue, saturation, and brightness shifts within the HSV color space to enhance the contrast between the water stain area and the tunnel background. The hue shift range was ±0.1, the saturation shift range was ±0.7, and the brightness shift range was ±0.3. By simultaneously altering the color and brightness distribution of the image, the model's adaptability to complex lighting conditions such as dim lighting, backlighting, and direct flash illumination was enhanced, thereby significantly improving the visual contrast between the water stain area and the tunnel background.

[0071] This preprocessing implementation expands the tunnel images used in the training phase to cover a data distribution with multiple scales, aspect ratios, and lighting conditions. This enables the deep convolutional backbone network to learn feature representations that are more invariant to geometric transformations and photometric variations in the image. After introducing geometric enhancement and photometric enhancement strategies, the model's accuracy in recognizing water stains of different sizes and under different lighting conditions is significantly improved on the test set. False positives and false negatives in complex lighting scenes are effectively suppressed, providing a solid foundation for improving overall segmentation accuracy.

[0072] like Figure 2As shown, in the above embodiment, preferably, the deep convolutional neural network used by the encoder of the semantic segmentation network is a residual network structure built based on ResNet50. The encoder first performs initial feature extraction on the preprocessed image through a 7×7 convolutional layer with 64 output channels and a stride of 2. Then, it performs downsampling through a 3×3 max pooling layer (with a stride of 2) to achieve initial feature compression.

[0073] After the initial convolution and pooling, the network core consists of four residual stages, each comprising a predetermined number of Bottleneck residual blocks stacked together. Specifically, the first residual stage includes 3 Bottleneck residual blocks, the second residual stage includes 4 Bottleneck residual blocks, the third residual stage includes 6 Bottleneck residual blocks, and the fourth residual stage includes 3 Bottleneck residual blocks.

[0074] Each Bottleneck residual block consists of a 1×1 convolutional layer for dimensionality reduction, a 3×3 convolutional layer for feature extraction, and a 1×1 convolutional layer for dimensionality increase, connected in sequence. Each convolutional layer can be followed by batch normalization and non-linear activation functions, and the input and output of each Bottleneck residual block are added together through residual connections.

[0075] Through the progressive feature extraction and downsampling of the four residual stages, the network expands the receptive field while retaining multi-scale feature information. Finally, the four residual stages output multi-level feature maps with different scales and number of channels. These feature maps serve as inputs to the subsequent channel-space multi-scale attention structure and global context modeling structure, respectively, to complete the multi-scale feature enhancement and global semantic modeling of the water stain area.

[0076] In this implementation, ResNet50 is used as the encoder backbone network. While ensuring network depth and expressive power, the Bottleneck residual structure and cross-layer identity mapping effectively alleviate the gradient vanishing problem in deep networks, improving training convergence speed and stability. The multi-scale features output from multiple residual stages provide rich and hierarchical feature inputs for subsequent CMSAA and AtlasGPM modules. Experiments show that this backbone structure, compared to shallow or simple convolutional backbones, can significantly improve the comprehensive representation ability of texture, edge, and contextual information of water stain areas in tunnel lining, thereby improving the overall performance of the segmentation network.

[0077] like Figure 3As shown, in the above embodiment, preferably, the channel-spatial multi-scale attention structure is set along the skip connection path between the encoder and the decoder to process the three feature maps of different scales output from the first residual stage to the third residual stage in the deep convolutional neural network ResNet50 backbone.

[0078] First, the three feature maps of different scales are concatenated at the channel level along the channel dimension to obtain a fused feature map, thereby aggregating shallow details and mid-level semantic information in a unified feature space.

[0079] Subsequently, the fused feature map is input into the multi-scale spatial attention submodule. The multi-scale spatial attention submodule performs multi-scale spatial modeling on the fused feature map by setting convolution kernels with different receptive fields or similar multi-scale feature extraction operators in parallel, generating a spatial attention weight map to characterize the importance of different spatial locations.

[0080] Then, the fused feature map is weighted position by position based on the spatial attention weight map to obtain attention-enhanced top level features, mid level features and bottom level features, which strengthens the feature response related to the water stain area and suppresses the background interference features.

[0081] The attention-enhanced top-level, mid-level, and bottom-level features are input to the upsampling layers of the decoder through corresponding skip connections. During the upsampling process, fine-grained spatial details are supplemented to the decoder, enabling the effective recovery of water stain edges and small water stain areas when restoring high-resolution features.

[0082] In this implementation, by introducing a channel-spatial multi-scale attention structure into the skip connection path, the model no longer simply concatenates encoder features directly to the decoder, but instead selectively enhances multi-scale features in both spatial and channel dimensions. Experimental results show that after introducing the CMSAA module, the mIoU index of the segmentation network is improved by approximately 0.94 percentage points. In particular, in complex textured backgrounds and low-contrast water stain areas, edge misclassification and small target omissions are significantly reduced, making the pixel-level contours of the water stain areas more closely match the morphology of the real lining surface.

[0083] In the above implementation, preferably, the global context modeling structure is set at the bottleneck position of the semantic segmentation network and connected to the output feature maps of at least two residual stages in the deepest layer of the encoder. Specifically, high-level feature maps at two scales are obtained from the feature output of the fourth residual stage and thereafter, and input into the global perception module built based on the Transformer architecture.

[0084] The global perception module includes at least one global perception submodule. In each submodule, the input high-level feature map is flattened and embedded. Then, a multi-head self-attention mechanism is introduced to model the correlation between any two positions within the entire feature map. The features are weighted and aggregated through self-attention weights to obtain the first and second high-level feature maps processed by global perception. The second high-level feature map processed by global perception serves as the initial input feature map for the decoder in the top-down progressive upsampling and feature fusion strategy. The first high-level feature map processed by global perception is input to the first upsampling stage of the decoder through a skip connection, where it is fused with the bottom-level features processed by the channel-space multi-scale attention structure.

[0085] In this implementation, by introducing a Transformer-based global context modeling structure at the bottleneck location, deep features no longer rely solely on local convolutional receptive fields. Instead, they can establish long-range dependencies across the entire tunnel lining image, enabling the model to understand the relationship between water stain areas and surrounding structures from a global perspective. Experiments show that after adding the AtlasGPM module, the model's mIoU index is further improved by approximately 1.47% based on the introduction of CMSAA. Particularly when handling discontinuous water stains caused by pipeline obstruction, highlight areas caused by flash lighting, and areas where rust and water stain textures are similar, the segmentation results are more continuous, the misclassification rate is significantly reduced, and the overall robustness is enhanced.

[0086] In the above embodiments, preferably, the decoder of the semantic segmentation network adopts a step-by-step upsampling structure, including a first upsampling module, a second upsampling module, a third upsampling module and a fourth upsampling module connected in sequence.

[0087] The first upsampling module takes the second high-level feature map processed by global perception as input, improves the feature resolution through deconvolution or upsampling operations, and fuses it with the bottom-level features processed by the channel-space multi-scale attention structure to obtain a feature map that has both deep semantic and mid-scale spatial information.

[0088] The second upsampling module continues to upsample based on the features output by the first upsampling module, and then fuses them with the mid-level features processed by the channel-space multi-scale attention structure.

[0089] The third upsampling module upsamples the features output by the second upsampling module and fuses them with the top-level features processed by the channel-space multi-scale attention structure.

[0090] The fourth upsampling module continues to upsample based on the features output by the third upsampling module, and further refines the segmentation boundary of the water stain region under the spatial detail constraints provided by the toplevel features. It outputs a feature map used to generate a water stain segmentation mask, which is finally mapped by the Head module to a segmentation result map of the same size as the input image.

[0091] In this embodiment, the decoder structure performs resolution restoration step by step, starting from deep features. At each stage, attention-enhanced features of different scales are fused, allowing the decoding process to continuously compensate for shallow edges and texture details while incorporating global semantic information. Compared to decoders that only use simple upsampling or lack multi-scale feature fusion, this embodiment can better repair the breaks in the boundaries of water stain regions, significantly improving the integrity and edge sharpness of water stain contours, making the segmentation mask more suitable for precise area and morphological parameter calculations in engineering.

[0092] In the above embodiments, preferably, the results are output and analyzed based on the water stain segmentation mask.

[0093] First, based on the connectivity analysis of the foreground pixels in the water stain segmentation mask, the location range of at least one water stain region in the tunnel lining image is determined, and each connected region is regarded as an independent water stain object.

[0094] Then, based on the pixel set corresponding to each water stain region in the water stain segmentation mask, and combined with the spatial resolution information of the tunnel image, the area, perimeter, and optional morphological parameters (such as major and minor axes, roundness, elongation, etc.) of the water stain region are calculated.

[0095] After obtaining the above quantitative indicators, the erosion degree of the water stain area is graded and assessed by comparing the area of ​​the water stain area with the preset area threshold and combining the morphological parameter characteristics. For example, it is divided into light, moderate and heavy erosion levels, and corresponding water stain assessment results are generated to assist tunnel operation and maintenance personnel in implementing differentiated treatment strategies for water stains of different risk levels.

[0096] In this implementation, by analyzing the area, perimeter, and shape of the segmentation mask, the pixel-level segmentation results, which were originally only visually meaningful, are transformed into quantifiable engineering indicators. This expands the identification of tunnel water stains from "whether they exist" to a series of parameters that can be used for decision-making, such as "size, shape, and degree of erosion." Compared to detection methods that only output the location or bounding box of water stains, this implementation significantly enhances the system's ability to manage tunnel water stains with greater precision, facilitating the development of more accurate maintenance and reinforcement plans and optimizing the allocation of operation and maintenance resources.

[0097] In the above embodiments, preferably, the semantic segmentation network adopts a semantic segmentation model built based on deep learning, and the semantic segmentation model is one of SegFormer, U-Net, HRNet or DeepLab v3+.

[0098] For example, SegFormer can be used as the main body of the semantic segmentation network. The multi-scale features extracted by ResNet50 can be connected to the encoder-decoder structure of SegFormer through the adaptation layer. Its Transformer-based encoder can be used to further model the overall features, and a lightweight multilayer perceptron decoder can be combined to complete pixel-level prediction.

[0099] For example, HRNet can be used as the main semantic segmentation network, allowing multi-resolution branches to exist in parallel throughout the network and maintaining high-resolution feature representation through cross-resolution information exchange. In these alternative implementations, channel-space multi-scale attention structures and global context modeling structures can be embedded into the mid-to-high-level feature fusion or bottleneck positions of the corresponding models to enhance the specific performance of the models in tunnel lining water stain segmentation tasks.

[0100] In this implementation, by introducing mature semantic segmentation models such as SegFormer, U-Net, HRNet, or DeepLabv3+ as the basic framework, flexible expansion and deployment adaptation of the model structure are achieved while ensuring that specialized modules (such as CMSAA and global perception modules) still function in tunnel scenarios. For example, the lightweight SegFormer solution can run on terminal devices with limited computing power, while structures such as HRNet and DeepLabv3+ have stronger expressive capabilities in high-precision scenarios. Overall, these alternative implementations enable the present invention to balance model complexity and segmentation performance according to different engineering application scenarios, improving the applicability and scalability of the technical solution.

[0101] This invention also proposes a tunnel lining water stain segmentation system based on a computer vision model, which applies the tunnel lining water stain segmentation method using the computer vision model disclosed in any of the above embodiments, including:

[0102] The image preprocessing module is used to acquire tunnel lining images and perform image enhancement preprocessing on the tunnel lining images to obtain preprocessed images;

[0103] The multi-feature extraction module is used to input the preprocessed image into the encoder of the semantic segmentation network. The encoder uses a deep convolutional neural network as the backbone to perform multi-level feature extraction on the preprocessed image and obtain feature maps of different scales.

[0104] The attention enhancement module is used to set up a channel-space multi-scale attention structure in the skip connection between the encoder and the decoder of the semantic segmentation network. It performs joint modeling and attention weighting on feature maps of multiple different scales in the channel dimension and spatial dimension to obtain attention-enhanced multi-scale features.

[0105] The context modeling module is used to introduce a global context modeling structure based on a self-attention mechanism at the bottleneck position between the encoder and the decoder, and to perform global perception processing on the high-level feature map from the encoder to obtain the high-level features after global perception processing.

[0106] The upsampling fusion module is used to take the high-level features processed by global perception as input to the decoder, and adopts a top-down hierarchical upsampling and feature fusion strategy to fuse and reconstruct the attention-enhanced multi-scale features with the features of each layer of the decoder, and outputs a water stain segmentation mask with the same size as the preprocessed image. The water stain segmentation mask is used to represent the water stain area in the tunnel lining.

[0107] In the above embodiments, preferably, the tunnel lining water stain segmentation system based on computer vision models further includes a water stain assessment module, specifically used for:

[0108] Determine the location range of at least one water stain region in the tunnel lining image based on the water stain segmentation mask;

[0109] Based on the pixel set corresponding to each water stain region in the water stain segmentation mask, calculate the area, perimeter and / or morphological parameters of the water stain region;

[0110] Based on the comparison between the area of ​​the water stains and the preset area threshold, as well as the morphological parameters, the degree of erosion of the water stains is evaluated, and the water stain evaluation results are output.

[0111] The tunnel lining water stain segmentation system based on computer vision model disclosed in the above embodiments has the same function as each step of the tunnel lining water stain segmentation method based on computer vision model disclosed in the above embodiments. In the implementation process, the above embodiments are referred to for operation, and will not be repeated here.

[0112] The above modules can run as software functional units on the processor of the same server, or they can be distributed across multiple computing nodes to work together according to computing power requirements, and interact with field acquisition equipment and operation and maintenance management system through network interfaces.

[0113] By integrating various functional modules into a unified system, this implementation method forms an end-to-end automated processing flow from image acquisition, preprocessing, feature extraction, segmentation inference to result analysis. Compared with the traditional method that mainly relies on manual inspection and offline analysis, this system can perform batch, high-throughput processing of a large number of tunnel images, significantly reducing human involvement and subjective judgment errors, improving the efficiency and consistency of tunnel water stain detection, and providing real-time or near-real-time technical support for tunnel operation and maintenance.

[0114] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for segmenting water stains in tunnel lining based on a computer vision model, characterized in that, include: Acquire tunnel lining images and perform image enhancement preprocessing on the tunnel lining images to obtain preprocessed images; The preprocessed image is input into the encoder of the semantic segmentation network. The encoder uses a deep convolutional neural network as its backbone to perform multi-level feature extraction on the preprocessed image, resulting in multiple feature maps of different scales. In the skip connection between the encoder and the decoder of the semantic segmentation network, a channel-space multi-scale attention structure is set up to jointly model and weight the feature maps of multiple different scales in the channel dimension and the spatial dimension to obtain attention-enhanced multi-scale features. The channel-spatial multi-scale attention structure is used to process three feature maps of different scales from the first to third stages of the deep convolutional neural network backbone. The three feature maps of different scales are concatenated at the channel level to obtain a fused feature map. The fused feature map is input into the multi-scale spatial attention submodule to generate a spatial attention weight map. The fused feature map is weighted based on the spatial attention weight map to obtain attention-enhanced top-level features, mid-level features, and bottom-level features. The top-level features, mid-level features, and bottom-level features are then input to the upsampling layers of the decoder through corresponding skip connections. At the bottleneck position between the encoder and the decoder, a global context modeling structure based on a self-attention mechanism is introduced to perform global perception processing on the high-level feature maps from the encoder, resulting in globally perception-processed high-level features. The global context modeling structure is connected to the output feature maps of at least two stages in the deepest layer of the encoder. A global perception module built on a Transformer architecture performs global context modeling based on a self-attention mechanism on the output feature maps of the at least two stages, generating a first and a second globally perception-processed high-level feature map. The second globally perception-processed high-level feature map serves as the initial input feature map for the decoder. The first globally perception-processed high-level feature map is input to the first upsampling stage of the decoder via a skip connection and is then fused with the bottom-level features. The high-level features processed by global perception are used as the input of the decoder, and a top-down progressive upsampling and feature fusion strategy is adopted to fuse and reconstruct the attention-enhanced multi-scale features with the features of each layer of the decoder, and output a water stain segmentation mask with the same size as the preprocessed image. The water stain segmentation mask is used to represent the water stain area in the tunnel lining. The decoder includes a first upsampling module, a second upsampling module, a third upsampling module, and a fourth upsampling module connected in sequence. The first upsampling module upsamples the second high-level feature map and fuses it with the bottom-level features. The second upsampling module continues to upsample the features output by the first upsampling module and fuses them with the mid-level features. The third upsampling module upsamples the features output by the second upsampling module and fuses them with the top-level features. The fourth upsampling module continues to upsample the features output by the third upsampling module and outputs a feature map for generating the water stain segmentation mask. After outputting the water stain segmentation mask, the location range of at least one water stain area in the tunnel lining image is determined according to the water stain segmentation mask. The area, perimeter, and morphological parameters of the water stain area are calculated based on the pixel set corresponding to the water stain area in the water stain segmentation mask. The degree of erosion of the water stain area is evaluated and the water stain evaluation result is output according to the comparison result of the area of ​​the water stain area with a preset area threshold and the morphological parameters.

2. The method for water stain segmentation in tunnel lining based on a computer vision model according to claim 1, characterized in that, The specific process of performing image enhancement preprocessing on the tunnel lining image includes: The tunnel lining image is subjected to aspect ratio jitter and scale jitter based on geometric transformation. The aspect ratio jitter range is ±0.3, and the scaling ratio of the scale jitter is sampled between 0.25 and 2. The image size is adjusted by bicubic interpolation after dithering, and the corresponding label mask is adjusted synchronously by nearest neighbor interpolation. The processed image is randomly translated into a canvas of the target size, and then horizontally flipped with a preset probability. Based on photometric transformation, the tunnel lining image is subjected to hue shift, saturation shift, and brightness shift in the HSV color space to enhance the contrast between the water stain area and the tunnel background. The hue shift range is ±0.1, the saturation shift range is ±0.7, and the brightness shift range is ±0.

3.

3. The method for water stain segmentation in tunnel lining based on a computer vision model according to claim 1, characterized in that, The encoder of the semantic segmentation network uses a deep convolutional neural network structure based on ResNet50, which includes: Convolutional layers for initial feature extraction of the preprocessed image and max pooling layers for downsampling the initial features; And four residual stages connected in sequence, each residual stage includes a preset number of Bottleneck residual blocks, each Bottleneck residual block includes a 1×1 convolutional dimensionality reduction convolutional layer, a 3×3 convolutional feature extraction convolutional layer and a 1×1 convolutional dimensionality increase convolutional layer connected in sequence, and the input and output of each Bottleneck residual block are added together through residual connection; The first residual stage includes 3 Bottleneck residual blocks, the second residual stage includes 4 Bottleneck residual blocks, the third residual stage includes 6 Bottleneck residual blocks, and the fourth residual stage includes 3 Bottleneck residual blocks. The four residual stages output multi-level feature maps with different scales and number of channels, which are processed by the channel-space multi-scale attention structure and the global context modeling structure.

4. The method for segmenting water stains in tunnel lining based on a computer vision model according to claim 1, characterized in that, The semantic segmentation network employs a semantic segmentation model built based on deep learning, which is one of SegFormer, U-Net, HRNet, or DeepLab v3+.

5. A tunnel lining water stain segmentation system based on a computer vision model, characterized in that, The method for segmenting water stains in tunnel lining using a computer vision model as described in any one of claims 1 to 4 includes: An image preprocessing module is used to acquire tunnel lining images and perform image enhancement preprocessing on the tunnel lining images to obtain preprocessed images; The multi-feature extraction module is used to input the preprocessed image into the encoder of the semantic segmentation network. The encoder uses a deep convolutional neural network as the backbone to perform multi-level feature extraction on the preprocessed image to obtain multiple feature maps of different scales. The attention enhancement module is used to set up a channel-space multi-scale attention structure in the skip connection between the encoder and the decoder of the semantic segmentation network, and to jointly model and weight the feature maps of multiple different scales in the channel dimension and the spatial dimension to obtain attention-enhanced multi-scale features. The context modeling module is used to introduce a global context modeling structure based on a self-attention mechanism at the bottleneck position between the encoder and the decoder, and to perform global perception processing on the high-level feature map from the encoder to obtain the high-level features after global perception processing. The upsampling fusion module is used to take the high-level features processed by global perception as the input of the decoder, and adopts a top-down stepwise upsampling and feature fusion strategy to fuse and reconstruct the attention-enhanced multi-scale features with the features of each layer of the decoder, and outputs a water stain segmentation mask with the same size as the preprocessed image. The water stain segmentation mask is used to represent the water stain area in the tunnel lining.

6. The tunnel lining water stain segmentation system based on computer vision model according to claim 5, characterized in that, It also includes a water stain assessment module, specifically used for: The location range of at least one water stain region in the tunnel lining image is determined based on the water stain segmentation mask. Based on the pixel set corresponding to each water stain region in the water stain segmentation mask, calculate the area, perimeter and / or morphological parameters of the water stain region; Based on the comparison between the area of ​​the water stain region and the preset area threshold, as well as the morphological parameters, the degree of erosion of the water stain region is evaluated, and the water stain evaluation result is output.

Citation Information

Patent Citations

  • Semantic segmentation method and device for medical image

    CN114972756A

  • Tunnel lining leakage water image segmentation method

    CN117409023A

  • Ore image segmentation method and system fusing channel space multi-scale features

    CN119379724A