A Weak Surface Detection Method for Downhole Boreholes Based on Dual Attention and Transfer Learning

By constructing a dataset of weak surfaces in downhole boreholes and embedding transfer learning methods with CBAM and CCNET attention modules, the problems of low efficiency and insufficient accuracy in identifying weak surfaces in downhole boreholes are solved, achieving high-precision identification under small sample conditions and supporting engineering safety optimization.

CN121259537BActive Publication Date: 2026-03-06HUNAN UNIV OF SCI & TECH +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511795144.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-02
Publication Date
2026-03-06
Estimated Expiration
2045-12-02

AI Technical Summary

Technical Problem

Current technologies rely on manual observation for weak surface identification in downhole boreholes, which is inefficient and highly subjective. Deep learning-based methods are prone to overfitting under small sample conditions and are difficult to accurately identify weak surfaces in irregular or low-light environments, thus failing to meet practical engineering needs.

Method used

A dataset of weak surface images of downhole boreholes was constructed, and data preprocessing and enhancement were performed. The Crack500 public road weak surface dataset was selected as the source domain dataset. The DeepLabv3+ basic model was initialized through transfer learning, and the CBAM channel spatial attention module and CCNET cross attention module were embedded to optimize the model and improve the accuracy of weak surface feature extraction.

Benefits of technology

High-precision identification of weak surfaces in downhole boreholes was achieved under small sample conditions, improving identification efficiency and stability, providing accurate weak surface detection results, supporting optimized support scheme design, and preventing roof collapse and water inrush disasters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121259537B_ABST
    Figure CN121259537B_ABST
Patent Text Reader

Abstract

This invention discloses a downhole borehole weak surface detection method based on dual attention and transfer learning. The method includes the following steps: constructing a downhole borehole weak surface image dataset to generate a target domain dataset; selecting the Crack500 public road weak surface dataset as the source domain dataset; embedding a CBAM channel spatial attention module and a CCNET cross-attention module into the initial DeepLabv3+ base model based on transfer learning; testing the model with independent samples not used in training; and applying the trained model to new borehole weak surface images to obtain the borehole weak surface detection results. Thus, by selecting source domain samples similar to the target domain dataset from the source domain dataset, an improved DeepLabv3+ base model is constructed. Furthermore, embedding the CBAM channel spatial attention module and the CCNET cross-attention module into the DeepLabv3+ base model enhances the perception ability of weak surface features in downhole borehole images, achieving high-precision recognition under small sample conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of mining engineering technology, and in particular to a method for detecting weak surfaces in downhole boreholes based on dual attention and transfer learning. Background Technology

[0002] In underground engineering fields such as coal mining and tunnel construction, the development of weak surfaces (i.e., borehole weak surfaces) within the surrounding rock of roadways directly affects construction safety and long-term stability. Parameters such as the location, size, development density, and permeability coefficient of weak surfaces are not only crucial for determining the extent of the loosened zone in the surrounding rock and assessing the distribution of ground stress, but also essential data support for optimizing support scheme design and preventing disasters such as roof collapse and water inrush. Therefore, achieving accurate and efficient extraction of weak surface parameters has irreplaceable engineering significance for the safety of underground engineering projects.

[0003] In existing technologies, traditional downhole borehole weak surface identification relies heavily on manual observation and experience, resulting in low efficiency, high subjectivity, and insufficient accuracy. Existing deep learning-based identification methods are prone to overfitting due to the scarcity of downhole borehole weak surface samples, and ordinary semantic segmentation models have limited ability to capture weak surface features, making it difficult to accurately identify weak surfaces in irregular or low-light environments, thus failing to meet practical engineering needs. Therefore, there is an urgent need for a method that can improve the accuracy and efficiency of weak surface identification under small sample conditions. Summary of the Invention

[0004] This invention aims to at least solve one of the technical problems existing in the prior art. Therefore, one object of this invention is to propose a downhole borehole weak surface detection method based on dual attention and transfer learning, which can detect weak surfaces in boreholes even when the number of weak surface samples is small.

[0005] The downhole borehole weak surface detection method based on dual attention and transfer learning according to the present invention includes: constructing a downhole borehole weak surface image dataset and performing data preprocessing and enhancement to generate a target domain dataset; selecting the Crack500 public road weak surface dataset as the source domain dataset, extracting morphological features of the source domain dataset and the target domain dataset, thereby filtering source domain samples in the source domain dataset whose similarity to the target domain dataset is within a preset range; constructing an initial DeepLabv3+ base model based on transfer learning, reusing the pre-trained road weak surface model weights obtained from the filtered source domain samples, using them as the initialization basis of the borehole weak surface detection model, and then using the road weak surface model... The weights are directly transferred to the initial DeepLabv3+ base model based on transfer learning corresponding to the target domain dataset to be trained, accelerating the training process. The CBAM channel spatial attention module and CCNET cross-attention module are embedded in the initial DeepLabv3+ base model based on transfer learning. The model is optimized through parameter tuning and feature fusion logic to improve the accuracy of weak surface feature extraction. An independent sample set not involved in training is placed into the model for testing, and the model's average intersection-over-union ratio, loss value, and accuracy are checked to verify the model's ability to extract weak surface features and its recognition stability. The trained model is then applied to new borehole weak surface images to obtain the borehole weak surface detection results.

