A tunnel disease intelligent identification method based on image processing

By constructing a directional response field and performing asymmetric convolution in tunnel defect identification, and combining boundary curvature and internal grayscale features, the problems of unclear seepage boundaries and insufficient morphological recognition in existing technologies are solved, achieving high-precision seepage detection and differentiated maintenance.

CN122176426APending Publication Date: 2026-06-09ANHUI QIXING ENG TESTING CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ANHUI QIXING ENG TESTING CO LTD
Filing Date
2026-05-11
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

Existing deep learning-based tunnel defect identification methods lack enhanced local directional consistency of seepage boundaries when identifying seepage, resulting in the prediction mask showing boundary expansion, contraction, or breakage at concave polygon corners and slender branch areas. Furthermore, they fail to effectively distinguish between point-like, linear, and surface-like seepage, reducing the engineering practical value of the detection results.

Method used

By acquiring candidate regions for seepage water from grayscale images of tunnel lining, multi-scale wavelet decomposition is performed to construct a directional response field and perform directional-guided asymmetric convolution. Combining boundary curvature changes and internal grayscale gradient entropy, the category of seepage water is output.

Benefits of technology

It effectively restores the complete outline of the polygonal corners and slender branch areas of the leakage concave water, improves the shape segmentation accuracy of leakage detection, and provides differentiated maintenance strategies according to different shapes, thereby enhancing the engineering practical value of the detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122176426A_ABST
    Figure CN122176426A_ABST
Patent Text Reader

Abstract

This invention belongs to the field of tunnel defect recognition technology, specifically an intelligent tunnel defect recognition method based on image processing. First, it uses the largest connected region of pixels where both the local gray-level mean and local gray-level variance are lower than the global baseline as candidate regions for seepage. Low-frequency and high-frequency sub-bands are obtained through multi-scale wavelet decomposition. Then, the multi-directional gradient response intensity of the high-frequency sub-band is calculated, and the direction corresponding to the maximum gradient response intensity is taken as the local principal direction. A directional response field is constructed after effective boundary screening. Next, the directional response field is used as modulation weights to perform directional-guided asymmetric convolution on the low-frequency sub-band, outputting a directionally enhanced low-frequency sub-band. Subsequently, the directionally enhanced low-frequency sub-band is upsampled and fused element-wise with the high-frequency sub-band to obtain a mask prediction of the seepage candidate region. Finally, it outputs point-like, line-like, or area-like seepage categories. This helps improve the recognition and segmentation accuracy of tunnel seepage areas and achieves fine morphological classification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of tunnel defect identification technology, specifically a method for intelligent identification of tunnel defects based on image processing. Background Technology

[0002] Water leakage in tunnels is one of the most common defects in operating tunnels, often manifesting as point-like, linear, or area-like patterns. Potential leakage areas generally exhibit blurred boundaries, gradual changes in grayscale, irregular shapes, and are often concave polygons, posing significant challenges to automated detection.

[0003] Currently, deep learning-based tunnel defect identification methods mostly employ an encoder-decoder structure. This involves concatenating or element-wise adding the texture features output from the shallow layer of the encoder with the semantic features output from the deep layer of the decoder through skip connections or feature pyramids, in order to restore spatial details while preserving semantic information. This type of method has been applied to mask prediction of water seepage defects.

[0004] However, the existing technologies described above have the following drawbacks when applied to seepage identification: 1. Existing methods simply add shallow and deep features together without selectively enhancing the local directional consistency of the seepage boundary. The seepage boundary is a weak edge, and its gradient response decays rapidly along the boundary normal. The fusion of shallow features lacking directional guidance is insufficient to suppress background noise, causing the prediction mask to exhibit boundary expansion, contraction, or breakage at concave polygon corners and slender branch regions, resulting in insufficient shape segmentation accuracy.

[0005] 2. Existing methods only determine whether a pixel belongs to a water leakage area, without further distinguishing between different morphologies such as point-like, line-like, and area-like leaks based on boundary curvature distribution and internal grayscale statistical characteristics. Different leakage types correspond to drastically different maintenance strategies, and the lack of detailed classification reduces the practical engineering value of the detection results. Summary of the Invention

[0006] To overcome the shortcomings of the prior art, this invention provides an intelligent identification method for tunnel defects based on image processing, which can effectively solve the problems mentioned in the prior art.

[0007] The objective of this invention can be achieved through the following technical solution: This invention provides an intelligent identification method for tunnel defects based on image processing, comprising: acquiring a grayscale image of the tunnel lining, and using the largest connected region of pixels whose local grayscale mean and local grayscale variance are both lower than the global baseline as candidate regions for water leakage.

[0008] Multi-scale wavelet decomposition is performed on the candidate region of leakage water to obtain low-frequency sub-bands that characterize the structural profile and high-frequency sub-bands that represent edge details.

