Tunnel rock mass hole surrounding rock fissure detection method, computer device and readable storage medium
By improving the YOLOv8-seg model for detecting cracks inside tunnel boreholes, the problem of insufficient high-precision automated detection in existing technologies has been solved. This has enabled accurate crack detection and automated parameter extraction, thereby improving the accuracy and efficiency of the detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA RAILWAY 19 BUREAU GRP CO LTD
- Filing Date
- 2026-04-27
- Publication Date
- 2026-07-10
AI Technical Summary
Existing tunnel borehole camera devices and supporting crack detection systems are insufficient in terms of high-precision and automated detection, making it difficult to meet the high-precision requirements of tunnel borehole detection. Furthermore, crack identification relies on manual visual observation, which is easily affected by subjective judgment bias.
An improved YOLOv8-seg model is used for crack detection. It combines depthwise separable convolution, cross-stage local attention module and dynamically weighted Focal Loss for image preprocessing and panoramic unfolding, thereby improving the accuracy and automation of crack detection.
It enables precise detection and segmentation of cracks inside tunnel boreholes, automatically extracts geometric parameters, improves the accuracy and efficiency of detection, and reduces subjective bias caused by human intervention.
Smart Images

Figure CN122368014A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of tunnel and underground engineering inspection technology, specifically to a method for detecting fractures in the surrounding rock inside a tunnel rock mass, a computer device, and a readable storage medium. Background Technology
[0002] In the field of tunnels and underground engineering, the stability of the surrounding rock directly determines the safety level of the tunnel project. Cracks, as the main manifestation of damage to the surrounding rock, have their development degree, distribution characteristics, and geometric parameters serving as the core basis for assessing the stability of the surrounding rock, predicting engineering risks, and formulating reinforcement measures. Therefore, accurate and efficient detection of cracks in the surrounding rock within tunnel inspection boreholes is a crucial aspect of tunnel and underground engineering safety monitoring.
[0003] Existing tunnel borehole camera devices and supporting crack detection systems still face many technical bottlenecks in practical engineering applications, making it difficult to meet the core requirements of high precision and automation for tunnel borehole inspection.
[0004] From the perspective of image acquisition inside the borehole, tunnel inspection boreholes generally have special environments characterized by narrow space, insufficient lighting, high humidity, and a lot of dust. Existing camera devices lack targeted adaptation designs, resulting in problems such as blurriness, noise, reflection, and distortion in the acquired images. This makes it impossible to provide a clear and reliable data source for subsequent crack identification, thus affecting the accuracy of crack identification from the source.
[0005] In the crack detection process, the existing systems have a low level of intelligence. Most can only achieve basic image acquisition functions. Crack identification and analysis still rely heavily on manual visual observation, which not only greatly reduces detection efficiency, but is also affected by factors such as subjective judgment bias of the inspectors, and is prone to problems such as measurement deviation of crack geometric parameters. Summary of the Invention
[0006] The primary objective of this invention is to provide a method for detecting fractures in the surrounding rock inside tunnel boreholes, thereby improving the accuracy of fracture detection.
[0007] The method for detecting surrounding rock fissures in tunnel rock masses provided by the first objective of this invention includes an image preprocessing step, a fissure detection step, and a fissure analysis step. The image preprocessing step includes sequentially performing an image enhancement step, an illumination unevenness correction step, and a panoramic unfolding processing step. In the image preprocessing step, the acquired original image data is subjected to the image enhancement and illumination unevenness correction steps to obtain corrected image data. In the panoramic unfolding processing step, the pixel values of each pixel in the unfolded image are calculated based on the corrected image data and a preset transformation model. The unfolded image is then traversed to generate a panoramic unfolded image. The fissure detection step includes using a trained improved YOLOv8-seg model to infer the panoramic unfolded image and output pixel-level segmentation results of the fissures. The improved YOLOv8-seg model introduces depthwise separable convolution (DSconv) and a cross-stage local attention module (CSLA), and improves the pixel loss function based on dynamically weighted Focal Loss. The fissure analysis step includes quantitative extraction of geometric parameters and connectivity analysis of the pixel-level segmentation results of the fissures.
[0008] As can be seen from the above scheme, in the image enhancement step of the method of the present invention, the acquired original image is converted from the RGB color space to the HSV color space. Since the chromaticity (H) and saturation (S) components mainly carry color information and are not directly related to the light intensity, this step only processes the luminance component (V) to preserve the true color of the image. In the uneven illumination correction step, the image processed by the image enhancement module is received, and a correction method based on luminance distribution model fitting is used to perform low-pass filtering on the input image to estimate the background luminance distribution of the image. In the panoramic unfolding correction step, the circular image is converted into a rectangular planar panoramic unfolded image. In the fracture detection step, an improved YOLOv8-seg instance segmentation model is constructed. By introducing depthwise separable convolution, cross-stage local attention modules, and dynamically weighted Focal Loss, it adapts to the slender, tortuous, and multi-scale geometric features of tunnel borehole wall fractures, achieving accurate detection and segmentation of fractures at different scales. For the quantitative extraction of geometric parameters and connectivity analysis of intelligently detected fractures, a path planning algorithm is introduced into fracture network analysis. AI algorithms quantify the spatial connectivity between fractures, achieving a two-dimensional evaluation of rock mass fracturing and connectivity, providing a quantitative basis for rock mass quality assessment. Therefore, the tunnel borehole fracture detection method of this invention effectively improves the accuracy of fracture detection in tunnel inspection boreholes.
[0009] A further approach involves using the trained improved YOLOv8-seg model to infer the panoramic unfolded image and output pixel-level segmentation results for the cracks. This includes: the improved YOLOv8-seg model outputting a probability map of the same size as the panoramic unfolded image, where the value of each pixel represents the probability that the pixel belongs to a crack; and using the maximum inter-class variance method, calculating the optimal segmentation threshold of the probability map according to the following formula, thereby converting the probability map into an initial binary segmentation map.
[0010] in, For the initial binary segmentation image at pixel coordinates The value at that location, For the probability map at pixel coordinates The value at that location, The optimal segmentation threshold is [value].
[0011] A further approach involves using the maximum inter-class variance method to calculate the optimal segmentation threshold of the probability map according to the following formula. After converting the probability map into an initial binary segmentation map, the method further includes: performing morphological closing operations on the initial binary segmentation map to fill the small holes inside the cracks, connecting the fractured cracks; first, using a structural kernel to traverse the image, extending the crack mask outward by 2 pixels to temporarily fill the holes; then, using the same kernel to shrink the edges, restoring the original contour while retaining the filled holes; and using an area threshold filtering method to calculate the area of each connected component in the initial binary segmentation map. Set area threshold For 100 pixels, for all satisfying It is determined to be residual noise and its pixel value is set as the background color; Canny edge detection is used to perform edge optimization processing on the preserved crack area to generate a processed binary segmentation map containing only edge information.
[0012] As can be seen above, it is determined to be residual noise and its pixel value is set as the background color, which effectively filters out small discrete noise points that were not cleared in the closing operation. Canny edge detection is used to perform edge optimization processing on the retained crack area, capture the abrupt change in the crack contour, and generate a binary map containing only edge information. The edge map is combined with the closing operation mask to ensure that the subsequent crack parameter extraction can accurately identify the crack boundary.
[0013] A further approach involves a step of quantitatively extracting geometric parameters from the pixel-level segmentation results of the cracks. This includes extracting the following geometric parameters for each segmented crack based on its skeleton and binary region, according to the processed binary segmentation image: crack trace length, average crack width, crack density, and the 3D coordinate transformation used to calculate the crack's 3D dip angle and dip direction. Specifically, for each crack segmented from the processed binary segmentation image, its skeleton is composed of an ordered set of pixels. Composition, length of crack trace The sum of the Euclidean distances between adjacent skeleton pixels:
[0014] in, For the first The coordinates of each pixel For the first The coordinates of each pixel This represents the total number of skeleton pixels; pixels are taken at equal intervals along the crack skeleton. At each sampling point, the span of the crack pixels within the binary region is statistically analyzed along the skeleton normal direction, and the average value is taken as the average width of the crack.
[0015] in, For the first The distance between the gap pixels along the normal direction at each sampling point The number of sampling points is determined by using the geometric mapping relationship between the hole wall unfolding diagram and the three-dimensional cylindrical surface to determine the two-dimensional pixel coordinates on the skeleton. Inverse calculation to three-dimensional coordinates in the borehole coordinate system Let the borehole radius be... The width of the panoramic unfolded image is The conversion relationship is as follows:
[0016]
[0017]
[0018]
[0019] in, For circumferential angle, Generate a 3D point set of the fracture skeleton for each pixel at the corresponding actual depth interval. The three-dimensional point set of the fracture skeleton is considered as a structural surface. The least squares method is used for plane fitting, and the plane equation is given as:
[0020] The normal vector is solved by minimizing the sum of the squared distances from each point to the plane. Calculate the three-dimensional dip angle of the fracture based on the normal vector. and tendencies :
[0021]
[0022] Wherein, the dip angle is the angle between the fracture surface and the horizontal plane, and the dip direction is... The direction angle of the projection of the fracture surface normal vector onto the horizontal plane; within the statistical region, calculate the fracture density. :
[0023] in, To count the total number of cracks in the area, For the first The length of the crack trace, This represents the area of the statistical region.
[0024] As can be seen from the above, in the parameter quantification step, for each segmented fracture, based on its skeleton and binary region, geometric parameters are automatically extracted: fracture trace length, fracture width, three-dimensional coordinate transformation to calculate the three-dimensional dip angle and dip direction of the fracture, fracture density, and output of refined geometric parameters for each fracture, providing basic data for connectivity analysis.
[0025] A further approach involves performing connectivity analysis on the pixel-level segmentation results of the cracks, which includes: constructing an undirected graph of the crack network using the intersections and endpoints of the crack skeleton as nodes and the skeleton segments as edges. Each node Record its three-dimensional spatial coordinates, each edge Connect adjacent nodes and And assign weights:
[0026] in, For the edge The corresponding skeleton segment length, This represents the average width of the crack segment. For a given starting point and the end point An AI algorithm is used to search for the optimal connected path. The evaluation function of the AI algorithm is:
[0027] in, The actual cost from the starting point to the current node. For the heuristic cost estimation from the current node to the destination, the AI algorithm path search heuristic function is:
[0028] in, The three-dimensional coordinates of the current node. Let be the three-dimensional coordinates of the target node. For the current node, For the target node; AI algorithm iteration execution is selected from the open list. Set the smallest node as the current node; move the current node into the closed list; for each neighboring node of the current node, calculate the new... If the value is better than the historical record, then update its parent node and... The value is added to the open list; until the endpoint is added to the closed list, or the open list is empty (no connected path). The optimal path obtained by the search Calculate the connectivity strength of the path :
[0029] in, The width of a single crack segment. The length of a single crack segment. The index of the edge; Perform connectivity analysis on all node pairs in the fracture network and construct the connectivity matrix. ,in Represents a node and If a connected path exists, the value is 0; otherwise, the value is 0. Calculating network connectivity based on the connectivity matrix:
[0030] in, Total number of nodes, connectivity Between 0 and 1.
[0031] As can be seen from the above, in the path analysis step, for complex fracture networks, an AI heuristic search algorithm is introduced to analyze fracture connectivity paths. Connectivity strength. The larger the value, the greater the overall width and short distance of the path, indicating that it is a dominant channel in the fracture network. The total length, average width, number of nodes, and other characteristics of the path are recorded to provide input for subsequent rock mass quality evaluation. Connectivity reflects the overall connectivity of the fracture network. The larger the value, the more developed the fracture network and the better its connectivity.
[0032] Another further approach is to improve the YOLOv8-seg model by having the C2f module of the Backbone part output to the depthwise separable convolution DSconv; and to improve the YOLOv8-seg model by having the C2f module of the Neck part output to the cross-stage local attention module CSLA, and then having the cross-stage local attention module CSLA of the Neck part output to the detection head of the Head part.
[0033] As can be seen from the above, this invention optimizes the backbone network of the YOLOv8-seg model. In the backbone part, depthwise separable convolutions replace the conventional convolutions in stages C3-C5. Depthwise separable convolutions split the standard convolution into channel-wise convolutions and pointwise convolutions. In the C3 module of YOLOv8, the conventional convolutional layer is located and replaced with a depthwise separable convolution structure. First, channel-wise convolutions are set with a kernel size of 3×3 and the number of groups equal to the number of input channels, allowing each channel to perform convolution operations independently. Then, pointwise convolutions are connected with a kernel size of 1×1 to achieve feature fusion between channels. In modules C4-C5, this part is responsible for processing high-dimensional features. During the replacement process, it is necessary to maintain a balance between computational load and feature extraction accuracy. Directly replacing it with depthwise separable convolution may lead to excessive feature fusion and loss of edge details of the crack due to the excessive number of channels in the pointwise convolution. The number of output channels of the pointwise convolution should be adjusted after the channelwise convolution is completed, so that it is slightly less than the number of channels of the original conventional convolution. In the Neck part, a cross-stage local attention module (CSLA) is introduced. Through the cascading of channel attention and spatial attention, it first focuses on the channel features related to the crack edge, and then locates the spatial position of the edge, which enhances the ability to identify the crack edge and focuses on the crack edge features. The cross-stage local attention module (CSLA) channel attention mines the contribution of different channels to the edge features, highlighting the channels closely related to the edge.
[0034] A further approach is to output the predicted probability for each pixel during the backpropagation stage of training the improved YOLOv8-seg model. Combined with the dynamic weight corresponding to that pixel Preset and The value of a single pixel is calculated using the dynamically weighted FocalLoss formula. loss: Dynamic weighted Focal Loss formula:
[0035] in, For the first The dynamically weighted Focal Loss value is calculated from each pixel. For the model to predict the first The probability of each pixel's category For the first Dynamic weights of each pixel To balance the weights for each category, For difficult samples, the modulation factor, For focusing parameters;
[0036] in, The pixel area of each crack instance. This is the adjustment coefficient; All The summation of losses yields the total loss, which is used to update and improve the YOLOv8-seg model.
[0037] As can be seen from the above, this setting optimizes the model's ability to segment cracks.
[0038] Another further approach involves an image enhancement step that includes converting the acquired raw image data from the RGB color space to the HSV color space to obtain process image data; performing logarithmic transformation preprocessing on the luminance component in the process image data; decomposing the process image data to obtain illumination and reflection components; performing adaptive gamma correction on the luminance of the illumination component; performing guided filtering on the reflection component; processing the luminance component using a hybrid space enhancement method; and converting the processed process image data from the HSV color space to the RGB color space to obtain enhanced image data. The illumination unevenness correction step includes a luminance distribution model-based fitting correction method; performing low-pass filtering on the enhanced image data to obtain image background luminance distribution data; constructing a two-dimensional Gaussian surface model with the same size as the enhanced image data to fit the image background luminance distribution data to obtain estimated illumination components; and calculating the corrected image data based on the enhanced image data, estimated luminance components, and a preset luminance adjustment factor.
[0039] As can be seen from the above, in the image enhancement step, the acquired original image is converted from the RGB color space to the HSV color space. Since the chromaticity (H) and saturation (S) components mainly carry color information and are not directly related to light intensity, this step only processes the luminance component (V) to preserve the true color of the image. Adaptive gamma correction is applied to the luminance component of the image to dynamically adjust the overall brightness of the image and avoid it being too bright or too dark. Guided filtering is applied to the reflection component to highlight the image edge information. A hybrid space enhancement method is used to process the luminance component (V) to further enhance image details and reconstruct the enhanced image. In the uneven illumination correction step, the image processed by the image enhancement module is received, and a correction method based on luminance distribution model fitting is used to perform low-pass filtering on the input image to estimate the background luminance distribution of the image. In the panoramic unfolding correction step, the circular image is converted into a rectangular planar unfolded image.
[0040] The second objective of this invention is to provide a computer device comprising a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, it implements the steps of the above-described method for detecting fractures in the surrounding rock inside a tunnel borehole.
[0041] The third objective of this invention is to provide a computer-readable storage medium storing a computer program, which, when executed by a controller, implements the steps of the above-described method for detecting fractures in the surrounding rock inside a tunnel borehole. Attached Figure Description
[0042] Figure 1 This is a schematic diagram of the overall structure of the high-definition camera device in an embodiment of the method for detecting fractures in the surrounding rock inside a tunnel borehole according to the present invention.
[0043] Figure 2 This is a schematic diagram of the main component of the high-definition camera probe in an embodiment of the method for detecting fractures in the surrounding rock inside a tunnel borehole according to the present invention.
[0044] Figure 3 This is a flowchart of the image preprocessing steps in an embodiment of the method for detecting fractures in the surrounding rock inside a tunnel borehole according to the present invention.
[0045] Figure 4 This is a structural diagram of the fracture detection model in an embodiment of the tunnel rock mass fracture detection method of the present invention.
[0046] Figure 5 This is a schematic diagram of the path planning of the fracture network AI algorithm in the fracture analysis step of the embodiment of the tunnel rock mass surrounding rock fracture detection method of the present invention. Detailed Implementation
[0047] Methods for detecting fractures in the surrounding rock inside tunnel boreholes The method for detecting surrounding rock fissures inside tunnel boreholes in this embodiment is based on a system for detecting surrounding rock fissures inside tunnel boreholes.
[0048] See Figure 1 and Figure 2 The tunnel rock mass borehole surrounding rock fissure detection system includes a high-definition camera device inside the tunnel borehole. The high-definition camera device inside the tunnel borehole includes: a probe main body component 1, a high-definition camera component 108, an adaptive supplementary lighting component 107, a sealing and protection component, an adjustable support component, and a data transmission and display component.
[0049] The probe body component 1 adopts a miniaturized columnar structure with a diameter adapted to the aperture of the tunnel inspection hole, and is used to integrate a high-definition camera module, an adaptive supplementary lighting module, and a data transmission module. The probe body 101 has various diameter specifications, which can be replaced according to the actual aperture of the tunnel inspection hole to avoid the probe rubbing against the hole wall. The probe body 101 is equipped with a first aviation plug interface at the tail for quick plug-in connection with the data transmission cable. It adopts a bayonet positioning design to ensure the stability and convenience of the connection. The high-definition camera assembly 108 is housed inside the probe body 101 and includes an industrial high-definition camera, an anti-distortion optical lens, and an image acquisition card. The industrial high-definition camera uses a digital high-definition camera to achieve real-time acquisition of images inside the hole, clearly capturing minute cracks in the hole wall. The anti-distortion optical lens is connected to the imaging surface of the industrial high-definition camera and is used to focus the optical image of the hole wall onto the industrial high-definition camera. It adopts a wide-angle design to cover the entire circumference of the hole wall and effectively corrects image distortion generated during the inside-hole shooting process, ensuring the geometric accuracy of the acquired image. The image acquisition card is connected to the industrial high-definition camera and supports real-time acquisition and transmission of multiple image formats. It is used to receive image data captured by the camera and transmit it to the subsequent data processing module, ensuring the real-time performance and integrity of image transmission. An adaptive supplementary lighting component 107 is arranged around the outside of the lens of the high-definition camera module, including a ring light source and a light driving unit. The ring light source is composed of multiple circumferentially evenly arranged LED beads, which are used to provide illumination in the environment inside the hole. The LED beads are waterproof to adapt to the humid environment inside the hole. The light driving unit is electrically connected to the ring light source and is used to automatically adjust the supplementary lighting intensity of the LED beads according to the image brightness parameters acquired by the high-definition camera module. It can also be manually adjusted through the display terminal. This can avoid image blurring in low light conditions and prevent excessive supplementary lighting from causing reflections, ensuring that the acquired image inside the hole is clear and has moderate contrast, providing a high-quality data source for subsequent crack identification. The sealing and protection components include a waterproof sealing structure, an anti-fog coating, and a protective shell. The waterproof sealing structure is made of a special rubber material and is installed at various connection points of the probe body 101 and at the first aviation connector 104. It is suitable for the high-pressure and humid environment inside the tunnel and protects the internal electronic components. The anti-fog coating is evenly applied to the surface of the anti-distortion optical lens to prevent the lens from fogging and avoid image blurring. It also has anti-scratch and anti-fouling functions. The protective shell is made of high-strength engineering metal with a wear-resistant surface treatment. It can resist the scratches of the borehole wall and extend the service life of the device. The shell is made of bright silver with high visibility, which facilitates quick positioning of the probe during detection and is suitable for the complex geological environment inside the tunnel. One end of the probe body 101 is equipped with a probe interface protective cover 102, and the other end is a high-definition camera protective cover 103.
[0050] The adjustable support assembly includes a centering device 106 and a depth counter 3. The centering device is located at both ends of the probe body 101 and is made of elastic and wear-resistant material. It is used to keep the probe body in a centered position in the borehole and avoid probe displacement that would cause image acquisition deviation. The depth counter is linked to the centering device and is used to measure the lowering depth or moving distance of the probe body 3 in real time, and to transmit the depth data synchronously to the detection host through the data transmission module of the second cable 4. The data transmission and display components include a transmission cable 110 and a display terminal 2. The display terminal 2 is equipped with a protective shell 5 and a display screen 6. One end of the transmission cable 110 is provided with a second aviation plug interface 105 that matches the first aviation plug interface 104. It is quickly connected to the probe body 101 through a bayonet positioning structure. The other end is connected to the detection host (display terminal 2) to realize bidirectional and stable transmission of image data, control commands, and depth data. The display terminal is connected to the transmission cable and is used to display the acquired image data and depth data in real time, so that the detection personnel can keep track of the probe position and the image inside the hole in real time.
[0051] The tunnel rock mass borehole surrounding rock fracture detection system also includes an intelligent fracture detection system, which comprises a data acquisition front-end, a data transmission unit, a data control and processing unit, a data storage and management unit, and a data display terminal.
[0052] The data acquisition front end is a high-definition camera device inside the tunnel borehole, used to acquire raw image data and depth data inside the tunnel inspection borehole. The data transmission unit connects the data acquisition front end and the data control and processing unit to achieve bidirectional data transmission. The data control and processing unit is the core processing part of the system, comprising four sub-units: an image preprocessing sub-unit, a crack intelligent detection sub-unit, a crack analysis sub-unit, and a display and control sub-unit. These sub-units receive and process the raw image data and depth data transmitted from the data acquisition front end, output crack detection and analysis results, and are responsible for the coordinated control and parameter configuration of each sub-unit. The data storage and management unit is connected to the data control and processing unit and is used to store raw data, processing results, and inspection reports. The data display terminal is connected to the data control and processing unit and is used to display borehole images, crack detection results, and analysis data in real time. Furthermore, the data acquisition front end is a high-definition camera device inside the tunnel borehole, used to acquire raw image data and depth data inside the tunnel detection borehole. Specifically, it includes a high-definition camera module for acquiring 360° panoramic images of the borehole wall, accurately recording the morphology, distribution, and development characteristics of the fractures; a depth counter linked to the straightening device of the adjustable support module for real-time recording of the probe's depth position, providing millimeter-level precision depth coordinates for each frame of image; the image data and depth data are fused and output after being timestamped to ensure that the image at each depth position corresponds to accurate depth coordinates, providing a consistent data foundation for subsequent fracture identification, parameter quantization, and spatial positioning. Furthermore, the data transmission unit connects the data acquisition front-end and the data control and processing unit to achieve bidirectional data transmission. Specifically, it includes a transmission cable made of wear-resistant and waterproof material. One end has a second aviation plug interface matching the first aviation plug interface, which is quickly plugged into and unplugged into the probe body via a bayonet positioning structure. The other end is connected to the data control and processing unit. It supports bidirectional data transmission: image data transmission transmits the raw image data and depth data acquired by the data acquisition front-end to the data control and processing unit in real time; control command transmission transmits control commands generated by the data control and processing unit to the data acquisition front-end. The transmission cable length can reach 1500m, supporting long-distance stable transmission in deep hole detection scenarios. Furthermore, the data control and processing unit is the core processing part of the system, including four sub-units: an image preprocessing sub-unit, a crack intelligent detection sub-unit, a crack analysis sub-unit, and a display and control sub-unit. It receives and processes the raw image data and depth data transmitted from the data acquisition front-end, outputs crack detection and analysis results, and is responsible for the coordinated control and parameter configuration of each sub-unit of the system.
[0053] Combination Figure 3 The method for detecting fractures in the surrounding rock inside a tunnel borehole according to the present invention includes an image preprocessing step, a fracture detection step, and a fracture analysis step. The image preprocessing steps include image enhancement, illumination unevenness correction, and panoramic unfolding processing, performed sequentially. In the image preprocessing step, the acquired raw image data is subjected to image enhancement and illumination unevenness correction steps to obtain corrected image data; In the panoramic unfolding process, the pixel values of each pixel in the unfolded image are calculated based on the corrected image data and the preset transformation model. The panoramic unfolded image is then generated by traversing each pixel in the unfolded image.
[0054] In the image enhancement step, the acquired original image is converted from the RGB color space to the HSV color space to obtain process image data. The luminance component in the process image data undergoes logarithmic transformation preprocessing. Since the chromaticity (H) and saturation (S) components primarily carry color information and are not directly related to light intensity, this step only processes the luminance component (V) to preserve the true colors of the image. Specifically, this includes: The RGB model can be converted to the HSV model using the following formula:
[0055]
[0056]
[0057] Where V is the luminance component, S is the saturation, H is the chroma, and R, G, B are the color space component values. The formula for preprocessing the luminance component V using logarithmic transformation is as follows:
[0058] in, The input image's original brightness value, with 0.01 as a protection constant. The output brightness value is obtained after logarithmic transformation. Then, a bilateral filter is used to decompose the original image after logarithmic transformation to obtain the illumination component and reflection component of the image, specifically including: Calculate the illumination component:
[0059] in, pixel coordinates The amount of light at that location, For the neighborhood The current pixel coordinates within, Spatial weights, For color weights, In order to be in The new brightness value obtained after logarithmic transformation; Calculate the reflection component:
[0060] in, pixel coordinates The reflection component at that location, The brightness value after logarithmic transformation. pixel coordinates The amount of light at that location.
[0061] Furthermore, adaptive gamma correction is performed on the brightness of the image's illumination components to dynamically adjust the overall brightness of the image, avoiding excessive brightness or darkness. Specifically, this includes: The image illumination component data is normalized to ensure that the pixel values are within the range of [0,1]. Adaptive gamma correction is as follows:
[0062] in, Here, γ represents the output pixel value after gamma correction, and γ is the gamma correction parameter. The input pixel value to be corrected; The value of the gamma correction parameter γ should adaptively change according to the illumination variations in the actual image, utilizing the estimated illumination components. The mean is adaptively obtained for the parameters. Thus, the gamma correction parameter γ is adaptively determined;
[0063]
[0064] Furthermore, guided filtering is applied to the reflection component to highlight image edge information, specifically including: Input the guide image and reflection components, set the filter radius, regularization parameters and sliding window size, calculate the mean and variance within the window and solve for the linear regression coefficients; For each pixel The filtered reflection components are calculated using the smoothed coefficients as follows:
[0065] in, For at pixel The linear coefficients and slopes calculated at that point For at pixel The linear coefficients-intercepts calculated at that point To guide the image at the pixel The pixel value at that location.
[0066] Furthermore, a hybrid space enhancement method is used to process the luminance component V to further enhance image details. Finally, the enhanced image is reconstructed, and the color space is restored to RGB space to obtain enhanced image data. Specifically, this includes: The luminance component V of the HSV color space is decomposed into multiple scales to obtain a small-scale detail layer, a medium-scale contrast layer, and a large-scale illumination layer. Large-scale illumination layers are subjected to contrast-limited adaptive histogram equalization (CLAHE) with a block size of 8×8 and a contrast limit threshold of 2.0. Bilinear interpolation is used to eliminate block artifacts. The enhanced small-scale detail layer, the mid-scale contrast layer, and the CLAHE-processed large-scale lighting layer are fused according to the weight coefficients [0.4, 0.6] to obtain the enhanced brightness component V'; Nonlinear enhancement of the saturation component S: S'=min(S 1.2 (1.0), keeping the hue component H unchanged; The processed HS'V' is converted back to the RGB color space, and the chroma channel of the Lab space is filtered. The a and b channels are subjected to 3×3 median filtering to limit the chroma value range to [-128, 127]. After being converted back to the RGB space, nonlocal mean denoising is performed.
[0067] The illumination unevenness correction steps include a brightness distribution model-based fitting correction method, which involves low-pass filtering the enhanced image data to obtain the image background brightness distribution data; constructing a two-dimensional Gaussian surface model with the same size as the enhanced image data to fit the image background brightness distribution data and obtain the estimated illumination components; and calculating the corrected image data based on the enhanced image data, the estimated light intensity components, and the preset brightness adjustment factor.
[0068] In the uneven illumination correction step, the image processed by the image enhancement module is received, and a correction method based on brightness distribution model fitting is used to perform low-pass filtering on the input enhanced image data to estimate the background brightness distribution of the image. Specifically, this includes: A large-size Gaussian filter is used to perform a convolution operation on the image to obtain the low-frequency components that reflect the overall illumination changes:
[0069] in, The image output by the image enhancement module. The standard deviation is Gaussian kernel, The value is typically 1 / 10 to 1 / 20 of the image size to ensure that a smooth background lighting distribution can be extracted; Furthermore, a two-dimensional Gaussian surface model with the same dimensions as the image is constructed to fit the background brightness distribution, thereby obtaining the accurate illumination components:
[0070] in, For amplitude, The coordinates of the center of the light spot are: and These are the standard deviations in the horizontal and vertical directions, respectively. This is the background constant; Furthermore, by dividing the original image by this estimated illumination component, the unevenness of the image illumination is corrected, resulting in an image with uniform brightness.
[0071] in, The input image for the image enhancement module. To estimate the illumination component, For the corrected image data, This is the brightness adjustment factor, usually taken as the global average.
[0072] In the panoramic unfolding process, the pixel values of each pixel in the unfolded image are calculated based on the corrected image data and the preset transformation model. The panoramic unfolded image is then generated by traversing each pixel in the unfolded image.
[0073] In the panoramic unfolding correction step, the annular image is converted into a rectangular planar unfolded image. A coordinate transformation algorithm is used to map the annular image to the rectangular image, establishing the transformation relationship between the annular image coordinate system and the rectangular image coordinate system:
[0074]
[0075] in, This represents the radial distance from the point to the center of the image. The azimuth angle corresponds to the circumferential direction of the borehole, and its value ranges from [value missing]. , The average radius of the borehole image, in pixels; In practical image processing, continuous transformations need to be discretized. Let the size of the annular image be... , of which Radial height, corresponding to the hole depth direction. This refers to the circumferential width, corresponding to a 360° circle. The target size for a panoramic unfolded image is typically set to... , of which The horizontal width after expansion is typically the same as the number of pixels in the circular direction as the circular image. ; For each pixel in the unfolded image The polar coordinates in its corresponding annular image Determined by the following formula:
[0076]
[0077] in, That is, the number of pixels per radian.
[0078] Then, polar coordinates Convert to Cartesian coordinates in a circular image :
[0079]
[0080] in, The coordinates of the center of the circular image are obtained from the calculation. The coordinates may be sub-pixel coordinates containing decimals. A bilinear interpolation method is used to obtain the pixel value at that location.
[0081] in, , They are respectively and The decimal part of the direction, These are the pixel values of the original circular image. These are the pixel values of the expanded rectangular image. For each pixel; Iterate through all pixels in the unfolded image, perform coordinate transformation and interpolation operations, map each pixel in the annular image to the corresponding position in the rectangular image, and generate a panoramic unfolded image with a width representing the perimeter of the borehole wall and a height representing the borehole depth.
[0082] See Figure 4 The crack detection step is primarily based on an improved YOLOv8-seg instance segmentation model. By introducing depthwise separable convolution, a cross-stage local attention module (CSLA), and dynamically weighted Focal Loss, it adapts to the slender, tortuous, and multi-scale geometric features of tunnel borehole wall cracks, achieving accurate detection and segmentation of cracks at different scales. The crack detection step involves inferring the trained improved YOLOv8-seg model onto the panoramic unfolded image, outputting pixel-level segmentation results of the cracks. The improved YOLOv8-seg model incorporates depthwise separable convolution (DSconv), a cross-stage local attention module (CSLA), and an improved pixel loss function based on dynamically weighted Focal Loss. The crack analysis step includes quantitative extraction of geometric parameters and connectivity analysis of the pixel-level segmentation results of the cracks.
[0083] In the improved YOLOv8-seg model, the C2f module of the Backbone part outputs to the depthwise separable convolution DSconv; in the improved YOLOv8-seg model, the C2f module of the Neck part outputs to the cross-stage local attention module CSLA, and then the cross-stage local attention module CSLA of the Neck part outputs to the detection head of the Head part.
[0084] Specifically, the backbone network is optimized by replacing the conventional convolutions in stages C3-C5 with depthwise separable convolutions in the backbone part. Depthwise separable convolutions split the standard convolutions into channel-wise convolutions and point-wise convolutions. In the C3 module of YOLOv8, the conventional convolutional layers are located and replaced with depthwise separable convolutional structures.
[0085] First, set up channel-wise convolution with a kernel size of 3×3 and the number of groups equal to the number of input channels, allowing each channel to perform convolution operations independently; then connect pointwise convolution with a kernel size of 1×1 to achieve feature fusion between channels.
[0086] In modules C4-C5, this part is responsible for handling high-dimensional features. During the replacement process, it is necessary to maintain a balance between computational load and feature extraction accuracy. Directly replacing it with depthwise separable convolution may lead to excessive feature fusion and loss of edge details of the gaps due to too many channels in the pointwise convolution. After the pointwise convolution is completed, the number of output channels of the pointwise convolution should be adjusted to be slightly less than the number of channels of the original conventional convolution. In the Neck section, a cross-stage local attention module (CSLA) is introduced. By cascading channel attention and spatial attention, it first focuses on the channel features related to the crack edge, and then locates the spatial position of the edge, thereby enhancing the ability to identify the crack edge and focusing on the crack edge features. The Cross-Stage Local Attention (CSLA) module uses channel attention to mine the contribution of different channels to edge features, highlighting channels closely associated with the edges. In the channel attention submodule, the feature maps output from stages C3-C5 of the Neck are first subjected to global average pooling to compress the spatial dimension, obtaining global features in the channel dimension. Then, they are fed into a multilayer perceptron (MLP) for dimensionality reduction and then expansion to restore the original number of channels. Channel attention weights are then generated using the sigmoid function, with the formula:
[0087] in, For the input feature map, For global average pooling, For global max pooling, It is a multilayer perceptron. It is the Sigmoid activation function. The channel attention weights are multiplied by the original feature map channel by channel to obtain the channel attention-weighted feature map. ,Right now
[0088] Spatial attention, building upon channel attention, enhances the spatial response of edge regions. It performs multi-size processing and feature fusion. Max pooling and average pooling are performed separately to obtain two 1×H×W feature maps. These maps are then concatenated along the channel dimension, followed by convolution with a 3×3 kernel to compress the number of channels to 1. Spatial attention weights are then generated using the sigmoid function. The formula is:
[0089] in, Weighted feature map, It is the Sigmoid activation function. It is a 3×3 convolution. Will and Pixel-by-pixel multiplication yields the final CSLA-processed feature map, i.e. .
[0090] After applying the CSLA module to the feature maps of C3-C5 in the Neck, the attention-weighted multi-scale features are fused according to the original feature fusion method of YOLOv8-seg, so that the model can better capture the crack edges at different scales and improve the recognition effect of large-scale through cracks and small-scale micro cracks. Furthermore, the damage function is improved, and dynamic weighted Focal Loss is used to address the crack scale difference problem, thereby further enhancing the generalization ability.
[0091] Dynamic weighted Focal Loss formula:
[0092] in, For the first The dynamically weighted Focal Loss value is calculated from each pixel. For the model to predict the first The probability of each pixel's category For the first Dynamic weights of each pixel To balance the weights for each category, For difficult samples, the modulation factor, For focusing parameters;
[0093] in, The pixel area of each crack instance. The adjustment coefficient can be set to an empirical value of 0.1. During the backpropagation phase of model training, for each pixel, the predicted probability is first output. Combined with the dynamic weight corresponding to that pixel Preset and Calculate the value of a single pixel Loss. Then, the losses of all pixels are summed to obtain the total batch loss, which is used to update the model parameters and optimize the model's ability to segment cracks. The model was trained using the Adam optimizer, with an initial learning rate set to... The training batch size was set to 8, and the training was iterated for 300 rounds until the loss function fully converged. To improve the model's generalization ability, data augmentation operations such as random rotation, horizontal flipping, brightness adjustment, and Gaussian noise were applied to the input image.
[0094] In the step of using the trained improved YOLOv8-seg model to infer the preprocessed panoramic unfolded image and output the pixel-level segmentation results of the cracks: The model outputs a probability map of the same size as the input image. Each pixel value represents the probability that the pixel belongs to a gap. The optimal global threshold for the image is automatically calculated using the maximum inter-class variance method, thus converting the probability map into a binary segmentation map. For pixel coordinates... The segmentation result is determined by the following formula:
[0095] in, For the binarized image in pixel coordinates The value at that location, The probability map output by the model in pixel coordinates The value at that location, To determine the optimal segmentation threshold, For the initial binary segmentation image, morphological closing operations are performed to fill the small holes inside the cracks and connect the fractured cracks. First, a structural kernel is used to traverse the image, extending the crack mask outward by 2 pixels to temporarily fill the holes. Then, the same kernel is used to shrink the edges, restoring the original contour while retaining the filled holes. An area thresholding filter is used to calculate the area of each connected component in the binary image. Set area threshold For 100 pixels, for all satisfying The noise is identified as residual noise and its pixel value is set as the background color, effectively filtering out small discrete noise points that were not cleared in the closing operation. Canny edge detection is used to perform edge optimization processing on the retained crack area, capturing abrupt changes in the crack contour, generating a binary map containing only edge information, and combining the edge map with the closing operation mask to ensure that the subsequent crack parameter extraction can accurately identify the crack boundary.
[0096] The fracture analysis subunit is used to quantitatively extract geometric parameters and analyze connectivity of intelligently detected fractures. It introduces path planning algorithms into fracture network analysis and quantifies the spatial connectivity between fractures through AI algorithms, thereby achieving a two-dimensional evaluation of rock mass fracturing and connectivity and providing a quantitative basis for rock mass quality evaluation. Furthermore, in the parameter quantization step, for each segmented fracture, based on its skeleton and binary region, geometric parameters are automatically extracted: fracture trace length, fracture width, 3D coordinate transformation to calculate the 3D dip angle and dip direction of the fracture, and fracture density. This outputs refined geometric parameters for each fracture, providing fundamental data for connectivity analysis. Specifically, for a single crack, its skeleton consists of an ordered set of pixels. Composition, length of crack trace The sum of the Euclidean distances between adjacent skeleton pixels:
[0097] in, For the first The coordinates of each pixel For the first The coordinates of each pixel This represents the total number of skeleton pixels. Take samples at equal intervals along the fracture skeleton At each sampling point, the span of the crack pixels within the binary region is statistically analyzed along the skeleton normal direction, and the average value is taken as the average width of the crack.
[0098] in, For the first The distance between the gap pixels along the normal direction at each sampling point The number of sampling points. By utilizing the geometric mapping relationship between the unfolded diagram of the hole wall and the three-dimensional cylindrical surface, the two-dimensional pixel coordinates on the skeleton are... Inverse calculation to three-dimensional coordinates in the borehole coordinate system Let the borehole radius be... The width of the panoramic unfolded image is The conversion relationship is as follows:
[0099]
[0100]
[0101]
[0102] in, For circumferential angle, Generate a 3D point set of the fracture skeleton for each pixel at the corresponding actual depth interval. , The three-dimensional point set of the fracture skeleton is considered as a structural surface, and plane fitting is performed using the least squares method. Let the plane equation be:
[0103] The normal vector is solved by minimizing the sum of the squared distances from each point to the plane. Calculate the three-dimensional dip angle of the fracture based on the normal vector. and tendencies :
[0104]
[0105] Wherein, the dip angle is the angle between the fracture surface and the horizontal plane, and the dip direction is... The direction angle of the projection of the normal vector of the fracture surface onto the horizontal plane. Within the statistical region, calculate the fracture density. :
[0106] in, To count the total number of cracks in the area, For the first The length of the crack trace, This represents the area of the statistical region.
[0107] The crack analysis steps include quantitative extraction of geometric parameters and connectivity analysis of the pixel-level segmentation results of the cracks.
[0108] See Figure 5 In the path analysis step, for complex fracture networks, an AI heuristic search algorithm is introduced to analyze fracture connectivity paths. An undirected graph of the fracture network is constructed using the intersections and endpoints of the fracture skeleton as nodes and the skeleton segments as edges. Each node Record its three-dimensional spatial coordinates, each edge Connect adjacent nodes and and assign weights The weighting function takes into account both path length and crack width:
[0109] in, For the edge The corresponding skeleton segment length, The average width of the crack segment is given by the weighting function, which makes the path more inclined to select cracks that are shorter in length and wider in width. For a given starting point and the end point An AI algorithm is used to search for the optimal connected path. The evaluation function of the AI algorithm is:
[0110] in, The actual cost from the starting point to the current node. For a heuristic estimate of the cost from the current node to the destination, AI algorithm path search heuristic function:
[0111] in, The three-dimensional coordinates of the current node. Let be the three-dimensional coordinates of the target node. For the current node, For the target node, AI algorithm iteration execution is selected from the open list. Set the smallest node as the current node; move the current node into the closed list; for each neighboring node of the current node, calculate the new... If the value is better than the historical record, then update its parent node and... The value is added to the open list; until the endpoint is added to the closed list, or the open list is empty (no connected path). The optimal path obtained by the search Calculate the connectivity strength of the path :
[0112] in, The width of a single crack segment. The length of a single crack segment. The index of the edge. Connectivity strength The larger the value, the greater the overall width and the shorter the distance of the path, indicating that it is a dominant channel in the fracture network. The total length, average width, number of nodes and other characteristics of the path are recorded to provide input for subsequent rock mass quality evaluation. Perform connectivity analysis on all node pairs in the fracture network and construct the connectivity matrix. ,in Represents a node and If a connected path exists, the value is 0; otherwise, it is 0. Network connectivity is calculated based on the connectivity matrix:
[0113] in, Total number of nodes, connectivity A value between 0 and 1 reflects the overall connectivity of the fracture network; a larger value indicates a more developed fracture network with better connectivity.
[0114] The borehole rock fracture detection system for tunnels also includes a display and control submodule, which visualizes the entire process of data acquisition, image processing, and fracture analysis, and is used to configure system parameters, perform manual verification, and output results. Furthermore, throughout the entire process of data acquisition, image processing, and fracture analysis, the system can display real-time dynamic images from the borehole camera and depth counts, overlay fracture detection results onto a panoramic view, use different colors to fill different fracture instances, display fracture parameter distribution along depth using a curve graph, display fracture attitude statistics using a rose diagram, and display the fracture topology and optimal connectivity path obtained by the AI algorithm using a network diagram.
[0115] Furthermore, in the control section, it provides parameter setting interfaces for image enhancement, crack detection, and analysis algorithms, supporting the saving and loading of parameter schemes; it provides manual editing functions for crack segmentation results, supporting the addition and deletion of cracks, adjustment of boundaries, and false detection marking; it outputs detection and analysis results in multiple formats, including crack parameter statistical reports, crack network topology files, crack 3D point cloud data files, and detection reports. Among them, the crack network topology files and crack 3D point cloud data files can be imported into mainstream network analysis software and 3D modeling software for further analysis and visualization.
[0116] Furthermore, the data storage and management unit, connected to the data control and processing unit, is used to store raw data, processing results, and detection reports. Specifically, it includes lossless storage of the raw annular image sequence acquired by the borehole camera, establishing an index relationship between image frames and depth positions; hierarchical storage of intermediate image preprocessing results, fracture detection and segmentation results, fracture parameter analysis data, and fracture network topology, supporting version-based management of processing results; storing the detection reports generated by the system; and providing multi-dimensional data retrieval functions by borehole number, acquisition time, depth range, fracture characteristics, etc., supporting multi-dimensional data retrieval and batch export, facilitating subsequent analysis and report generation.
[0117] Furthermore, the data display terminal, connected to the data control and processing unit, serves as the system's front-end interactive interface. It is used to display in-hole images, fracture detection results, and analysis data in real time. Specifically, it displays in-hole camera images, pre-processed panoramic views, and overlaid fracture detection results, supporting image freeze, local magnification, and contrast adjustment. It presents fracture analysis results in various formats, including numerical values, curves, and charts. It also displays the system's operating status in real time, including probe depth count, acquisition frame rate, processing progress, remaining storage space, and abnormal warning information. Finally, it provides control functions such as parameter adjustment, acquisition start / stop, image saving, and report generation.
[0118] Computer device embodiment: The computer device of the present invention is a controller, including a processor and a memory, such as a microcontroller containing a central processing unit. Furthermore, the processor executes a computer program stored in the memory to implement the steps of the aforementioned control method.
[0119] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0120] The memory can primarily include a program storage area and a data storage area. The program storage area can store the operating system and at least one application program required for a function (such as sound playback, image playback, etc.); the data storage area can store data created based on the use of the phone (such as audio data, phonebook, etc.). Furthermore, the memory can include high-speed random access memory, and can also include non-volatile memory, such as hard disks, RAM, plug-in hard disks, smart media cards (SMC), secure digital cards (SD cards), flash cards, at least one disk storage device, flash memory device, or other volatile solid-state storage devices.
[0121] Examples of computer-readable storage media: The computer-readable storage medium of the present invention can be any form of storage medium that can be read by the processor of a computer device, including but not limited to non-volatile memory, volatile memory, ferroelectric memory, etc. The computer-readable storage medium stores a computer program. When the processor of the computer device reads and executes the computer program stored in the memory, the steps of the above control method can be implemented.
[0122] Computer programs include computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. Computer-readable media can include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in computer-readable media can be appropriately added to or subtracted according to the requirements of legislation and patent practice in a jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.
[0123] Finally, it should be emphasized that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention can have various changes and modifications. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for detecting fractures in the surrounding rock inside a tunnel borehole, characterized in that, include: Image preprocessing steps, crack detection steps, and crack analysis steps; The image preprocessing steps include sequentially performing an image enhancement step, an illumination unevenness correction step, and a panoramic unfolding processing step; In the image preprocessing step, the acquired raw image data is subjected to an image enhancement step and an illumination unevenness correction step to obtain the corrected image data. In the panoramic unfolding process, the pixel values of each pixel in the unfolded image are calculated based on the corrected image data and the preset transformation model, and the panoramic unfolded image is generated by traversing each pixel in the unfolded image. The crack detection step includes: The trained improved YOLOv8-seg model is used to infer the panoramic unfolded image and output the pixel-level segmentation result of the crack; wherein, the improved YOLOv8-seg model introduces depthwise separable convolution DSconv, cross-stage local attention module CSLA, and improved pixel loss function based on dynamic weighted Focal Loss. The crack analysis step includes quantitative extraction of geometric parameters and connectivity analysis of the pixel-level segmentation results of the cracks.
2. The method for detecting fractures in the surrounding rock inside a tunnel borehole according to claim 1, characterized in that: The steps of using the trained improved YOLOv8-seg model to infer the panoramic unfolded image and output pixel-level segmentation results of the cracks include: The improved YOLOv8-seg model outputs a probability map with the same size as the panoramic unfolded image, where the value of each pixel in the probability map represents the probability that the pixel belongs to a crack; The optimal segmentation threshold of the probability map is calculated using the maximum inter-class variance method according to the following formula, thereby converting the probability map into an initial binary segmentation map; in, The initial binary segmentation map at pixel coordinates The value at that location, For the probability map at pixel coordinates The value at that location, The optimal segmentation threshold is [value].
3. The method for detecting fractures in the surrounding rock inside a tunnel borehole according to claim 2, characterized in that: After the step of converting the probability map into an initial binary segmentation map by calculating the optimal segmentation threshold of the probability map using the maximum inter-class variance method according to the following formula, the method further includes: Morphological closing operations are performed on the initial binary segmentation image to fill the small holes inside the cracks and connect the fractured cracks. First, the image is traversed using a structural kernel to extend the crack mask outward by 2 pixels to temporarily fill the holes. Then, the same kernel is used to shrink the edges to restore the original outline but retain the filled holes. The area of each connected component in the initial binary segmentation graph is calculated using the area threshold filtering method. Set area threshold For 100 pixels, for all satisfying It was determined to be residual noise, and its pixel value was set to the background color. Canny edge detection is used to perform edge optimization processing on the preserved crack region, generating a processed binary segmentation map containing only edge information.
4. The method for detecting fractures in the surrounding rock inside a tunnel borehole according to claim 3, characterized in that: The step of quantitatively extracting geometric parameters from the pixel-level segmentation results of the crack includes: Based on the processed binary segmentation image, for each segmented fracture, the following geometric parameters are extracted based on its skeleton and binary region: fracture trace length, average fracture width, fracture density, and three-dimensional coordinate transformation to calculate the three-dimensional dip angle and dip direction of the fracture. For each crack segmented by the processed binary segmentation image, its skeleton consists of an ordered set of pixels. Composition, length of crack trace The sum of the Euclidean distances between adjacent skeleton pixels: in, For the first The coordinates of each pixel For the first The coordinates of each pixel This represents the total number of skeleton pixels. Take samples at equal intervals along the fracture skeleton At each sampling point, the span of the crack pixels within the binary region is statistically analyzed along the skeleton normal direction, and the average value is taken as the average width of the crack. in, For the first The distance between the gap pixels along the normal direction at each sampling point The number of sampling points; By utilizing the geometric mapping relationship between the unfolded diagram of the hole wall and the three-dimensional cylindrical surface, the two-dimensional pixel coordinates on the skeleton are... Inverse calculation to three-dimensional coordinates in the borehole coordinate system Let the borehole radius be... The width of the panoramic unfolded image is The conversion relationship is as follows: in, For circumferential angle, Generate a 3D point set of the fracture skeleton for each pixel at the corresponding actual depth interval. ; The three-dimensional point set of the fracture skeleton is considered as a structural surface. The least squares method is used for plane fitting, and the plane equation is given as: The normal vector is solved by minimizing the sum of the squared distances from each point to the plane. Calculate the three-dimensional dip angle of the fracture based on the normal vector. and tendencies : Wherein, the dip angle is the angle between the fracture surface and the horizontal plane, and the dip direction is... The direction angle of the projection of the normal vector of the fracture surface onto the horizontal plane; Within the statistical region, calculate the fracture density. : in, To count the total number of cracks in the area, For the first The length of the crack trace, This represents the area of the statistical region.
5. The method for detecting fractures in the surrounding rock inside a tunnel borehole according to claim 4, characterized in that: The step of performing connectivity analysis on the pixel-level segmentation results of the crack includes: An undirected graph of the fracture network is constructed using the intersections and endpoints of the fracture skeleton as nodes and the skeleton segments as edges. Each node Record its three-dimensional spatial coordinates, each edge Connect adjacent nodes and And assign weights: in, For the edge The corresponding skeleton segment length, This represents the average width of the crack segment. For a given starting point and the end point An AI algorithm is used to search for the optimal connected path. The evaluation function of the AI algorithm is: in, The actual cost from the starting point to the current node. For the heuristic cost estimation from the current node to the destination, the AI algorithm path search heuristic function is: in, The three-dimensional coordinates of the current node. Let be the three-dimensional coordinates of the target node. For the current node, For the target node; AI algorithm iteration execution is selected from the open list. Set the smallest node as the current node; move the current node into the closed list; for each neighboring node of the current node, calculate the new... If the value is better than the historical record, then update its parent node and... The value is added to the open list; until the endpoint is added to the closed list, or the open list is empty (no connected path). The optimal path obtained by the search Calculate the connectivity strength of the path : in, The width of a single crack segment. The length of a single crack segment. The index of the edge; Perform connectivity analysis on all node pairs in the fracture network and construct the connectivity matrix. ,in Represents a node and If a connected path exists, the value is 0; otherwise, the value is 0. Calculating network connectivity based on the connectivity matrix: in, Total number of nodes, connectivity Between 0 and 1.
6. The method for detecting fractures in the surrounding rock inside a tunnel borehole according to any one of claims 1 to 5, characterized in that: In the improved YOLOv8-seg model, the C2f module of the Backbone part outputs to the depthwise separable convolution DSconv; In the improved YOLOv8-seg model, the C2f module of the Neck part outputs to the cross-stage local attention module CSLA, and then the cross-stage local attention module CSLA of the Neck part outputs to the detection head of the Head part.
7. The method for detecting fractures in the surrounding rock inside a tunnel borehole according to claim 6, characterized in that: In the backpropagation stage of model training of the improved YOLOv8-seg model, the predicted probability is first output for each pixel. Combined with the dynamic weight corresponding to that pixel Preset and The dynamic weighted Focal Loss formula is used to calculate the value of a single pixel. loss: Dynamic weighted Focal Loss formula: in, For the first The dynamically weighted Focal Loss value is calculated from each pixel. For the model to predict the first The probability of each pixel's category For the first Dynamic weights of each pixel To balance the weights for each category, For difficult samples, the modulation factor, For focusing parameters; in, The pixel area of each crack instance. This is the adjustment coefficient; All The total loss is obtained by summing the losses, and the total loss is used to update the improved YOLOv8-seg model.
8. The method for detecting fractures in the surrounding rock inside a tunnel borehole according to any one of claims 1 to 5, characterized in that: The image enhancement steps include: The acquired raw image data is converted from the RGB color space to the HSV color space to obtain process image data, and the luminance component in the process image data is preprocessed by logarithmic transformation. The process image data is decomposed to obtain illumination component and reflection component. Adaptive gamma correction is performed on the brightness of the illumination component, and guided filtering is performed on the reflection component. The brightness component is processed using a hybrid space enhancement method, and the processed process image data is converted from HSV color space to RGB color space to obtain enhanced image data. The uneven illumination correction step includes: The method based on the brightness distribution model fitting correction method involves low-pass filtering the enhanced image data to obtain the image background brightness distribution data; constructing a two-dimensional Gaussian surface model with the same size as the enhanced image data to fit the image background brightness distribution data to obtain the estimated illumination component; and calculating the corrected image data based on the enhanced image data, the estimated illumination component, and a preset brightness adjustment factor.
9. A computer device comprising a processor and a memory, characterized in that: The memory stores a computer program, which, when executed by the processor, implements the steps of the tunnel rock mass borehole surrounding rock fracture detection method as described in any one of claims 1 to 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the controller, it implements the steps of the tunnel rock mass borehole surrounding rock fracture detection method as described in any one of claims 1 to 8.