[0006] Therefore, source domain samples similar to the target domain dataset are selected from the source domain dataset to construct an improved DeepLabv3+ base model. Furthermore, the CBAM channel spatial attention module and CCNET cross attention module are embedded in the DeepLabv3+ base model to enhance the perception of weak surface features in downhole borehole images and achieve high-precision recognition under small sample conditions.

[0007] In some examples of the present invention, the step of constructing a dataset of weak surfaces in underground boreholes and performing data preprocessing and enhancement to generate a target domain dataset further includes: using a borehole inspection device to dynamically scan the borehole wall features in the coal mine, processing the data with supporting software to generate a rock stratum columnar diagram, and obtaining a two-dimensional unfolded image of the borehole wall; using the LabelMe annotation tool to perform pixel-level semantic annotation on the weak surfaces in the image, generating corresponding binary masks and VOC format annotation files to form an initial target domain dataset with semantic labels; dividing the annotated target domain dataset into a training set, a validation set, and a test set according to a preset ratio, for model training, parameter tuning, and performance verification, respectively; and expanding the training set, the validation set, and the test set using geometric transformation, lighting simulation, and noise addition.

[0008] In some examples of this invention, the step of selecting the publicly available Crack500 road weak surface dataset as the source domain dataset, extracting morphological features of the source domain dataset and the target domain dataset, and thereby filtering source domain samples in the source domain dataset whose similarity to the target domain dataset is within a preset range, further includes: using the publicly available Crack500 road weak surface dataset as the source domain dataset, the source domain dataset including road crack images and pixel-level annotations, the road crack images having linear defect features similar to the weak surfaces in the two-dimensional unfolded images of the borehole walls, wherein the number of samples in the source domain dataset is greater than the number of samples in the target domain dataset; removing invalid samples from the source domain dataset and the target domain dataset that affect feature extraction, and performing uniform size cropping and pixel value normalization on the remaining valid samples. Extracting the morphological features of the valid samples in the source domain dataset, and standardizing the features according to the formula:

[0009] X S ,

[0010] in, These are the original values ​​of the morphological features of the source domain dataset. The mean of the morphological features of the source domain dataset. X represents the standard deviation. S The morphological features of the source domain dataset are standardized values; the morphological features of valid samples in the target domain dataset are extracted, and the features are standardized according to the formula:

[0011] Y S ,

[0012] Where y represents the original values ​​of the morphological features of the target domain dataset. The mean of the morphological features of the target domain dataset. Y represents the standard deviation. S The values ​​are the morphological features of the target domain dataset after standardization.

[0013] The distribution similarity is then calculated using the MMD unbiased estimation formula, which is:

[0014] ,

[0015] Where m and n are the number of samples in the source domain dataset and the target domain dataset, respectively, F is the mapping function, q and p are the morphological feature distributions of the source domain dataset and the target domain dataset, respectively, k is the Gaussian kernel function, and i and j are the sample indices in the source domain dataset and / or the target domain dataset. This paper uses the Gaussian kernel function:

[0016] ,

[0017] in, The MMD value is the bandwidth parameter of the kernel function. The smaller the MMD value, the closer the morphological feature distributions in the source domain dataset and the target domain dataset are. To further analyze the overall similarity between each road weak surface image in the source domain dataset and the weak surface images in the target domain dataset, a single-sample similarity score is defined based on the kernel mean term in the MMD formula.

[0018] ),

[0019] in, This represents the average similarity between the i-th weak surface image of a road in the source domain dataset and all weak surface image samples in the target domain dataset. The larger the value, the more similar the i-th road weak surface image in the source domain dataset is to the overall weak surface image samples in the target domain dataset.

[0020] In some examples of the present invention, the morphological features in both the source domain dataset and the target domain dataset include at least one of area, perimeter, principal axis length, secondary axis length, and number of branches.

[0021] In some examples of this invention, the step of constructing a transfer learning-based initial DeepLabv3+ base model, reusing the road weak surface model weights obtained by pre-training with the selected source domain samples, using them as the initialization basis for the borehole weak surface detection model, and directly transferring the road weak surface model weights to the transfer learning-based initial DeepLabv3+ base model corresponding to the training set to be trained, to accelerate the training process, further includes: using MobileNetV2 as the backbone network of the transfer learning-based initial DeepLabv3+ base model; performing multi-scale feature extraction on the deep features extracted by MobileNetV2 through a structure including 1×1 convolution, 3×3 dilated convolution with different dilation rates, and image pooling; reusing the road weak surface model weights obtained by pre-training with the selected samples in the source domain dataset, using them as the initialization basis for the borehole weak surface detection model, and directly transferring the road weak surface model weights to the transfer learning-based initial DeepLabv3+ base model corresponding to the training set to be trained.

[0022] In some examples of this invention, the step of embedding a CBAM channel spatial attention module and a CCNET cross attention module into the initial DeepLabv3+ base model based on transfer learning, and optimizing the model through parameter tuning and feature fusion logic to improve the accuracy of weak surface feature extraction, further includes: embedding a CBAM channel spatial attention module at the feature fusion layer of the model decoder of the DeepLabv3+ base model; connecting a CCNET cross attention module to the output of the ASPP multi-scale feature extraction module of the DeepLabv3+ base model; adjusting the model learning rate in conjunction with the road weak surface model weights in the transfer learning stage, and simultaneously optimizing the feature splicing logic to ensure that the deep features refined by the CBAM module and enhanced by the CCNET module are fused with the high-resolution low-level features passed through the shallow layers of the backbone network via skip connections.