[0009] Calculate the gradient response intensity of the high-frequency subband in at least two different directions. For each pixel, take the direction corresponding to the maximum gradient response intensity as its local principal direction. Construct a directional response field of the same size as the tunnel lining image by filtering effective boundary pixels.

[0010] Using the directional response field as modulation weight, a directionally guided asymmetric convolution is performed on the low-frequency subband to output the directionally enhanced low-frequency subband.

[0011] The low-frequency subband with enhanced direction is upsampled and then fused with the high-frequency subband element by element to obtain the mask prediction of the candidate region for water leakage.

[0012] Extract the boundary curvature change sequence and internal gray-level gradient entropy of the connected domain from the mask prediction. The internal gray-level gradient entropy is calculated based on the gradient amplitude frequency distribution of the pixels inside the connected domain. Calculate the median and interquartile range of the boundary curvature change sequence, and convert the median, interquartile range, and internal gray-level gradient entropy to dimensionless scalars respectively. Based on the numerical comparison relationship between the three, output the point-like, line-like, or area-like leakage water category.

[0013] Compared with the prior art, the embodiments of the present invention have at least the following advantages or beneficial effects: (1) The present invention constructs a directional response field by calculating the gradient response intensity of the high-frequency sub-band, extracts the local principal direction of each pixel, and uses the directional response field as the modulation weight to perform asymmetric convolution on the low-frequency sub-band. This directional guidance mechanism enhances the response along the principal direction of the seepage boundary, suppresses background noise in the normal direction, and helps to restore the complete contour of the corners and slender branch regions of the seepage concave polygon.

[0014] (2) The present invention upsamples the low-frequency subband after direction enhancement and adds it to the high-frequency subband element by element to obtain the mask prediction of the candidate region of seepage water. The boundary curvature change sequence and internal gray-level gradient entropy of the connected domain are extracted from the mask prediction. The point, line or surface seepage water category is output by utilizing the boundary geometric features and the statistical difference of internal texture, providing a direct basis for differentiated treatment in tunnel maintenance. Attached Figure Description

[0015] The present invention will be further described with reference to the accompanying drawings, but the embodiments in the drawings do not constitute any limitation on the present invention. For those skilled in the art, other drawings can be obtained based on the following drawings without creative effort.

[0016] Figure 1 This is a flowchart illustrating the implementation steps of the method of the present invention;

[0017] Figure 2 This is a schematic diagram illustrating the logic for obtaining candidate areas for water leakage in this invention.

[0018] Figure 3This is a schematic diagram illustrating the construction logic of the directional response field of the present invention. Detailed Implementation

[0019] 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, and 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.

[0020] Reference Figure 1 As shown, this embodiment of the invention provides a method for intelligent identification of tunnel defects based on image processing, including: S1. acquiring a grayscale image of the tunnel lining, and using the largest connected region of pixels whose local grayscale mean and local grayscale variance are both lower than the global baseline as candidate regions for water leakage.

[0021] Reference Figure 2 As shown, in this embodiment, the steps for obtaining the candidate region of leakage water are as follows: S11. Traverse each pixel in the grayscale image of the tunnel lining and delineate a neighborhood window with each pixel as the center: calculate the ratio of the preset minimum detectable size of leakage water to the acquisition resolution of the grayscale image of the tunnel lining and round it to an odd number, delineate a square neighborhood window with the odd number as the side length, or delineate a circular neighborhood window with half of the odd number as the radius.

[0022] Calculate the gray-level mean and gray-level variance of pixels within the neighborhood window, which are used as the local gray-level mean and local gray-level variance.

[0023] S12. Remove the maximum and minimum values ​​from all local grayscale mean values, and obtain the global grayscale mean value by calculating the arithmetic mean of the remaining local grayscale mean values.

[0024] S13. Using the global grayscale mean as a reference, calculate the deviation of each pixel's grayscale value relative to the global grayscale mean and quantify the global grayscale variance using the deviation statistics. Specifically, calculate the mean of the squared deviations of each pixel's grayscale value from the global grayscale mean, and use it as the global grayscale variance.

[0025] The global grayscale mean and global grayscale variance are used as global baselines.

[0026] S14. Mark the pixels whose local gray-level mean is lower than the global gray-level mean and whose local gray-level variance is lower than the global gray-level variance as seed points.

[0027] S15. Starting from various sub-points, the neighboring pixels that meet the gray-level consistency condition are incorporated into the same region through the region growing algorithm to form several connected regions.

[0028] The region growing algorithm is executed as follows: all seed points are stored in a first-in-first-out queue. One seed point is taken out from the queue in turn. The eight neighboring pixels of the seed point are traversed. For each neighboring pixel, it is determined whether the grayscale consistency condition is met. If it is met, the neighboring pixel is added to the tail of the queue as a new seed point and assigned the same connected component number as the neighboring pixel. The determination is repeated until the queue is empty. Pixels with the same connected component number are merged into a set to obtain the connected component.

