Subway shield tunnel crack segmentation measurement method and system
Through the improved YOLOv8-GSD model, gamma correction and RCLAHE theory, the problem of poor detection of slender cracks in subway shield tunnels is solved, and the precise measurement and segmentation of cracks is achieved, and the detection accuracy and efficiency are improved.
Patent Information
- Application Number
- CN202411417796.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-11
- Publication Date
- 2025-01-17
AI Technical Summary
The prior art is not effective in detecting elongated cracks in subway shield tunnels, and it is difficult to distinguish cracks from similar interference categories, resulting in low detection accuracy and efficiency.
The improved YOLOv8-GSD model combined with gamma correction and RCLAHE theory was used to perform crack segmentation and image pre-processing on the subway shield tunnel images, and the crack skeleton was extracted through various sub-region growth methods, and the crack length and width were calculated according to the pixel connection method.
Accurate measurement and segmentation of slender cracks in subway shield tunnels is achieved, detection accuracy and efficiency are improved, errors are reduced, and sensitivity to crack characteristics is enhanced.
Smart Images

Figure CN119323598A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of deep learning technology, and more specifically, to a subway shield tunnel crack segmentation measurement method and system. Background Art
[0002] In subway shield tunnels, as the operation time continues to increase, the tunnel structure is affected by a variety of factors, such as groundwater flow, pressure changes, train vibration, and soil load, which inevitably cause cracks in the tunnel lining structure. These cracks not only affect the stability of the tunnel structure, but may also further cause more serious diseases such as water leakage and block falling, posing a serious threat to the safety of subway operations. Therefore, timely and accurate detection and measurement of tunnel cracks is crucial.
[0003] However, traditional crack detection methods mainly rely on manual inspection with strong flashlights and feeler gauge measurements, which are inefficient, subjective, and easy to miss. Especially in the case of dark and complex subway tunnels, where cracks are long and thin and difficult to reach, traditional detection methods are even more difficult to guarantee the reliability and accuracy of the detection results.
[0004] In order to overcome the limitations of traditional detection methods, scholars began to explore tunnel crack detection methods based on non-destructive testing (NDI) technology. At present, NDI methods for tunnels mainly include intensity-based methods, acoustic and ultrasonic methods, magnetic methods, electrical methods, thermal imaging methods, radar methods, radiographic methods, and endoscopes. However, these methods are often limited by various factors in practical applications, such as low detection accuracy, large errors, and demanding detection environments, so they have not been widely used. With the rapid development of data acquisition and computing hardware, especially graphics processing units (GPUs), crack detection methods based on image processing have gradually emerged. These methods mainly use edge detection, support vector machines, fractal dimension calculation and other technologies to detect tunnel cracks. However, in an environment with complex noise and uneven light, detection methods based on image processing often find it difficult to accurately extract crack information, which can easily cause crack information loss. In order to further improve detection accuracy and efficiency, a series of tunnel detection technologies based on robot and sensor integrated systems have been developed. These technologies collect data using high-resolution image acquisition cameras and then use image processing technology to detect defects. Although these technologies have improved the detection quality to a certain extent, there are still problems such as poor detection of slender cracks and susceptibility to interference.
[0005] In recent years, with the rapid development of artificial intelligence technology, crack detection methods based on deep learning have gradually become a research hotspot. By building a model training framework through neural networks and computer platforms, and then relying on the model to complete automatic detection, deep learning has shown excellent performance in the detection of defects such as cracks. However, for subway shield tunnels, the improvement direction of most current methods does not fully consider the characteristics of subway tunnels, resulting in poor results when detecting slender cracks. In addition, how to distinguish cracks from interference categories similar to cracks, such as scratches and joints, is also a major problem facing current research. Summary of the invention
[0006] The purpose of the present invention is to provide a subway shield tunnel crack segmentation measurement method and system, which performs crack segmentation on subway shield tunnel images based on an improved YOLOv8-GSD model, and introduces a method combining gamma correction with RCLAHE theory to accurately measure crack width and length information.
[0007] In order to achieve the above object, the present invention provides a subway shield tunnel crack segmentation measurement method, the method comprising:
[0008] Step S1: collecting images of subway shield tunnels containing cracks;
[0009] Step S2: performing crack segmentation on the collected subway shield tunnel image based on the improved YOLOv8-GSD model to form a subway tunnel crack image;
[0010] Step S3: performing image preprocessing on the subway tunnel crack image;
[0011] Step S4: extracting the crack region of the subway tunnel crack image after image preprocessing according to the multi-seed region growing method, and extracting the crack skeleton of the crack region by using the thinning algorithm;
[0012] Step S5: Based on the crack skeleton, the crack length and crack width are calculated according to the pixel connection mode.
[0013] Preferably, the improved YOLOv8-GSD model includes:
[0014] The backbone network Backbone is used to extract features from the input subway shield tunnel image, collect semantic information, and enhance the feature matrix;
[0015] Neck network, which is used to replace the original Neck structure with the GD mechanism, obtains global information by fusing features at different levels in a global scope, and injects global information into features at different levels for information interaction and fusion;
[0016] Head network, including:
[0017] The classification submodule is used to predict the class probability of each bounding box;
[0018] The regression submodule is used to predict the bounding box coordinates and objectness score of each feature point, and obtain the final prediction results of each feature layer by applying the non-maximum suppression (NMS) algorithm to remove redundant and overlapping bounding boxes.
[0019] Preferably, the backbone network Backbone introduces a C2f-DySnakeConv module to fuse information from features and Euclidean space to enhance the feature matrix;
[0020] At the end of the backbone network, the SPPF module is connected to the dual-layer routing attention mechanism BiLevelRoutingAttention to focus on global dimensional features with more flexible computing allocation and content awareness.
[0021] Preferably, the classification submodule is used to predict the class probability of each bounding box, and two 3×3 convolutions and one 1×1 convolution are applied to each feature layer. The output of the 1×1 convolution is normalized using the softmax function to generate the probability distribution of each category, and the cross entropy loss is used to measure the difference between the predicted probability and the true label. The formula is:
[0022]
[0023] Among them, Softmax(x i ) represents the input vector x i The probability distribution of H(p,q) represents the cross entropy, p(x) represents the true label distribution, q(x) represents the distribution predicted by the model, and x i represents the i-th input vector, and j represents the total number of vectors.
[0024] Preferably, the regression submodule is used to predict the bounding box coordinates and objectness score of each feature point, and a 3×3 convolution and a 1×1 convolution are applied to each feature layer. The output of the 1×1 convolution is compressed to the range [0,1] using the sigmoid function, and the difference between the predicted value and the true value is measured using the BCE loss, which is:
[0025]
[0026] Among them, σ(z) represents the possibility that the sample belongs to a certain category, y represents the true label vector, Represents the predicted output vector of the model, which contains the predicted probability that each sample belongs to the positive class. N represents the number of samples, and y i represents the true label of the i-th sample, It indicates the probability that the model believes that the sample belongs to the positive class, and z indicates the predicted value used to calculate the horizontal coordinate of the center point of the target box.
[0027] Preferably, the CD mechanism comprises:
[0028] Information alignment module FAM, used to collect and align features of different sizes at different levels;
[0029] The information fusion module IFM is used to fuse the aligned features through convolution and Transformer operators to obtain global information;
[0030] The information injection module Inject is used to inject global information into different levels.
[0031] Preferably, the GD mechanism replaces the upsampling fusion stage and the downsampling fusion stage of PANet with Low-GD and High-GD respectively.
[0032] Preferably, the step S3: performing image preprocessing on the subway tunnel crack image comprises:
[0033] Step S3.1: grayscale processing and preliminary denoising of the subway tunnel crack image are performed to form a grayscale denoised image;
[0034] Step S3.2: adjusting the brightness of the grayscale denoised image by gamma correction nonlinear transformation, and adjusting the contrast of the grayscale denoised image by Retinex theory and contrast limited adaptive histogram equalization CLAHE;
[0035] Step S3.3: converting the grayscale denoised image into a binary image using adaptive binarization;
[0036] Step S3.4: Remove scattered point interference and block interference in the binary image by setting the area threshold and rectangularity threshold respectively.
[0037] Preferably, the step S5: calculating the crack length and crack width based on the crack skeleton and according to the pixel connection mode comprises:
[0038] The line between the pixel center points in the crack skeleton image is taken as the length direction, and the skeleton pixel length of different pixel connection methods is taken as the crack length. The calculation formula is:
[0039] L c =L f +L d
[0040]
[0041] Among them, L c Indicates the crack length, L fThe length of the skeleton pixel representing the horizontal pixel connection mode and the vertical pixel connection mode, L d The length of the skeleton pixel representing the diagonal pixel connection mode and the anti-diagonal pixel connection mode, A n , B n are the number of groups corresponding to the pixel connection mode, n is the number of connected pixels, and D represents the actual width represented by the pixel;
[0042] The normal line perpendicular to the length direction is taken as the width direction line, and the crack area occupied by the normal line is taken as the crack width. The calculation formula is:
[0043]
[0044] w jf =n·D
[0045] Among them, w id represents the length of the i-th width direction line in the diagonal direction, w jf It represents the length of the jth width direction line in the vertical or horizontal direction, n represents the number of pixels occupied by the width direction line, and D represents the actual width represented by the pixel.
[0046] Compared with the prior art, the subway shield tunnel crack segmentation and measurement method provided by the present invention has the following beneficial effects: crack segmentation is performed on subway shield tunnel images based on the improved YOLOv8-GSD model, and a method combining gamma correction and RCLAHE theory is introduced to accurately measure crack width and length information.
[0047] The present invention also provides a subway shield tunnel crack segmentation measurement system, the system comprising:
[0048] An image acquisition module, used to acquire images of subway shield tunnels containing cracks;
[0049] A segmentation module is used to perform crack segmentation on the collected subway shield tunnel images based on the improved YOLOv8-GSD model to form a subway tunnel crack image;
[0050] An image preprocessing module, used for performing image preprocessing on subway tunnel crack images;
[0051] The crack skeleton extraction module is used to extract the crack area of the subway tunnel crack image after image preprocessing according to the multi-seed region growth method, and extract the crack skeleton of the crack area through the thinning algorithm;
[0052] The calculation module is used for calculating the crack length and crack width based on the crack skeleton and the pixel connection mode.
[0053] Compared with the prior art, the beneficial effects of a subway shield tunnel crack segmentation measurement system provided by the present invention are the same as the beneficial effects of a subway shield tunnel crack segmentation measurement method described in the above technical solution, which will not be repeated here.
[0054] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0056] Figure 1 A flow chart of a subway shield tunnel crack segmentation measurement method provided by an embodiment of the present invention is shown;
[0057] Figure 2 A schematic diagram of the YOLOv8-GSD network structure provided in an embodiment of the present invention is shown;
[0058] Figure 3 A schematic diagram of a C2f module and a bottleneck structure provided in an embodiment of the present invention is shown;
[0059] Figure 4 It shows a schematic diagram of the structure of connecting the SPPF module at the tail of Backbone to BiLevelRoutingAttention provided by an embodiment of the present invention;
[0060] Figure 5 The Low-GD and High-GD parts of the GD mechanism structure provided by the embodiment of the present invention are shown;
[0061] Figure 6 It shows a schematic diagram of a width direction line provided by an embodiment of the present invention;
[0062] Figure 7 A schematic diagram showing the comparison of segmentation results of the YOLOv8-GSD model provided by an embodiment of the present invention and four other segmentation models is shown;
[0063] Figure 8 A schematic diagram showing the results of segmentation and splicing by the YOLOv8-GSD model provided in an embodiment of the present invention is shown;
[0064] Fig. 9A schematic diagram showing the results obtained after image preprocessing provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0065] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as limiting the present invention.
[0066] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0067] The embodiment of the present invention provides a method for measuring crack segmentation in a subway shield tunnel. Figure 1 FIG. 4 is a flow chart showing a method for measuring crack segmentation in a subway shield tunnel provided by an embodiment of the present invention. Figure 1 As shown, the method includes:
[0068] Step S1: Acquire a subway shield tunnel image containing cracks.
[0069] It should be noted that the subway shield tunnel image comes from the real-life image of a subway tunnel taken by the CCD camera on the subway tunnel inspection vehicle that has been marked. The system is integrated with 8 sets of industrial cameras, flash light supporting industrial computers, mileage measurement modules, synchronous control modules, etc. The detection efficiency is 3-15km / skylight. The camera consists of 8 independent cameras and a fill light system. The overall shooting angle is 290°, the camera horizontal resolution is 4096 pixels, the vertical resolution is 2168 pixels, the lens focal length is 16mm, the effective camera field of view is 36.25°, the camera overlap is 5.7°, and the overlap length is 0.23m. It can meet the field of view coverage of all shield ring angles above the track plate.
[0070] Step S2: Based on the improved YOLOv8-GSD model, crack segmentation is performed on the collected subway shield tunnel image to form a subway tunnel crack image.
[0071] It should be noted that the YOLOv8-GSD network structure is as follows Figure 2As shown, the improved YOLOv8-GSD network structure model includes:
[0072] The backbone network Backbone is used to extract features from the input subway shield tunnel image, collect semantic information, and enhance the feature matrix. Specifically, an image of size 320*320 is input into the backbone network Backbone for feature extraction, and the output feature matrix is calculated through the convolution layer.
[0073] The backbone network Backbone introduces the C2f-DySnakeConv module to fuse the information from the features and Euclidean space to enhance the feature matrix. That is, the c2f module combined with DySnakeConv (Dynamic Snake Convolution) fuses the information from the features and Euclidean space to enhance the feature matrix, and obtains three effective feature matrices of sizes 40x40x256, 20x20x512, and 10x10x512 respectively.
[0074] DySnakeConv aims to adaptively focus on slender and tortuous local structures. In order to focus on the complex geometric features of the target, the convolution kernel is given more flexibility by adding continuity constraints to the convolution kernel, so that each convolution position is based on its previous position and can freely choose the swing direction, thereby ensuring the continuity of the feeling while freely choosing, so as to accurately capture the characteristics of the tubular structure. The c2f feature extraction module structure in the original YOLOv8 is as follows: Figure 3 As shown, it includes a series of 3x3 convolution kernels and CSP bottlenecks. In the subway shield tunnel crack segmentation task, since the crack structure has the characteristics of tortuosity and slenderness, in order to make the module capture cracks more accurately, the present invention combines DySnakeConv with the c2f module into a C2f-DySnakeConv module to improve the detection ability of fine and weak local structural features and complex global morphology, so as to extract cracks with more accurate segmentation.
[0075] The SPPF module at the end of the backbone network Backbone is connected to the two-level routing attention mechanism BiLevelRoutingAttention to achieve more flexible computing allocation and content perception, so as to effectively integrate features of different scales and improve the accuracy of object detection.
[0076] BiLevelRoutingAttention aims to achieve more flexible computational allocation and content awareness through dual-layer routing to save computational and memory resources. By constructing a directed graph to determine the participation relationship between different key-value pairs, irrelevant key-value pairs are first filtered out at the coarse region level, and then fine-grained token-to-token attention is applied to the remaining candidate regions, namely the routing regions. The SPPF module aims to increase the receptive field and aggregate contextual information of different scales. Figure 4 As shown, the present invention adds BiLevelRoutingAttention after the SPPF module, which can help the model pay more attention to global dimensional features and improve the detection accuracy of cracks.
[0077] The neck network Neck is used to replace the original Neck structure with the GD mechanism. It obtains global information by fusing features of different levels on a global scale, and injects the global information into features of different levels for information interaction and fusion.
[0078] The GD (Gather-and-Distribute Mechanism) mechanism is adopted to replace the original Neck structure. The global information is obtained by fusing features of different levels on a global scale, and the global information is injected into features of different levels to achieve efficient information interaction and fusion and obtain three enhanced feature layers.
[0079] The original Yolov8 uses a FPN-like method for information fusion, allowing detection of objects of various scales. By combining low-level and high-level features, the semantic value of features can be improved, thereby improving detection accuracy. However, this structure increases the complexity of the model, resulting in longer training time and requiring more computing resources. Figure 5 As shown, the GD mechanism provided in the embodiment of the present invention replaces the upsampling fusion stage and downsampling fusion stage of PANet with Low-GD and High-GD respectively. The CD mechanism includes: an information alignment module FAM, which is used to collect and align features of different sizes at different levels; an information fusion module IFM, which is used to fuse the aligned features through convolution and Transformer operators to obtain global information; and an information injection module Inject, which is used to inject global information into different levels.
[0080] The present invention uses the GD mechanism in the Neck part of the model to globally fuse features at different levels to obtain global information and inject it into features at different levels, thereby achieving efficient information interaction and fusion. The information fusion capability of the Neck part is significantly enhanced without significantly increasing the delay, and the model's ability to perceive and extract various crack features is improved, and the ability to retain crack features during model segmentation is enhanced.
[0081] Head network, including:
[0082] The classification submodule is used to predict the class probability of each bounding box. Two 3×3 convolutions and one 1×1 convolution are applied to each feature layer. The output of the 1×1 convolution is normalized using the softmax function to generate the probability distribution of each category. The cross entropy loss is used to measure the difference between the predicted probability and the true label. The formula is:
[0083]
[0084] Among them, Softmax(x i ) represents the input vector x i The probability distribution of H(p,q) represents the cross entropy, p(x) represents the true label distribution, q(x) represents the distribution predicted by the model, and x i represents the i-th input vector, and j represents the total number of vectors.
[0085] The regression submodule is used to predict the bounding box coordinates and objectness score of each feature point. The non-maximum suppression (NMS) algorithm is applied to remove redundant and overlapping bounding boxes to obtain the final prediction results of each feature layer. Specifically, a 3×3 convolution and a 1×1 convolution are applied to each feature layer. The sigmoid function is used to compress the output of the 1×1 convolution to the range [0,1]. The BCE loss is used to measure the difference between the predicted value and the true value. The formula is:
[0086]
[0087] Among them, σ(z) represents the possibility that the sample belongs to a certain category, y represents the true label vector, Represents the predicted output vector of the model, which contains the predicted probability that each sample belongs to the positive class. N represents the number of samples, and y i represents the true label of the i-th sample, It indicates the probability that the model believes that the sample belongs to the positive class, and z indicates the predicted value used to calculate the horizontal coordinate of the center point of the target box.
[0088] The regression submodule outputs two types of values: bounding box coordinates and object scores. The final prediction results for each feature layer are obtained by applying the non-maximum suppression (NMS) algorithm to remove redundant and overlapping bounding boxes. The final prediction result is a set of bounding boxes, each with an object score and a class probability.
[0089] Step S3: performing image preprocessing on the subway tunnel crack image.
[0090] It should be noted that the step S3: performing image preprocessing on the subway tunnel crack image includes:
[0091] Step S3.1: grayscale the subway tunnel crack image and perform preliminary denoising to form a grayscale denoised image. Grayscale the subway tunnel crack image and perform preliminary denoising to remove the influence of noise such as Gaussian noise and salt and pepper noise.
[0092] Step S3.2: The brightness of the grayscale denoised image is adjusted by gamma correction nonlinear transformation, and the contrast of the grayscale denoised image is adjusted by Retinex theory and contrast limited adaptive histogram equalization CLAHE.
[0093] Due to the uneven lighting in most areas of the subway tunnel, some images have low contrast, which affects the image quality and makes the crack features unclear. Therefore, the present invention combines gamma correction with Regional Contrast Limited Adaptive Histogram Equalization (RCLAHE) to adjust the brightness and contrast of the image to make the image brightness balanced.
[0094] Gamma correction is based on the mathematical principle of the gamma function. It adjusts the display brightness of the image by performing a nonlinear transformation on the grayscale value of the image. It is usually expressed in the following form:
[0095]
[0096] Among them, V out is the output grayscale value; A is a constant, usually used as a scaling factor to adjust the output V out The amplitude is usually set to 1; V in is the input grayscale value; γ is the gamma value. When γ is less than 1, it is called gamma correction, and when γ is greater than 1, it is called gamma compression.
[0097] After gamma correction, the crack area in the grayscale image has a low contrast, so the image is processed by RCLAHE to enhance the crack area in the image. RCLAHE combines two main technologies: Retinex and Contrast Limited Adaptive Histogram Equalization (CLAHE) to achieve more effective image enhancement, improve visibility and details without distorting the natural features of the image, and thus effectively improve image quality.
[0098] Retinex handles illumination changes by separating the illumination and reflection components of an image and enhances the reflection component to improve the visual quality of the image. The principle expression is as follows:
[0099] G(x,y)=L(x,y)*G σ (x,y)
[0100] R(x,y)=L(x,y)-G(x,y)
[0101] E(x,y)=R′(x,y)+G(x,y)
[0102] where G(x,y) is the illumination component; G σ (x, y) is the Gaussian kernel; L(x, y) is the original image after logarithmic transformation; R(x, y) is the reflection component; R′(x, y) is the enhanced reflection component; E(x, y) is the final output image.
[0103] CLAHE is a variant of histogram equalization, which can perform adaptive histogram equalization in local areas of the image to avoid the problem of excessive contrast enhancement in global histogram equalization. The image is divided, histogram equalization is performed on each sub-image, and contrast is limited at the same time to limit the pixel values in the histogram to a specific contrast range. Finally, the pixels in all blocks are recombined into the final CLAHE enhanced image.
[0104] Step S3.3: Adaptive binarization is used to convert the grayscale denoised image into a binary image.
[0105] After RCLAHE processing, the image is then adaptively binarized to convert the grayscale denoised image into a binary image.
[0106] Step S3.4: Remove scattered point interference and block interference in the binary image by setting the area threshold and rectangularity threshold respectively.
[0107] In the binary image, in addition to cracks, there are other interference areas in the original image that are not noise, which can be divided into scattered interference and block interference. Scattered interference appears as free scattered points in the binary image, which are composed of a single or a few pixels. Block interference is composed of a large number of pixels. The embodiment of the present invention removes scattered interference by setting an area threshold and removes block interference by setting a rectangular threshold.
[0108] Step S4: extract the crack region of the subway tunnel crack image after image preprocessing according to the multi-seed region growing method, and extract the crack skeleton of the crack region through the thinning algorithm.
[0109] It should be noted that the crack region is extracted through multiple seed region growing algorithms to obtain the final crack image. When the previous image processing generates a binary image of the crack, the crack region is a black pixel. The seed region growing algorithm is applied to extract only the black pixels in the image and invert the pixels. Finally, the final extracted image of the crack is obtained, in which the crack region is inverted to white pixels and the rest are black pixels. Finally, the thinning algorithm is applied to gradually reduce the width of the crack edge in the binary image. The crack edge pixels are gradually thinned toward the center until the edge is finally reduced to a line with a single pixel width. Its path corresponds to the shape of the original crack edge. The final line is used as the skeleton line of the crack.
[0110] Step S5: Based on the crack skeleton, the crack length and crack width are calculated according to the pixel connection mode.
[0111] It should be noted that in the crack skeleton image, the crack skeleton is composed of single pixels with a width of one pixel. The connection modes between pixels can be divided into four types: horizontal connection, vertical connection, diagonal connection and anti-diagonal connection. Based on this feature, the skeleton pixels are classified according to the connection mode, and each category is further grouped according to the number of connected pixels.
[0112] When calculating the crack length, the embodiment of the present invention uses the line between the pixel center points in the crack skeleton map as the length direction, uses the skeleton line length as the crack length, and calculates the crack length through the pixel width. The calculation formula is as follows:
[0113] L c =L f +L d
[0114]
[0115] Where L c Represents the crack length measurement, L f is the skeleton pixel length of the two categories of horizontal connection and vertical connection, L d is the skeleton pixel length of the two categories of diagonal connection and anti-diagonal connection, A n , B n is the number of groups corresponding to the category, n is the number of connected pixels, and D is the actual width represented by the pixel.
[0116] Since most cracks are tortuous and twisted, the crack width cannot be represented by a single width direction line. The embodiment of the present invention is based on the crack skeleton line pixel group, calculates the width direction line corresponding to each pixel group, and uses the obtained width direction line to represent the true width direction of the crack area where the pixel group is located. The width of the crack area is obtained by calculating the number of pixels in the crack area occupied by the width direction line.
[0117] like Figure 6As shown, in the image, each pixel is a square of the same size. D refers to the width represented by the skeleton pixel in the actual scene, which is also the width represented by each pixel in the actual scene. c , L f , L d is the calculated crack length. When calculating the crack width, the normal line perpendicular to the length direction is used as the width direction line, and the crack area occupied by the normal line is used as the calculated crack width. Figure 6 As shown, considering that most of the cracks are tortuous, twisted, and elongated, a single or a few width direction lines cannot be used to represent the overall width distribution of the crack during calculation. Therefore, an embodiment of the present invention is based on crack skeleton line pixel grouping, and divides an entire crack into several areas according to the direction of pixel connection and the number of connected pixels through grouping. The width direction line corresponding to each pixel group is calculated, and the obtained width direction line represents the true width direction of the crack area where the pixel group is located. The crack width value of each area is obtained by calculating the number of pixels in the crack area occupied by the width direction line, and finally the detailed width distribution of the entire crack is obtained. Figure 6 Each blue line is the width direction line of this small crack area, and the length of the direction line is the width of the area. By calculating the width values of all areas in turn, the width distribution of the crack can be statistically analyzed. When calculating, the basis is still the width of the pixel point. When calculating the crack width, based on the perpendicularity between the crack width direction and the length direction, the normal line in the crack length direction is used as the width direction line, and the crack width is calculated based on the number of pixels occupied by the normal line in the crack area. The calculation formula is:
[0118]
[0119] w jf =n·D
[0120] Among them, w id represents the length of the i-th width direction line in the diagonal direction, w jf It represents the length of the jth width direction line in the vertical or horizontal direction, n represents the number of pixels occupied by the width direction line, and D represents the actual width represented by the pixel.
[0121] Experimental verification
[0122] 1. Dataset processing
[0123] The crack dataset comes from the real-life images of a subway tunnel taken by the CCD camera on the subway tunnel inspection vehicle that has been labeled. The system is integrated with 8 sets of industrial cameras, flash light supporting industrial computers, mileage measurement modules, synchronous control modules, etc. The detection efficiency is 3-15km / skylight. The camera consists of 8 independent cameras and a fill light system. The overall shooting angle is 290°, the camera horizontal resolution is 4096 pixels, the vertical resolution is 2168 pixels, the lens focal length is 16mm, the effective camera field of view is 36.25°, the camera overlap is 5.7°, and the overlap length is 0.23m. It can meet the field of view coverage of all shield ring angles above the track plate. Since the cracks are very slender, the proportion in the image is usually less than 1%. In order to achieve the best training effect for the crack segmentation model, this paper adopts the method of cropping the image, segmenting and then splicing to segment the cracks. In addition to annotating the cracks, targets with similar features to cracks such as scratches and seams are also annotated and classified as other categories. The image resolution of the image set is adjusted to 4160*2240 and then cropped to 320*320. At the same time, the crack annotation coordinates are updated, and the crack annotation file of the sub-image set is calculated and generated; the area threshold is set. If there are crack areas in the cropped sub-image that are partly annotated in the original image and the proportion exceeds 20%, they are saved as normal samples, and the sub-images that do not meet the conditions and the sub-image set without crack areas are deleted as abnormal samples; the normal samples are rotated, sharpened, adjusted in brightness, and noise is added to make them more suitable for the complex and dim environment of the tunnel. Through the above operations, the generalization ability, anti-interference ability and robustness of the model can be improved while amplifying the image of small cracks in the tunnel, and the accuracy of the model can be improved, so that the model can distinguish cracks more accurately.
[0124] 2. Model training
[0125] After preprocessing, this paper uses 6374 images in the training set and 1001 images in the validation set for model training and evaluation. The training platform uses pycharm, python 3.8 and pytorch 2.0.1, Windows 10 system, RTX4090 graphics card, 24G video memory, i9-13900K CPU, 32G memory, and 32 training batches.
[0126] 3. Model Evaluation
[0127] In deep learning, the commonly used model evaluation indicators are Precision, Recall, F1-Score and mAP. Precision refers to the proportion of samples predicted as positive that are actually positive; Recall refers to the proportion of positive samples that are correctly predicted as positive; F1-Score refers to the harmonic mean of precision and recall; mAP refers to the average accuracy of all categories. The expressions of the four indicators are as follows:
[0128]
[0129] Among them, TP is the crack sample correctly predicted by the model; FP is the crack sample incorrectly predicted by the model; FN is the crack sample not predicted by the model; TN is the non-crack sample correctly predicted; N is the number of all categories; AP i is the average precision of the i-th class.
[0130] Due to a series of enhancements to feature perception and feature information fusion, the accuracy of model segmentation is also improved. The PR curve in the model evaluation index shows that the mAP index is 0.655, the crack AP index score is 0.824, and the interference category AP index is 0.487; the model F1 curve shows that the F1 index score reaches 0.65 when the confidence level is 0.448; it can be seen that the model proposed in this paper has high accuracy for crack segmentation and strong adaptability to subway shield tunnels.
[0131] In the instance segmentation task, in addition to evaluation indicators such as F1, mAP, and Recall, mIoU is also an important evaluation parameter. The IoU is obtained by calculating the ratio of the intersection and union between the area predicted by the model and the area of the true label. The IoU value of each category is then analyzed as a whole to measure the correlation between the area predicted by the model and the area of the true label. This is used to evaluate the segmentation quality of the model. The higher the correlation, the higher the value.
[0132]
[0133] Among them, Intersection represents the number of pixels of the intersection of the predicted mask and the true label mask; Union represents the number of pixels of their union.
[0134] 4. Model comparison
[0135] In this embodiment of the present invention, four different segmentation network algorithms are selected for comparative experiments, namely YOLOv8x, BlendMask, SOLOv2 and YOLACT. The same data set is used for training, and the superiority of the segmentation accuracy and segmentation quality of the YOLOv8-GSD model is verified by the mAP and mIoU indicators.
[0136] Table 1 Comparison with traditional segmentation models
[0137]
[0138] Table 1 shows the performance indicators of each segmentation model, among which the mIoU indicators of YOLOv8x, BlendMask, SOLOv2 and YOLACT are 0.757, 0.680, 0.713 and 0.717 respectively, while the mIoU indicator of the YOLOv8-GSD model is 0.812, which are all higher than the other four comparison models. On the other hand, the crack AP value of the YOLOv8-GSD model is 0.824, which is 4.1% higher than that of the YOLOv8x segmentation model. The AP value of the interference category is 11.1% lower than that of the YOLOv8x segmentation model, resulting in a corresponding 3.6% lower mAP indicator, indicating that the model is more accurate in detecting and segmenting cracks and can better identify real cracks. The decrease in the AP value of the other category means that the model has become more cautious in distinguishing some non-crack interference elements with similar crack features, thereby reducing the possibility of misjudgment. This is a positive sign of model optimization, indicating that the model is learning how to better identify and distinguish key features, proving that the model has a high sensitivity to tunnel crack features.
[0139] like Figure 7 As shown in the figure, when some crack features are not obvious, YOLOv8x, BlendMask, SOLOv2 and YOLACT can locate the crack position but the crack segmentation range is incomplete, which will lead to measurement errors in subsequent image processing due to incomplete crack information. However, the YOLOv8-GSD model can still achieve accurate crack location and segmentation with a wider field of view perception range and stronger feature extraction and analysis capabilities. Figure 8 As shown in the figure, the model has stronger adaptability to slender cracks in tunnels, proving that the performance of the model in the subway tunnel crack segmentation task is better than other segmentation models.
[0140] 5. Crack measurement
[0141] In subway shield tunnels, cracks can cause serious damage to tunnel structure safety and subway operation safety. In order to assess the crack hazard level, it is crucial to extract the length and width of the cracks. After the crack segmentation map is obtained by the model, a series of digital image processing as described above is performed on it. The crack skeleton is extracted and classified according to the pixel connection mode. Each category is grouped according to the number of connected pixels. The crack length is calculated by the skeleton pixel width; the crack width direction line is established based on the skeleton to determine the width of the crack area where each pixel group is located, thereby completing the crack length and width measurement.
[0142] Fig. 9The figure shows the results from image segmentation to image pre-processing, i.e., the aforementioned RCLAHE, gamma correction, image denoising, crack thinning, etc., and finally extracting the crack skeleton and establishing the width direction line. The first column is the crack image segmented by the YOLOv8-GSD model proposed in this paper; the second column is the crack binary image generated by the crack segmentation image after gamma correction, RCLAHE and denoising; the third column is the crack skeleton image obtained after thinning; the fourth column is the width direction line of the crack area, where the blue line represents the width direction line of the crack area where the pixel group is located.
[0143] Table 2 Crack length measurement and calculation
[0144]
[0145]
[0146] Table 3 Statistics of the number of pixels in the crack area occupied by the width direction line of C2 crack
[0147]
[0148] Table 4 Comparison of the maximum and average values of crack width measurement with the actual values
[0149]
[0150] Table 3 gives the comparison between the measured values and the actual values of the cracks, Table 4 gives the number of pixels of the first 20 widths measured in the C2 crack, and Table 5 gives the comparison between the measured values and the actual values of the maximum width and average width of the cracks. It can be seen that the error between the measured values and the actual values is within 5%. The main reason for the error is that when the crack segmentation image is pre-processed by gamma correction, RCLAHE, etc., some crack edge pixels and background pixels adjacent to the crack edge are over-corrected, resulting in almost the same grayscale values of the two after processing, causing some crack edge areas to expand or shrink during adaptive binarization, and ultimately causing errors between the calculated value and the actual value.
[0151] The mAP and mIoU indicators of the crack segmentation model proposed in the embodiment of the present invention are 0.655 and 0.812 respectively, among which the crack AP indicator is 0.824 and the interference category AP indicator is 0.487. Compared with other models, the crack detection and segmentation accuracy of the model has a great advantage. It can quickly identify and segment cracks while completely retaining crack information. Compared with the actual length and width, the key information of crack length and width is measured with an error of 5%, which is of great significance to maintaining the structural safety and operational safety of subways.
[0152] Compared with the prior art, the subway shield tunnel crack segmentation measurement method provided by the embodiment of the present invention has the following beneficial effects:
[0153] 1. A YOLOv8-GSD model for crack segmentation in subway shield tunnels is proposed. DySnakeConv is introduced in the c2f feature extraction module, BiLevelRoutingAttention is introduced in the backbone structure, and the neck structure is replaced by the Gather-and-Distribute Mechanism mechanism to enhance the model's field of view perception and feature information extraction capabilities, quickly identify and segment cracks while fully retaining crack information, and improve sensitivity to cracks.
[0154] 2. A crack image processing method based on gamma correction and RCLAHE theory is proposed. The crack length and width information is calculated through the crack skeleton and compared with the actual length and width. The key information of crack length and width can be measured with an error of 5%, which is of great significance to maintaining the structural safety and operational safety of subways.
[0155] The embodiment of the present invention further provides a subway shield tunnel crack segmentation measurement system, the system comprising:
[0156] An image acquisition module, used to acquire images of subway shield tunnels containing cracks;
[0157] A segmentation module is used to perform crack segmentation on the collected subway shield tunnel images based on the improved YOLOv8-GSD model to form a subway tunnel crack image;
[0158] An image preprocessing module, used for performing image preprocessing on subway tunnel crack images;
[0159] The crack skeleton extraction module is used to extract the crack area of the subway tunnel crack image after image preprocessing according to the multi-seed region growth method, and extract the crack skeleton of the crack area through the thinning algorithm;
[0160] The calculation module is used for calculating the crack length and crack width based on the crack skeleton and the pixel connection mode.
[0161] Compared with the prior art, the beneficial effects of a subway shield tunnel crack segmentation measurement system provided by an embodiment of the present invention are the same as the beneficial effects of a subway shield tunnel crack segmentation measurement method described in the above technical solution, which will not be repeated here.
[0162] In addition, an embodiment of the present invention also provides an electronic device, including a bus, a transceiver, a memory, a processor, and a computer program stored in the memory and run on the processor. The transceiver, the memory and the processor are respectively connected via a bus. When the computer program is executed by the processor, each process of the above-mentioned subway shield tunnel crack segmentation measurement method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0163] In addition, an embodiment of the present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned subway shield tunnel crack segmentation measurement method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0164] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technical solution that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A method for measuring crack segmentation in a subway shield tunnel, characterized in that: include: Step S1: collecting images of subway shield tunnels containing cracks; Step S2: performing crack segmentation on the collected subway shield tunnel image based on the improved YOLOv8-GSD model to form a subway tunnel crack image; Step S3: performing image preprocessing on the subway tunnel crack image; Step S4: extracting the crack region of the subway tunnel crack image after image preprocessing according to the multi-seed region growing method, and extracting the crack skeleton of the crack region by using the thinning algorithm; Step S5: Based on the crack skeleton, the crack length and crack width are calculated according to the pixel connection mode.
2. A subway shield tunnel crack segmentation measurement method according to claim 1, characterized in that: The improved YOLOv8-GSD model includes: The backbone network Backbone is used to extract features from the input subway shield tunnel image, collect semantic information, and enhance the feature matrix; Neck network, which is used to replace the original Neck structure with the GD mechanism, obtains global information by fusing features at different levels in a global scope, and injects global information into features at different levels for information interaction and fusion; Head network, including: The classification submodule is used to predict the class probability of each bounding box; The regression submodule is used to predict the bounding box coordinates and objectness score of each feature point, and obtain the final prediction results of each feature layer by applying the non-maximum suppression (NMS) algorithm to remove redundant and overlapping bounding boxes.
3. A subway shield tunnel crack segmentation measurement method according to claim 2, characterized in that: The backbone network Backbone introduces the C2f-DySnakeConv module to fuse information from features and Euclidean space to enhance the feature matrix; At the end of the backbone network, the SPPF module is connected to the dual-layer routing attention mechanism BiLevelRoutingAttention to focus on global dimensional features with more flexible computing allocation and content awareness.
4. A subway shield tunnel crack segmentation measurement method according to claim 2, characterized in that: The classification submodule is used to predict the class probability of each bounding box. Two 3×3 convolutions and one 1×1 convolution are applied to each feature layer. The output of the 1×1 convolution is normalized using the softmax function to generate the probability distribution of each category. The cross entropy loss is used to measure the difference between the predicted probability and the true label. The formula is: Among them, Softmax(x i ) represents the input vector x i The probability distribution of H(p,q) represents the cross entropy, p(x) represents the true label distribution, q(x) represents the distribution predicted by the model, and x i represents the i-th input vector, and j represents the total number of vectors.
5. The method for measuring crack segmentation in a subway shield tunnel according to claim 2, characterized in that: The regression submodule is used to predict the bounding box coordinates and objectness score of each feature point. A 3×3 convolution and a 1×1 convolution are applied to each feature layer. The sigmoid function is used to compress the output of the 1×1 convolution to the range [0,1]. The BCE loss is used to measure the difference between the predicted value and the true value. The formula is: Among them, σ(z) represents the possibility that the sample belongs to a certain category, y represents the true label vector, Represents the predicted output vector of the model, which contains the predicted probability that each sample belongs to the positive class. N represents the number of samples, and y i represents the true label of the i-th sample, It indicates the probability that the model believes that the sample belongs to the positive class, and z indicates the predicted value used to calculate the horizontal coordinate of the center point of the target box.
6. A subway shield tunnel crack segmentation measurement method according to claim 2, characterized in that: The CD mechanism includes: Information alignment module FAM, used to collect and align features of different sizes at different levels; The information fusion module IFM is used to fuse the aligned features through convolution and Transformer operators to obtain global information; The information injection module Inject is used to inject global information into different levels.
7. A subway shield tunnel crack segmentation measurement method according to claim 2, characterized in that: The GD mechanism replaces the upsampling fusion stage and the downsampling fusion stage of PANet with Low-GD and High-GD respectively.
8. The method for measuring crack segmentation in a subway shield tunnel according to claim 1, characterized in that: The step S3: performing image preprocessing on the subway tunnel crack image comprises: Step S3.1: grayscale processing and preliminary denoising of the subway tunnel crack image are performed to form a grayscale denoised image; Step S3.2: adjusting the brightness of the grayscale denoised image by gamma correction nonlinear transformation, and adjusting the contrast of the grayscale denoised image by Retinex theory and contrast limited adaptive histogram equalization CLAHE; Step S3.3: converting the grayscale denoised image into a binary image using adaptive binarization; Step S3.4: Remove scattered point interference and block interference in the binary image by setting the area threshold and rectangularity threshold respectively.
9. A subway shield tunnel crack segmentation measurement method according to claim 1, characterized in that: The step S5: based on the crack skeleton, calculating the crack length and crack width according to the pixel connection mode, comprises: The line between the pixel center points in the crack skeleton image is taken as the length direction, and the skeleton pixel length of different pixel connection methods is taken as the crack length. The calculation formula is: L c =L f +L d Among them, L c Indicates the crack length, L f The length of the skeleton pixel representing the horizontal pixel connection mode and the vertical pixel connection mode, L d The length of the skeleton pixel representing the diagonal pixel connection mode and the anti-diagonal pixel connection mode, A n , B n are the number of groups corresponding to the pixel connection mode, n is the number of connected pixels, and D represents the actual width represented by the pixel; The normal line perpendicular to the length direction is taken as the width direction line, and the crack area occupied by the normal line is taken as the crack width. The calculation formula is: w jf =n·D Among them, w id represents the length of the i-th width direction line in the diagonal direction, w jf It represents the length of the jth width direction line in the vertical or horizontal direction, n represents the number of pixels occupied by the width direction line, and D represents the actual width represented by the pixel.
10. A subway shield tunnel crack segmentation measurement system, characterized in that: include: An image acquisition module, used to acquire images of subway shield tunnels containing cracks; A segmentation module is used to perform crack segmentation on the collected subway shield tunnel images based on the improved YOLOv8-GSD model to form a subway tunnel crack image; An image preprocessing module, used for performing image preprocessing on subway tunnel crack images; The crack skeleton extraction module is used to extract the crack area of the subway tunnel crack image after image preprocessing according to the multi-seed region growth method, and extract the crack skeleton of the crack area through the thinning algorithm; The calculation module is used for calculating the crack length and crack width based on the crack skeleton and the pixel connection mode.
Citation Information
Cited By
Tunnel lining crack parameter quantification and safety evaluation method based on digital image
CN120375056A