[0023] In some examples of the present invention, the step of embedding a CBAM channel spatial attention module at the feature fusion layer of the model decoder of the DeepLabv3+ base model further includes: performing global average pooling and global max pooling on the input feature map to obtain two different channel descriptors; inputting these two descriptors into a shared multilayer perceptron; generating a channel attention weight matrix after computation; multiplying the weight matrix with the original input feature map to achieve feature recalibration in the channel dimension, suppressing irrelevant channels and highlighting weak surface related features; using the feature map optimized by channel attention as input, performing average pooling and max pooling along the channel dimension, and concatenating the two resulting two-dimensional feature maps; performing a convolution operation through a standard convolutional layer to generate a spatial attention weight map; multiplying the spatial attention weight map with the input feature map to focus on the spatial location of weak surfaces and improve the ability to capture local features of weak surfaces in the two-dimensional unfolded image of the hole wall.

[0024] In some examples of this invention, the step of testing the model by placing an independent sample set that was not used in training, checking the average intersection-over-union ratio, loss value, and accuracy of the model output, and verifying the model's ability to extract weak surface features and its recognition stability further includes: using a joint loss function as the model training objective function; freezing all parameters of the backbone network MobileNetV2, pausing its gradient updates, using a relatively high initial learning rate, and utilizing the general features obtained from pre-training on the source domain dataset to prioritize adjusting the parameters of the decoder part to adapt to the target domain data distribution; unfreezing the backbone network parameters, setting all model parameters to a trainable state, and using the Adam optimizer according to a preset epoch. The node performs training, combining a fixed epoch period with cosine annealing scheduling. It periodically evaluates performance on the validation set and saves the optimal weights. Based on the general knowledge inherited from the source domain dataset, it adapts to the target domain dataset and finally obtains the optimal model parameters for the target domain, which are used for high-precision segmentation and recognition of weak surfaces in downhole boreholes. The test set that did not participate in the training is put into the trained model for testing. The average intersection-union ratio, loss value, and accuracy index of weak surface recognition are calculated. The change of loss value during the training process is monitored to ensure that the model accuracy meets the standard and the loss value steadily converges to a low level, thus verifying the model's generalization ability.

[0025] According to the present invention, a computer program is stored thereon, which, when executed, implements the above-described method for detecting weak surfaces in downhole boreholes based on dual attention and transfer learning.

[0026] According to the processor of the present invention, the processor is communicatively connected to the aforementioned memory, and a computer program on the memory can be executed on the processor.

[0027] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0028] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:

[0029] Figure 1 This is a flowchart of a downhole borehole weak surface detection method based on dual attention and transfer learning, according to an embodiment of the present invention.

[0030] Figure 2 These are schematic diagrams of the original target domain data and the target domain data after being expanded by brightness enhancement, 180° rotation, and noise enhancement, respectively, according to embodiments of the present invention.

[0031] Figure 3This is the initialization of the DeepLabv3+ base model for this embodiment of the invention;

[0032] Figure 4 This is a diagram illustrating the attention mechanism architecture that integrates CBAM and CCNET according to an embodiment of the present invention.

[0033] Figure 5 This is a diagram of the improved deeplabV3+ model according to an embodiment of the present invention;

[0034] Figure 6 This is a graph showing the change in training loss according to an embodiment of the present invention;

[0035] Figure 7 This is a graph showing the mIoU variation in an embodiment of the present invention.

[0036] Figure 8 The image shows the detection results of the downhole borehole weak surface detection method based on dual attention and transfer learning in an embodiment of the present invention. Recognition result a is the weak surface detection recognition result of the original image a, recognition result b is the weak surface detection recognition result of the original image b, recognition result c is the weak surface detection recognition result of the original image c, and recognition result d is the weak surface detection recognition result of the original image d.

[0037] Figure 9 This is a partial flowchart of the downhole borehole weak surface detection method based on dual attention and transfer learning according to an embodiment of the present invention.

[0038] Figure 10 This is a partial flowchart of the downhole borehole weak surface detection method based on dual attention and transfer learning according to an embodiment of the present invention.

[0039] Figure 11 This is a partial flowchart of the downhole borehole weak surface detection method based on dual attention and transfer learning according to an embodiment of the present invention.

[0040] Figure 12 This is a partial flowchart of the downhole borehole weak surface detection method based on dual attention and transfer learning, according to an embodiment of the present invention. Detailed Implementation

[0041] The embodiments of the present invention are described in detail below. The embodiments described with reference to the accompanying drawings are exemplary. The embodiments of the present invention are described in detail below.

[0042] The following is for reference. Figures 1-12 This invention describes a downhole borehole weak surface detection method based on dual attention and transfer learning according to embodiments of the present invention.

[0043] Combination Figures 1-12 As shown, the downhole borehole weak surface detection method based on dual attention and transfer learning according to the present invention mainly includes the following steps:

[0044] S1. Construct a dataset of images of weak surfaces in downhole boreholes, and perform data preprocessing and enhancement to generate a dataset of the target domain.

[0045] S2. Select the Crack500 public road weak surface dataset as the source domain dataset, extract the morphological features of the source domain dataset and the target domain dataset, and then select source domain samples in the source domain dataset whose similarity to the target domain dataset is within a preset range.

[0046] S3. Construct an initial DeepLabv3+ base model based on transfer learning, reuse the road weak surface model weights obtained by pre-training the selected source domain samples, use them as the initial basis for the borehole weak surface detection model, and directly transfer the road weak surface model weights to the initial DeepLabv3+ base model based on transfer learning corresponding to the target domain dataset to be trained, thereby accelerating the training process.