[0029] The grayscale consistency condition is defined as the absolute difference between the grayscale of the pixel to be judged and the current seed point being less than a preset grayscale tolerance threshold, wherein the preset grayscale tolerance threshold is 0.5 times the global grayscale standard deviation of the image.

[0030] S16. Select the connected region with the largest number of pixels. If its number of pixels reaches the preset minimum detectable size for water leakage, then output it as a candidate region for water leakage. Otherwise, determine that there is no water leakage in the current image and terminate the subsequent recognition steps.

[0031] It should be noted that the selection of candidate areas for water leakage is based on the following: after water infiltrates the tunnel lining surface, the grayscale value of the water leakage area is lower than that of the dry lining background, resulting in a lower local grayscale mean than the global grayscale mean. Simultaneously, the internal texture of the water leakage area is uniform with small grayscale fluctuations, resulting in a lower local grayscale variance than the global grayscale variance. Based on these physical imaging characteristics, pixels that simultaneously satisfy the condition that both the local grayscale mean and local grayscale variance are lower than the corresponding global baseline are selected as candidate pixels for water leakage. The largest connected component formed by these candidate pixels is then used as the candidate area for water leakage.

[0032] S2. Perform multi-scale wavelet decomposition on the candidate region of leakage water to obtain low-frequency sub-bands that characterize the structural contour and high-frequency sub-bands that represent edge details.

[0033] In this embodiment, the multi-scale wavelet decomposition of the candidate leakage area includes: using a two-dimensional discrete wavelet transform, with at least one decomposition layer, each layer generating a low-frequency sub-band and three high-frequency sub-bands in three directions, the three directions including the horizontal direction, the vertical direction and the diagonal direction.

[0034] In this model, both the low-frequency subband and the high-frequency subband are coefficient matrices. The coefficients of the low-frequency subband are the approximate gray-level components of the input image at the corresponding scale, and each coefficient is the arithmetic mean of the pixel gray-level in the local neighborhood.

[0035] The high-frequency subband coefficients include grayscale detail components in three directions: horizontal, vertical, and diagonal. Each coefficient is the grayscale difference value in the corresponding direction. The absolute value of the coefficient corresponds to the grayscale change amplitude, and the sign of the coefficient corresponds to the direction of grayscale change.

[0036] It should be noted that the two-dimensional discrete wavelet transform can employ Haar wavelets, performing one-dimensional wavelet transforms in the row and column directions and halving downsampling sequentially on each layer of the input image. The four sub-band coefficients generated by each layer of decomposition are processed as follows: low-frequency sub-band coefficients : .

[0037] Horizontal high-frequency subband coefficient : .

[0038] Vertical high-frequency subband coefficient : .

[0039] Diagonal high-frequency subband coefficient : .

[0040] The input image is denoted as a grayscale matrix. Its size is , These are the row and column coordinate indices in the low-frequency subband coefficient matrix, respectively. , .

[0041] in, Indicates the first element in the input image. line, number The pixel grayscale value of the column. Indicates the first element in the input image. line, number The pixel grayscale value of the column. Indicates the first element in the input image. line, number The pixel grayscale value of the column. Indicates the first element in the input image. line, number The pixel grayscale value of the column.

[0042] In the formula for calculating the low-frequency subband coefficient, the arithmetic mean of the gray values ​​of four pixels is taken. The resulting value is used as the gray approximation component of the local block to reflect the average brightness of the local block.

[0043] In the formula for calculating the horizontal high-frequency subband coefficient, the numerator represents the grayscale difference between the left and right columns of pixels in the same row: in the first row, subtract the opposite of the left column from the right column; the same applies to the second row. After dividing the whole by 4, the calculated value approximates the grayscale change rate in the vertical direction. Specifically, a positive value indicates that the average grayscale of the upper pixel is higher than that of the lower pixel, and a negative value indicates that the average grayscale of the upper pixel is lower than that of the lower pixel.

[0044] In the formula for calculating the vertical high-frequency subband coefficient, the numerator represents the grayscale change rate in the horizontal direction, calculated by subtracting the sum of the two pixels in the upper row from the sum of the two pixels in the lower row and dividing by 4. A positive value indicates that the average grayscale of the left pixels is higher than that of the right pixels, while a negative value indicates that it is lower than that of the right pixels.

[0045] The numerator in the formula for calculating the diagonal high-frequency subband coefficient represents the gray-level difference in the diagonal direction: the sum of the two pixels on the main diagonal (from the top left to the bottom right) minus the sum of the two pixels on the subdiagonal (from the top right to the bottom left), and then divided by 4, which reflects the gray-level change rate in the diagonal direction.

