A weak target image detection method for micro-pores and micro-cracks in carbonate rocks
Patent Information
- Application Number
- CN202611467439.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-21
- Publication Date
- 2026-10-30
AI Technical Summary
[0004]针对现有技术在面对复杂成像条件与弱目标共存的碳酸盐岩图像时,普遍存在适应性差、响应衰减、类别混淆和弱目标漏检等核心问题,难以实现高精度、高鲁棒性的微孔隙与微裂缝联合检测,本发明提供一种碳酸盐岩中微孔隙与微裂缝的弱目标图像检测方法,实现两类弱目标的高精度分离检测,提升检测准确率与鲁棒性
[0012]本发明通过多域自适应增强机制对碳酸盐岩可见光图像进行弱目标特征增强处理,有效提升微孔隙与微裂缝等低对比度弱目标的响应强度并抑制背景干扰;继而通过主干网络提取多尺度上下文特征,增强对结构与语义的全局感知能力;在此基础上,分别利用微孔隙尺度敏感分支和微裂缝方向敏感分支提取孔隙特征与裂缝特征,并引入互补竞争门控机制,在同一空间位置对两类特征施加软竞争约束,使其中一种响应获得更高门控权重,从而有效抑制因形态相似性导致的类别混淆与背景结构的双重激活;随后,将经门控调制的孔隙特征与裂缝特征拼接生成形态引导增强特征,并通过双向融合路径将其跨尺度传播至特征金字塔的每一层,使微孔隙检测分支与微裂缝检测分支均能基于融合了形态先验的多尺度特征进行精准预测,最终同步输出分类概率、定位结果、分割概率及裂缝方向预测结果。因此,本发明能够有效解决现有技术中微孔隙与微裂缝因形态差异导致响应混淆、背景结构同时触发两类目标响应的问题,实现两类弱目标的高精度分离检测,提升检测准确率与鲁棒性,为碳酸盐岩储层微观结构的智能评估提供可靠技术支撑。
Smart Images