[0047] S4. On the DeepLabv3+ basic model based on transfer learning, the CBAM channel spatial attention module and CCNET cross attention module are embedded. The model is optimized through parameter tuning and feature fusion logic to improve the accuracy of weak surface feature extraction.

[0048] S5. Put the independent sample set that was not used in training into the model for testing, check the average intersection-union ratio, loss value and accuracy index of the model output, and verify the model's ability to extract weak surface features and its recognition stability.

[0049] S6. Apply the trained model to the new borehole weak surface image to obtain the borehole weak surface detection results.

[0050] Combination Figure 9 As shown, step S1 further includes:

[0051] The borehole wall features of underground coal mine boreholes are dynamically scanned using borehole inspection equipment. The resulting rock strata columnar diagram is generated by the accompanying software, and a two-dimensional unfolded image of the borehole wall is obtained.

[0052] Using the LabelMe annotation tool, pixel-level semantic annotations are performed on weak surfaces in the image to generate corresponding binary masks and VOC format annotation files, forming an initial target domain dataset with semantic labels.

[0053] The labeled target domain dataset is divided into training set, validation set and test set according to a preset ratio, which are used for model training, parameter tuning and performance verification, respectively.

[0054] Geometric transformations, lighting simulations, and noise additions were used to augment the training, validation, and test sets.

[0055] Specifically, borehole imaging equipment is used to scan the surrounding rock of the tunnel to obtain two-dimensional unfolded images of the borehole wall. Professional technicians select and preprocess the acquired images, and use the image annotation tool LabelMe to perform pixel-level fine annotation of geological defects such as weak surfaces in these images, generating corresponding binary masks and VOC format annotation files to form an initial target domain dataset with semantic labels.

[0056] Furthermore, the labeled target domain dataset is divided into training set, validation set, and test set according to the proportions of 70%, 20%, and 10%, respectively, for model training, parameter tuning, and performance verification.

[0057] To address the issue of scarce samples in the target domain dataset, various data augmentation techniques are employed to expand the original target domain dataset.

[0058] Enhanced operations such as Figure 2 As shown, the specific operations include: random horizontal / vertical image flipping; brightness and contrast adjustment: randomly adjusting the image gamma value to simulate different lighting conditions; and adding Gaussian noise: adding random Gaussian noise to the image to simulate dust interference.

[0059] By combining the above enhancement strategies, the number of samples in the target domain dataset is expanded to 2-3 times the original number, forming the final target domain dataset for model training, which contains 1000 samples.

[0060] In some embodiments of the present invention, step S2 further includes:

[0061] The publicly available Crack500 road weak surface dataset was used as the source domain dataset. The source domain dataset includes road crack images and pixel-level annotations. The road crack images have linear defect features similar to the weak surfaces in the two-dimensional unfolded images of the hole walls. The number of samples in the source domain dataset is greater than the number of samples in the target domain dataset.

[0062] Invalid samples that affect feature extraction are removed from both the source and target domain datasets, and the remaining valid samples are cropped to a uniform size and their pixel values ​​are normalized.

[0063] A large-scale public weak surface dataset is selected as the source domain dataset. In the embodiments of the present invention, the Crack500 public weak surface dataset is used as the source domain dataset, which contains 3514 high-resolution road crack images and pixel-level annotations.

[0064] To achieve effective knowledge transfer from the source domain dataset (road weak surfaces) to the target domain dataset (weak surface images) and avoid negative transfer, this invention first filters the source domain dataset, retaining samples with feature distributions similar to those in the target domain dataset. The filtering process is based on the Maximum Mean Discrepancy (MMD) theory, calculated by determining the distribution similarity between the source and target domain samples.

[0065] First, feature vectors characterizing the morphological properties of weak faces are extracted from both the source and target domain datasets. These morphological properties preferably include the size, geometry, spatial extensibility, and topological structure of the weak faces. Specifically, the following features are extracted for each connected component of a weak face in the image samples from both the source and target domain datasets: area, perimeter, principal axis length, secondary axis length, and number of branches. For image samples containing multiple connected components, the final feature vector is the average of all connected component features.

[0066] Extract morphological features from valid samples in the source domain dataset, and standardize the features according to the formula:

[0067] X S ,

[0068] in, These are the original values ​​of the morphological features of the source domain dataset. The mean of the morphological features of the source domain dataset. X represents the standard deviation. S The values ​​are the morphological features of the source domain dataset after standardization.

[0069] Extract morphological features from valid samples in the target domain dataset, and standardize the features according to the formula:

[0070] Y S ,

[0071] Where y represents the original values ​​of the morphological features of the target domain dataset. The mean of the morphological features of the target domain dataset. Y represents the standard deviation. S The values ​​are the morphological features of the target domain dataset after standardization.

[0072] The distribution similarity is then calculated using the MMD unbiased estimation formula, which is:

[0073] ,

[0074] Where m and n are the number of samples in the source and target datasets, respectively, F is the mapping function, q and p are the morphological feature distributions of the source and target datasets, respectively, k is the Gaussian kernel function, and i and j are the sample indices in the source and / or target datasets. This paper uses the Gaussian kernel function:

[0075] ,

[0076] in, The MMD value is the bandwidth parameter of the kernel function. The smaller the MMD value, the closer the morphological feature distributions in the source domain dataset and the target domain dataset are.