[0046] The Haar wavelet transform divides the image into non-overlapping 2×2 blocks, and each block is decomposed into one low-frequency component and three high-frequency components through the sub-band coefficient process described above.

[0047] S3. Calculate the gradient response intensity of the high-frequency sub-band in at least two different directions. For each pixel, take the direction corresponding to the maximum gradient response intensity as its local principal direction. Construct a directional response field of the same size as the tunnel lining image by filtering effective boundary pixels.

[0048] In this embodiment, the calculation of the gradient response intensity of the high-frequency subband in at least two different directions includes: for each pixel in the high-frequency subband, constructing at least two anisotropic Gaussian kernels with mutually perpendicular directional angles, such as 0 degrees and 90 degrees, or 45 degrees and 135 degrees.

[0049] Perform convolution operation between the anisotropic Gaussian kernel corresponding to each directional angle and the high-frequency subband: move the anisotropic Gaussian kernel pixel by pixel along the row and column directions of the high-frequency subband so that the center of the kernel coincides with the current pixel.

[0050] The gray values ​​of each pixel within the kernel coverage area are multiplied by the weight coefficients at the corresponding kernel positions and then summed. The summed result is used as the gradient response intensity of the high-frequency subband in the corresponding direction.

[0051] It should be noted that the anisotropic Gaussian kernel is composed of sampled values ​​of a two-dimensional Gaussian function on a discrete grid. The two-dimensional Gaussian function is defined as follows: .

[0052] in, Let these be the position coordinates of pixels within the anisotropic Gaussian kernel relative to the kernel center. The axis is along the principal direction of the core. The axis is perpendicular to the principal direction of the nucleus. Let be the standard deviations along the principal direction and its perpendicular direction, respectively. This is to elongate the nucleus along the main direction. The size of the nucleus is taken as... And normalize it so that the sum of all weights is 1.

[0053] The normalization coefficient term helps the integral of the two-dimensional Gaussian function over the entire plane to equal 1.

[0054] This is an exponential term used to control the decay rate of the weights at each location within the kernel: its value increases with... or The increase in weight and the decrease in exponential weight result in pixels near the center of the kernel receiving higher weights and pixels far from the center receiving lower weights.

[0055] A two-dimensional Gaussian function describes a two-dimensional anisotropic Gaussian distribution, whose contour lines are ellipses, with the major axis of the ellipse along... axial direction, minor axis along Axial direction. When When, the function is The attenuation is slower in the direction, in The weighting decreases rapidly in the main direction, thus forming a smooth weighted window that is elongated along the main direction. In the convolution operation, pixels closer to the center of this window receive a larger weight, while pixels farther from the center receive a smaller weight. Furthermore, the response range along the main direction is greater than that in the vertical direction, thereby achieving selective enhancement of edges in a specific direction.

[0056] For each orientation angle, the above two-dimensional Gaussian function is rotated by the corresponding orientation angle, and then sampled on discrete grid points to obtain the weight coefficient matrix of the anisotropic Gaussian kernel corresponding to the orientation angle. That is, the weight is assigned to the position of the anisotropic Gaussian kernel. The weight coefficient matrix of the anisotropic Gaussian kernel is calculated and stored once before the algorithm runs, and is reused for different pixels and different images.

[0057] It should also be noted that, in order to improve the computation speed, the anisotropic Gaussian kernel can be decomposed into a cascade of two one-dimensional kernels: a one-dimensional Gaussian kernel along the main direction and a one-dimensional Gaussian kernel along the vertical direction. During the operation, filtering can be performed first along the main direction and then along the vertical direction, thereby transforming the two-dimensional convolution into two one-dimensional convolutions.

[0058] Reference Figure 3 As shown, in this embodiment, the step of constructing a directional response field of the same size as the tunnel lining image by filtering effective boundary pixels includes: recording the gradient response intensity in the local principal direction as the principal direction response intensity.

[0059] The principal direction response intensity of each pixel is compared with the principal direction response intensity of all pixels within a defined neighborhood window. If it is greater than the principal direction response intensity of all other pixels within the neighborhood window, it is determined to be a valid boundary pixel, and its local principal direction and principal direction response intensity are retained. Otherwise, the local principal direction of the pixel is marked as invalid, and the principal direction response intensity is set to zero.

[0060] A two-dimensional tensor with the same number of rows and columns as the tunnel lining image is constructed as the directional response field. Each element in the two-dimensional tensor is a vector formed by concatenating the local principal direction index and the principal direction response intensity.