Figure CN123015960A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, specifically to a method for detecting weak targets in carbonate rocks through micropores and microcracks. Background Technology
[0002] Microporosity and microfractures in carbonate rocks are key geological features for evaluating reservoir performance, seepage channels, and rock structural integrity. Currently, the detection of microporosity and microfractures in carbonate rock surface images typically employs traditional image processing methods, such as fixed-parameter grayscale thresholding, contrast enhancement, edge sharpening, or morphological filtering, relying on manually set global parameters for image preprocessing and binarization. Although some studies have introduced general deep learning models, such as U-Net, MaskR-CNN, or Transformer-based segmentation networks, to extract features through multi-layer convolution and attention mechanisms, in practical applications, due to problems such as mineral grain reflection, shadows, scratches, complex matrix textures, and variable imaging conditions (e.g., uneven illumination, resolution differences) on carbonate rock sample surfaces, microporosity often appears as low-contrast, small-area, and blurred-boundary point-like or blocky structures, while microfractures exhibit a slender, continuous but weakly responsive and easily broken linear morphology. Both are easily confused with background textures or mineral edges in image space.
[0003] In existing depth detection methods, the response of weak targets often decreases significantly due to information loss during continuous downsampling. Simply relying on multi-scale feature pyramids or attention mechanisms is insufficient to effectively recover their original structural details. More importantly, micropores and microcracks differ fundamentally in morphology—the former are approximately circular or locally clustered, while the latter extend in a strong direction—but traditional methods typically employ a uniform feature extraction and response enhancement path. This leads to the simultaneous activation of both pore and crack detection branches by background structures such as particle edges, surface scratches, or shadows, causing severe class confusion and false detections. For example, the edge of a mineral particle may be misclassified as multiple isolated pores or identified as a broken crack fragment, resulting in high rates of over-detection of pores, crack breaks, and class cross-class misclassification in the detection results. Furthermore, the equal weighting of all target instances during training causes a large number of small-area, low-gray-contrast micropores and weak cracks to be systematically ignored due to their minimal contribution to the gradient, further reducing detection integrity. Summary of the Invention
[0004] To address the core issues of existing technologies when dealing with complex imaging conditions and weak targets in carbonate rock images, such as poor adaptability, response attenuation, category confusion, and missed detection of weak targets, making it difficult to achieve high-precision and robust joint detection of micropores and microcracks, this invention provides a method for weak target image detection of micropores and microcracks in carbonate rocks. This method achieves high-precision separation and detection of the two types of weak targets, improving detection accuracy and robustness.
[0005] To achieve the above objectives, the present invention provides the following technical solution:
[0006] A method for weak target image detection of micropores and microcracks in carbonate rocks, comprising the following steps:
[0007] Step S1: Obtain a visible light image of the carbonate rock surface and perform weak target feature enhancement processing to obtain enhanced features;
[0008] Step S2: Based on the enhanced features, multi-scale features are extracted through the backbone network of the joint detection network for micropores and microcracks in carbonate rocks, and context modeling is performed to obtain context features with a large receptive field that can capture structural and semantic features.
[0009] Step S3: Based on the context features obtained in step S2, pore features and crack features are extracted through a micropore scale-sensitive branch and a microcrack direction-sensitive branch, respectively. The microcrack direction-sensitive branch employs constrained learning line-aware convolution, distributing sampling points along the local crack tangential direction and applying constrained displacement in the normal direction. Complementary competitive gating is applied to the pore features and crack features, normalizing them in both pore and crack dimensions. This ensures that the morphological responses of pores and cracks at the same spatial location form a competitive weight allocation to suppress category confusion.
[0010] Step S4: The gated and modulated pore features are spliced with the crack features to generate morphology-guided enhancement features, which are propagated to the multi-scale feature layer through a bidirectional fusion path to form a feature pyramid. Each layer of the feature pyramid is used as the input to the micropore detection branch and the microcrack detection branch, respectively, and the corresponding classification probability, localization result and segmentation probability are output. The microcrack detection branch also outputs the crack direction prediction result.
[0011] Compared with the prior art, the beneficial effects of the present invention are:
[0012] This invention enhances the weak target features of visible light images of carbonate rocks through a multi-domain adaptive enhancement mechanism, effectively improving the response intensity of low-contrast weak targets such as micropores and microcracks while suppressing background interference. Then, it extracts multi-scale contextual features through a backbone network, enhancing the global perception of structure and semantics. Based on this, it extracts pore and crack features using a micropore scale-sensitive branch and a microcrack direction-sensitive branch, respectively, and introduces a complementary competitive gating mechanism. This mechanism applies soft competitive constraints to the two types of features at the same spatial location, giving one type of response a higher gating weight, thereby effectively suppressing category confusion caused by morphological similarity and the dual activation of background structures. Subsequently, the gated pore and crack features are concatenated to generate morphology-guided enhancement features, which are then propagated across scales to each layer of the feature pyramid via a bidirectional fusion path. This allows both the micropore detection branch and the microcrack detection branch to make accurate predictions based on multi-scale features fused with morphological priors. Finally, it synchronously outputs classification probability, localization result, segmentation probability, and crack direction prediction result. Therefore, this invention can effectively solve the problems in the prior art where the response of micropores and microcracks is confused due to the difference in morphology, and the background structure triggers the response of two types of targets at the same time. It can achieve high-precision separation and detection of two types of weak targets, improve detection accuracy and robustness, and provide reliable technical support for intelligent assessment of the microstructure of carbonate reservoirs. Attached Figure Description
[0013] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0014] Figure 1 This is a schematic flowchart of the weak target image detection method for micropores and microcracks in carbonate rocks in the embodiment.
[0015] Figure 2 This is a schematic diagram of the weak target feature enhancement process in the embodiment.
[0016] Figure 3 The diagram illustrates the process of morphology-specific dual branches and complementary competitive gating, which are the micropore scale-sensitive branch and the microcrack direction-sensitive branch in the embodiment.
[0017] Figure 4 This is a framework diagram of the combined detection network for micropores and microcracks in carbonate rocks in the embodiments.
[0018] Figure 5 Comparison of crack segmentation effects in complex backgrounds for GeoCrack class.
[0019] Figure 6 Visualization results for dynamic weak response enhancement, competitive gating, and joint output.
[0020] Figure 7 This image shows the combined detection results of pores and fractures in a self-made carbonate rock dataset. Detailed Implementation
[0021] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0022] To avoid confusion regarding the meaning of variables in different steps, this paper uniformly adopts a tensor representation method of "batch dimension - spatial dimension - channel dimension".
[0023] The pixel tensor of the batch of images input to the backbone network is denoted as ,in This indicates the number of images in a training batch; This represents the three color channels: red, green, and blue. and These represent the height and width of the input image to the backbone network, respectively, and can be taken as... , or When representing a single image, the batch dimension can be omitted. For any feature tensor , Indicates the number of feature channels. and This indicates the height and width of the feature map of this layer.
[0024] The symbol "⊙" indicates element-wise multiplication; the symbol "+" indicates element-wise addition at corresponding positions. This indicates splicing along the channel dimension; This indicates global average pooling over the spatial dimension; Indicates global max pooling; Indicates proportionally Perform upsampling; Indicates proportionally Perform downsampling; Represents the Sigmoid function; This represents the normalized exponential function; This represents a nonlinear activation function, preferably one of ReLU, SiLU, or GELU. The scalar δ without a function independent variable represents the dynamic fusion weights of the high-level feature branches in the spatial domain, and is distinguished from the activation function δ(·) by its notation and context.
[0025] The convolution operator is uniformly written as:
[0026]
[0027] In the formula, Represents input features; Indicates the side length of the convolution kernel; Indicates the void ratio; Indicates the convolution stride; This represents the trainable convolutional parameters, including the kernel weights and optional biases; Indicates core size void ratio Step length Two-dimensional convolution; Indicates batch normalization; This represents the activation function. If omitted in the formula... or The default is... and The subsequent formulas contain 1×k f or k f When performing non-square convolutions of ×1 ( (The value can be 5~15). The two kernel size subscripts of ϕ represent the height and width of the convolution kernel, respectively; the superscript dw represents depthwise separable convolution, not the hole rate.
[0028] Micropores refer to small-area, low-contrast, and indistinctly defined pore structures in carbonate rocks. They typically appear as dots, nearly circular, massive, or locally aggregated forms and are important microscopic features for evaluating reservoir space and permeability. In this invention, they are considered as one of the weak target detection objects. Microcracks refer to slender, continuous, and clearly directional tiny fissures in carbonate rocks, often formed by diagenesis or tectonic processes. They have low gray-scale contrast, discontinuous local responses, and are easily confused with mineral edges. In this invention, they are considered as another type of weak target for joint detection with micropores.
[0029] As described in the background section, existing technologies for detecting micropores and microcracks in carbonate rock surface images generally employ image enhancement methods with fixed parameters or general-purpose deep learning networks. However, these methods struggle to address the characteristics of weak targets with low contrast, small areas, and blurred boundaries. Furthermore, because micropores (point-like / block-like) and microcracks (slender / directional) have fundamental differences in morphology but share a unified feature extraction path, background structures such as mineral edges, shadows, and scratches simultaneously activate both types of detection branches, leading to severe category confusion and false detections. At the same time, weak targets are systematically ignored during training due to insufficient gradient contribution, resulting in poor detection integrity, crack breaks, and missed detection of pores.
[0030] After long-term research, the inventors discovered that the most fundamental reason for the above-mentioned predicament lies in the fact that existing methods fail to achieve joint modeling of "morphology-specific response" and "category competition suppression". Specifically, traditional models treat pores and cracks as similar targets and treat them uniformly, lacking explicit modeling of the differences in their geometric morphology. Therefore, they cannot distinguish between "true pores" and "pseudo-pores" (such as particle edges), or "true cracks" and "pseudo-cracks" (such as scratches) at the feature level. At the same time, because no competitive constraint mechanism between morphology-specific branches is introduced, the same background structure is doubly activated in the shared feature space, resulting in superimposed responses rather than competition.
[0031] Based on the above findings, the inventors proposed a method for class separation through morphologically specific branches and complementary competitive gating: On the basis of shared contextual features, independent pore and crack feature extraction paths are constructed, focusing the pore response on local clustering morphologies and the crack response on continuous linear extensions. A soft competitive mechanism is then introduced, allowing pore and crack responses at the same spatial location to mutually constrain each other through complementary gating, giving one morphologically specific branch a higher gating weight, thereby suppressing repeated activation of both target types by the background structure. The gated and modulated features are then concatenated and propagated to a multi-scale feature layer through a bidirectional fusion path, preserving morphological priors while achieving cross-scale collaborative prediction. The core of this concept lies in decoupling the originally unified detection path into a morphologically specific bi-branch structure and forming competitive weight allocation in the feature space through competitive gating. This directly solves the class confusion problem at the feature level without relying on additional annotations or post-processing, while preserving structural integrity for gradient optimization of weak targets.
[0032] Guided by this inventive concept, the inventors proposed a method for weak target image detection of micropores and microcracks in carbonate rocks. Figure 1 This is a schematic flowchart illustrating the weak target image detection method for micropores and microcracks in carbonate rocks in this embodiment. Figure 1 As shown, the method for weak target image detection of micropores and microcracks in carbonate rocks includes the following steps:
[0033] Step S1: Obtain a visible light image of the carbonate rock surface and perform weak target feature enhancement processing to obtain enhanced features.
[0034] In this embodiment, after acquiring visible light images of the carbonate rock surface, scale unification and pixel normalization are first performed to ensure that the input images maintain consistency in spatial resolution and grayscale range. This effectively reduces fluctuations in input distribution caused by differences in imaging equipment, acquisition distance, or exposure conditions, providing a stable and comparable feature basis for subsequent weak target feature enhancement processing. This ensures the reliability of frequency and spatial domain feature extraction, improves the network's generalization ability to different samples and imaging conditions, and reduces training instability or detection bias caused by inconsistent image preprocessing.
[0035] In this embodiment, a multi-domain adaptive enhancement mechanism is used to enhance weak target features. The specific process of generating enhanced features that fuse frequency and spatial domain information is as follows: Figure 2 As shown, it includes: constructing four parallel feature paths based on the same shallow basic features extracted from visible light images, including a high-frequency path in the frequency domain, a low-frequency path in the frequency domain, a low-level path in the spatial domain, and a high-level path in the spatial domain; wherein, a two-dimensional frequency domain transformation is performed on the shallow basic features, and complementary frequency masks based on the spectrum center are used to extract the high-frequency and low-frequency components in the frequency domain respectively, and the high-frequency and low-frequency features in the frequency domain are obtained through their respective learnable mappings; local edges, fine-grained textures, and short-range morphological information are extracted from the shallow basic features through the low-level path in the spatial domain to obtain the low-level features in the spatial domain; structural and contextual information with a large receptive field is extracted from the shallow basic features through the high-level path in the spatial domain to obtain the high-level features in the spatial domain; and global smoothing is performed on the shallow basic features. Average pooling is performed, and based on the pooling results, four fusion weights corresponding to the four parallel feature paths are predicted simultaneously. Softmax normalization is performed on the four parallel feature path dimensions so that the sum of the four fusion weights is 1. The corresponding high-frequency features, low-frequency features, low-level features, and high-level features in the spatial domain are weighted and summed according to the four normalized fusion weights. The weighted fusion result is then residually fused with the shallow basic features to obtain enhanced features. This enhances the low-contrast response of micropores and microcracks without destroying the original details, while suppressing background interference caused by mineral reflection, matrix texture, or shadows. This improves the detectability of weak targets under complex imaging conditions and provides more stable and discriminative feature inputs for subsequent morphology-specific analysis.
[0036] Specifically, in this embodiment, when acquiring visible light images, a representative carbonate rock sample to be tested is first selected. The sample surface is cleaned and fixed on the imaging platform. Then, one or more raw images (i.e., visible light images) of the sample surface are acquired using a common industrial camera, a microscope camera, or other visible light imaging devices. To reduce data distribution differences, it is preferable to fix the shooting distance between the camera (or other visible light imaging device) and the sample, the camera pitch angle, the focal length, and the exposure range. For example, the... The original image is denoted as:
[0037]
[0038] In the formula, Indicates the original image number; This represents the total number of original images in the image dataset; and They represent the first The height and width of the original image; Indicates the first The original pixel tensor of the original image.
[0039] After acquiring the original image of the carbonate rock surface, bilinear interpolation or region interpolation is used during scale unification to adjust the original image to the preset network input size. During pixel normalization, integer pixel values are first converted to... The interval is then standardized using channel parameters. The specific steps are as follows:
[0040]
[0041] In the formula, This indicates that the input original image will be resampled to a higher resolution. ,width Size transformation operator; This represents an image after it has been resized. Indicates the original image number; Indicates the first Original image; This represents the maximum possible value of an image pixel (set in this embodiment). ); Indicates pixel value scaling to The image after; This indicates the color channel numbers for red, green, and blue. and They represent the first The mean and standard deviation of each channel on the training set; To prevent division by zero, small positive numbers can be represented in 10. -6 Up to 10 -4 Choose between; This represents the standardized image that is ultimately input into the backbone network.
[0042] The standardized image, after scale unification and pixel normalization, is then processed using a step size of 1, a hole ratio of 1, and a kernel size of 1. 2D convolution Extracting shallow basic features :
[0043]
[0044] In the formula, The shallow basic features are represented, preserving information such as micropore edges, crack textures, mineral grains, and local brightness; I represents a batch of standard images; B represents the number of standardized images in a batch; H and W represent the height and width of the feature map, respectively; C0 represents the shallow basic features F. low The number of channels can be 24 to 64; This represents the parameters of the shallow convolution layer.
[0045] In obtaining shallow basic features F low Then, it is mapped to the frequency domain, retaining the high-frequency components on the periphery of the spectrum to highlight rapidly changing structures such as micropore boundaries, microcrack edges, and fine-grained textures, as well as extracting low-frequency features to characterize overall brightness, matrix distribution, spatial trends of pore clusters, and other slowly changing global structural information. The specific operations are as follows:
[0046]
[0047] In the formula, This indicates the shallow basic feature F low Perform a two-dimensional Fourier transform; Shift(·) means moving the zero-frequency component and its neighboring low-frequency components to the center of the spectrum, so that the high-frequency components are distributed on the periphery of the spectrum; Indicates element-wise multiplication; M h This represents a high-frequency mask used to suppress low-frequency features and extract high-frequency features; M l This represents a low-frequency mask, used to preserve the low-frequency components in the center of the spectrum and suppress the peripheral high-frequency response; F h This represents the original high-frequency features obtained in the frequency domain; Θ fh F represents the trainable parameters corresponding to the high-frequency branch in the frequency domain; fh This represents the original high-frequency features F in the frequency domain. h The high-frequency features obtained after performing learnable mapping; F l This represents the acquired low-frequency raw features in the frequency domain; Θ fl F represents the trainable parameters corresponding to the low-frequency branch in the frequency domain; fl This represents the original low-frequency features F in the frequency domain. l The low-frequency features in the frequency domain are obtained after performing a learnable mapping. Preferably, the high-frequency mask M... h With low-frequency mask M l A complementary frequency division method based on the center of the spectrum is adopted, and its cutoff range is determined according to the feature map size according to a preset ratio; the spectrum position within the low-frequency cutoff range is preserved by the low-frequency mask, and the remaining positions are preserved by the high-frequency mask.
[0048] Low-level features of the spatial domain F detand spatial domain high-level characteristics F sup During extraction, the low-level branches of the spatial domain directly extract from shallow basic features. The middle layer retains local edges, fine textures, and short-range morphological information; while high-level features in the spatial domain are directly derived from shallow basic features. Structural semantics with a large receptive field are extracted independently. Among them, high-level features in the spatial domain are extracted. shallow basic features With the same spatial dimensions and number of channels, it is used to describe a large range of matrix structures, pore-fracture combinations, and background context. The specific operation is as follows:
[0049]
[0050]
[0051] In the formula, F smooth This represents low-frequency background features, and shallow basic features F. low Having the same spatial dimensions; F low Indicates shallow basic features; The smoothing window is k. h ×k h Average pooling function (k h The values can be 3, 5, or 7; in this embodiment, k is preferred. h =7), average pooling uses a padding method that matches the input size to keep the output space size constant; Represents the original shallow features F low The high-frequency residuals represent the rapidly changing portions relative to the locally smooth background. These residuals simultaneously contain pore edges, crack boundaries, fine-grained textures, and some random noise. Under the joint optimization of the detection supervision loss, this mapping enhances the high-frequency structural response related to pore and crack detection and suppresses some task-independent perturbations. det F represents the trainable parameters of the lower-level branches in the spatial domain; det This represents the low-level features of the spatial domain obtained through learnable mapping; and Indicates the characteristics of the intermediate space under different receptive fields; , and F represents the trainable parameters of the corresponding convolutional layer. sup This represents the high-level features of the spatial domain obtained through learnable mapping.
[0052] After generating four types of features based on shallow basic features—frequency domain high-frequency features, frequency domain low-frequency features, spatial domain low-level features, and spatial domain high-level features—the shallow basic feature F is first processed. lowGlobal average pooling is performed, followed by a two-layer weighted prediction network to obtain four unnormalized branch weights. Then, softmax is used to obtain dynamic fusion weights, which are then weighted and fused with the shallow base features F. low Residual fusion is performed to obtain enhanced features. The specific steps are as follows:
[0053]
[0054] In the formula, F low、 These represent shallow basic features, high-frequency features in the frequency domain, low-frequency features in the frequency domain, low-level features in the spatial domain, and high-level features in the spatial domain, respectively; B represents the number of normalized images in a batch; C0 represents shallow basic features. The number of channels; z0 represents the global semantic vector; GAP(·) represents global average pooling over the spatial dimension; and Indicates the weights of the fully connected layer; and Indicates bias; The unnormalized weights of the four branches correspond to the high-frequency branch in the frequency domain, the low-frequency branch in the frequency domain, the low-level branch in the spatial domain, and the high-level branch in the spatial domain, respectively (i.e., the four parallel feature paths: the high-frequency path in the frequency domain, the low-frequency path in the frequency domain, the low-level path in the spatial domain, and the high-level path in the spatial domain). Represents the weights of high-frequency features in the frequency domain; This represents the weights of low-frequency features in the frequency domain; This represents the weights of low-level features in the spatial domain; The weights represent the high-level features in the spatial domain, and α+β+γ+δ=1. These weights can be generated from an image or extended to be generated from a channel. When the weights are generated from an image, each weight is broadcast to the corresponding branch in the form of B×1×1×1. This represents the normalized exponential function; Indicates enhanced features, where, This represents the output of the adaptive weak response enhancement module, preserving shallow basic features. The residual path can avoid destroying the original image information when the augmentation branch is incorrectly estimated, and make the gradient propagate stably to the subsequent backbone network.
[0055] In this embodiment, a visible light image of the carbonate rock surface is first acquired as the raw input data for subsequent processing. Then, a multi-domain adaptive enhancement mechanism is used to enhance the weak target features of the image. This mechanism utilizes information from both the frequency and spatial domains to enhance the visible light image, thereby improving the response intensity of low-contrast weak targets such as micropores and microcracks, and reducing interference from background structures such as mineral grain edges, matrix textures, and imaging noise. This process does not rely on enhancement methods with fixed parameters; instead, it dynamically extracts and fuses multiple features in the frequency and spatial domains based on the image content, thus strengthening the distinguishability between the target and the background without altering the essence of the image.
[0056] Step S2: Based on enhanced features, multi-scale features are extracted through the backbone network of the joint detection network for micropores and microcracks in carbonate rocks, and contextual modeling is performed to obtain contextual features with a large receptive field that can capture structural and semantic features.
[0057] In this embodiment, the specific process of this step includes: using the enhanced features as initial input, downsampling them step by step through the backbone network to generate a multi-scale general feature map from high resolution to low resolution; using the deepest feature map with the lowest resolution in the multi-scale general feature map as input, and applying multiple dilated convolution branches with different dilation rates in parallel; generating a global semantic vector through global average pooling and upsampling it back to the original spatial size; concatenating the outputs of each branch with 1×1 convolution features and compressing the channels to generate contextual features with a large receptive field that can capture structural and semantic features. This process effectively integrates multi-level semantic information such as local crack extension, pore group distribution, and macroscopic structure of carbonate matrix without relying on an additional attention module, improving the response consistency of low-contrast micro-targets in deep features, providing more discriminative input for subsequent morphology-specific branches, thereby supporting more stable feature separation and detection performance of pores and cracks in complex backgrounds.
[0058] Specifically, the backbone network in this embodiment consists of a convolutional initiation layer and multiple detail-preserving stages. The main branch, shortcut branch, and residual unit output of a single residual unit are as follows:
[0059]
[0060] In the formula, Indicates the residual cell number; U represents the stride of the first layer of the main branch convolution; l This represents the convolution operator for the l-th residual unit; Indicates the main branch and shortcut branch inputs; norm(·) indicates normalization; , and V represents the first convolution, second convolution, and shortcut branch mapping parameters of the main branch, respectively; l , and This indicates the main branch output, quick branch output, and residual unit output.
[0061] The backbone network outputs five levels of features:
[0062]
[0063] In the formula, Indicates the first One main stage; Indicates the first All parameters of each main stem order; Indicates the first Primary characteristics, Let represent the (i-1)th backbone feature. The recommended dimensions for each level of features are shown below. To avoid confusion caused by using the same letter for feature tensor and channel number, the bolded C is used. i Let C represent the i-th level feature tensor, not bold. i This indicates the number of channels in this layer.
[0064] The dimensions and main functions of each feature are as follows:
[0065] First-level features Space dimensions are The number of channels is It primarily preserves the edges of extremely small pores, fine crack textures, and precise locations.
[0066] Second-level features Space dimensions are The number of channels is It mainly describes the small pore profile, short crack segments, and local structure.
[0067] Third-level features Space dimensions are The number of channels is It mainly describes medium-scale pores and local context.
[0068] Fourth-level features Space dimensions are The number of channels is It mainly describes the combination relationship of holes and gaps and has strong semantic information.
[0069] Fifth-level features Space dimensions are The number of channels is It mainly describes the large-scale rock structure, pore distribution and global semantics.
[0070] Compared to structures that use large stride convolution followed by immediate max pooling, this embodiment preferably uses small convolution kernels, stepwise downsampling, and shallow bypass connections to reduce the probability of micropores or narrow cracks disappearing in the early stages of the network.
[0071] The deepest feature, i.e., the fifth level feature. Input a multi-scale context module. Let the set of void ratios be... , No. The output of each dilated convolution branch is:
[0072]
[0073] In the formula, Indicates the number of branches in a dilated convolution; Indicates the first The void ratio of each void convolution branch is used to determine the void ratio. Smaller void ratios emphasize local pores and short cracks, while larger void ratios describe crack extension and the spatial relationship between pore groups. The global branch provides prior knowledge of the rock structure of the entire image. This represents the convolution parameters for the corresponding dilated convolution branch; This represents the contextual features output by the m-th dilated convolution branch.
[0074] The local channel mapping branch and the global context branch are as follows:
[0075]
[0076] In the formula, Represents a global semantic vector; The trainable parameters of the local channel mapping branch are represented; GAP(·) represents global average pooling over the spatial dimension; This indicates the output of a local channel mapping branch; Indicates global branch mapping parameters; and These represent the fifth-level features. Height and width; Indicates will Feature broadcasting or interpolation to ; This indicates the output of the global context branch.
[0077] splicing outputs at various scales and compressing channels:
[0078]
[0079] In the formula, This indicates the output of a local channel mapping branch; This represents the contextual features output by the first dilated convolution branch; This represents the contextual features output by the m-th dilated convolution branch; Indicates the output of the global context branch; This indicates splicing along the channel dimension; This indicates a multi-branch splicing feature; Indicates the fusion mapping parameters; Represents multi-scale contextual features; This indicates the number of output channels for this module.
[0080] In this step of the embodiment, based on the obtained enhanced features, spatial features at different scales are extracted step by step through the backbone network to preserve multi-level responses from fine edges to macroscopic structures. Subsequently, contextual modeling is performed on the deep features. By combining multi-scale dilated convolution, global context aggregation and local channel mapping, the receptive field of the features is expanded, enabling the backbone network to capture the distribution patterns, connectivity and overall semantic structure of pores and fractures in the carbonate matrix, thereby forming contextual features containing a wide range of spatial dependencies.
[0081] It should be noted that, in addition to the aforementioned five-level features output by the backbone network, secondary features, eighth-level features, etc., can also be output by the backbone network according to actual image processing needs and other factors. No specific limitation is made in this invention.
[0082] Step S3: Based on the contextual features obtained in Step S2, pore features and crack features are extracted through a micropore scale-sensitive branch and a microcrack orientation-sensitive branch, respectively. The crack orientation-sensitive branch employs constrained learning line-aware convolution, distributing sampling points along the local crack tangential direction and applying constrained displacement in the normal direction. Complementary competitive gating is applied to the pore and crack features, normalizing them in both pore and crack dimensions. This ensures competitive weight allocation for the morphological responses of pores and cracks at the same spatial location, suppressing category confusion. The process is as follows: Figure 3 As shown.
[0083] In this embodiment, the micropore scale-sensitive branch uses multi-scale local convolution to extract pore features to capture point-like, block-like, and clustered micropore responses; the microcrack direction-sensitive branch uses constrained learning line-aware convolution to extract crack features. This learning line-aware convolution establishes a tangential-normal coordinate system based on the local crack direction, with sampling points distributed along the tangential direction. The normal displacement is restricted and less than the maximum tangential displacement, thus constraining the sampling area to the neighborhood of the crack centerline. This maintains the geometric continuity of the crack and avoids degradation into free two-dimensional sampling, improving the response stability to fractured, bent, or width-varying cracks, reducing response breakage or false detections caused by background texture interference, enhancing the ability of the morphology-specific branch to distinguish between the two types of targets, and providing more reliable and structurally consistent feature inputs for subsequent complementary competitive gating.
[0084] In this embodiment, complementary competitive gating is implemented for pore and crack features. The specific process of normalization in the two dimensions of pores and cracks includes: concatenating the pore and crack features into channels, inputting them into a 1×1 convolutional layer, and outputting a dual-channel feature map; performing Softmax normalization on the dual-channel feature map in both the pore and crack dimensions to generate two complementary spatial gating maps, where the sum of corresponding values in the two spatial gating maps at the same spatial location is 1; and using the two spatial gating maps to perform element-wise multiplication modulation on the pore and crack features respectively, forming a competitive modulation response. This mechanism effectively suppresses the repeated activation of background structures such as mineral particle edges, surface scratches, or shadows in the two morphological branches of pores and cracks, improves the class separability of the two weak targets in the shared feature space, maintains the continuous response of slender cracks and the local sensitivity of small-area pores, reduces the misclassification rate, and enhances the morphological consistency of the detection results.
[0085] Preferably, in this embodiment, pore features and crack features are concatenated to form a joint pore and crack feature, and channel attention and spatial attention maps are generated based on the joint pore and crack feature. The channel attention is generated by a multilayer perceptron with shared parameters, based on the channel descriptions obtained by global average pooling and global max pooling of the joint pore and crack feature. The spatial attention map is generated by convolution and a sigmoid function, based on the average and max maps of the joint pore and crack feature along the channel dimension. Subsequently, the two spatial gating maps, the spatial attention map, and the channel attention sub-weights corresponding to the pore branch and crack branch, respectively, are modulated element-wise with the pore feature and crack feature to obtain modulated and enhanced pore and crack features, forming a competitive modulation response. This effectively reduces the repeated activation of background structures such as particle edges, scratches, or shadows in the two branches while maintaining morphology-specific expression, improves the class discrimination of pore and crack responses, reduces false detections and false negatives, and especially improves the discrimination stability of low-contrast, small-area targets in the shared semantic space.
[0086] Specifically, in this embodiment, based on contextual features, pore features and crack features are extracted through morphology-specific branches (i.e., micropore scale-sensitive branch and microcrack direction-sensitive branch). In the micropore scale-sensitive branch, contextual features are... Multiple local feature extraction paths with different kernel sizes or effective receptive fields are set up, and then the extracted multi-scale pore features are spliced and fused. In the microcrack orientation sensitive branch, in order to establish a clear correspondence between the sampling method and the crack geometry, this embodiment adopts a constrained learning line-aware convolution. This learning line-aware convolution establishes a local orientation θ at each sampling position p. pA defined tangential-normal coordinate system (sampling points mainly extend along the crack tangentially, with only limited small offsets allowed in the normal direction) is used to model the crack's extension continuity and local width variation. The specific operation is as follows:
[0087]
[0088]
[0089] In the formula, F ctx Represents multi-scale contextual features; , and These represent point-level (i.e., point-like), local neighborhood-level (i.e., block-like), and larger neighborhood-level (aggregated) pore responses, respectively. , and These represent the response parameters for point-like, block-like, and aggregated micropores. Indicates depth separability Convolution to reduce computational cost, where depthwise separable convolution can be composed of a channel-wise 5×5 convolution followed by a 1×1 channel mapping; Indicates the fusion parameters of pore features; The feature represents a scale-sensitive pore structure that preserves the local responses of extremely small isolated pores, near-circular pores, and irregular blocky pores; p represents the current convolution center position; i represents the i-th linear sampling point; r represents the maximum sampling radius; w i Represents the convolution weights; α i The importance coefficient of the i-th sampling position can be constrained to [0,1] using a Sigmoid function to adjust the effective sampling length; θ p The undirected crack direction is predicted or learned from local contextual features; Δs i This represents the learnable displacement along the crack tangential direction, used to adjust the sampling interval and effective length; Δb i This represents a restricted displacement along the crack normal, used to accommodate slight bending and width variations, preferably limiting |Δb|. i | Less than the maximum tangential displacement, ensuring the sampling points remain within the neighborhood of the parameterized centerline, avoiding degeneration into completely free two-dimensional deformable sampling; F line This represents the obtained linear structural features; F f This represents the direction-sensitive crack feature obtained through 1×1 channel mapping; Θ f This represents the corresponding trainable mapping parameters.
[0090] After extracting pore and crack features, they are first concatenated along the channel dimension to form a joint pore and crack feature. Based on this joint pore and crack feature, channel descriptions are generated using global average pooling and global max pooling, and channel attention is generated through a multilayer perceptron with shared parameters. Then, the average map and max map are calculated along the channel dimension of the joint pore and crack feature, and a spatial attention map is generated through convolution and the sigmoid function. The specific operations are as follows:
[0091]
[0092] In the formula, Indicates porosity characteristics; F f Indicates crack characteristics; This indicates the combined characteristics of pores and cracks; This indicates splicing along the channel dimension; (·) and GMP(·) represent global average pooling and global max pooling, respectively, for the spatial dimension; and These represent the average pooling and max pooling channel descriptions, respectively. Represents a multilayer perceptron with shared parameters; Indicates channel attention; Indicating the combined characteristics of pores and cracks The number of channels; and These represent the average and maximum values along the channel dimension, respectively. , These represent the average plot and the maximum plot, respectively, both of which are single-channel spatial plots. Represents the Sigmoid function; Indicates the spatial attention convolution parameters; Represents a spatial attention map.
[0093] Since particle edges may simultaneously trigger both micropore-scale sensitive branches and microcrack-direction sensitive branches, to reduce repetitive responses of these two branches to the same background structure, pore-gated maps and crack-gated maps (i.e., two spatial gated maps) are generated separately. These maps are then used to modulate and enhance pore and crack features, respectively, forming the final morphology-guided enhancement features. The specific operation is as follows:
[0094]
[0095] In the formula, This represents the gating parameters corresponding to the micropore scale-sensitive branch and the microcrack direction-sensitive branch; This indicates the combined characteristics of pores and cracks; This indicates that Softmax is performed on both the "pore" and "crack" dimensions; and These represent pore-gated and fracture-gated maps, respectively, and satisfy the following conditions at the same spatial location: This two-branch competition is used to characterize the relative response relationship between pores and cracks, and does not directly undertake the background classification function. The background position is suppressed by the foreground probability output by the subsequent prediction head. Represents a spatial attention map; and These represent channel attention. The sub-weights corresponding to pore channels and fracture channels; Indicates porosity characteristics; Indicates crack characteristics; and These represent the pore and crack features after gated modulation enhancement, respectively; This indicates element-wise multiplication; Indicates morphological feature fusion parameters; This indicates splicing along the channel dimension; This indicates a morphology-guided enhancement feature that simultaneously contains pore size information and crack orientation information.
[0096] In this step of the embodiment, based on contextual features, pore features and crack features are extracted through the micropore scale-sensitive branch and the microcrack direction-sensitive branch, respectively. This means that two types of features are independently derived from the shared contextual features. One type focuses on the scale and morphological response of micropores, and the other focuses on the directional and continuity response of microcracks. Subsequently, a complementary competitive gating mechanism is used to apply soft constraints to the two. At the same spatial location, the pore response and crack response are competitively assigned weights through mathematical normalization. This ensures that the activation signal at any location is preferentially attributed to either pores or cracks, thereby forming a direct competitive relationship at the feature level and suppressing category confusion caused by the simultaneous activation of both branches by the same background structure (such as particle edges or scratches).
[0097] Step S4: The gated and modulated pore features and crack features are spliced together to generate morphology-guided enhancement features. These features are then propagated to the multi-scale feature layer through a bidirectional fusion path to form a feature pyramid. Each layer of the feature pyramid is used as the input to the micropore detection branch and the microcrack detection branch, respectively, and the corresponding classification probability, localization result, and segmentation probability are output. The microcrack detection branch also outputs the crack direction prediction result.
[0098] In this embodiment, the specific process of propagating to multi-scale feature layers through a bidirectional fusion path to form a feature pyramid includes: aligning the morphological guidance enhancement features with channels using 1×1 convolutions to ensure the number of channels matches the features of each layer in the backbone network; performing learnable weighted fusion of the deepest feature map output from the backbone network with the channel-aligned morphological guidance enhancement features, i.e., assigning trainable scalar weights to each input, performing weighted summation after ReLU activation and normalization, and then performing nonlinear fusion through 3×3 convolutions to generate the highest-level fused features; upsampling the highest-level fused features step-by-step through a top-down path and performing learnable weighted fusion with the features of each layer in the backbone network to achieve propagation of high-level semantics to high-resolution layers; downsampling the high-resolution layer features step-by-step through a bottom-up path and performing learnable weighted fusion with the corresponding low-resolution layer features and the fused features obtained from the top-down path to achieve propagation of low-level spatial details to high-level semantic layers; finally, generating a feature pyramid containing semantic and positional information. After channel alignment of the morphologically guided enhancement features through 1×1 convolution, they are fused with the deepest features of the backbone network using learnable weighted fusion to generate the highest-level fused features. Then, multi-scale features are fused step by step through bidirectional paths from top to bottom and from bottom to top, realizing bidirectional interactive propagation between high-level semantics and low-level spatial details. This enhances the consistency of localization and semantic integrity of each layer in the feature pyramid for small, low-contrast targets while maintaining prior information on the morphology of pores and cracks. This effectively improves the response stability of the multi-scale detection head to the blurred edges of micropores and the fractured areas of microcracks.
[0099] Specifically, for morphology-guided enhancement features, the backbone network output and morphology-guided enhancement features are uniformly mapped to the number of channels. First, achieve channel alignment; then, for those that need to be merged... Input features Define normalized weights and fuse the highest-level fused features; then perform top-down and bottom-up fusion (taking the five-level features output by the aforementioned backbone network as an example), finally obtaining the feature pyramid (e.g. The specific steps are as follows:
[0100]
[0101] In the formula, C i This represents the i-th level feature output by the backbone network; Indicates the first Level channel alignment parameters; The number of channels is uniformly represented as The Level features; Indicates the alignment parameters of morphological features; Indicates the morphological features after alignment; This indicates a morphology-guided enhancement feature that simultaneously contains pore size information and crack orientation information; Indicates the first Trainable scalar weights of the input path; Indicates normalized non-negative weights; Represents the stability constant; ReLU(·) represents the nonlinear activation function; Fuse(·) represents fusion; X i This represents the i-th input feature; This represents the convolution parameters after fusion, where each input feature needs to be adjusted to the same spatial size through upsampling or downsampling before fusion is performed; Indicates the highest-level fusion characteristics; T i+1 They represent the first Top-down features of level i+1 and level i+1; This means that the spatial size is magnified by 2 times, and the morphological prior is first injected into the highest layer of fused features, and then passed down to the high-resolution layer through this path. Indicates the highest resolution fused feature; P i-1 Indicates the first Level i and the (i-1)th level final fusion features; This means that the spatial size is reduced by a factor of 2. This path re-injects precise location information from shallow layers into deeper layers, improving the consistency of multi-scale predictions.
[0102] Each layer of the feature pyramid is used as input to the micropore detection branch, and features are fused at each level. After scale-sensitive refinement of the unit, the anchorless aperture detection head outputs the center probability, boundary distance, and center mass, while the aperture segmentation head outputs the mask probability, i.e., the corresponding classification probability, localization result, and segmentation probability. The specific operation is as follows:
[0103]
[0104]
[0105] In the formula, Indicates the first Refinement parameters for micropore characteristics; Indicates porosity prediction characteristics; This represents a probability map of the center or foreground of micropores. Indicates classification parameters; This represents the predicted distance from the current feature location to the left, top, right, and bottom boundaries of the target. Indicates positioning parameters; Indicates the center quality or location quality score; Indicates the parameters for quality prediction; Indicates a pore segmentation head; Indicates the segmentation header parameters; This represents the first-level and second-level fusion features; This represents a pixel-level probability map or instance mask for micropores. When an instance mask is needed, the probability map should be associated with the corresponding detection candidate, and instantiation methods such as candidate box mask, connected component analysis, or watershed should be used to distinguish adjacent pores.
[0106] Similarly, each layer of the feature pyramid is used as input to the micro-crack detection branch, and the corresponding classification probability, localization result, orientation prediction result, and segmentation probability are output. The specific operation is as follows:
[0107]
[0108] In the formula, The crack direction refinement unit is preferably the aforementioned constrained learning line-aware convolution. Represents the i-th level fusion feature; This indicates the refined element parameters for the crack direction; Indicates crack prediction characteristics; The trainable parameters of the i-th layer microcrack foreground / centerline prediction convolution are represented. Indicates the probability of the microcrack foreground or centerline; The trainable parameters representing the crack boundary distance prediction branch in the i-th layer Indicates the boundary distance of the area surrounded by the crack; and These represent the predicted sine and cosine values of the two angles, respectively. The orientation prediction parameters are represented by bi-angle sine and bi-angle cosine components instead of the direct regression angle scalar. For undirected crack orientations, this representation helps to reduce the angle's position within the range of... and In this embodiment, the crack direction is defined as an undirected principal direction within the range of [0,π). Therefore, consistent direction mapping rules should be adopted in the training, data augmentation and inference stages. Indicates the crack splitting head; Indicates crack segmentation parameters; This represents a pixel-level probability map or instance mask for micro-cracks. To obtain the instance mask, the probability map should be associated with the corresponding crack candidate and instantiated by combining the candidate region, connected components, and skeleton graph. This represents the Sigmoid function.
[0109] In this embodiment, the gated and modulated pore features and crack features are spliced together to form a unified morphology-guided enhancement feature. This morphology-guided enhancement feature simultaneously carries the scale response information of the pores and the directional response information of the cracks. Then, this morphology-guided enhancement feature is injected into the highest-level fusion feature, and through a bidirectional fusion path from top to bottom and from bottom to top, the morphological prior information is propagated to multiple feature layers of spatial resolution, thereby embedding the morphological association information of pores and cracks in each feature layer. Finally, each feature layer of the feature pyramid serves as the input to the micropore detection branch and the microcrack detection branch, respectively used to generate the classification probability, localization result, and segmentation probability of the corresponding category. The crack detection branch also generates crack direction prediction results, ensuring that the detection output at each scale is uniformly controlled by the morphology-guided enhancement feature.
[0110] Step S5: Generate candidate pore regions and candidate crack regions based on classification probability, localization results, and segmentation probability; Step S6: Perform one or more post-processing operations on the candidate pore regions and candidate crack regions, including: pre-set confidence threshold filtering, same-class non-maximum suppression, and mapping the detection results back to the original image coordinate system according to image preprocessing parameters; Step S7: Output the final micropore and microcrack detection results.
[0111] In this embodiment, after generating candidate pore and fracture regions based on classification probability, localization results, and segmentation probability, low-confidence candidates are filtered by setting a pre-set confidence threshold. Non-maximum suppression is applied to candidates of the same category to eliminate redundant detection, or the detection coordinates are inversely mapped to the original image space according to the scaling or filling parameters in the image preprocessing stage. This achieves high-precision, low-redundancy detection result output, effectively improving the localization consistency and instance identifiability of micropores and microfractures in real imaging scenarios, and providing a reliable spatial localization basis for subsequent reservoir parameter quantification and rock structure analysis.
[0112] In the training phase of the joint detection network for micropores and microcracks in carbonate rocks, training samples are constructed based on labeled micropore and microcrack instances, and a joint training strategy is adopted to iteratively update all trainable parameters of the weak target image detection method. The joint training strategy includes: calculating classification loss, localization loss, segmentation loss, orientation consistency loss, and weak target weighted instance loss based on the predicted output and the ground truth annotations; summing the above basic losses of classification, localization, and segmentation, as well as the weak target weighted instance loss, according to preset weights to obtain the total loss function; and updating the network parameters based on the total loss function through an optimizer to minimize the total loss.
[0113] Specifically, for example, approximately 2000 images of carbonate rock surfaces can be acquired before training (each image undergoes size uniformization and pixel normalization processing), and the training set, validation set, and test set are preferably divided according to the source of the rock samples, for example, using a ratio of 70:10:20, to avoid highly similar images of the same rock sample being included in different datasets simultaneously. For the first... Images were used to establish a set of micropore annotations. and microcrack annotation set Both the micropore annotation set and the microcrack annotation set are organized in the order of "number of instances - boundary or enclosed region - instance mask - category label"; crack instances also include undirected principal direction angles calculated from the principal axis or skeleton, and are uniformly represented in the range [0, π). The specific operation is as follows:
[0114]
[0115] In the formula, Indicates the first The number of micropore instances in the image; Indicates the first The first image Bounding box of a micropore instance; Indicates the first The first image Instance mask for each micropore instance; Indicates the first The first image Category labels for individual micropore instances; Indicates the first The number of microcrack instances in the image; Indicates the first The first image The bounding box or enclosed region of a microcrack instance; Indicates the first The first image Instance mask of a microcrack instance; Indicates the first The first image Category labels for individual microcrack instances; Indicates the first The first image Each microcrack instance is calculated from the crack principal axis or skeleton, yielding an undirected principal direction angle. Represents a set of micropore annotations; This represents the set of microcrack annotations.
[0116] The training samples are input into the network in batches. Let the total number of trainable parameters be... , No. The parameters for the next iteration are updated as follows:
[0117]
[0118] In the formula, Indicates the training iteration number; Indicates the first All model parameters at the next iteration; Indicates the current learning rate; This represents the gradient of the total loss with respect to the parameters; The gradient transformation rule of the optimizer can be represented by AdamW, SGD or other first-order optimization algorithms; Indicates the total loss; , These represent the focal loss for pore classification and the focal loss for crack classification, respectively. , These represent pore positioning loss and crack positioning loss, respectively. This represents the pore segmentation loss and the crack segmentation loss; Indicates the loss of consistency in crack direction; L weak This represents the weak target weighted instance loss; , and These represent the weights of the pore classification focal loss, localization loss, and segmentation loss, respectively. , and These represent the weights of the crack classification focus loss, localization loss, and segmentation loss, respectively. This represents the weighting of the crack direction consistency loss. This represents the loss weight of the weak target weighted instance.
[0119] All network parameters are minimized by the total loss. Perform a joint update. To avoid the same instance loss being weighted repeatedly, when the weak target weighted instance loss L... weak Added to total loss as an independent auxiliary item When the aforementioned classification, localization, and segmentation losses use the unweighted base loss; when the instance weights have already been directly incorporated into the base losses of each branch, the weak target weighted instance loss λ should be set. weak =0, will not be added again.
[0120] In this embodiment, for any predicted location, the focus loss is defined as:
[0121]
[0122] In the formula, This indicates the probability that the model predicts the prospect as the foreground. Indicates the true label; This represents the model's predicted probability of the true class. This represents the positive and negative sample balance coefficient; This represents the focusing parameter for difficult samples.
[0123] Furthermore, the focal loss for pore classification and the focal loss for crack classification are denoted as follows: and .
[0124] In this embodiment, the prediction box and real frame The complete intersection-union ratio loss is expressed as:
[0125]
[0126] In the formula, This represents the intersection-union ratio (IoU) between the predicted bounding box and the ground truth bounding box. These represent the predicted bounding box and the ground truth bounding box, respectively. and These represent the center of the predicted bounding box and the center of the ground truth bounding box, respectively. Indicates Euclidean distance; This represents the length of the diagonal of the smallest bounding rectangle that simultaneously encloses the predicted bounding box and the ground truth bounding box. Indicates the aspect ratio penalty weight. and These represent the actual frame width and height, respectively; and These represent the width and height of the prediction box, respectively. Indicates the difference in aspect ratio; To prevent division by zero, small positive numbers can be represented in 10. -6 Up to 10 -4 Choose from the options.
[0127] Furthermore, the pore location loss and the crack location loss are denoted as follows: and .
[0128] In this embodiment, the Dice loss, binary cross-entropy loss, and single-branch splitting loss are respectively:
[0129]
[0130]
[0131] In the formula, Indicates the pixel index; Represents the set of mask pixels; Indicates the total number of pixels; Indicates the actual mask in pixels The label at the location; Indicates the predicted probability; , , These represent Dice loss, binary cross-entropy loss, and single-branch splitting loss, respectively. Indicates the BCE loss weight; To prevent division by zero, small positive numbers can be represented in 10. -6 Up to 10 -4 Choose from the options.
[0132] Furthermore, the porosity and crack segmentation losses are denoted as follows: and .
[0133] In this embodiment, the true undirected principal direction angle of the crack is denoted as θ. The direction prediction branch outputs a double-angle sine component ŝ and a double-angle cosine component ĉ. The direction consistency loss is defined as:
[0134]
[0135] In the formula, This represents the number of crack instances participating in directional supervision; Indicates the crack instance number; Indicates the first A true crack direction angle; and These represent the corresponding predicted values. The training objective uses sin(2θ) j ) and cos(2θ j The double-angle encoding allows the main direction to be restored during inference by mapping θ = 1 / 2·atan2(ŝ,ĉ) to [0,π), thus ensuring that the direction cycle is consistent during training, data augmentation, and inference.
[0136] In this embodiment, for the i-th target instance, first, according to the instance mask M... i Construct a background ring band. This background ring band can be represented as Dilate(M) i ,r2) and Dilate(M i The difference set of r1 and r2 is used to exclude other labeled target regions, so that the local contrast reflects the difference between the target and its immediate neighborhood matrix.
[0137] Equation (77) first generates the initial weights for weak targets. To avoid excessively large weights due to extremely small areas or extremely low contrast, the initial weights are preferably limited to [1, w] before entering equation (79). max Within the specified range, and normalized within the current batch, the average weight of each instance after normalization is kept to 1. The normalized weights are applied to the classification loss, localization loss, and segmentation loss of the corresponding instance, respectively; when a certain implementation does not include a localization head, only the classification loss and segmentation loss may be weighted.
[0138] Weak target weights are defined based on target area and target-background contrast:
[0139]
[0140] In the formula, Indicates the first Training weights for each target; Indicates the area of the target mask or the area of the bounding box; This represents the area weighting coefficient; Indicates the contrast weighting coefficient; and They represent the first The average intensity and standard deviation of each target area; and These represent the mean intensity and standard deviation of the background ring zone adjacent to the target, respectively. It represents the standardized contrast index constructed by the difference between the target and background mean values and local fluctuations, and its value does not need to be strictly limited to [0,1]. To prevent division by zero, small positive numbers can be represented in 10. -6 Up to 10 -4 Choose between them. Equation (77) gives the original weights without truncation. The weights used in the final training are based on the results after truncation and intra-batch normalization. Generally, the smaller the target area and the closer it is to the background, the better. The larger.
[0141] The weighted instance loss for weak targets is:
[0142]
[0143] In the formula, This indicates the total number of target instances in the current batch; Indicates the first The basic loss for classification, localization, or segmentation corresponding to each instance; ω i This should be understood as having been completed [1, w] max Truncated and intra-batch normalized actual instance weights; This is represented as the weak target weighted instance loss.
[0144] During training, random flipping, rotation, scaling, brightness perturbation, contrast perturbation, slight blurring, and random cropping can be performed, but the bounding boxes, instance masks, and crack direction labels should be transformed simultaneously. For the direction labels, the image rotation angle is... When, it should be updated to:
[0145]
[0146] In the formula, This indicates that the crack before reinforcement has no principal direction; Indicates the image rotation angle; Indicates the direction of the reinforced crack; uses a mold This is because the crack axis direction usually does not distinguish between positive and negative. For implementations that use the horizontal axis of the image as the direction reference, the direction labels for horizontal and vertical flips can be mapped to (π-θ)modπ and (-θ)modπ, respectively, and should be consistent with the image coordinate direction used.
[0147] The joint detection network for micropores and microfractures in carbonate rocks in this embodiment consists of an input module, an adaptive multi-domain feature enhancement module, a shallow detail feature extraction module, a multi-scale contextual feature extraction module, a pore and fracture morphology-guided enhancement module, a cross-layer bidirectional feature fusion module, and a pore and fracture joint prediction module, etc. The framework diagram is shown below. Figure 4 (As shown) Precision, recall, mean precision, and crossover ratio (CROR) of pores and fractures are calculated on the validation set, and the optimal model parameters are selected based on the comprehensive indicators. To avoid highly similar images of the same rock sample in the training and validation sets, data partitioning is preferably performed on carbonate rock samples rather than simply dividing images randomly.
[0148] In this step of the embodiment, based on the labeled micropore and microcrack instances, classification, localization, segmentation, orientation consistency, and weak target weighted instance loss are jointly calculated in the initial stage of the image detection process and during multiple rounds of feature extraction. The optimizer iteratively updates all trainable parameters, enabling the network to simultaneously optimize multi-task response and sample weighting strategy during training. This significantly improves the recall ability for low-contrast, small-area targets while maintaining detection accuracy, and effectively suppresses cross-misjudgment of pore and crack branches on shared background structures. It ensures that morphology-specific features and weak target weighting mechanism form synergistic optimization in parameter updates, enhancing the model's generalization stability for complex imaging conditions and multi-scale weak targets.
[0149] The weak target image detection method for micropores and microcracks in carbonate rocks in this embodiment uses a multi-domain adaptive enhancement mechanism to jointly enhance the visible light image of carbonate rocks in the frequency and spatial domains, effectively improving the response intensity of low-contrast weak targets such as micropores and microcracks and suppressing background interference. Then, based on the backbone network, multi-scale features are extracted and context modeling is completed to obtain structural and semantic fusion features with a large receptive field. Furthermore, pore features and crack features are extracted by micropore scale-sensitive branches and microcrack direction-sensitive branches, respectively, and a complementary competitive gating mechanism is introduced to apply soft constraints to the two types of features at the same spatial location, so that the two types of features competitively allocate gating weights and preferentially retain the dominant response, thereby effectively reducing response confusion caused by morphological similarity and false triggering of background structures. Subsequently, the gated and modulated pore features and crack features are spliced to generate morphological guidance features, and then propagated to the multi-scale feature layer through a bidirectional fusion path to construct a feature pyramid, so that each layer of features carries morphological and semantic guidance information, which is then supplied to the micropore detection branch and the microcrack detection branch for classification, localization and segmentation, respectively, to achieve accurate separation and high-precision detection of the two types of targets. Therefore, the present invention can effectively solve the problems in the prior art where micropores and microcracks cause response confusion due to morphological differences, and the background structure simultaneously triggers responses from two types of targets, thus achieving the technical effect of significantly suppressing category confusion and improving the accuracy and stability of weak target detection.
[0150] The following is a more specific example; in this example, the joint detection network for micropores and microcracks in carbonate rocks adopts the aforementioned framework structure and uses formulas (2) to (80) to perform the training and detection processes. Specifically:
[0151] 1. Experimental Objectives, Evaluation Indicators, and Standardized Setup
[0152] 1.1 Evaluation Indicators
[0153] This embodiment uses Precision, Recall, F1, IoU, mIoU, AP50, AP50:95, crack connectivity, crossover misclassification rate, mean absolute angle error, number of parameters, and FPS to evaluate the model performance.
[0154] Here, Precision represents the proportion of correctly predicted targets, Recall represents the proportion of correctly detected ground truth targets, and F1 is used to comprehensively measure Precision and Recall; IoU represents the intersection-union ratio of the predicted region and the ground truth region, and mIoU represents the average IoU of each target category, used to evaluate the overall segmentation accuracy. AP50 represents the average detection accuracy at an IoU threshold of 0.50, and AP50:95 represents the comprehensive average detection accuracy within the range of IoU thresholds from 0.50 to 0.95, with intervals of 0.05.
[0155] Crack connectivity is used to characterize the continuity of the predicted crack structure; a higher value indicates fewer crack breaks and isolated segments. For each real microcrack instance, the corresponding predicted crack region is skeletonized. Predicted instances of the same category are preferably matched one-to-one with real instances according to mask IoU, resulting in a set of predicted crack skeleton pixels. And the connected skeleton component with the most pixels is denoted as The crack connectivity rate is defined as:
[0156]
[0157] In the formula, Indicates the crack connectivity; This indicates the number of actual microcrack instances participating in the evaluation; Indicates the relationship with the first The set of all skeleton pixels obtained by skeletonizing the predicted crack region matched with a real microcrack instance. express The connected skeleton component with the most pixels; This represents the number of pixels in the set. When the... No effective matching prediction results were obtained for any real microcrack instances. When the set is empty, the connectivity of the instance is recorded as 0. The higher the crack connectivity, the lower the degree to which the predicted crack is divided into multiple broken segments, and the better the continuity of the crack structure.
[0158] Cross-classification misclassification rate represents the proportion of instances where micropores are misclassified as microcracks or microcracks are misclassified as micropores out of the total number of foreground instances. The lower the value, the stronger the ability to distinguish between pores and cracks.
[0159]
[0160] In the formula, Indicates the crossover false positive rate; This represents the number of instances that are actually classified as micropores but are incorrectly identified as microcracks. This represents the number of instances that are actually classified as microcracks but are incorrectly identified as micropores. and These represent the total number of real micropore instances and the total number of real microcrack instances participating in the evaluation, respectively. A lower cross-classification misclassification rate indicates a stronger ability of the model to distinguish between micropores and microcracks.
[0161] The mean absolute angle error (MAO) is used to evaluate the deviation between the predicted main crack direction and the actual main crack direction; a smaller value indicates a more accurate direction prediction. The number of parameters measures the model size, and FPS measures the model's inference efficiency. Robustness under different imaging conditions is evaluated using a joint F1 score for pores and cracks (the joint F1 score is the arithmetic mean of the pore category F1 and the crack category F1). Thresholds used for segmentation binarization, candidate selection, and instance matching are determined on the validation set and fixed for the test set; the IoU thresholds used for AP50 and AP50:95 are fixed according to the definitions of the corresponding evaluation metrics.
[0162] 1.2 Unified Training and Reasoning Settings
[0163] To ensure fairness, all methods used the same training, validation, and test sets, and employed the same input resolution and data augmentation. The public dataset had an input of 448×448, while the self-made dataset had an input of 640×640. The optimizer used was AdamW, with an initial learning rate of 1×10⁻⁶. -4 The weight decays to 5×10 -4 The first five training epochs were linear warm-up, followed by cosine annealing. The public dataset was trained for 180 epochs, and the self-made dataset for 220 epochs, with batch sizes of 16 and 8, respectively. Random augmentations included horizontal and vertical flipping, ±30° rotation, 0.75–1.25x scaling, brightness and contrast perturbations, slight Gaussian blur, and random cropping, with crack direction labels updated simultaneously. The unified experimental environment and training configuration are shown in Table 1.
[0164] Table 1 Experimental Environment and Training Configuration
[0165]
[0166] 2. Experiment 1: Crack segmentation experiment on the GeoCrack public dataset
[0167] 2.1 Dataset and Task Setup
[0168] GeoCrack is a dataset of geological outcrop fracture edges released in 2024. Images are derived from ground and UAV photogrammetry at 11 geological sites in Europe and the Middle East, encompassing various lithologies including carbonate, clastic sedimentary, and crystalline rocks. After cleaning, normalization, and manual pixel-level fracture annotation, the data was divided into 12,158 pairs of 224×224 image-mask samples. This dataset contains interference such as shadows, vegetation, roots, weathering textures, fracture width variations, and localized low contrast, making it suitable for testing the adaptability of this invention to slender, continuous, and weakly directional targets. The experiment organized training, validation, and test samples according to the publicly available dataset partitioning and enlarged the images to 448×448. This experiment only enabled the fracture prediction branch while retaining dynamic weak response enhancement, fracture orientation sensitive branches, fracture channels in competitive gating, and weak target weighting.
[0169] 2.2 Comparison Method
[0170] The comparison objects were selected from representative methods that were publicly available and searchable in 2024-2025: SAM2-Adapter (CHENT, LUA, ZHUL, et al. SAM2-Adapter: Evaluating & adapting SegmentAnything2 in downstream tasks: Camouflage, shadow, medical image segmentation, and more [EB / OL]); EfficientCrackNet (ZIMAH, IQBALA, AL-HUDAZ, et al. EfficientCrackNet: A lightweight model for crack segmentation [C] / / Proceedings of the IEEE / CVF Winter Conference on Applications of Computer Vision (WACV). 2025:6279-6289. DOI:10.1109 / WACV61041.2025.00612.); SAM-LoRA (GUOY, XUY, CUIH, et al. ... odel-basedcracksegmentationusinglow-rankadaptionfine-tuning[J].StructuralHealthMonitoring,2025,24(4):2579-2591.DOI: 10.1177 / 14759217241261089.); Crack-EdgeSAM (WANGY,HEJ,YUS.Crack-EdgeSAM:Self-promptingcracksegmentationsystemforedgede vices[EB / OL].arXiv:2412.07205,2024.DOI:10.48550 / arXiv.2412.07205.); EGA-UNet (YANGL,DENGJ,DUANH,etal.Anefficientsemant icsegmentationmethodforroadcrackbasedonEGA-UNet[J].ScientificReports,2025,15:33818.DOI:10.1038 / s41598-025-01983-3.).
[0171] 2.3 Quantitative Results
[0172] Table 2. Crack segmentation results on the GeoCrack test set.
[0173]
[0174] Table 2 shows that this invention achieves high results in IoU, Recall, and F1. Compared with EGA-UNet, which has the closest performance, IoU is improved by 2.1 percentage points and Recall by 1.3 percentage points. The improvement mainly comes from two aspects: First, the dynamic multi-domain weak response enhancement achieves high-frequency, low-frequency, low-level spatial, and high-level spatial features through adaptive fusion, while preserving the edge response of fine cracks and a larger range of structural context; Second, the constrained learning line-aware convolution establishes a tangential-normal sampling coordinate system based on the local crack direction, so that the sampling position is continuously distributed along the crack extension direction, and adapts to local bending and width changes with constrained normal offset, thereby reducing local breakpoints in fine cracks.
[0175] Figure 5 The image shows a comparison of crack segmentation results in complex backgrounds like GeoCrack. As can be seen from the image, the method of this invention maintains the continuous structure of the main trunk and branches of weak cracks more completely, with fewer local breaks and missed detections. It also exhibits fewer false responses to background textures, and the detection results are more consistent with manually labeled crack directions and boundaries.
[0176] 3. Experiment 2: Self-made combined detection experiment of micropores and microcracks in carbonate rocks
[0177] 3.1 Data Collection and Labeling
[0178] This embodiment constructs a self-made dataset using 36 carbonate rock samples with different matrix textures, porosity, and fracture orientations. After cleaning and fixing the sample surfaces, images were acquired using a visible light industrial camera and a microscope camera at equivalent magnifications of 20x, 40x, and 80x, resulting in 2,160 RGB images. The original resolution was 2048×2048 or 2448×2048, which were then cropped to 640×640 for network input while maintaining the aspect ratio. Annotators drew masks for micropore instances, microcrack instances, and the main fracture direction, while a second annotator verified the boundaries and categories; disputed elongated targets were determined by a third geologist. The dataset contains 18,742 micropore instances and 7,306 microcrack instances, of which approximately 34.7% are weak instances with an area less than 64 pixels or a local contrast index below 0.15. The data was divided into training, validation, and test sets according to rock samples, with a ratio of 70:10:20, to avoid adjacent views of the same rock sample entering different sets simultaneously. The composition of the self-made carbonate rock joint detection dataset is shown in Table 3.
[0179] Table 3. Composition of the self-made carbonate rock joint detection dataset
[0180]
[0181] 3.2 Comparison Methods and Adaptation Approaches
[0182] The joint detection experiment selected real-time detection and basic segmentation methods from the past two years for comparison: YOLOv10 (WANGA, CHENH, LIUL, et al. YOLOv10: Real-Time End-to-End Object Detection [C] / / Advances in Neural Information Processing Systems. 2024, 37: 107984-108011. DOI: 10.52202 / 079017-3429.) and RT-DETRv3 (WANGS, XIAC, LVF, et al. RT-DETRv3: Real-Time End-to-End Object Detection with Hierarchical Dense Positive Supervision [C] / / Proceedings of the IEEE / CVF Winter Conference on Applications of Computer Vision. 2025) :1628-1636.DOI:10.1109 / WACV61041.2025.00166.), D-FINE (PENGY, LIH, WUP, etal.D-FINE: RedefineRegressionTaskofDETRsasFine-grainedDistributionRefinement[C] / / InternationalConferenceonLearningRepresentation s.2025.), SAM2-Adapter and YOLOv12 (TIANY, YEQ, DOERMANND.YOLOv12: Attention-CentricReal-TimeObjectDetector s[C] / / Advances inNeuralInformationProcessingSystems.2025,38:78433-78457.DOI:10.52202 / 085713-2627.). To ensure task consistency, a prototype masking terminal of the same capacity was connected after the detection outputs of YOLOv10, RT-DETRv3, D-FINE, and YOLOv12, and a crack direction regression branch was added; the SAM2-Adapter used detection boxes as automatic prompts and output masks for pores and cracks respectively. The comparison model did not use the four-branch dynamic enhancement, pore-crack complementary competitive gating, and area-local contrast joint weighting of this invention.
[0183] 3.3 Quantitative Results of Combined Detection
[0184] Table 4. Results of combined micropore-microcrack detection on the self-made dataset.
[0185]
[0186] Table 4 shows that the present invention outperforms the comparative methods in terms of porosity AP50, crack AP50, AP50:95, mask mIoU, and orientation error. Compared with YOLOv12-seg, the porosity AP50 is improved by 2.8 percentage points, the crack AP50 by 3.9 percentage points, and the mask mIoU by 4.1 percentage points. The gain for the crack category is greater than that for the porosity category, indicating that orientation-sensitive convolution, competitive gating, and fine crack weighting are more effective for targets with high aspect ratios and discontinuous responses. The average orientation error is reduced to 5.6°, which is beneficial for subsequent crack orientation statistics; 48.6 FPS can still be achieved with 640×640 input, indicating that morphological branching and bidirectional fusion do not cause unacceptable computational overhead.
[0187] 3.4 Core Module Ablation and Category Competition Analysis
[0188] Table 5. Ablation experimental results of the core module on the self-made dataset.
[0189]
[0190] Table 5 shows that after the addition of competitive gating, the cross-rejection rate decreased from 6.4% to 3.9%, indicating that complementary Softmax constraints at the same spatial location can effectively reduce the repeated activation of pore and crack branches by particle edges, scratches, and shadows. Area-local contrast weighting further increased the AP50 of pores and cracks by 1.7 and 2.0 percentage points, respectively, indicating that this mechanism does not only expand the weight of target pixels, but can allocate more sufficient gradient contributions to difficult examples with small areas and close to the background intensity.
[0191] Figure 6 The visualization results show the effects of dynamic weak response enhancement, competitive gating, and joint output. As can be seen from the figure, the weak responses of micropores and fine cracks are enhanced after dynamic weak response enhancement; competitive gating further reduces the overlapping responses of pores and crack branches on the same background structure; and the joint output can simultaneously maintain the continuous structure of the pore region and the crack.
[0192] 3.5 Robustness under different imaging conditions
[0193] Table 6. Joint F1 results under different brightness and background conditions.
[0194]
[0195] Table 6 shows that under low illumination, localized strong reflections, low contrast, and strong matrix texture conditions, the joint F1 scores of the method of this invention are 90.8%, 89.9%, 89.2%, and 90.1%, respectively, which are 2.4, 3.3, 4.0, and 3.1 percentage points lower than the 93.2% under normal illumination conditions. In contrast, YOLOv12-seg and SAM2-Adapter both show more significant performance degradation under the above complex conditions, indicating that the present invention has better adaptability to brightness variations, localized reflections, low contrast, and complex matrix textures. This robustness is mainly due to the complementary modeling of different types of information by the adaptive multi-domain feature enhancement module. Among them, high-frequency features in the frequency domain and low-level features in the spatial domain mainly preserve pore boundaries, crack edges, fine textures, and local morphological information; while low-frequency features in the frequency domain and high-level features in the spatial domain provide overall brightness, matrix distribution, and a larger range of structural context. By dynamically weighting and fusing the four types of features, the network can adaptively balance between detailed response and structural semantics, thereby reducing the impact of single-domain features on response attenuation or background false activation under complex imaging and background conditions. The above results demonstrate that the present invention can not only improve the accuracy of pore-crack joint detection under normal imaging conditions, but also maintain relatively stable detection performance under interference from changes in illumination, local reflection, low contrast and complex matrix texture.
[0196] Figure 7 This image shows the combined detection results of pores and fractures in a self-made carbonate rock dataset. As can be seen from the image, the method of this invention can simultaneously identify micropores and microfractures. The pore regions are relatively concentrated, and the main branches and branches of the fractures maintain good continuity, showing high consistency with manually labeled results.
[0197] 4. Experimental Conclusions
[0198] This invention validates its technical effectiveness from different perspectives through experiments on both public and self-made datasets. The public dataset experiments demonstrate that dynamic weak response enhancement, crack feature weighting, and weak target weighting can improve the integrity of fine cracks in complex backgrounds. The self-made dataset experiments further illustrate that complementary competitive gating of pore and crack features can significantly reduce class confusion while improving the detection recall of small pores, low-contrast pores, and fine cracks. The combined results indicate that the performance improvement of this invention stems from a continuous technical relationship between front-end enhancement, morphological decoupling and competition, multi-scale bidirectional propagation, and weak target optimization, rather than the replacement of a single attention module or a general backbone network.
Claims
1. A method for weak target image detection of micropores and microcracks in carbonate rocks, characterized in that, Includes the following steps: Step S1: Obtain a visible light image of the carbonate rock surface and perform weak target feature enhancement processing to obtain enhanced features; Step S2: Based on the enhanced features, multi-scale features are extracted through the backbone network of the joint detection network for micropores and microcracks in carbonate rocks, and context modeling is performed to obtain context features with a large receptive field that can capture structural and semantic features. Step S3: Based on the context features obtained in step S2, pore features and crack features are extracted through a micropore scale-sensitive branch and a microcrack direction-sensitive branch, respectively. The microcrack direction-sensitive branch employs constrained learning line-aware convolution, distributing sampling points along the local crack tangential direction and applying constrained displacement in the normal direction. Complementary competitive gating is applied to the pore features and crack features, normalizing them in both pore and crack dimensions. This ensures that the morphological responses of pores and cracks at the same spatial location form a competitive weight allocation to suppress category confusion. Step S4: The gated and modulated pore features are spliced with the crack features to generate morphology-guided enhancement features, which are propagated to the multi-scale feature layer through a bidirectional fusion path to form a feature pyramid. Each layer of the feature pyramid is used as the input to the micropore detection branch and the microcrack detection branch, respectively, and the corresponding classification probability, localization result and segmentation probability are output. The microcrack detection branch also outputs the crack direction prediction result.
2. The method for weak target image detection of micropores and microcracks in carbonate rocks as described in claim 1, characterized in that, In step S1, after acquiring the visible light image of the carbonate rock surface, scale unification and pixel normalization are first performed.
3. The method for weak target image detection of micropores and microcracks in carbonate rocks as described in claim 1 or 2, characterized in that, The weak target feature enhancement process in step S1 employs a multi-domain adaptive enhancement mechanism, the specific process of which includes: Based on the same shallow basic features extracted from the visible light image, four parallel feature paths are constructed, including a high-frequency path in the frequency domain, a low-frequency path in the frequency domain, a low-level path in the spatial domain, and a high-level path in the spatial domain. Among them, a two-dimensional frequency domain transformation is performed on the shallow basic features, and complementary frequency masks based on the spectrum center are used to extract the high-frequency components and low-frequency components in the frequency domain, respectively. The high-frequency features and low-frequency features in the frequency domain are obtained through their respective learnable mappings. Local edge, fine-grained texture and short-range morphological information are extracted from the shallow basic features through the spatial domain low-level path to obtain spatial domain low-level features; The spatial domain high-level features are obtained by extracting structural and contextual information with a large receptive field from the shallow basic features through the spatial domain high-level path; Global average pooling is performed on the shallow basic features, and four fusion weights corresponding to the four parallel feature paths are predicted simultaneously based on the pooling result. Softmax normalization is performed on the dimensions of the four parallel feature paths so that the sum of the four fusion weights is 1. The corresponding high-frequency features, low-frequency features, low-level features, and high-level features in the frequency domain are weighted and summed according to the four normalized fusion weights. The weighted fusion result is then residually fused with the shallow basic features to obtain the enhanced features.
4. The method for weak target image detection of micropores and microcracks in carbonate rocks as described in claim 1, characterized in that, The specific process of step S2 includes: The enhanced features are used as initial inputs and downsampled step by step through the backbone network to generate a multi-scale general feature map from high resolution to low resolution. The deepest feature map with the lowest resolution in the multi-scale general feature map is used as input, and multiple dilated convolution branches with different dilation rates are applied in parallel. Global semantic vectors are generated by global average pooling and then upsampled back to the original spatial size; The outputs of each branch are concatenated with 1 × 1 convolutional features and the channels are compressed to generate the contextual features with a large receptive field that can capture structural and semantic features.
5. The method for weak target image detection of micropores and microcracks in carbonate rocks as described in claim 1, characterized in that, In step S3, the micropore scale-sensitive branch uses multi-scale local convolution to extract pore features in order to capture point-like, block-like, and aggregated micropore responses. The microcrack orientation sensitive branch uses constrained learning line-aware convolution to extract crack features. The learning line-aware convolution establishes a tangential-normal coordinate system based on the local crack direction. The sampling points are distributed along the tangential direction, and the normal displacement is restricted and less than the maximum tangential displacement, so that the sampling area is constrained to the neighborhood of the crack centerline, so as to maintain the geometric continuity of the crack and avoid degenerating into free two-dimensional sampling.
6. The method for weak target image detection of micropores and microcracks in carbonate rocks as described in claim 1 or 5, characterized in that, The specific process of implementing complementary competitive gating for the pore features and the crack features in step S3, and normalizing them in both the pore and crack dimensions, includes: The pore features and the crack features are concatenated by channels, input into a 1 × 1 convolutional layer, and output a dual-channel feature map; The dual-channel feature map is normalized using Softmax in both the pore and crack dimensions to generate two complementary spatial gating maps. At the same spatial location, the sum of the corresponding values of the two spatial gating maps is 1. The pore features and the crack features are modulated element-wise using two spatial gating maps respectively, forming a competitive modulation response.
7. The method for weak target image detection of micropores and microcracks in carbonate rocks as described in claim 6, characterized in that, In step S3, the channel splicing result of the pore feature and the crack feature is also used as the joint feature of pore and crack. Global average pooling and global max pooling are performed on the joint features of pores and cracks, respectively, and channel attention is generated based on the obtained channel description. The channel attention includes channel attention sub-weights corresponding to the pore features and the crack features, respectively. The average map and the maximum map are calculated along the channel dimension of the joint feature, and a spatial attention map is generated based on the average map and the maximum map. The two spatial gating maps, the spatial attention map and the corresponding channel attention sub-weights are respectively modulated by element-wise multiplication with the pore feature and the crack feature to obtain the modulation-enhanced pore feature and the crack feature, forming the competitive modulation response.
8. The method for weak target image detection of micropores and microcracks in carbonate rocks as described in claim 1 or 4, characterized in that, In step S4, the specific process of propagating to the multi-scale feature layer through a bidirectional fusion path to form a feature pyramid includes: The morphological guidance enhancement features are channel aligned using 1 × 1 convolutions to make their number of channels consistent with the features of each layer of the backbone network; The deepest feature map output by the backbone network is fused with the morphologically guided enhancement feature after channel alignment using a learnable weighted fusion method. This involves assigning trainable scalar weights to each input, performing ReLU activation and normalization, then weighted summation, and finally non-linear fusion using 3 × 3 convolution to generate the highest-level fused feature. By using a top-down path, the highest-level fused features are upsampled step by step and fused with the features of each layer of the backbone network in a learnable weighted manner, thereby enabling the propagation of high-level semantics to high-resolution layers. By using a bottom-up approach, high-resolution layer features are downsampled step by step and then fused with the corresponding low-resolution layer features and the fusion features obtained from the top-down approach in a learnable weighted manner, thereby enabling the propagation of low-level spatial details to high-level semantic layers. The final feature pyramid containing semantic and location information is generated.
9. The method for weak target image detection of micropores and microcracks in carbonate rocks as described in claim 1, characterized in that, Also includes: Step S5: Generate candidate pore regions and candidate crack regions based on the classification probability, the localization result, and the segmentation probability; Step S6: Perform one or more post-processing operations on the candidate pore region and the candidate crack region, including: pre-set confidence threshold screening, same-class non-maximum suppression, and mapping the detection results back to the original image coordinate system according to the image preprocessing parameters; Step S7: Output the final detection results of micropores and microcracks.
10. The method for weak target image detection of micropores and microcracks in carbonate rocks as described in any one of claims 1, 2, 4, 5, 7, and 9, characterized in that, The training process of the joint detection network for micropores and microfractures in carbonate rocks includes: Training samples are constructed based on labeled micropore and microcrack instances. The undirected principal direction angle of the crack and the area and local background grayscale contrast of each target instance are obtained, and the instance weights are determined accordingly. Among them, the smaller the area and the lower the contrast, the greater the weight. Based on the prediction and annotation, the classification, localization, segmentation and orientation consistency losses are calculated, and the corresponding basic losses of classification, localization or segmentation are weighted with the instance weights to obtain the weak target weighted instance loss. The above-mentioned classification, localization, and segmentation basic losses, as well as the weak target weighted instance losses, are weighted and summed according to preset weights to obtain the total loss function; The optimizer updates the network parameters based on the total loss function to minimize the total loss.