[0077] To further analyze the overall similarity between each road weak surface image in the source domain dataset and the weak surface images in the target domain dataset, a single-sample similarity score is defined based on the kernel mean term in the MMD formula:

[0078] ,

[0079] in, This represents the average similarity between the i-th weak surface image of a road in the source domain dataset and all weak surface image samples in the target domain dataset. The larger the value, the more similar the i-th road weak surface image in the source domain dataset is to the overall weak surface image samples in the target domain dataset.

[0080] The weak facets of the source domain dataset were calculated based on single-sample similarity scores, and finally divided into 5 intervals. The sample distribution of each interval is shown in the table below:

[0081] Table 1. Sample Distribution Table for Similarity Intervals

[0082] Similarity score range Sample size Percentage (%) 0.0 - 0.2 610 17.36 0.2 - 0.4 901 25.64 0.4 - 0.6 1795 51.08 0.6 - 0.8 160 4.55 0.8 - 1.0 48 1.37

[0083] Combination Figure 10 As shown, step S3 further includes:

[0084] MobileNetV2 was used as the backbone network for initializing the DeepLabv3+ base model based on transfer learning;

[0085] The deep features extracted by MobileNetV2 are extracted at multiple scales through a structure that includes 1×1 convolution, 3×3 dilated convolution with different dilation rates, and image pooling.

[0086] The road weak surface model weights are obtained by reusing samples from the selected source domain dataset for pre-training. These weights are used as the initialization basis for the borehole weak surface detection model. The road weak surface model weights are then directly transferred to the DeepLabv3+ base model based on transfer learning, which is the same as the training set to be trained.

[0087] Combination Figure 11 As shown, step S4 further includes:

[0088] Embed the CBAM channel spatial attention module in the feature fusion layer of the model decoder of the DeepLabv3+ base model;

[0089] The CCNET cross-attention module is connected to the output of the ASPP multi-scale feature extraction module of the DeepLabv3+ basic model.

[0090] By combining the road weakness model weights in the transfer learning stage, the model learning rate is adjusted, and the feature concatenation logic is optimized to ensure that the deep features refined by the CBAM module and enhanced by the CCNET module are fused with the high-resolution low-level features passed from the shallow layers of the backbone network through skip connections.

[0091] Specifically, this invention is based on the standard DeepLabv3+ model, such as... Figure 3 As shown, an innovative dual attention mechanism combining "local perception" and "global context" is introduced. By cascading and integrating the CBAM channel spatial attention module and the CCNET cross-attention module, the deeplabV3+ model's ability to extract and integrate weak surface features is enhanced from three dimensions: feature channels, spatial regions, and long-range dependencies. This significantly improves the deeplabV3+ model's ability to focus on key weak surface features and its recognition accuracy. The architecture diagram of the attention mechanism integrating CBAM and CCNET is shown below. Figure 4 As shown.

[0092] To enhance the model's ability to focus on key features of weak areas, a Convolutional Block Attention Module (CBAM) is embedded after the output of the bottleneck layers in the MobileNetV2 backbone network. This module operates in a feedforward sequence manner and specifically includes:

[0093] The Channel Attention submodule first performs global average pooling and global max pooling on the input feature map to obtain two different channel descriptors. Then, these two descriptors are input into a shared multilayer perceptron (MLP) to generate a channel attention weight matrix. Finally, the weight matrix is ​​multiplied with the original input feature map to achieve feature recalibration in the channel dimension, thereby enhancing the information-rich feature channels.

[0094] Spatial Attention submodule: It takes the feature map optimized by channel attention as input, performs average pooling and max pooling along the channel dimension, and concatenates the two two-dimensional feature maps. Then, it performs a convolution operation through a standard convolutional layer to generate a spatial attention weight map. Finally, it multiplies the weight map with the input feature map to highlight the spatial regions with significant features.

[0095] To capture long-range dependencies and global contextual information of weak surfaces, a CCNET (Criss-Cross Network) module is introduced after the Dilated Spatial Pyramid Pooling (ASPP) module in the DeepLabv3+ model. This CCNET module operates through a Criss-Cross Attention mechanism: for any pixel in the feature map, this operation aggregates the feature information of all pixels in its row and column, thereby establishing efficient long-range dependencies. The architecture diagram of the attention mechanism combining CBAM and CCNET is shown below. Figure 5 As shown.

[0096] The deep, high-level semantic features refined by the CBAM module and enhanced by the CCNET module are concatenated and fused with high-resolution, detail-rich low-level features passed from the shallow layers of the backbone network via skip connections. The fused feature map is then processed by a 3×3 convolutional layer for feature integration and dimensionality reduction. Subsequently, the feature map resolution is gradually restored to the same level as the input image through four bilinear upsampling operations. Finally, a 1×1 convolutional layer is used to adjust the number of channels and output a probability map of each pixel belonging to the weak surface category.

[0097] Combination Figure 12 As shown, step S5 includes:

[0098] The joint loss function is used as the objective function for model training;

[0099] Freeze all parameters of the backbone network MobileNetV2, pause its gradient updates, adopt a relatively high initial learning rate, utilize the general features obtained from pre-training on the source domain dataset, and prioritize adjusting the parameters of the decoder part to adapt to the target domain data distribution.