[0061] It should be noted that the significance of valid boundary pixel screening lies in the fact that pixels located at the water leakage boundary have high confidence in their local principal direction, serving as a reliable basis for subsequent direction-guided convolution. The significance of invalid markers lies in the fact that pixels are not located on the water leakage boundary, their direction information is unreliable or nonexistent, and setting them to zero avoids introducing erroneous direction priors in non-boundary regions, thereby suppressing the interference of background noise on the low-frequency subband enhancement process. By distinguishing between valid and invalid pixels, the direction response field only provides reliable boundary direction information to the asymmetric convolution, ensuring that the convolution kernel only generates direction enhancement responses near the true boundary, thus improving the accuracy of water leakage contour segmentation.

[0062] S4. Using the directional response field as modulation weights, perform directional-guided asymmetric convolution on the low-frequency subband to output the directionally enhanced low-frequency subband.

[0063] In this embodiment, the asymmetric convolution with directional guidance for the low-frequency sub-band includes: taking each pixel in the low-frequency sub-band as the current target pixel in turn, and reading the local principal direction index and principal direction response intensity corresponding to the current target pixel from the directional response field.

[0064] Construct an asymmetric convolution kernel. The shape of the asymmetric convolution kernel is stretched along the local principal direction and its perpendicular direction, such that the length of the convolution kernel in the local principal direction is greater than its length in the perpendicular direction. The specific construction process is as follows: take the local principal direction of the current target pixel as the principal axis direction of the convolution kernel, and take the direction perpendicular to the principal axis as the secondary axis direction.

[0065] The length of the convolution kernel along the main axis is defined as the first length, and the length along the secondary axis is defined as the second length, with the first length being greater than the second length.

[0066] The standard square convolution kernel is stretched along the principal axis by a ratio equal to the first length to the second length, while remaining unchanged along the secondary axis, to obtain the spatial support domain of the asymmetric convolution kernel.

[0067] The modulated convolution kernel is obtained by multiplying each weight coefficient of the asymmetric convolution kernel by the main directional response intensity of the current target pixel in the directional response field.

[0068] The low-frequency subband is convolved using a modulated convolution kernel, and the convolution result is used as the orientation enhancement response value of the current target pixel.

[0069] Iterate through all pixels in the low-frequency subband and output the directionally enhanced low-frequency subband, which is composed of the directional enhancement response values ​​of each pixel.

[0070] It should be noted that the weight coefficients of the asymmetric convolution kernels mentioned above are obtained by pre-calculating the discrete sampled values ​​of the two-dimensional Gaussian function on the stretched spatial support domain, and then normalizing them after sampling.

[0071] S5. After upsampling the directionally enhanced low-frequency subband, it is added to the high-frequency subband element by element and fused to obtain the mask prediction of the candidate region of leakage water.

[0072] In this embodiment, the step of upsampling the directionally enhanced low-frequency subband and fusing it element-wise with the high-frequency subband includes: upsampling the directionally enhanced low-frequency subband using bilinear interpolation to make its spatial size the same as that of the high-frequency subband. Specifically, the spatial size of the high-frequency subband is considered as the target size. For each pixel position in the target size, the floating-point coordinates corresponding to the pixel position in the original low-frequency subband are first calculated; then, the pixel values ​​at the four adjacent integer coordinate points around the floating-point coordinates are taken; and the offset of the floating-point coordinates from the left integer point in the horizontal direction is calculated respectively. and the offset from the upper integer point in the vertical direction The interpolation weights of the four adjacent integer points are respectively , , , The pixel values ​​at each integer coordinate point are multiplied by their corresponding weights and then summed to obtain the interpolation result. Linear interpolation is then performed on the upper and lower rows horizontally, and then on the two horizontal interpolation results vertically to obtain the actual values ​​of the pixel positions at the target size. All pixel positions are then iterated sequentially to generate an upsampled low-frequency subband that is completely identical to the high-frequency subband size.

[0073] The pixel values ​​at the same coordinate positions in the upsampled low-frequency sub-band and high-frequency sub-band are added together to obtain the fused feature map.

[0074] The fusion feature value of each pixel in the fusion feature map is mapped to a fixed numerical range through a preset function, namely the Sigmoid function. The mapped value is used as the probability value of the pixel belonging to the candidate region of water leakage.

[0075] Pixels with a probability value greater than their complement are identified as water leakage pixels, otherwise they are identified as background pixels. Specifically, pixels with a probability value greater than 0.5 are identified as water leakage pixels, and pixels with a probability value less than or equal to 0.5 are identified as background pixels. This generates a binary mask for the water leakage candidate region, which is then used for mask prediction.

[0076] It should be noted that if there are abnormal cases where the pixel value is infinite or non-numerical in the fused feature map, the Sigmoid function will map it to a limit value close to 0 or 1, and it can still be binarized normally.

[0077] S6. Extract the boundary curvature change sequence and internal gray-level gradient entropy of the connected domain from the mask prediction. The internal gray-level gradient entropy is calculated based on the gradient amplitude frequency distribution of the pixels inside the connected domain. Calculate the median and interquartile range of the boundary curvature change sequence, and convert the median, interquartile range and internal gray-level gradient entropy to dimensionless scalars respectively. Based on the numerical comparison relationship between the three, output the point-like, line-like or area-like leakage water category.

