A method, system and medium for detecting apparent seepage of a tunnel
By using the MobileViT network structure and attention mechanism for feature extraction and fusion in tunnel seepage detection, the problem of high misjudgment rate of apparent water seepage detection in tunnel is solved, and higher detection accuracy and segmentation performance are achieved.
Patent Information
- Application Number
- CN202510199728.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-24
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2045-02-24
AI Technical Summary
When detecting tunnel seepage by image processing, the misjudgment rate of apparent water seepage detection in tunnel is high due to the confusing light and complex background in the tunnel.
The detection network and segmentation network are constructed using the MobileViT network structure, and the first coordinate attention mechanism is introduced into the detection network for global feature extraction, and the initial features, local features and global features are integrated in the feature fusion part; the second coordinate attention mechanism is integrated into the segmentation network for semantic segmentation, suppressing unimportant features and highlighting important information.
It effectively improves detection accuracy and segmentation performance, reduces the misjudgment rate, enhances the generalization ability of the model, and can more effectively capture key features at different locations, and overcomes complex image data of light and background.
Smart Images

Figure CN119693360B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image recognition, and particularly relates to a method, a system and a medium for detecting apparent water seepage in a tunnel. Background Art
[0002] A tunnel is a building constructed in the ground. Whether it is a mountain tunnel, an underwater tunnel or an underground tunnel, it has extremely important traffic functions. Therefore, the safety problem of the tunnel is particularly prominent. Among various tunnel diseases, tunnel water seepage has become a key factor affecting the structural strength of the tunnel. Tunnel water seepage has a direct or indirect impact on other tunnel diseases and is one of the most widespread tunnel diseases. Defects existing in the tunnel structure are extremely likely to cause water seepage diseases, and the long-term action of water seepage will further exacerbate the damage of the tunnel structure. Tunnel water seepage is actually a comprehensive reflection of various tunnel diseases. Therefore, strengthening the research on the method for detecting water seepage in the tunnel lining is a necessary way to effectively prevent the potential hazards of tunnel diseases and make predictions about possible safety hazards.
[0003] At present, most of them adopt manual detection to check whether there is water seepage in the tunnel, which is laborious and inefficient, bringing great challenges to tunnel safety. With the proposal of the concept of intelligent devices, more and more intelligent inspection robots replace workers for inspection. The robots can operate autonomously in the tunnel through the hanging rail technology and pause at the set inspection points to detect and analyze the water seepage in the tunnel wall area. The infrared thermal imaging method is the most widely used automatic water seepage detection method at present, which realizes water seepage detection according to the different infrared thermal radiation of objects at different temperatures. Another laser scanning non-destructive detection method is also developing rapidly. It can perform a full-range scan detection on the tunnel, thereby recording the size and position of the water seepage area, and has the characteristics of fast scanning speed and high measurement accuracy. However, the above methods all have the disadvantage of high cost. Using the method of image processing to detect tunnel water seepage is a better choice. However, due to reasons such as messy light and complex background in the tunnel, the misjudgment rate of tunnel apparent water seepage detection is relatively high. Summary of the Invention
[0004] The technical problem to be solved by the present invention is that when detecting tunnel water seepage based on an image processing method, due to reasons such as messy light and complex background in the tunnel, the misjudgment rate of tunnel apparent water seepage detection is relatively high. The object of the present invention is to provide a tunnel apparent water seepage detection method, system and medium, which make improvements in the method on the basis of the existing tunnel water seepage detection based on image processing technology. By means of the MobileViT network structure, a detection network and a segmentation network are constructed. At the same time, in the detection network, improvements are made to the model structure and fusion strategy of the MobileViT recognition model. The first coordinate attention mechanism is introduced in the global feature extraction part to obtain global features. In the feature fusion part, preliminary features, local features and global features are fused to detect water seepage images, so that the network can more effectively capture key features at different positions, overcome image data with complex light and background, and improve the detection accuracy. In the segmentation network, the second coordinate attention mechanism is incorporated to segment the water seepage area of the water seepage image. By suppressing unimportant features through the second coordinate attention mechanism, important information in the feature map is highlighted, effectively improving the segmentation performance and generalization ability of the segmentation network.
[0005] The present invention is realized through the following technical solutions:
[0006] This solution provides a tunnel apparent water seepage detection method, including:
[0007] Collect the basic data of the target tunnel and preprocess the basic data; the basic data includes image data and environmental data;
[0008] Input the preprocessed basic data into the constructed water seepage detection model for detection; the water seepage detection model includes a detection network and a segmentation network; the detection network uses the MobileViT network structure as the basic network, introduces the first coordinate attention mechanism in the global feature extraction part to obtain global features, and fuses preliminary features, local features and global features in the feature fusion part to detect water seepage images; the segmentation network uses the MobileViT network structure as the basic network, incorporates the second coordinate attention mechanism to perform semantic segmentation on the water seepage image to obtain the water seepage area;
[0009] Output the water seepage image and the water seepage area.
[0010] For tunnel water seepage, it is not enough to accurately and quickly identify and judge whether there is water seepage in a certain area; to further obtain a more comprehensive and accurate distribution of the water seepage location and the water seepage area of the tunnel, it is necessary to perform pixel-level classification and recognition on the water seepage image, that is, semantic segmentation of the water seepage area in the water seepage image, so as to prepare for targeted maintenance strategies. The MobileViT network structure is a hybrid architecture model of the CNN model architecture and the Transfomrer model architecture, and has a good classification effect on the data set. However, when identifying apparent water seepage, due to the complex light and background in the tunnel, the target of the water seepage part is small, and it generally has a similar performance to the surrounding complex background, resulting in great difficulty in tunnel apparent water seepage detection and high difficulty in feature extraction; therefore, this solution uses the MobileViT network structure to construct a detection network and a segmentation network, and at the same time improves the model structure and fusion strategy of the MobileViT recognition model in the detection network, introduces the first coordinate attention mechanism in the global feature extraction part to obtain global features, and performs feature fusion on the preliminary features, local features and global features in the feature fusion part to detect the water seepage image; so that the network can more effectively capture the key features at different positions, overcome the image data with complex light and background, and improve the detection accuracy; the second coordinate attention mechanism is incorporated into the segmentation network to segment the water seepage area of the water seepage image, and the unimportant features are suppressed by the second coordinate attention mechanism to highlight the important information in the feature map, effectively improving the segmentation performance and generalization ability of the segmentation network.
[0011] A further optimization solution is that the preprocessing of the basic data includes the method:
[0012] Obtain environmental data and calculate an image adjustment factor based on the environmental data;
[0013] Perform data augmentation on the image data, and determine the degree of data augmentation according to the image adjustment factor during the data augmentation process:
[0014] Set a first threshold interval. When the adjustment factor is within the first threshold interval, perform data augmentation on the image data so that the image contrast parameter is D1; set a second threshold interval. When the adjustment factor is within the second threshold interval, perform data augmentation on the image data so that the image contrast parameter is D2; where the first threshold interval is greater than the second threshold interval; D1 > D2.
[0015] A further optimization solution is that the method for obtaining the image adjustment factor includes:
[0016] Obtain the basic data of the target tunnel and match each image data with the environmental data; the environmental data includes soil humidity Z, air humidity I, and the cumulative rainfall within the most recent time period T B ;
[0017] Calculate the image adjustment factor for each image data based on the environmental data:
[0018] ;
[0019] A further optimization solution is that the detection network also introduces a PConv layer in the local feature extraction part to perform convolution operations on some channels.
[0020] Specifically, in the MobileViT recognition model, the standard convolution layer in the local feature extraction part is replaced with a PConv layer; to reduce the computational complexity in the detection task and ensure the continuity and regularity of memory access during the task, some channels of the input features are used as specific channels to represent the entire feature map for convolution operations. The number of floating-point operations per second and the number of memory accesses of the PConv layer are much smaller than those of the standard convolution layer. Therefore, in this solution, the standard convolution layer in the original local feature extraction part is replaced with a PConv layer to effectively reduce the computational complexity of the network and make the network more lightweight.
[0021] A further optimization solution is that the first coordinate attention mechanism is a permutation coordinate attention mechanism; the permutation coordinate attention mechanism includes a grouped feature part, a fused attention part, and an aggregated feature part;
[0022] The grouped feature part divides the input feature map X ∈ R C×H×W into G groups of sub-features along the channel dimension, denoted as X = [X1,..., X k ,..., X G , X k ∈ R C / G×H×W , where the sub-feature layer X k will capture the accurate semantic feedback after training and then divide X k into sub-feature maps X k1 , X k2 ∈ R C / 2G×H×W along the height and width dimensions. The fused attention part generates a channel attention map based on the relationship between channels and uses global average pooling to generate s to embed global information, obtaining a contracted sub-feature map X k1,s on the height and width dimensions H × W:
[0023] ;
[0024] Among them, F gp represents embedding global information; H represents the total height of the feature map; W represents the total width of the feature map; C represents the total number of channels; R represents a real number; i represents the height, and j represents the width;
[0025] Then, a Sigmoid activation function is used to create compact features, and channel attention is output in the height dimension as:
[0026] ;
[0027] Channel attention output in the width dimension is:
[0028] ;
[0029] where b1 represents the compact parameter in the height dimension; b2 represents the compact parameter in the width dimension; GN(X k2 ) represents the number of groups for sub-feature X k2 ; W1 represents the coefficient parameter in the height dimension; W2 represents the coefficient parameter in the width dimension;
[0030] The aggregated feature part aggregates the overall output There is:
[0031] .
[0032] A further optimization solution is that the detection network uses the MobileViT recognition model as the basic network, and a first coordinate attention mechanism is introduced in the global feature extraction part to obtain global features, including the method:
[0033] Embed the first coordinate attention mechanism between the second convolutional layer and the third convolutional layer, and between the third convolutional layer and the fourth convolutional layer in the global feature extraction part respectively;
[0034] The first coordinate attention mechanism performs first self-attention calculations in the height dimension and the width dimension respectively, calculates the attention weights and applies them to the output feature map to enhance or suppress the features at the corresponding positions of the output feature map.
[0035] A further optimization solution is that the fused feature Z obtained by fusing the preliminary feature, the local feature and the global feature in the feature fusion part is:
[0036] ;
[0037] where M1 represents the fusion weight of the preliminary feature X, the local feature Y and the global feature Z, and its value is a real number between 0 and 1; represents the element-wise summation of the feature maps; represents the corresponding elements of the feature maps being...
[0038] A further optimization solution is that the construction method of the segmentation network includes:
[0039] Construct a segmentation network based on the MobileViT network structure; the segmentation network includes a global branch structure and a local branch structure; the global branch structure includes a first encoder and a first decoder; the local branch structure includes a second encoder and a second decoder; the first encoder and the second encoder are used to extract feature maps from image data, and the first decoder and the second decoder are used to parse the encoded data into the original image data form;
[0040] Embed a second coordinate attention mechanism between the first convolutional layer and the second convolutional layer of the first decoder and the second decoder; the second coordinate attention mechanism is a self-attention mechanism with position encoding, and the second coordinate attention mechanism performs second self-attention calculations in the height dimension and the width dimension respectively.
[0041] A further optimization scheme is that the second coordinate attention mechanism performs second self-attention calculations in the height dimension and the width dimension respectively. The method includes:
[0042] The self-attention calculation of the second coordinate attention mechanism in the width dimension is:
[0043]
[0044] The self-attention calculation of the second coordinate attention mechanism in the height dimension is:
[0045]
[0046] Among them, y ij represents the self-attention weight of the feature at the i-th row and j-th column; q ij , k ij , v ij are the query vector, key vector, and value vector of the feature at the i-th row and j-th column respectively; W is the total width of the feature map; w represents the width of the feature at the i-th row and j-th column; H is the total height of the feature map; h represents the height of the feature at the i-th row and j-th column; T represents the transpose of the vector; G Q , G K , G V1 , G V2 ∈R, representing the control parameters of the relative position information of the query vector, the relative position information of the key vector, the relative position information of the value vector, and the offset position information of the value vector respectively; represents the position offset of the query vector of the feature at the i-th row and j-th column in the width dimension and the height dimension; Denote the position offset of the feature key vector at the \(i\)-th row and \(j\)-th column in the width and height dimensions; Denote the position offset of the feature at the \(i\)-th row and \(j\)-th column in the width and height dimensions; Denote the position offset in the width dimension from the feature at the \(i\)-th row and \(j\)-th column to the query vector of the feature at the \(h\)-th row and \(w\)-th column; Denote the position offset in the width dimension from the feature at the \(i\)-th row and \(j\)-th column to the key vector of the feature at the \(h\)-th row and \(w\)-th column; Denote the position offset in the width dimension from the feature at the \(i\)-th row and \(j\)-th column to the value vector of the feature at the \(h\)-th row and \(w\)-th column; Denote the position offset in the height dimension from the feature at the \(i\)-th row and \(j\)-th column to the query vector of the feature at the \(h\)-th row and \(w\)-th column; Denote the position offset in the height dimension from the feature at the \(i\)-th row and \(j\)-th column to the key vector of the feature at the \(h\)-th row and \(w\)-th column; Denote the position offset in the height dimension from the feature at the \(i\)-th row and \(j\)-th column to the value vector of the feature at the \(h\)-th row and \(w\)-th column; Softmax w Denote the activation function in the width dimension; Softmax h Denote the activation function in the height dimension.
[0047] This solution also provides a tunnel apparent water seepage detection system, including:
[0048] An acquisition module, used to acquire the basic data of the target tunnel;
[0049] A preprocessing module, used to preprocess the basic data; the basic data includes image data and environmental data;
[0050] A detection module, used to input the preprocessed basic data into the constructed water seepage detection model for detection; the water seepage detection model includes a detection network and a segmentation network; the detection network uses the MobileViT network structure as the basic network, introduces the first coordinate attention mechanism in the global feature extraction part to obtain global features, and performs feature fusion on the preliminary features, local features and global features in the feature fusion part to detect the water seepage image; the segmentation network uses the MobileViT network structure as the basic network, integrates the second coordinate attention mechanism to perform semantic segmentation on the water seepage image to obtain the water seepage area;
[0051] An output module, used to output the water seepage image and the water seepage area.
[0052] This solution also provides a computer-readable medium, on which a computer program is stored, and the computer program can be implemented by a processor to realize a tunnel apparent water seepage detection method as described above.
[0053] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0054] 1. A method, system and medium for detecting apparent water seepage in tunnels provided by the present invention; by means of the MobileViT network structure, a detection network and a segmentation network are constructed. At the same time, improvements are made to the MobileViT recognition model in terms of model structure and fusion strategy in the detection network. The first coordinate attention mechanism is introduced in the global feature extraction part to obtain global features, and in the feature fusion part, the preliminary features, local features and global features are fused to detect the water seepage image; so that the network can more effectively capture the key features at different positions, solve the problem of complex light and background in the original image, and improve the detection accuracy; in the segmentation network, the second coordinate attention mechanism is incorporated to segment the water seepage area of the water seepage image, and the unimportant features are suppressed by the second coordinate attention mechanism to highlight the important information in the feature map, effectively improving the segmentation performance and generalization ability of the segmentation network;
[0055] 2. A method, system and medium for detecting apparent water seepage in tunnels provided by the present invention; in the process of preprocessing the image data, each image is enhanced according to the environmental data. For areas with high actual environmental humidity and precipitation, deeper data enhancement is carried out. By directly adjusting the contrast parameter, or adjusting the black point parameter and shadow parameter, the contrast of the image can be enhanced to highlight the data features with unclear water seepage traces in the image;
[0056] 3. A method, system and medium for detecting apparent water seepage in tunnels provided by the present invention; pixel-level classification and recognition of the water seepage image, that is, semantic segmentation of the water seepage area in the water seepage image, to further obtain a more comprehensive and accurate distribution of the water seepage position and water seepage area of the tunnel, so as to prepare for targeted maintenance strategies. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] In order to more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the following will briefly introduce the drawings required in the embodiments. It should be understood that the following drawings only show some embodiments of the present invention, and therefore should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts. In the drawings:
[0058] Figure 1 It is a schematic flow chart of the method for detecting apparent water seepage in tunnels;
[0059] Figure 2 It is a schematic diagram of the detection network structure;
[0060] Figure 3 It is a schematic diagram of the segmentation network structure;
[0061] Figure 4 It is a schematic structural diagram of a tunnel apparent water seepage detection system;
[0062] Figure 5 It is a schematic diagram for comparing the accuracy rates of the detection results between the method of this solution and the traditional method. Specific implementation manners
[0063] To make the objectives, technical solutions and advantages of the present invention clearer and more understandable, the present invention will be further described in detail below in conjunction with embodiments and the accompanying drawings. The illustrative embodiments of the present invention and their descriptions are only used to explain the present invention and do not limit the present invention.
[0064] When detecting tunnel water seepage based on an image processing method, due to reasons such as messy light and complex background in the tunnel, the misjudgment rate of tunnel apparent water seepage detection is relatively high; in view of this, the following embodiments are provided in this solution to solve the above technical problems.
[0065] Embodiment 1: This embodiment provides a method for detecting tunnel apparent water seepage, as Figure 1 shown, including:
[0066] Step 1, collect the basic data of the target tunnel and preprocess the basic data; the basic data includes image data and environmental data; among them, the image data mainly includes the image data or video frame data of the target tunnel appearance, and the environmental data corresponds to the image data. A distance threshold r is set. For the collected image data A, the corresponding environmental data mainly includes the environmental data within a range with the center position of the image data A as the center point and a radius of the distance threshold r from the center point. The environmental data mainly includes soil humidity, air humidity, and rainfall duration in the most recent period.
[0067] The preprocessing of the basic data includes the following methods:
[0068] Obtain the environmental data and calculate the image adjustment factor based on the environmental data; the specific calculation method includes:
[0069] S11, obtain the basic data of the target tunnel and match each image data with the environmental data; the environmental data includes soil humidity Z, air humidity I, and the cumulative rainfall in the most recent period T B ;
[0070] S12, calculate the image adjustment factor of each image data based on the environmental data:
[0071] ;
[0072] S13. Perform data augmentation on the image data. During the data augmentation process, determine the degree of data augmentation according to the image adjustment factor: Set the first threshold interval. When the adjustment factor is within the first threshold interval, perform data augmentation on the image data so that the image contrast parameter is D1; Set the second threshold interval. When the adjustment factor is within the second threshold interval, perform data augmentation on the image data so that the image contrast parameter is D2; where the first threshold interval is greater than the second threshold interval; D1 > D2.
[0073] Traditional detection methods mainly rely on training and modeling with image data, and their accuracy still needs to be improved. In this solution, during the preprocessing of image data, data augmentation is performed on each image according to environmental data. For areas with high actual environmental humidity and precipitation, deeper data augmentation is carried out. By directly adjusting the contrast parameter, or adjusting the black point parameter and shadow parameter, the contrast of the image can be enhanced to highlight the data features with unclear water seepage traces in the image.
[0074] Step 2. Input the preprocessed basic data into the constructed water seepage detection model for detection; The water seepage detection model includes a detection network and a segmentation network; The detection network uses the MobileViT network structure as the basic network, introduces the first coordinate attention mechanism in the global feature extraction part to obtain global features, and performs feature fusion on the preliminary features, local features, and global features in the feature fusion part to detect water seepage images; The segmentation network uses the MobileViT network structure as the basic network, integrates the second coordinate attention mechanism to perform semantic segmentation on the water seepage image to obtain the water seepage area;
[0075] As Figure 2 shown, the detection network uses the MobileViT recognition model as the basic network, and introduces the first coordinate attention mechanism in the global feature extraction part to obtain global features, including methods:
[0076] Embed the first coordinate attention mechanism between the second convolutional layer and the third convolutional layer, and between the third convolutional layer and the fourth convolutional layer in the global feature extraction part respectively;
[0077] The first coordinate attention mechanism performs the first self-attention calculation in the height dimension and the width dimension respectively, calculates the attention weights and applies them to the output feature map to enhance or suppress the features at the corresponding positions of the output feature map.
[0078] The first coordinate attention mechanism is a permutation coordinate attention mechanism; The permutation coordinate attention mechanism includes a grouped feature part, a fusion attention part, and an aggregated feature part;
[0079] The grouped feature part maps the input feature X ∈ R C×H×WDivided into G groups of sub - features along the channel dimension, denoted as X = [X1,..., X k ,..., X G , X k ∈R C / G×H×W , where the sub - feature layer X k will capture the accurate semantic feedback after training and then divide X k into sub - feature maps X k1 , X k2 ∈R C / 2G×H×W along the height and width dimensions. The fusion attention part generates a channel attention map based on the relationship between channels and uses global average pooling to generate s to embed global information, obtaining a contracted sub - feature map X k1,s on the height and width dimensions H×W:
[0080] ;
[0081] where, F gp denotes embedding global information; H represents the total height of the feature map; W represents the total width of the feature map; C represents the total number of channels; R represents real numbers; i represents height, and j represents width;
[0082] Then, a compact feature is created through the Sigmoid activation function, and the channel attention output in the height dimension is:
[0083] ;
[0084] The channel attention output in the width dimension is:
[0085] ;
[0086] where, b1 represents the compact parameter in the height dimension; b2 represents the compact parameter in the width dimension; GN(X k2 ) represents the number of groups for the sub - feature X k2 ; W1 represents the coefficient parameter in the height dimension; W2 represents the coefficient parameter in the width dimension;
[0087] The aggregation feature part aggregates the overall output as:
[0088] .
[0089] The permutation coordinate attention mechanism can focus on the important information in the input feature map to improve the performance of the model. Compared with other attention modules, the permutation coordinate attention mechanism introduces height-dimensional channels and width-dimensional channels, shuffles the channel order of the original feature map through channel shuffling, further enhances the diversity of attention features, and combines shuffling and attention to make the permutation coordinate attention mechanism have better generalization ability.
[0090] The detection network also introduces a PConv layer in the local feature extraction part to perform convolution operations on some channels.
[0091] Specifically, in the MobileViT recognition model, the standard convolution layer in the local feature extraction part is replaced with a PConv layer; to reduce the computational complexity in the detection task and ensure the continuity and regularity of memory access during the task, some channels of the input features are used as specific channels to represent the entire feature map for convolution operations. The number of floating-point operations per second and the number of memory accesses of the PConv layer are much smaller than those of the standard convolution layer. Therefore, in this scheme, the standard convolution layer in the original local feature extraction part is replaced with a PConv layer to effectively reduce the computational complexity of the network and make the network more lightweight.
[0092] The fused feature Z obtained by fusing the preliminary feature, local feature, and global feature in the feature fusion part includes:
[0093] ;
[0094] Among them, M1 represents the fusion weight of the preliminary feature X, local feature Y, and global feature Z, and its value is a real number between 0 and 1; represents the element-wise summation of the feature maps; represents the corresponding elements of the feature maps being...
[0095] The construction method of the segmentation network includes:
[0096] Construct a segmentation network based on the MobileViT network structure as the base network; as Figure 3 shown, the segmentation network includes a global branch structure and a local branch structure; the global branch structure includes a first encoder and a first decoder; the local branch structure includes a second encoder and a second decoder; the first encoder and the second encoder are used to extract feature maps from the image data (input feature map), and the first decoder and the second decoder are used to parse the encoded data into the original image data form, and add the output of the global branch and the output of the local branch to obtain the output feature map;
[0097] Embed a second coordinate attention mechanism between the first convolutional layer and the second convolutional layer of the first decoder and the second decoder; the second coordinate attention mechanism is a self-attention mechanism with positional encoding, and the second coordinate attention mechanism performs second self-attention calculations in the height dimension and the width dimension respectively.
[0098] The second coordinate attention mechanism performs second self-attention calculations in the height dimension and the width dimension respectively, and the method includes:
[0099] The self-attention calculation of the second coordinate attention mechanism in the width dimension is:
[0100]
[0101] The self-attention calculation of the second coordinate attention mechanism in the height dimension is:
[0102]
[0103] Among them, y ij represents the self-attention weight of the feature at the i-th row and j-th column; q ij , k ij , v ij are the query vector, key vector, and value vector of the feature at the i-th row and j-th column respectively; W is the total width of the feature map; w represents the width of the feature at the i-th row and j-th column; H is the total height of the feature map; h represents the height of the feature at the i-th row and j-th column; T represents the transpose of the vector; G Q , G K , G V1 , G V2 ∈R, represent the control parameters of the relative position information of the query vector, the relative position information of the key vector, the relative position information of the value vector, and the offset position information of the value vector respectively; represents the position offset of the query vector of the feature at the i-th row and j-th column in the width dimension and the height dimension; represents the position offset of the key vector of the feature at the i-th row and j-th column in the width dimension and the height dimension; represents the position offset of the feature at the i-th row and j-th column in the width dimension and the height dimension; represents the position offset of the query vector of the feature at the i-th row and j-th column to the feature at the h-th row and w-th column in the width dimension; represents the position offset of the key vector of the feature at the i-th row and j-th column to the feature at the h-th row and w-th column in the width dimension; It represents the position offset in the width dimension of the eigenvector of the feature at the \(i\)-th row and \(j\)-th column to the feature at the \(h\)-th row and \(w\)-th column. It represents the position offset in the height dimension of the query vector of the feature at the \(i\)-th row and \(j\)-th column to the feature at the \(h\)-th row and \(w\)-th column. It represents the position offset in the height dimension of the key vector of the feature at the \(i\)-th row and \(j\)-th column to the feature at the \(h\)-th row and \(w\)-th column. It represents the position offset in the height dimension of the eigenvector of the feature at the \(i\)-th row and \(j\)-th column to the feature at the \(h\)-th row and \(w\)-th column. Softmax w It represents the activation function in the width dimension. Softmax h It represents the activation function in the height dimension.
[0104] Step 3: Output the seepage image and the seepage area.
[0105] For tunnel seepage, it is not enough to accurately and quickly identify and judge whether there is seepage in a certain area; to further obtain a more comprehensive and accurate distribution of tunnel seepage positions and seepage areas, it is necessary to perform pixel-level classification and recognition on the seepage image, that is, to perform semantic segmentation on the seepage area in the seepage image, so as to prepare for targeted maintenance strategies.
[0106] The MobileViT network structure is a hybrid architecture model of the CNN model architecture and the Transfomrer model architecture, and it has good classification effects on the dataset. However, when identifying apparent seepage, due to the complex light and background in the tunnel, the seepage part has small targets, and generally has similar manifestations to the surrounding complex background, resulting in great difficulty in tunnel apparent seepage detection and high difficulty in feature extraction; therefore, this solution constructs a detection network and a segmentation network with the help of the MobileViT network structure, and at the same time improves the MobileViT recognition model in terms of model structure and fusion strategy in the detection network. The first coordinate attention mechanism is introduced in the global feature extraction part to obtain global features, and in the feature fusion part, the preliminary features, local features and global features are fused to detect the seepage image; so that the network can more effectively capture key features at different positions and improve the detection accuracy; the second coordinate attention mechanism is incorporated into the segmentation network to segment the seepage area of the seepage image, and the unimportant features are suppressed by the second coordinate attention mechanism to highlight the important information in the feature map, effectively improving the segmentation performance and generalization ability of the segmentation network.
[0107] The detection network also introduces a PConv layer in the local feature extraction part to perform convolutional operations on some channels.
[0108] Specifically, in the MobileViT network structure of the detection network, the standard convolutional layer in the local feature extraction part is replaced with a PConv layer; to reduce the computational complexity in the detection task and ensure the continuity and regularity of memory access during the task, some channels of the input features are used as specific channels to represent the entire feature map for convolution operations. The number of floating-point operations per second and the number of memory accesses of the PConv layer are much smaller than those of the standard convolutional layer. Therefore, in this solution, the standard convolutional layer in the original local feature extraction part is replaced with a PConv layer to effectively reduce the computational complexity of the network and make the network more lightweight.
[0109] Embodiment 2: This embodiment provides a tunnel apparent water seepage detection system, as Figure 4 shown, including:
[0110] An acquisition module for acquiring the basic data of the target tunnel;
[0111] A preprocessing module for preprocessing the basic data; the basic data includes image data and environmental data;
[0112] A detection module for inputting the preprocessed basic data into a constructed water seepage detection model for detection; the water seepage detection model includes a detection network and a segmentation network; the detection network uses the MobileViT network structure as the basic network, introduces a first coordinate attention mechanism in the global feature extraction part to obtain global features, and performs feature fusion on the preliminary features, local features, and global features in the feature fusion part to detect water seepage images; the segmentation network uses the MobileViT network structure as the basic network, integrates a second coordinate attention mechanism to perform semantic segmentation on the water seepage images to obtain water seepage areas;
[0113] An output module for outputting the water seepage images and water seepage areas.
[0114] Embodiment 3: This embodiment provides a computer-readable medium, on which a computer program is stored. When the computer program is executed by a processor, it can implement a tunnel apparent water seepage detection method as described in Embodiment 1; specifically, the following steps are executed:
[0115] Step 1, acquire the basic data of the target tunnel and preprocess the basic data; the basic data includes image data and environmental data;
[0116] Step 2: Input the preprocessed basic data into the constructed water seepage detection model for detection; the water seepage detection model includes a detection network and a segmentation network; the detection network uses the MobileViT network structure as the basic network, introduces a first coordinate attention mechanism in the global feature extraction part to obtain global features, and performs feature fusion on the preliminary features, local features, and global features in the feature fusion part to detect water seepage images; the segmentation network uses the MobileViT network structure as the basic network, integrates a second coordinate attention mechanism to perform semantic segmentation on the water seepage images to obtain water seepage areas;
[0117] Step 3: Output the water seepage images and water seepage areas.
[0118] In this embodiment, the detection network method based on this solution is compared with the picture detection method of the traditional MobileViT architecture. As Figure 5 shown, the line b in the figure represents the accuracy rate of the detection result of this solution, and the line a represents the accuracy rate of the detection result of the traditional MobileViT architecture. According to Figure 5 it can be obtained that the accuracy rate of this solution is much higher than that of the picture detection method of the traditional MobileViT architecture.
[0119] The specific embodiments described above further elaborate on the purpose, technical solutions, and beneficial effects of the present invention. It should be understood that the above description is only for the specific embodiments of the present invention and is not used to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for detecting apparent water seepage in a tunnel, characterized in that: include: Collect basic data of the target tunnel and pre-process the basic data; the basic data includes image data and environmental data; the pre-processing includes a method: acquiring environmental data and calculating an image adjustment factor based on the environmental data; Performing data enhancement on the image data, and determining the degree of data enhancement according to the image adjustment factor during the data enhancement process: setting a first threshold interval, and when the adjustment factor is within the first threshold interval, performing data enhancement on the image data so that the image contrast parameter is D1; setting a second threshold interval, and when the adjustment factor is within the second threshold interval, performing data enhancement on the image data so that the image contrast parameter is D2; wherein the first threshold interval is greater than the second threshold interval; D1>D2; The method for obtaining the image adjustment factor includes: obtaining basic data of the target tunnel, and matching each image data with environmental data; the environmental data includes soil moisture Z, air humidity I and cumulative rainfall in the most recent time period T. B ; Calculate the image adjustment factor of each image data based on the environmental data: ; The preprocessed basic data is input into the constructed water seepage detection model for detection; the water seepage detection model includes a detection network and a segmentation network; the detection network uses the MobileViT network structure as the basic network, introduces the first coordinate attention mechanism in the global feature extraction part to obtain the global feature, and performs feature fusion on the preliminary features, local features and global features in the feature fusion part to detect the water seepage image; the segmentation network uses the MobileViT network structure as the basic network, and integrates the second coordinate attention mechanism to perform semantic segmentation on the water seepage image to obtain the water seepage area; The detection network uses the MobileViT recognition model as the basic network, and introduces the first coordinate attention mechanism in the global feature extraction part to obtain global features, including a method: the first coordinate attention mechanism is respectively embedded between the second convolution layer and the third convolution layer of the global feature extraction part, and between the third convolution layer and the fourth convolution layer; the first coordinate attention mechanism performs a first self-attention calculation on the height dimension and the width dimension respectively, calculates the attention weight and applies it to the output feature map to enhance or suppress the features at the corresponding position of the output feature map; the first coordinate attention mechanism is a permutation coordinate attention mechanism; the permutation coordinate attention mechanism includes a grouping feature part, a fusion attention part and an aggregation feature part; the grouping feature part converts the input feature map X∈R C×H×W It is divided into G groups of sub-features along the channel dimension, expressed as X=[X1,..., X k , ..., X G ], X k ∈R C / G×H×W , where the sub-feature layer X k After capturing the accurate semantic feedback after training, X k Divide into sub-feature maps X along the height and width dimensions k1 , X k2 ∈R C / 2G×H×W The fusion attention part generates a channel attention map based on the relationship between channels, and uses global average pooling to generate s to embed global information, by obtaining a shrink sub-feature map X on the height dimension and width dimension H×W k1,s : ;in, F gp represents the embedding of global information; H represents the total height of the feature map; W represents the total width of the feature map; C represents the total number of channels; R represents a real number; i represents the height, and j represents the width; Then the Sigmoid activation function is used to create compact features and channel attention of the high-dimensional output for: ; Channel attention of width dimension output for: ; Among them, b1 represents the compact parameter of the height dimension; b2 represents the compact parameter of the width dimension; GN (X k2 ) represents the pair feature X k2 The number of groups; W1 represents the coefficient parameter of the height dimension; W2 represents the coefficient parameter of the width dimension; Aggregate feature parts to aggregate the overall output have: ; Output water seepage image and water seepage area.
2. A tunnel apparent water seepage detection method according to claim 1, characterized in that: The fusion feature Z obtained by fusing the preliminary features, local features and global features in the feature fusion part is: ; Among them, M1 represents the fusion weight of the preliminary feature X, the local feature Y and the global feature Z, and its value is a real number between 0 and 1; It represents the element-by-element summation of the feature map; Indicates the element phase corresponding to the characteristic diagram.
3. A tunnel apparent water seepage detection method according to claim 1, characterized in that: The construction methods of the segmentation network include: Constructing a segmentation network based on the MobileViT network structure; the segmentation network includes a global branch structure and a local branch structure; the global branch structure includes a first encoder and a first decoder; the local branch structure includes a second encoder and a second decoder; the first encoder and the second encoder are used to extract feature maps from image data, and the first decoder and the second decoder are used to parse the encoded data into the original image data form; A second coordinate attention mechanism is embedded between the first convolution layer and the second convolution layer of the first decoder and the second decoder; the second coordinate attention mechanism is a self-attention mechanism with position encoding, and the second coordinate attention mechanism performs second self-attention calculations on the height dimension and the width dimension respectively.
4. A tunnel apparent water seepage detection method according to claim 3, characterized in that: The second coordinate attention mechanism performs second self-attention calculations on the height dimension and the width dimension respectively, and the method includes: The self-attention calculation of the second coordinate attention mechanism in the width dimension is: ; The self-attention calculation of the second coordinate attention mechanism in the height dimension is: ; in, y ij Represents the self-attention weight of the feature in the i-th row and j-th column; q ij , k ij , v ij are the query vector, key vector and value vector of the feature of the i-th row and j-th column respectively; W is the total width of the feature map; w represents the width of the feature of the i-th row and j-th column; H is the total height of the feature map; w represents the height of the feature of the i-th row and j-th column; T represents the transpose of the vector; G Q , G K , G V1 , G V2 ∈R, respectively represent the control parameters of the query vector relative position information, key vector relative position information, value vector relative position information and value vector offset position information; Represents the position offset of the feature query vector in the width and height dimensions of the i-th row and j-th column; Represents the position offset of the feature key vector in the width and height dimensions of the i-th row and j-th column; Represents the position offset of the feature in the i-th row and j-th column in the width and height dimensions; Represents the position offset of the query vector from the feature of the i-th row and j-th column to the feature of the h-th row and w-th column in the width dimension; Represents the position offset of the feature in the i-th row and j-th column to the feature key vector in the h-th row and w-th column in the width dimension; Represents the position offset of the feature value vector of the i-th row and j-th column to the feature value vector of the h-th row and w-th column in the width dimension; Represents the position offset of the query vector from the feature of the i-th row and j-th column to the feature of the h-th row and w-th column in the height dimension; Represents the position offset of the feature in the i-th row and j-th column to the feature key vector in the h-th row and w-th column in the height dimension; Represents the position offset of the feature value vector of the i-th row and j-th column to the h-th row and w-th column in the height dimension; Softmax w represents the activation function in the width dimension; Softmax h Represents the activation function in the height dimension.
5. A tunnel apparent water seepage detection system, characterized in that: A method for detecting apparent water seepage in a tunnel according to any one of claims 1 to 4, the system comprising: A collection module, used to collect basic data of the target tunnel; A preprocessing module, used for preprocessing the basic data; the basic data includes image data and environmental data; The detection module is used to input the pre-processed basic data into the constructed water seepage detection model for detection; the water seepage detection model includes a detection network and a segmentation network; the detection network uses the MobileViT network structure as the basic network, introduces the first coordinate attention mechanism in the global feature extraction part to obtain the global feature, and performs feature fusion on the preliminary features, local features and global features in the feature fusion part to detect the water seepage image; the segmentation network uses the MobileViT network structure as the basic network, and integrates the second coordinate attention mechanism to perform semantic segmentation on the water seepage image to obtain the water seepage area; The output module is used to output water seepage images and water seepage areas.
6. A computer readable medium having a computer program stored thereon, characterized in that: The computer program is executed by a processor to implement a tunnel apparent water seepage detection method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Tunnel lining leakage water image segmentation method
CN117409023A
Tunnel concrete detection and analysis method and system
CN118968199A