[0100] Unfreeze the backbone network parameters, set all model parameters to trainable state, use Adam optimizer, execute training according to preset epoch nodes, combine fixed epoch period and cosine annealing scheduling, periodically evaluate performance on the validation set and save the optimal weights, adapt to the target domain dataset based on inheriting the general knowledge in the source domain dataset, and finally obtain the optimal model parameters in the target domain for high-precision segmentation and recognition of weak surfaces in downhole boreholes.

[0101] The test set that was not used in training is put into the trained model for testing. The average intersection-union ratio, loss value and accuracy index of weak surface identification are calculated. The change of loss value during training is monitored to ensure that the model accuracy meets the standard and the loss value is stably converged to a low level, thus verifying the model's generalization ability.

[0102] Specifically, to address the core challenge of sample scarcity in identifying weak surfaces in underground mine boreholes, a cross-domain transfer learning scheme is proposed for the improved DeepLabv3+ model, which integrates a dual attention mechanism. This scheme abandons the traditional random initialization training method from scratch, instead introducing pre-trained weights from a road weak surface dataset. Through a two-stage transfer learning process of "source domain pre-training - target domain fine-tuning," the general feature extraction capabilities of road scenes (such as edge and texture modeling) are transferred to the borehole weak surface identification task. This helps the model quickly adapt to specific features such as low-light subtle weak surfaces and irregular weak surfaces in scenarios with limited samples, ultimately improving recognition accuracy and generalization ability. The final improved deeplabv3+ model is as follows: Figure 5 As shown.

[0103] To avoid negative transfer leading to model performance degradation, we analyze the feature differences between road crack samples and mine borehole crack images based on sample feature similarity. Since some road crack samples and mine borehole cracks have excessively different features, which could interfere with the target domain (mine borehole crack) recognition task, we remove these significantly different road crack images and retain samples that are complementary to and highly similar to mine borehole cracks, achieving complementary enhancement at the feature level.

[0104] Comparative experiments were conducted by setting different similarity intervals (0.0-1.0, 0.2-1.0, 0.4-1.0, 0.6-1.0), and their weights were transferred to the target model. The average intersection-union ratio (mIoU) and accuracy of the model under each interval were statistically analyzed, as shown in Table 2, which compares the similarity intervals of road crack samples with the model performance.

[0105] Table 2 Comparison of road crack sample similarity intervals and model performance

[0106]

[0107] As shown in Table 2, combined with the table of the number of simulated samples in the previous period (2896 samples in the 0.2-1.0 range, accounting for 82.64% of the source domain), this range not only eliminated high-discrepancy samples <0.2 (to avoid negative transfer), but also fully retained the effective supplementary samples in the 0.2-0.4 range. This allows the model to simultaneously acquire "general features (0.2-0.4) + high-matching features (0.4-1.0)" during training. Therefore, the corresponding mIoU (74.0-76.3%) and Accuracy (89.5-91.5%) are the highest among all ranges, which fully meets the design goal of "feature complementarity enhancement".

[0108] Therefore, a road weak surface source domain dataset with a similarity range of 0.2-1.0 was used to pre-train the improved DeepLabv3+ model integrating CBAM and CCNET attention mechanisms. Model training aimed to minimize the joint loss function L_total, which by default uses weighted Focal loss (class weights configured as cls_weights=[1,10]) and supports optional Dice loss to improve robustness to boundaries and small targets. The mathematical expression is:

[0109] L_total = L_Focal + λ·L_Dice, (where λ=0, only Focal loss is enabled; when boundary learning needs to be strengthened, dice_loss=True can be set to adjust λ to a non-zero value).

[0110] The pre-trained weight file is loaded into the improved DeepLabv3+ model as the initial values ​​for the network parameters. Subsequently, the model is fine-tuned in a supervised manner using the target domain dataset D_target. The fine-tuning process employs a phased strategy, as follows:

[0111] Freeze all parameters of the backbone network MobileNetV2, pause its gradient updates, and train only the parameters of the decoder part (including the ASPP module, dual attention module, feature fusion layer and all subsequent convolutional layers); adopt a relatively high initial learning rate, utilize the general features obtained by pre-training on the source domain dataset, and prioritize adjusting the decoder part to adapt to the distribution of the target domain dataset.

[0112] The backbone network parameters are unfrozen, and all model parameters are set to a trainable state for end-to-end joint fine-tuning. The Adam optimizer is employed, with the initial learning rate set according to adaptive rules and dynamically adjusted via cosine annealing learning rate scheduling. Staged adaptive scaling ensures stable convergence. Training is performed at preset epoch nodes, combining a fixed epoch period with cosine annealing scheduling. Performance is periodically evaluated on the validation set, and optimal weights are saved. Based on inheriting general knowledge from the source domain, features specific to downhole weak surface images are adapted to ultimately obtain the optimal model parameters for the target domain, used for high-precision segmentation and recognition of weak surfaces in downhole boreholes.

[0113] After training, the model's training loss was 0.51, the validation set loss was 0.84, and the mean intersection-union ratio (mIoU) was 78.32%. The training loss variation curve is shown below. Figure 6 As shown, the curve of the average crossover ratio is as follows: Figure 7 As shown.

[0114] An independent test set (10% of the target domain dataset) that was not used in training was put into the trained model for testing. Accuracy metrics such as Intersection over Union (IoU) and Pixel Accuracy (PA) for weak surface recognition were calculated. The changes in loss values ​​during training were monitored to ensure that the model accuracy met the target and that the loss value steadily converged to a low level, thus verifying the model's generalization ability.