[0078] In this embodiment, the step of extracting the boundary curvature change sequence and internal gray-level gradient entropy of the connected domain from the mask prediction includes: using an edge detection operator to obtain the single-pixel edge closure curve of the connected domain in the mask prediction.

[0079] Resample the pixels on the closed curve in a clockwise direction to obtain an equally spaced coordinate sequence.

[0080] For each pixel in the coordinate sequence, a fixed number of its preceding and following neighboring pixels are taken. The local curvature is calculated by the ratio of the rate of change of the orientation angle to the arc length. The local curvatures are arranged in the sampling order to obtain the boundary curvature change sequence.

[0081] The grayscale values ​​of the connected components at their original positions in the grayscale image of the tunnel lining are obtained. By calculating the grayscale difference between the horizontal and vertical directions of each pixel, and then taking the square root of the sum of the squares of the differences, the gradient magnitude of all pixels within the connected component is obtained. The gradient magnitude range is then uniformly divided into several intervals. The process of obtaining the span of a single interval is as follows: the total number of pixels in the connected component is substituted into the Sturgess formula to determine the number of intervals. The difference between the maximum and minimum values ​​of the pixel gradient magnitude is divided by the determined number of intervals to obtain the span of a single interval. The frequency distribution of the number of pixels in each interval is statistically analyzed, and the internal grayscale gradient entropy is calculated using the Shannon entropy formula.

[0082] It should be noted that the Sturgess formula and the Shannon entropy formula mentioned above are existing formulas, and their calculation process will not be described in detail here.

[0083] In this invention, the internal gray-level gradient entropy refers to the entropy value calculated based on the gray-level gradient magnitude distribution of internal pixels within the original tunnel lining gray-level image region corresponding to the connected component after extracting the connected component from the mask prediction. It is used to characterize the complexity of the gray-level changes of the texture within the connected component.

[0084] In this embodiment, the output of point-like, line-like, or area-like leakage categories includes: calculating the median and interquartile range of the boundary curvature change sequence, and converting the median, interquartile range, and internal gray-level gradient entropy to dimensionless scalars through deviation standardization.

[0085] Specifically, the range between the maximum and minimum values ​​in the boundary curvature change sequence is obtained. The differences between the median and interquartile range and the minimum value are divided by the range to obtain the median and interquartile range as dimensionless scalar values. The number of intervals determined by the gradient magnitude range is substituted into the Shannon entropy formula to calculate the maximum value of the gray-level gradient entropy within the current candidate leakage area. The current internal gray-level gradient entropy is divided by the calculated maximum value of the internal gray-level gradient entropy to obtain the internal gray-level gradient entropy as a dimensionless scalar value.

[0086] When the median is greater than the internal gray-level gradient entropy and the interquartile range is less than the internal gray-level gradient entropy, the point-like leakage category is output.

[0087] When the median is less than the internal gray-level gradient entropy and the interquartile range is greater than the internal gray-level gradient entropy, the output is a surface leakage category.

[0088] In other cases, the linear leakage category will be output directly.

[0089] It should be noted that the above-mentioned criteria for classifying leakage are based on the following: the boundary curvature variation sequence of point leakage exhibits a generally high value and concentrated distribution; the median after deviation standardization approaches 1 (maximum), and the interquartile range approaches 0 (minimum); simultaneously, the gray level is uniform within the point leakage area, and although the standardized internal gray-level gradient entropy is low, it is significantly greater than the interquartile range approaching 0. Therefore, under standardized dimensions, the criteria for classifying point leakage are: the median is greater than the internal gray-level gradient entropy, and the interquartile range is less than the internal gray-level gradient entropy.

[0090] The irregular boundary of the planar seepage area, with its drastic curvature variation sequence and frequent alternation between positive and negative curvature, causes the standardized median to approach 0 (very small), while the large curvature dispersion makes the standardized interquartile range approach 1 (very large). Simultaneously, the complex internal texture of the planar seepage area results in a high standardized internal gray-level gradient entropy, but it is significantly smaller than the interquartile range approaching 1. Therefore, the criteria for determining planar seepage are: the median is less than the internal gray-level gradient entropy, and the interquartile range is greater than the internal gray-level gradient entropy.

[0091] For linear seepage, its boundary is approximately a parallel straight line, the curvature change sequence only shows peaks at both ends, and the curvature in the middle is close to zero. The standardized median and interquartile range are between those of point-like and area-like seepage, and their relationship with the magnitude of the standardized internal gray-level gradient entropy does not satisfy any of the above extreme cases. Therefore, all cases except for the point-like and area-like criteria are output as linear seepage categories.

