Tunnel face joint information calculation method, system and equipment based on YOLOv8-seg
By improving the YOLOv8-seg model, enhancing feature extraction and fusion capabilities, combining aspect ratio constraints and mathematical calculations, the robustness and accuracy problems of tunnel palm surface joint detection are solved, and the accurate calculation of joint information is achieved.
Patent Information
- Application Number
- CN202510425217.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-07
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2045-04-07
AI Technical Summary
The existing tunnel palm surface joint crack detection methods have poor robustness, low segmentation accuracy, and are difficult to distinguish independent joint targets, so they cannot accurately calculate joint information.
Based on the YOLOv8-seg model, an SE mechanism and a multi-directional static convolution module are introduced to enhance feature extraction capabilities; a two-way interactive channel is built to integrate high and low-level features; an aspect ratio constraint filtering algorithm is used to eliminate false joints; and a mathematical calculation method is used to calculate the actual height, length and area of the joints.
It improves the accuracy and efficiency of tunnel palm surface joint recognition, reduces the virtual detection rate and re-detection rate, and can effectively calculate the actual information of the joint.
Smart Images

Figure CN120471983A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of tunnel engineering and computer vision technology, and in particular to a method for calculating tunnel face joint information based on YOLOv8-seg. Background Art
[0002] With the steady advancement of the "Strong Transportation Nation" strategy, my country's tunnel engineering sector has ushered in new development opportunities. Since tunnel engineering is a concealed project, the uncertainty of the geological environment has always been the main risk factor in the construction process. The tunnel face, as a key part that directly reveals the complex geological conditions, contains a wealth of geological information and is crucial for ensuring construction safety. The joint and fissure characteristics of the face rock mass directly reflect its integrity and are key indicators for assessing the stability of the surrounding rock and construction safety. They also affect construction costs and future operational safety. Therefore, scientific detection and analysis of the joints and fissures of the tunnel face are crucial to ensuring the safety of tunnel construction.
[0003] Manual sketching is a traditional solution for detecting joints and cracks on tunnel faces. However, due to the large number of tunnels and the fact that the sketching results are seriously affected by the subjective judgment of the staff, false detections and missed detections often occur in actual work. In recent years, with the rapid improvement of computer performance, digital image processing methods, three-dimensional point cloud processing methods, and artificial intelligence algorithms have been gradually applied to the identification of joints and cracks on tunnel faces. Image processing-based crack detection technology usually binarizes the image according to specific rules to distinguish between cracked and non-cracked areas. Traditional crack detection algorithms usually require preprocessing such as denoising of the image. It is difficult for a single algorithm to accurately extract crack features, and a combination of multiple algorithms is often required. This has high computational costs, slow detection speeds, and lacks real-time detection capabilities.
[0004] The rapid development of deep learning technology has led to rapid progress in computer vision tasks such as object detection, semantic segmentation, and instance segmentation. Deep learning-based crack detection methods have also seen rapid development. These methods learn crack features from a large number of crack images, capturing crack characteristics in diverse forms and backgrounds to achieve accurate crack detection. This method offers advantages such as high accuracy and real-time performance.
[0005] YOLOv8-seg is an advanced one-stage instance segmentation model. Using the YOLOv8-seg model for joint and fissure identification and segmentation in tunnel face images, combined with mobile communication devices, allows for direct, easy, and convenient on-site use. However, this method still faces challenges such as poor robustness and low segmentation accuracy. Furthermore, it cannot distinguish independent joint targets, making subsequent processing difficult. Summary of the Invention
[0006] In response to the shortcomings of the above-mentioned prior art, the present invention proposes a tunnel face joint information calculation method based on YOLOv8-seg. On the basis of the YOLOv8-seg instance segmentation framework, an efficient and accurate tunnel face joint and fissure identification and segmentation algorithm is proposed, and the actual height and length information of the joints and fissures are obtained by processing and calculating the identified face photos.
[0007] In a first aspect, the present invention proposes a method for calculating tunnel face joint information based on YOLOv8-seg, which comprises the following steps:
[0008] Step 1: Obtain tunnel face photos and construct a tunnel face joint dataset;
[0009] Step 2: Construct an intelligent identification model for tunnel face joints based on yolov8-seg;
[0010] Step 3: Train the intelligent recognition model for tunnel face joints based on the tunnel face joint dataset, and use the trained intelligent recognition model to identify joint information on the tunnel face image to be tested;
[0011] Step 4: Calculate the joint information of the joint mask image identified in step 3;
[0012] Step 5: Output the calculated true height, length and area information of the joint.
[0013] Furthermore, the specific steps of step 1 include:
[0014] Step 1.1: Obtain a photo of the tunnel face;
[0015] Step 1.2: Annotate the obtained tunnel face photos and convert the JSON format file corresponding to each annotated image into a txt format file;
[0016] Step 1.3: Construct the tunnel face joint dataset based on all the obtained txt files;
[0017] Step 1.4: Divide the tunnel face joint dataset into training set, test set, and validation set.
[0018] Furthermore, the tunnel face joint intelligent identification model constructed in step 2 includes:
[0019] In the traditional YOLOv8-seg model, a multi-directional static convolution module is added before and after the Bottleneck block of the C2f module. The post-multi-directional static convolution module is set after the Bottleneck block of the C2f module and before the Concat block.
[0020] The SE module is connected after the post-multi-directional static convolution module to automatically learn the weights of each branch. At the same time, the SE module is connected after the Contact block to automatically learn the importance of each channel and enhance important features.
[0021] Based on the Neck module of the PANet structure in the traditional YOLOv8-seg model, a detection layer for small jointed objects is added, and a downward transmission channel from high-level features to low-level features is constructed. Together with the upward transmission channel of the original PANet structure, this constitutes a bidirectional interactive channel. The upward transmission channel transmits detailed information of low-level features to high-level features, and the downward transmission channel transmits semantic information of high-level features to low-level features.
[0022] The target detection frame output by the Head structure in the traditional YOLOv8-seg model is filtered using a filtering algorithm based on aspect ratio constraints to remove false joints.
[0023] Furthermore, the filtering algorithm based on the aspect ratio constraint includes the following steps:
[0024] Step 2.3.1: Based on the obtained coordinates of the upper left corner (x1, y1) and the lower right corner (x2, y2) of the target detection box, calculate the aspect ratio l of each target detection box;
[0025] Step 2.3.2: Define the aspect ratio constraint L;
[0026] Step 2.3.3: Determine whether l≤L holds. If so, remove the target detection box.
[0027] Furthermore, the specific steps of step 4 include:
[0028] Step 4.1: Calculate the actual height of the joints in the identified joint mask image;
[0029] Step 4.2: Calculate the actual length of the joints in the identified joint mask image;
[0030] Step 4.3: Calculate the area of the joints in the identified joint mask image.
[0031] Furthermore, the specific steps of step 4.1 include:
[0032] Step 4.1.1: Record the tunnel face height of the identified joint mask image as Y, the actual tunnel face height as h, and use the upper left corner of the joint mask image as the coordinate origin;
[0033] Step 4.1.2: Calculate the coordinates (x1, y1) of the center point of the joint mask image.
[0034] Step 4.1.3: Calculate the value of Y-y1 and use it as the pixel height y of the center point of the joint mask image.
[0035] Step 4.1.4: Calculate the actual height of the joint using the following formula:
[0036]
[0037] Where H represents the actual height of the joint.
[0038] Furthermore, the specific steps of step 4.2 include:
[0039] Step 4.2.1: The target detection box in the identified joint mask image is used as the minimum bounding rectangle of the joint outline;
[0040] Step 4.2.2: Establish a rectangular coordinate system with the upper left corner of the joint mask image as the origin. Set the upper left corner of the minimum bounding rectangle as vertex 1 and the lower right corner as vertex 2.
[0041] Step 4.2.3: Approximately calculate the length of the joint using the following formula:
[0042] L=y2-y1
[0043] Where L represents the length of the joint, y2 represents the ordinate of vertex 2, and y1 represents the ordinate of vertex 1;
[0044] Step 4.2.4: Based on the ratio of the actual tunnel face height to the tunnel face height in the image The actual joint length is obtained based on the calculated joint length L.
[0045] Furthermore, the specific steps of step 4.3 include:
[0046] Step 4.3.1: Sampling is performed along the joint curve in the joint mask image at fixed arc length intervals to obtain N sampling points. The N sampling points are arranged in a sampling order to obtain a discrete sampling point sequence of the joint curve.
[0047] Step 4.3.2: Use Danbechies wavelet to perform multi-scale decomposition on the discrete sampling point sequence of the joint curve. The sampling point sequence is The decomposition formula is as follows:
[0048]
[0049] Among them, A j (x) represents the j-th layer approximate component, D k (x) represents the detail component of the kth layer, represents the fractal dimension of each detail classification, x represents the horizontal distance along the tunnel face;
[0050] Step 4.3.3: Calculate the fractal dimension of each sub-region based on the discrete sampling point sequence of the joint curve, and then take the average fractal dimension μ based on the average fractal dimension of all sub-regions. D , then based on the fractal dimension of each sub-region and the average fractal dimension, the standard deviation σ of each sub-region is obtained D , and finally according to μ D and σ D Set threshold T = μ D +2σ D ;
[0051] Step 4.3.4: Judgment Is it true? If so, the curve segment is regarded as the main joint segment; otherwise, the curve segment is regarded as the micro joint segment;
[0052] Step 4.3.5: Use the polynomial fitting method to obtain the curve expression of the main joint segment;
[0053] Step 4.3.6: Use random process simulation modeling to obtain the curve expression of the micro-joint segment, and describe the morphology of the micro-joint segment through fractal Brownian motion:
[0054] y micro (x)=P(x)+σ·B H (x)
[0055] Among them, σ is the fluctuation amplitude, B H (x) is the fractal Brownian motion of the micro-joint segment;
[0056] Step 4.3.7: In the domain of the main joint segment curve [a, b], calculate the area of the main joint segment curve using the following formula:
[0057] S main =∫ a b P(x)dx;
[0058] Step 4.3.8: By variable substitution The area S of the main joint curve main Convert to the standard interval to get the estimated area of the main joint curve:
[0059]
[0060] Among them, τ i is the i-th integration node, ω i is the weight of the corresponding node;
[0061] Step 4.3.9: For the explicit micro-joint curve, calculate the area of the micro-joint curve using the following formula:
[0062] S micro =∫ c d y micro (x)dx;
[0063] Step 4.3.10: For the implicit micro-joint segment curve, generate N uniform random points by uniform sampling in the domain [c, d] Then through y i =y micro (xi) The function obtains the function value y of each random point i , based on y i Get area estimate
[0064]
[0065] Step 4.3.11: Add the calculated area of the main joint segment curve and the area of the micro joint segment curve to obtain the total joint area S total .
[0066] In a second aspect, the present invention further proposes a tunnel face joint information calculation system based on YOLOv8-seg, comprising:
[0067] The dataset construction module is used to obtain tunnel face photos and construct the tunnel face joint dataset;
[0068] Identification model building module, used to build a tunnel face joint intelligent identification model based on yolov8-seg;
[0069] The joint information recognition module is used to train the intelligent joint recognition model for the tunnel face based on the tunnel face joint data set, and use the trained intelligent joint recognition model for joint information recognition on the tunnel face image to be tested;
[0070] A joint information calculation module is used to calculate the joint information of the identified joint image;
[0071] The result output module is used to output the calculated true height, length and area information of the joints.
[0072] In a third aspect, the present invention provides an electronic device comprising at least one processor; and a memory communicatively connected to the processor; wherein the memory stores instructions executable by the processor, and the instructions are executed by the processor so that the processor can execute a method for calculating tunnel face joint information based on YOLOv8-seg.
[0073] Therefore, the present invention adopts the above-mentioned tunnel face joint information calculation method based on YOLOv8-seg, which has the following beneficial effects:
[0074] First, the present invention introduces the SE mechanism into the C2f module of the traditional YOLOv8-seg model, thereby enhancing the attention to key areas in low-light and complex background environments such as tunnels, enabling the model to efficiently utilize the feature information of joints. In addition, the present invention also introduces pre- and post-multi-directional static convolution modules into the C2f module. Each module uses three convolution kernels, corresponding to the horizontal, vertical, and diagonal directions, so that edge information is no longer ignored, enhancing the effect of feature fusion, and enabling the model to more accurately identify small targets in complex backgrounds.
[0075] Second, the present invention improves the PANet structure of the traditional YOLOv8-seg model, adds a target detection layer for small targets, and builds a bidirectional interactive channel. This avoids the loss of semantic information during multi-scale feature extraction due to the significant difference in the size of jointed targets when high-level features are fused from top to bottom with low-level features.
[0076] Third, the present invention applies a filtering algorithm with aspect ratio constraints in the head detection head to process the image output by the Neck module, which can eliminate false joints and reduce the false detection rate and re-detection rate of the model;
[0077] Fourth, based on the joint mask image identified by the improved YOLOv8-seg-SE3 model (intelligent identification model for tunnel face joints), the present invention calculates the height, length and area information of the joints using mathematical calculation methods.
[0078] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0079] Figure 1 The flowchart of the method proposed in the present invention is shown in FIG.
[0080] Figure 2 This is the C2f-SE3 structural framework diagram.
[0081] Figure 3 This is the traditional C2f structure framework diagram.
[0082] Figure 4 This is a schematic diagram of the improved PANet network structure of the present invention.
[0083] Figure 5 This is the overall structure of the improved YOLOv8-seg-SE3 model of the present invention.
[0084] Figure 6The principle of calculating joint length.
[0085] Figure 7 (a)-(d) are the map@0.5 of the improved model, the mAP@0.5-0.95 of the improved model, the map@0.5 of the original model, and the mAP@0.5-0.95 of the improved model, respectively.
[0086] Figure 8a The pixel coordinates of the center point of the joint and fissure in the complete section; Figure 8b is the result of calculating the coordinates of the center point;
[0087] Figure 9 Polynomial fitting results for the main joint segment.
[0088] Figure 10 is the curve fitting result of the micro-joint segment. DETAILED DESCRIPTION
[0089] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, these embodiments are only used to illustrate the present invention and are not intended to limit the scope of the present invention. In addition, it should be understood that after reading the content taught by the present invention, those skilled in the art will make various changes or modifications to the present invention, and these equivalent forms also fall within the scope defined by the appended claims of the application.
[0090] YOLOv8-seg is based on the YOLOv8 object detection framework and introduces a series of innovative improvements, such as the C2 module and the DFL loss function, to enhance its classification and localization capabilities. This model draws on the YOLOACT method for instance segmentation tasks, achieving high-precision segmentation through a linear combination of prototype contours and contour coefficients. Compared with the YOLOv8 object detection model, the main difference of YOLOv8-seg lies in the head part of its network structure. Specifically, YOLOv8-seg replaces the decoupling head of the head part with a segment decoupling head specifically for segmentation tasks, while the rest of the network remains consistent with YOLOv8. In addition, YOLOv8-seg can be trained and tested using the same dataset as the YOLOv8 object detection model.
[0091] Based on the YOLOv8-seg framework, the present invention proposes a tunnel face joint information calculation method based on YOLOv8-seg, which includes the following steps:
[0092] Step 1: Acquire the tunnel face image and construct the tunnel face joint dataset;
[0093] Step 2: construct an intelligent identification model for tunnel face joints based on yolov8-seg;
[0094] Step 3: training a tunnel face joint intelligent recognition model based on the tunnel face joint dataset, and using the trained tunnel face joint intelligent recognition model to identify joint information on the tunnel face image to be tested;
[0095] Step 4, performing joint calculation on the image identified in step 3;
[0096] Step 5: Output the calculated true height, length, and area information of the joint.
[0097] Furthermore, the specific steps of step 1 include:
[0098] Step 1.1: Use a mobile phone or camera to take a photo of the tunnel face to obtain a tunnel face image;
[0099] Step 1.2: Label the joints and cracks in the tunnel face images. Each image corresponds to a JSON file. Convert the JSON file into a txt file that can be processed by the YOLOv8-seg model. Build a tunnel face joint dataset based on the txt file.
[0100] Step 1.3: Divide the labeled tunnel face joint dataset into training set, test set, and validation set.
[0101] Furthermore, the specific steps of step 2 include:
[0102] Step 2.1: Introduce the SE mechanism into the C2f module in the traditional YOLOv8-seg model, and add multi-directional static convolution modules before and after the Bottleneck block of the C2f module;
[0103] The Backbone network of the traditional YOLOv8-seg model is mainly used to extract image feature information, but when identifying joint information, the image feature information will be lost. The core module of the Backbone network is the C2f module, such as Figure 3 As shown in the figure, it is used to convert the output of the convolutional layer into the input of the fully connected layer. It is a key module that causes missed detection and false detection after model training. Therefore, the present invention optimizes the C2f module in the traditional YOLOv8-seg Backbone network structure.
[0104] Specifically, first, the SE mechanism is introduced into the C2f module to enhance the attention to key areas in low-light and complex background environments such as tunnels, enabling the model to efficiently utilize the characteristic information of joints;
[0105] Second, in order to further improve the feature extraction capability of convolution, the front and back multi-directional static convolution modules are introduced into the C2f module ( Figure 2The gray area in the figure), both modules use three 3*3 convolution kernels, corresponding to 0°, 45°, and 90° (horizontal, vertical, and diagonal) directions, and the front static convolution module is set before the Bottleneck block of the C2f module, and the rear multi-directional static convolution module is set after the Bottleneck block of the C2f module and before the Concat block. Among them, the front static convolution module can better cover the convolution path, so that the edge information is no longer ignored, and the rear static convolution module enhances the effect of feature fusion, so that the model can more accurately identify small targets in complex backgrounds; the outputs of the front and rear multi-directional static convolution modules are calculated in parallel. In order to avoid the imbalance of the feature weight distribution of each channel output, the rear static convolution module is used to generate the convolution kernel. A SE module is connected after the multi-directional static convolution module, and the SE module is used to automatically learn the weights of each branch (front and rear multi-directional static convolution modules), so that the model can more effectively extract the important features of each branch and reduce the interference of redundant information before fusion. At the same time, since the concat operation will splice the feature maps of different branches or different layers in the channel dimension, the number of channels is increased. When integrating features of different levels or different sources, some channels may be more important and some may be redundant. Therefore, the present invention also connects a SE module after the Contact block to automatically learn the importance of each channel, enhance important features, and suppress unimportant features, thereby improving the representation ability of features; according to the above method, a new module C2f-SE3 structure is formed as shown Figure 2 As shown (red boxes indicate improvements);
[0106] Step 2.2: Based on the PANet structure of the Neck module, a detection layer for small joint targets is added, and a downward transmission channel from high-level features to low-level features is constructed. Together with the upward transmission channel of the original PANet structure, this constitutes a bidirectional interactive channel. The upward transmission channel transmits detailed information of low-level features to high-level features, and the downward transmission channel transmits semantic information of high-level features to low-level features.
[0107] Joints only occupy a small part of the entire image and have a limited pixel composition. Therefore, they are easily disturbed by complex backgrounds and cannot be effectively segmented in the segmentation algorithm. The YOLOv8-seg model is the same as YOLOv8 in that it uses the PANet structure in the Neck part. In the PANet structure, a top-down path enhancement method is adopted to continuously transmit feature information of targets of different scales through downsampling and upsampling to enhance the feature fusion ability of the algorithm. However, due to the lack of participation of original information, it is easy to cause training bias, which in turn affects the detection accuracy. In addition, when high-level features are fused with low-level features from top to bottom, due to the significant difference in the size of joint targets, semantic information may be lost in the multi-scale feature extraction process; at the same time, PANet only fuses feature maps of the same scale, and the lateral path is relatively single, resulting in the loss of detail information, resulting in insufficient multi-scale processing capabilities. Therefore, in response to the defects of the PANet network in dealing with multi-scale challenges, the present invention adds a detection layer specifically for small targets at joints, and at the same time constructs a P2-P5 bidirectional interaction channel to break the one-way flow of traditional PANet and establish a two-way interaction between high- and low-level features. The improved target detection layer structure is as follows: Figure 4 As shown, the red arrow in the figure indicates the newly added structure;
[0108] Specifically, if Figure 4 As shown in the figure, N1-N5 from bottom to top are the features of different levels in the Neck backbone network, and the green block from top to bottom represents the convolution module of the Neck backbone network, which is used to reduce the dimension of the features. Both parts are the basic structure of the original YOLOv8-seg model. In addition, the original YOLOv8-seg network contains three detection layers P3, P4 and P5 corresponding to small, medium and large target detection respectively. However, since the joints detected in this scheme occupy fewer pixels in the image, the present invention adds a P2 detection layer for joints on the basis of the original network structure ( Figure 4 ), and a new top-down path from P5 to P2 is added (corresponding to the red dotted line from P5 to P2). The input of the P2 detection layer is the output of the Neck backbone network, and the output is a feature map;
[0109] It can be seen that the present invention designs a bidirectional interaction channel for P2 - P5. The process of interacting using this bidirectional interaction channel includes: 1) Extracting lower - level features from the Neck backbone network to form a P2 detection layer, and then sorting the feature maps output by the P2 - P5 detection layers in descending order of resolution (P2 < P3 < P4 < P5). Using the upward - passing channels in the original YOLOv8 - seg model, the detailed information of the lower layers (such as P2, P3) is transmitted to the higher layers (such as P4, P5) to enhance the ability of the higher - layer features to perceive small targets; 2) Starting from the higher - level P5, gradually up - sample and fuse with the lower - layer features (P4, P3, P2) to form a downward - passing channel, and transmit the semantic information of the higher layers (such as P5, P4) to the lower layers (such as P3, P2) to enhance the semantic expression ability of the lower - layer features. Through the bidirectional interaction channel, the feature information of the target can be transmitted and fused between different feature layers to achieve a more comprehensive feature expression;
[0110] Step 2.3: Use a filtering algorithm based on aspect - ratio constraints to process the images output by the Neck module, eliminate false joints, and thus construct an intelligent recognition model for tunnel face joints based on yolov8 - seg;
[0111] When identifying the joint information of the tunnel face, in addition to relying on features such as shape and color, the main structural plane is also determined according to its position in the tunnel. However, during the identification process, false detections and duplicate detections sometimes occur. To solve this problem, the present invention proposes a filtering algorithm based on aspect - ratio constraints, and eliminates false joints through aspect - ratio conditions to reduce the false detection rate and duplicate detection rate of the model.
[0112] The specific process of the filtering algorithm based on aspect - ratio constraints is as follows: First, calculate the aspect - ratio based on the upper - left coordinate (x1, y1) and the lower - right coordinate (x2, y2) of the detection box. Then, introduce an aspect - ratio constraint L. Finally, calculate the aspect - ratio l of each detection box. If it is judged that l ≤ L, then eliminate this detection box. The overall structure of the improved YOLOv8 - seg model is as Figure 5 shown.
[0113] Furthermore, when training the intelligent recognition model for tunnel face joints constructed in step 2 in step 3, first set the model training parameters (learning rate, number of iterations, batch value), input the data in the training set into the intelligent recognition model for tunnel face joints to train the model, verify the trained intelligent recognition model for tunnel face joints on the validation set, and finally test the verified model on the test set to output an intelligent recognition model for tunnel face joints that passes the test;
[0114] Furthermore, the specific steps of step 4 include:
[0115] Step 4.1: Calculate the actual height of the joint;
[0116] Specifically, first, the tunnel face height of the joint mask image (joint mask image) identified in step 3 is recorded as Y, the actual tunnel face height is recorded as h, and the upper left corner of the joint mask image is used as the coordinate origin (0,0);
[0117] Secondly, calculate the coordinates of the center point (x1, y1) of the region of the node mask image and display the coordinates of the center point in the image;
[0118] Again, calculate the value of Y-y1, and use this value as the pixel height of the center point of the node mask image area, and record it as y;
[0119] Finally, the actual height of the joint is calculated by the following formula:
[0120]
[0121] Where H represents the actual height of the joint;
[0122] Step 4.2: Calculate the actual length of the joint;
[0123] Since the joints are irregular in shape, their actual geometric information cannot be directly obtained. Therefore, the target detection box in the image output after the tunnel face joint intelligent recognition model (YOLOv8-seg-SE3) constructed in step 2 is used as the minimum circumscribed rectangular box of the joint contour. The vertex coordinates of the minimum circumscribed rectangular box are used for calculation, and the side with the longer distance is used as the length of the joint. Since the calculation is for the same joint, the ratio of the size of the object in the same image to the actual object size is the same according to the principle of proportional enlargement and reduction. Therefore, according to the above ratio of the actual height of the tunnel face to the height of the tunnel face in the image, The actual length of the joint can be calculated;
[0124] like Figure 6 As shown in the figure, the red rectangular box is the target detection box of the output image of the intelligent joint recognition model of the tunnel face. It is used as the minimum circumscribed rectangular box of the joint outline. A rectangular coordinate system is established with the upper left corner of the output image as the coordinate origin. The upper left corner of the minimum circumscribed rectangular box is used as vertex 1, and the point in the lower right corner is used as vertex 2. The actual length of the joint is approximately calculated using the following formula:
[0125] L=y2-y1
[0126] Where L represents the actual length of the joint, y2 represents the ordinate of vertex 2, and y1 represents the ordinate of vertex 1;
[0127] Step 4.3: Calculate the actual area of the joint;
[0128] like Figure 6As shown in the figure, after the identified joint photos are binarized, the joint area is displayed as white in the picture. The white area in the picture is regarded as a number of irregular shapes. Therefore, the pixel area of the joint can be approximately obtained by calculating the area of this white irregular area. Then the ratio of the actual height of the tunnel face to the height of the tunnel face in the image is The true area of the joint can be calculated.
[0129] Consider the joints as being in the coordinate plane (e.g. Figure 6 Using the mathematical principle of solving function expressions, we can approximate the joint curve expression. Then, we can approximate the joint area by solving the curve area. However, the joints are complex in shape, and simple mathematical methods are difficult to express with simple functions. Furthermore, calculus calculations are inefficient and prone to large errors when applied to high-order curves or complex shapes. Therefore, to more accurately determine the joint curve expression equation, we need to decompose the curve and solve the function expression for each segment separately.
[0130] First, along the joint curve (such as Figure 6 The joint curve is sampled at fixed arc length intervals (e.g., 0.1 m). Assuming that N sampling points are finally obtained, they are arranged in the sampling order to obtain a discrete sampling point sequence of the joint curve. Then, the Danbechies wavelet (db4) is used to perform multi-scale decomposition on the discrete sampling point sequence of the joint curve. The sampling point sequence is The decomposition formula is as follows:
[0131]
[0132] Among them, A j (x) represents the j-th layer approximate component, D k (x) represents the detail component of the kth layer, represents the fractal dimension of each detail classification, x is the input independent variable, which represents the horizontal distance along the tunnel face, that is, the horizontal axis of the curve in the coordinate system;
[0133] Secondly, the fractal dimension of each sub-region is calculated according to the discrete sampling point sequence of the joint curve, and then the average fractal dimension μ is obtained based on the average fractal dimension of all sub-regions. D , then based on the fractal dimension of each sub-region and the average fractal dimension, the standard deviation σ of each sub-region is obtained D , and finally according to μ D and σ D Set threshold: T = μ D +2σ D ;
[0134] judge Whether it holds. If it holds, classify this segment of the curve as the major joint segment (i.e., the joints that are obvious in the image); otherwise, classify this segment of the curve as the minor joint segment (tiny joint fissures).
[0135] Next, use the polynomial fitting method to obtain the curve expression of the major joint segment, and use the stochastic process simulation modeling to obtain the curve expression of the minor joint segment. Among them, the morphology of the minor joint segment can be described by fractional Brownian motion, and the height change of the curve of the minor joint segment in the spatial position satisfies:
[0136] E[|B H (t + △t) - B H (t)|] ∞ (△t) H
[0137] where E represents the expected value, t represents the spatial position parameter along the joint curve, and △t represents the position increment of the spatial step; B H represents fractional Brownian motion, and H represents the Hurst exponent (0 < H < 1), which is used to control the roughness;
[0138] Estimate H using the rescaled range method:
[0139]
[0140] In the formula, R is the range, S is the standard deviation, and N is the data length.
[0141] Generate a Gaussian white noise sequence {W i} by calling the normal distribution function, and generate an FBM sequence through fractional integration:
[0142]
[0143] where W(s) is an approximate representation of the discrete white noise sequence {W i};
[0144] Superimpose the FBM sequence generated by the above formula on the polynomial curve of the major joint segment to obtain the curve equation of the minor joint segment:
[0145] y micro (x) = P(x) + σ · B H (x)
[0146] where σ is the amplitude of the fluctuation.
[0147] Then, within the domain interval [a, b] of the major joint segment curve, use the n-point Gaussian-Legendre numerical integration to obtain the area S main of the major joint segment curve:
[0148] S main = ∫ ab P(x)dx
[0149] Among them, [a,b] is the distribution interval of the main joint segment, that is, the range of the horizontal coordinate corresponding to the main joint segment in the coordinate plane;
[0150] The above n-point Gauss-Legendre integral formula is:
[0151]
[0152] Among them, τ is the integral variable, τ i is the i-th integration node, ω i is the weight of the corresponding node;
[0153] By variable substitution The area S of the main joint curve is obtained main Convert to standard interval:
[0154]
[0155] The area of the explicit microjoint curve is calculated by the following formula:
[0156] S micro =∫ c d y micro (x)dx
[0157] If the micro-joint segment curve is an implicit curve, uniform sampling is performed to generate N uniform random points in the domain [c, d] Then through y i =y micro (xi) The function obtains the function value y of each random point i , based on y i Get area estimate
[0158]
[0159] Finally, the area S of the main joint curve main Add the area of the micro-joint curve to get the total joint area S total .
[0160] Example
[0161] 1290 photos of tunnel face joints were taken with a mobile phone or camera. The joints in the obtained joint photos were annotated in the form of rectangular boxes using Labelme software, and the joint label was split. After the annotation was completed, each picture corresponded to a JSON format file. The JSON format file was then converted into a txt format file required for yolov8-seg instance segmentation to construct a tunnel face joint dataset. The tunnel face joint dataset was divided into training set, validation set, and test set in a ratio of 8:1:1.
[0162] Set the training hyperparameters of the intelligent joint identification model for the tunnel face:
[0163] 1) The learning rate is 0.007;
[0164] 2) The number of iterations (epochs) is 100;
[0165] 3) The batch size is 16;
[0166] To reduce model training time, the input photos were uniformly converted to 448 × 448 pixels. The performance and accuracy of the proposed intelligent tunnel face joint recognition model were compared with the traditional YOLOv8-seg model, and the precision, recall, and F1 score results before and after the improvement were compared.
[0167] As can be seen from Table 1, the precision, recall and F1 scores of the YOLOv8-seg-SE3 model are all higher than those of the YOLOv8-seg model (the original model in Table 1), which are 0.92, 0.93 and 0.92 respectively, indicating that the performance of the YOLOv8-seg-SE3 model (the improved model in Table 1) has been improved, thus verifying that the feature extraction optimization strategy proposed by the YOLOv8-seg-SE3 model is feasible.
[0168] Table 1 Comparison of model training results before and after improvement
[0169]
[0170]
[0171] The mAP@0.5 and mAP@0.5-0.95 of the two models are as follows Figure 7 As shown. Figure 7As can be seen, the optimized YOLOv8-seg-SE3 model achieves faster accuracy gains during training and achieves better final results. The mAP@0.5 and mAP@0.5-0.95 scores for the YOLOv8-seg-SE3 model are 0.83 and 0.57, respectively, representing improvements of 0.3 and 0.23, respectively, compared to the YOLOv8-seg model. This demonstrates the robustness of the YOLOv8-seg-SE3 model. Based on the above analysis, the optimization of the YOLOv8-seg model is feasible.
[0172] After the model training is completed, select the complete tunnel face photos, such as Figure 8a As shown, the height, length, and area of joints were calculated using the aforementioned method. Small cracks that have little impact on the tunnel face were ignored during the calculations, and the height and length of longer cracks that have a significant impact on the tunnel face were calculated. The height calculations were rounded to the nearest integer. The height calculations for some crack locations are shown in Table 2, and the length calculations for the joints are shown in Table 3.
[0173] Table 2 Actual height of joints
[0174]
[0175] Table 3 Joint length calculation
[0176]
[0177] by Figure 8a For example, the pixel height of the joint is obtained by subtracting the vertical coordinate value 275 of the upper left corner from the vertical coordinate value 314 of the lower right corner. The result is as follows: Figure 8b Then, according to the proportional relationship, the height ratio between the photo and the actual tunnel face is 0.00333 (unit: m), so the ratio of the pixel area to the actual area is 0.0000110889.
[0178] Figure 9 The polynomial fitting result of the main joint segment is shown in Figure 1. The horizontal axis is the horizontal distance of the tunnel face, and the vertical axis is the joint height. The blue scattered points are the sampling data of the main joint segment after wavelet decomposition, showing an approximately smooth curve trend. The red solid line is the polynomial fitting result. The formula is:
[0179] P(x)=0.002x 4 -0.15x 3 +2.1x 2 -8.7x+10.5
[0180] Figure 10The green scattered points are the micro-joint segment data after wavelet decomposition, showing high-frequency random fluctuations. The red curve is the objective function obtained by fitting:
[0181] y=sin(x)
[0182] The total joint area of the main joint segment and the micro joint segment is added together to obtain approximately 0.0133.
[0183] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit the same. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that they can still modify or replace the technical solutions of the present invention with equivalents, and these modifications or equivalent replacements cannot cause the modified technical solutions to deviate from the spirit and scope of the technical solutions of the present invention.
Claims
1. A tunnel face joint information calculation method based on YOLOv8-seg is characterized by: The following steps are involved: Step 1: Obtain tunnel face photos and construct a tunnel face joint dataset; Step 2: Construct an intelligent identification model for tunnel face joints based on yolov8-seg; Step 3: Train the intelligent recognition model for tunnel face joints based on the tunnel face joint dataset, and use the trained intelligent recognition model to identify joint information on the tunnel face image to be tested; Step 4: Calculate the joint information of the joint mask image identified in step 3; Step 5: Output the calculated true height, length and area information of the joint.
2. The tunnel face joint information calculation method based on YOLOv8-seg according to claim 1, characterized in that The specific steps of step 1 include: Step 1.1: Obtain a photo of the tunnel face; Step 1.2: Annotate the obtained tunnel face photos and convert the JSON format file corresponding to each annotated image into a txt format file; Step 1.3: Construct the tunnel face joint dataset based on all the obtained txt files; Step 1.4: Divide the tunnel face joint dataset into training set, test set, and validation set.
3. The tunnel face joint information calculation method based on YOLOv8-seg according to claim 1, characterized in that The intelligent identification model for tunnel face joints constructed in step 2 includes: In the traditional YOLOv8-seg model, a multi-directional static convolution module is added before and after the Bottleneck block of the C2f module. The post-multi-directional static convolution module is set after the Bottleneck block of the C2f module and before the Concat block. The SE module is connected after the post-multi-directional static convolution module to automatically learn the weights of each branch. At the same time, the SE module is connected after the Contact block to automatically learn the importance of each channel and enhance important features. Based on the Neck module of the PANet structure in the traditional YOLOv8-seg model, a detection layer for small jointed objects is added, and a downward transmission channel from high-level features to low-level features is constructed. Together with the upward transmission channel of the original PANet structure, this constitutes a bidirectional interactive channel. The upward transmission channel transmits detailed information of low-level features to high-level features, and the downward transmission channel transmits semantic information of high-level features to low-level features. The target detection frame output by the Head structure in the traditional YOLOv8-seg model is filtered using a filtering algorithm based on aspect ratio constraints to remove false joints.
4. The method for calculating tunnel face joint information based on YOLOv8-seg according to claim 3, wherein: The filtering algorithm based on aspect ratio constraint includes the following steps: Step 2.3.1: Based on the obtained coordinates of the upper left corner (x1, y1) and the lower right corner (x2, y2) of the target detection box, calculate the aspect ratio l of each target detection box; Step 2.3.2: Define the aspect ratio constraint L; Step 2.3.3: Determine whether l≤L holds. If so, remove the target detection box.
5. The method for calculating tunnel face joint information based on YOLOv8-seg according to claim 4, wherein: The specific steps of step 4 include: Step 4.1: Calculate the actual height of the joints in the identified joint mask image; Step 4.2: Calculate the actual length of the joints in the identified joint mask image; Step 4.3: Calculate the area of the joints in the identified joint mask image.
6. The method for calculating tunnel face joint information based on YOLOv8-seg according to claim 5, characterized in that: The specific steps of step 4.1 include: Step 4.1.1: Record the tunnel face height of the identified joint mask image as Y, the actual tunnel face height as h, and use the upper left corner of the joint mask image as the coordinate origin; Step 4.1.2: Calculate the coordinates (x1, y1) of the center point of the joint mask image. Step 4.1.3: Calculate the value of Y-y1 and use it as the pixel height y of the center point of the joint mask image. Step 4.1.4: Calculate the actual height of the joint using the following formula: Where H represents the actual height of the joint.
7. The method for calculating tunnel face joint information based on YOLOv8-seg according to claim 6, characterized in that: The specific steps of step 4.2 include: Step 4.2.1: The target detection box in the identified joint mask image is used as the minimum bounding rectangle of the joint outline; Step 4.2.2: Establish a rectangular coordinate system with the upper left corner of the joint mask image as the origin. Set the upper left corner of the minimum bounding rectangle as vertex 1 and the lower right corner as vertex 2. Step 4.2.3: Approximately calculate the length of the joint using the following formula: L=y2-y1 Where L represents the length of the joint, y2 represents the ordinate of vertex 2, and y1 represents the ordinate of vertex 1; Step 4.2.4: Based on the ratio of the actual tunnel face height to the tunnel face height in the image The actual joint length is obtained based on the calculated joint length L.
8. The method for calculating tunnel face joint information based on YOLOv8-seg according to claim 7, wherein: The specific steps of step 4.3 include: Step 4.3.1: Sampling is performed along the joint curve in the joint mask image at fixed arc length intervals to obtain N sampling points. The N sampling points are arranged in a sampling order to obtain a discrete sampling point sequence of the joint curve. Step 4.3.2: Use Danbechies wavelet to perform multi-scale decomposition on the discrete sampling point sequence of the joint curve. The sampling point sequence is The decomposition formula is as follows: Among them, A j (x) represents the j-th layer approximate component, D k (m) represents the detail component of the kth layer, represents the fractal dimension of each detail classification, x represents the horizontal distance along the tunnel face; Step 4.3.3: Calculate the fractal dimension of each sub-region based on the discrete sampling point sequence of the joint curve, and then take the average fractal dimension μ based on the average fractal dimension of all sub-regions. D , then based on the fractal dimension of each sub-region and the average fractal dimension, the standard deviation σ of each sub-region is obtained D , and finally according to μ D and σ D Set threshold T = μ D +2σ D ; Step 4.3.4: Judgment Is it true? If so, the curve segment is regarded as the main joint segment; otherwise, the curve segment is regarded as the micro joint segment; Step 4.3.5: Use the polynomial fitting method to obtain the curve expression of the main joint segment; Step 4.3.6: Use random process simulation modeling to obtain the curve expression of the micro-joint segment, and describe the morphology of the micro-joint segment through fractal Brownian motion: y micro (x)=P(x)+σ·B H (x) Among them, σ is the fluctuation amplitude, B H (x) is the fractal Brownian motion of the micro-joint segment; Step 4.3.7: In the domain of the main joint segment curve [a, b], calculate the area of the main joint segment curve using the following formula: S main =∫ a b P(x)dx; Step 4.3.8: By variable substitution The area S of the main joint curve main Convert to the standard interval to get the estimated area of the main joint curve: Among them, τ i is the i-th integration node, ω i is the weight of the corresponding node; Step 4.3.9: For the explicit micro-joint curve, calculate the area of the micro-joint curve using the following formula: S micro =∫ c d y micro (x)dx; Step 4.3.10: For the implicit micro-joint segment curve, generate N uniform random points by uniform sampling in the domain [c, d] Then through y i =y micro (x i ) function obtains the function value y of each random point i , based on y i Get area estimate Step 4.3.11: Add the calculated area of the main joint segment curve and the area of the micro joint segment curve to obtain the total joint area S total .
9. A tunnel face joint information calculation system based on YOLOv8-seg, characterized in that: The method according to any one of claims 1 to 8 is implemented, comprising: The dataset construction module is used to obtain tunnel face photos and construct the tunnel face joint dataset; Identification model building module, used to build a tunnel face joint intelligent identification model based on yolov8-seg; The joint information recognition module is used to train the intelligent joint recognition model for the tunnel face based on the tunnel face joint data set, and use the trained intelligent joint recognition model for joint information recognition on the tunnel face image to be tested; A joint information calculation module is used to calculate the joint information of the identified joint image; The result output module is used to output the calculated true height, length and area information of the joints.
10. An electronic device, characterized in that: The method comprises at least one processor; and a memory in communication with the processor; wherein the memory stores instructions executable by the processor, and the instructions are executed by the processor so that the processor can execute the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Method and device for extracting tunnel face structural plane information based on pixel difference network model
CN116721326A
Tunnel face joint information statistical method based on target detection technology
CN116824160A
Tunnel face surrounding rock information intelligent extraction and dynamic intelligent grading method
CN117392593A
Lightweight tunnel crack segmentation identification method based on improved YOLOv8
CN119515791A
Cited By
Tunnel face joint fissure identification method based on semi-supervised learning
CN121904395A