[0115] In some embodiments of the present invention, step S6 includes:

[0116] The trained and validated model was applied to the downhole borehole detection system. Weak surface identification was first performed on newly acquired borehole weak surface images. Some identification results are shown below. Figure 8 As shown, recognition result a is the weak surface detection recognition result of the original image a, recognition result b is the weak surface detection recognition result of the original image b, recognition result c is the weak surface detection recognition result of the original image c, and recognition result d is the weak surface detection recognition result of the original image d. The pixel-level segmentation results of the borehole weak surfaces are obtained because the weak surface development characteristics are the core basis for judging the extent of the loosened zone of the surrounding rock. In underground engineering, after the surrounding rock is disturbed by excavation, the internal stress is redistributed, and the integrity of the rock mass structure in the loosened zone area is destroyed, manifested as a significant increase in the number, density, and connectivity of weak surfaces (fractures), and the development depth of the weak surfaces is highly correlated with the boundary of the loosened zone. Therefore, combining the extent of the loosened zone can clarify the key parameters of the support design—the support depth must cover the entire loosened zone area, and the support strength must be adjusted according to the degree of weak surface development within the loosened zone (the denser the weak surfaces, the higher the strength of the anchor bolt + anchor cable combined support required).

[0117] Ultimately, the model identification results, by correlating the development of weak surfaces with the range of loosened zones, provide data support for accurately delineating support boundaries and optimizing support schemes, effectively avoiding the collapse of loosened zone rock masses due to insufficient support range, or the waste of engineering costs due to excessive support.

[0118] According to the present invention, a computer program is stored thereon, which, when executed, implements the above-described method for detecting weak surfaces in downhole boreholes based on dual attention and transfer learning.

[0119] According to the processor of the present invention, the processor is communicatively connected to the aforementioned memory, and the computer program on the memory can be executed on the processor.

[0120] In the description of this invention, it should be understood that the terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "clockwise," "counterclockwise," "axial," "radial," and "circumferential" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.

[0121] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example.

[0122] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.

Claims

1. A method for detecting weak plane in borehole based on dual attention and transfer learning, characterized in that, The method comprises the following steps: constructing a borehole weak face image dataset and performing data preprocessing and enhancement to generate a target domain dataset; selecting a Crack500 public road weak face dataset as a source domain dataset, extracting morphological features of the source domain dataset and the target domain dataset, and screening source domain samples with a preset interval of similarity to the target domain dataset in the source domain dataset; constructing an initial DeepLabv3+ model based on transfer learning, reusing the road weak face model weight pre-trained by the screened source domain samples as an initial basis of the borehole weak face detection model, and migrating the road weak face model weight to the initial DeepLabv3+ model based on transfer learning corresponding to the target domain dataset to be trained to accelerate the training process; embedding a CBAM channel and spatial attention module and a CCNET cross-attention module in the initial DeepLabv3+ model based on transfer learning, optimizing the model through parameter tuning and feature fusion logic to improve the weak face feature extraction accuracy, which comprises the following steps: a. embedding a CBAM channel and spatial attention module at a feature fusion layer of a model decoder of the DeepLabv3+ model; b. connecting a CCNET cross-attention module to an output end of an ASPP multi-scale feature extraction module of the DeepLabv3+ model; c. adjusting the model learning rate and optimizing the feature splicing logic in combination with the road weak face model weight in the transfer learning stage to ensure that the deep features refined by the CBAM module and enhanced by the CCNET module are fused with the high-resolution low-level features transmitted by the shallow network through the skip connection; putting an independent sample set not involved in the training into the model for testing to check the average intersection over union, loss value and accuracy rate indicators of the model output, and verifying the extraction ability and recognition stability of the model for weak face features; applying the trained model to new borehole weak face images to obtain the borehole weak face detection results.

2. The method of claim 1, wherein the method is based on a dual attention and transfer learning for detecting weak planes in a borehole. The step of constructing a borehole weak face image dataset and performing data preprocessing and enhancement to generate a target domain dataset further comprises: using a borehole peeping device to dynamically scan the hole wall features of the coal mine underground borehole, generating a rock column chart through a matching software, and obtaining a two-dimensional unfolded image of the hole wall; using a LabelMe labeling tool to perform pixel-level semantic labeling on the weak face in the image to generate corresponding binary masks and VOC format labeling files, forming an initial target domain dataset with semantic labels; dividing the labeled target domain dataset into a training set, a validation set and a test set according to a preset ratio, respectively for model training, parameter tuning and performance verification; expanding the training set, the validation set and the test set by geometric transformation, light simulation and noise addition.