[0092] The above description is merely an example and illustration of the structure of the present invention. Those skilled in the art can make various modifications or additions to the specific embodiments described, or use similar methods to replace them, as long as they do not deviate from the structure of the invention or exceed the scope defined by the present invention, they should all fall within the protection scope of the present invention.

Claims

1. A method for intelligent identification of tunnel defects based on image processing, characterized in that, include: Obtain grayscale images of the tunnel lining, and use the largest connected region of pixels whose local grayscale mean and local grayscale variance are both lower than the global baseline as candidate regions for water leakage. Multi-scale wavelet decomposition is performed on the candidate region of leakage water to obtain low-frequency sub-bands that characterize the structural contour and high-frequency sub-bands that represent edge details; Calculate the gradient response intensity of the high-frequency subband in at least two different directions, take the direction corresponding to the maximum gradient response intensity of each pixel as its local principal direction, and construct a directional response field of the same size as the tunnel lining image by filtering effective boundary pixels. Using the directional response field as modulation weight, a directional-guided asymmetric convolution is performed on the low-frequency subband to output the directionally enhanced low-frequency subband. The low-frequency subband with enhanced direction is upsampled and then fused with the high-frequency subband element by element to obtain the mask prediction of the candidate region for water leakage. Extract the boundary curvature change sequence and internal gray-level gradient entropy of the connected domain from the mask prediction. The internal gray-level gradient entropy is calculated based on the gradient amplitude frequency distribution of the pixels inside the connected domain. Calculate the median and interquartile range of the boundary curvature change sequence, and convert the median, interquartile range, and internal gray-level gradient entropy to dimensionless scalars respectively. Based on the numerical comparison relationship between the three, output the point-like, line-like, or area-like leakage water category.

2. The intelligent identification method for tunnel defects based on image processing according to claim 1, characterized in that, The method of using the largest connected region of pixels whose local gray-level mean and local gray-level variance are both lower than the global baseline as candidate regions for water leakage includes: Traverse each pixel in the grayscale image of the tunnel lining, delineate a neighborhood window centered on each pixel, and calculate the grayscale mean and grayscale variance of the pixels within the neighborhood window as local grayscale mean and local grayscale variance. The maximum and minimum values ​​of all local grayscale values ​​are removed, and the global grayscale mean is obtained by calculating the arithmetic mean of the remaining local grayscale values. Using the global grayscale mean as a reference, the deviation of each pixel's grayscale value relative to the global grayscale mean is calculated, and the global grayscale variance is quantified by the deviation statistics. The global grayscale mean and the global grayscale variance are used as the global baseline. Pixels whose local gray-level mean is lower than the global gray-level mean and whose local gray-level variance is lower than the global gray-level variance are marked as seed points; Starting from various sub-points, the neighboring pixels that meet the gray-level consistency condition are incorporated into the same region through the region growing algorithm, forming several connected regions. Select the connected region with the largest number of pixels. If its number of pixels reaches the preset minimum detectable size for water leakage, it is output as a candidate region for water leakage. Otherwise, it is determined that there is no water leakage in the current image, and the subsequent recognition steps are terminated.

3. The intelligent identification method for tunnel defects based on image processing according to claim 1, characterized in that, The multi-scale wavelet decomposition of the candidate leakage water region includes: A two-dimensional discrete wavelet transform is used, with at least one decomposition layer. Each decomposition layer generates a low-frequency sub-band and three high-frequency sub-bands in three directions, including the horizontal direction, the vertical direction, and the diagonal direction. Among them, both the low-frequency sub-band and the high-frequency sub-band are coefficient matrices. The coefficients of the low-frequency sub-band are the approximate gray-level components of the input image at the corresponding scale, and each coefficient is the arithmetic mean of the pixel gray-level in the local neighborhood. The high-frequency subband coefficients include grayscale detail components in three directions: horizontal, vertical, and diagonal. Each coefficient is the grayscale difference value in the corresponding direction. The absolute value of the coefficient corresponds to the grayscale change amplitude, and the sign of the coefficient corresponds to the direction of grayscale change.

4. The intelligent identification method for tunnel defects based on image processing according to claim 1, characterized in that, The calculation of the gradient response intensity of the high-frequency subband in at least two different directions includes: For each pixel in the high-frequency subband, construct at least two anisotropic Gaussian kernels with mutually perpendicular orientation angles; Perform convolution operation between the anisotropic Gaussian kernel corresponding to each directional angle and the high-frequency subband: move the anisotropic Gaussian kernel pixel by pixel along the row and column directions of the high-frequency subband so that the center of the kernel coincides with the current pixel, multiply the gray value of each pixel in the kernel coverage area by the weight coefficient of the corresponding position of the kernel and accumulate them, and the accumulated result is used as the gradient response intensity of the high-frequency subband in the corresponding direction.

5. The intelligent identification method for tunnel defects based on image processing according to claim 2, characterized in that, The construction of a directional response field of the same size as the tunnel lining image through effective boundary pixel filtering includes: The gradient response intensity along the local principal direction is denoted as the principal direction response intensity. The principal direction response intensity of each pixel is compared with the principal direction response intensity of all pixels within the defined neighborhood window. If it is greater than the principal direction response intensity of all other pixels within the neighborhood window, it is determined to be a valid boundary pixel, and its local principal direction and principal direction response intensity are retained; otherwise, the local principal direction of the pixel is set to invalid and the principal direction response intensity is set to zero. A two-dimensional tensor with the same number of rows and columns as the tunnel lining image is constructed as the directional response field. Each element in the two-dimensional tensor is a vector formed by concatenating the local principal direction index and the principal direction response intensity.

6. The intelligent identification method for tunnel defects based on image processing according to claim 5, characterized in that, The asymmetric convolution that guides the direction of the low-frequency subband includes: Each pixel in the low-frequency sub-band is taken as the current target pixel in turn, and the local main direction index and main direction response intensity corresponding to the current target pixel are read from the direction response field. Construct an asymmetric convolution kernel, the shape of which is stretched along the local principal direction and its perpendicular direction, such that the length of the convolution kernel in the local principal direction is greater than its length in the perpendicular direction; The modulated convolution kernel is obtained by multiplying each weight coefficient of the asymmetric convolution kernel by the main directional response intensity of the current target pixel in the directional response field. The low-frequency subband is convolved using a modulated convolution kernel, and the convolution result is used as the orientation enhancement response value of the current target pixel. Iterate through all pixels in the low-frequency subband and output the directionally enhanced low-frequency subband, which is composed of the directional enhancement response values ​​of each pixel.

7. The intelligent identification method for tunnel defects based on image processing according to claim 6, characterized in that, The construction of the asymmetric convolution kernel includes: The local principal direction of the current target pixel is used as the principal axis direction of the convolution kernel, and the direction perpendicular to the principal axis is used as the secondary axis direction. The length of the convolution kernel along the principal axis is defined as the first length, and the length along the secondary axis is defined as the second length, with the first length being greater than the second length; The standard square convolution kernel is stretched along the principal axis by a ratio equal to the first length to the second length, while remaining unchanged along the secondary axis, to obtain the spatial support domain of the asymmetric convolution kernel.

8. The intelligent identification method for tunnel defects based on image processing according to claim 1, characterized in that, The process of upsampling the directionally enhanced low-frequency subband and then adding it element-wise to the high-frequency subband includes: The low-frequency subband after directional enhancement is upsampled using a bilinear interpolation method so that its spatial size is the same as that of the high-frequency subband. The pixel values ​​at the same coordinate position in the upsampled low-frequency sub-band and high-frequency sub-band are added together to obtain the fused feature map; The fusion feature value of each pixel in the fusion feature map is mapped to a fixed numerical range through a preset function, and the mapped value is used as the probability value of the pixel belonging to the candidate region of water leakage. Pixels with a probability value greater than their complement are identified as water leakage pixels, and those otherwise are background pixels. This generates a binary mask for the water leakage candidate region, which is then used for mask prediction.

9. The intelligent identification method for tunnel defects based on image processing according to claim 1, characterized in that, The extraction of the boundary curvature change sequence and internal gray-level gradient entropy of connected components from mask prediction includes: The edge detection operator is used to obtain the single-pixel edge closure curve of the connected region in the mask prediction; Resample the pixels on the closed curve in a clockwise direction to obtain an equally spaced coordinate sequence; For each pixel in the coordinate sequence, a fixed number of its preceding and following neighboring pixels are taken, and the local curvature is calculated by the ratio of the rate of change of the orientation angle to the arc length. The local curvatures are then arranged in the sampling order to obtain the boundary curvature change sequence. Obtain the grayscale value of the original position of the connected component in the grayscale image of the tunnel lining, calculate the gradient magnitude of all pixels inside the connected component, divide the gradient magnitude range evenly into several intervals, count the frequency distribution of the number of pixels in each interval, and calculate the internal grayscale gradient entropy using the Shannon entropy formula.

10. The intelligent identification method for tunnel defects based on image processing according to claim 1, characterized in that, The output of point-like, linear, or area-like leakage categories includes: Calculate the median and interquartile range of the boundary curvature change sequence, and convert the median, interquartile range, and internal gray-level gradient entropy to dimensionless scalars through deviation normalization. When the median is greater than the internal gray-level gradient entropy and the interquartile range is less than the internal gray-level gradient entropy, the point-like leakage category is output. When the median is less than the internal gray-level gradient entropy and the interquartile range is greater than the internal gray-level gradient entropy, output the area leakage category. In other cases, the linear leakage category will be output directly.