3. The method of claim 2, wherein the method is based on a dual attention and transfer learning for detecting weak planes in a borehole. The selected Crack500 discloses a road weak surface data set as a source domain data set, and morphological features of the source domain data set and the target domain data set are extracted, so that the step of screening source domain samples with a similarity to the target domain data set in a preset interval in the source domain data set further comprises: The disclosed Crack500 road weak surface data set is used as the source domain data set, the source domain data set includes road crack images and pixel-level annotations, and the road crack images have linear defect characteristics similar to weak surfaces in a two-dimensional expansion image of a hole wall, wherein the number of samples in the source domain data set is greater than the number of samples in the target domain data set; Invalid samples affecting feature extraction in the source domain data set and the target domain data set are removed, and the remaining valid samples are subjected to uniform size cropping and pixel value normalization processing; Morphological features of the valid samples in the source domain data set are extracted, and the features are standardized according to a formula: X S , wherein, is the morphological feature raw value of the source domain dataset, is the morphological feature mean value of the source domain dataset, is the standard deviation, X S is the morphological feature normalized value of the source domain dataset; Morphological features of the valid samples in the target domain data set are extracted, and the features are standardized according to a formula: Y S , Wherein, y is the morphological feature original value of the target domain data set, is the mean value of the morphological feature of the target domain data set, is the standard deviation, Y S is the value of the morphological feature of the target domain data set after standardization processing; The distribution similarity is calculated by an MMD unbiased estimation formula, and the formula is: , Wherein, m and n are the number of samples in the source domain data set and the target domain data set, F is a mapping function, q and p are the morphological feature distributions of the source domain data set and the target domain data set, k is a Gaussian kernel function, i and j are sample serial numbers in the source domain data set and / or the target domain data set, and a Gaussian kernel function is used: , wherein, is a bandwidth parameter of the kernel function, the smaller the MMD value, the closer the morphological feature distribution in the source domain dataset and the target domain dataset. To further analyze the similarity between each road weak surface picture in the source domain data set and the weak surface image as a whole in the target domain data, based on the kernel mean term in the MMD formula, a single-sample similarity score is defined: , wherein, represents the average similarity of the i-th road weak face picture in the source domain data set and all weak face image samples in the target domain data set; The greater the i-th road weak face picture in the source domain data set is more similar to the weak face image samples in the target domain data set as a whole.

4. The method of claim 3, wherein the method is based on a dual attention and transfer learning based weak plane detection for downhole boreholes. The morphological features in the source domain data set and the target domain data set each include at least one of area, perimeter, major axis length, minor axis length, and branch number.

5. The method of claim 2, wherein the method is based on a dual attention and transfer learning based borehole weak plane detection method. The step of constructing an initialization DeepLabv3+ basic model based on transfer learning, reusing the road weak surface model weight pre-trained by the screened source domain samples as the initialization basis of the drilling weak surface detection model, and directly migrating the road weak surface model weight to the initialization DeepLabv3+ basic model based on transfer learning corresponding to the training set to be trained to speed up the training process further comprises: MobileNetV2 is used as the stem network of the initialization DeepLabv3+ basic model based on transfer learning; Deep features extracted by the MobileNetV2 are subjected to multi-scale feature extraction through a structure including 1x1 convolution, 3x3 dilated convolution with different expansion rates, and image pooling; The road weak surface model weight pre-trained by the screened samples in the source domain data set is reused as the initialization basis of the drilling weak surface detection model, and the road weak surface model weight is directly migrated to the initialization DeepLabv3+ basic model based on transfer learning corresponding to the training set to be trained.

6. The method of claim 2, wherein the method is based on a dual attention and transfer learning based weak plane detection for downhole boreholes. The step of embedding the CBAM channel-spatial attention module at the feature fusion layer of the model decoder of the DeepLabv3+ base model further comprises: performing global average pooling and global maximum pooling on the input feature map respectively to obtain two different channel descriptors, inputting the two descriptors into a shared multi-layer perception, generating a channel attention weight matrix after operation, and performing multiplication operation on the weight matrix and the original input feature map to realize feature re-labeling in the channel dimension, suppress irrelevant channels and highlight weak surface related features; taking the feature map optimized by the channel attention as input, performing average pooling and maximum pooling along the channel dimension respectively, and splicing the two obtained two-dimensional feature maps; performing convolution operation through a standard convolution layer to generate a spatial attention weight map; multiplying the spatial attention weight map and the input feature map to focus on weak surface spatial positions and improve the ability to capture weak surface local features of the hole wall two-dimensional unfolded image.

7. The method of claim 2, wherein the method is based on a dual attention and transfer learning based borehole weakness detection method. The step of putting the independent sample set not participating in training into the model for testing, checking the average intersection over union, loss value and accuracy rate indicators of the model output, and verifying the extraction ability and recognition stability of the model to weak surface features further comprises: using a joint loss function as the model training objective function; freezing all parameters of the backbone network MobileNetV2, suspending its gradient update, using a relatively high initial learning rate, using the general features obtained by pre-training the source domain data set, and preferentially adjusting the parameters of the decoder part to adapt to the target domain data distribution; unfreezing the backbone network parameters, setting the full model parameters to a trainable state, using the Adam optimizer, performing training according to the preset epoch node, combining fixed epoch period and cosine annealing scheduling, periodically evaluating performance in the validation set and saving the optimal weights, adapting the target domain data set on the basis of inheriting the general knowledge in the source domain data set, and finally obtaining the target domain optimal model parameters for downhole borehole weak surface high-precision segmentation and recognition; putting the test set not participating in training into the trained model for testing, calculating the average intersection over union, loss value and accuracy rate indicators of the weak surface recognition, monitoring the loss value change in the training process, ensuring that the model precision meets the standard and the loss value stably converges to a low level, and verifying the model generalization ability.

8. A storage storing a computer program thereon, characterized by The computer program is executed to implement the downhole borehole weak surface detection method based on double attention and transfer learning in any one of claims 1-7.

9. A processor, comprising: The processor is in communication connection with the memory in claim 8, and the computer program on the memory can be executed on the processor.

Citation Information

Patent Citations

  • Substation environment understanding method based on improved DeepLab V3 + network

    CN115359411A

  • Multi-attention codec network and system applied to skin lesion segmentation

    CN117496144A