Rock debris image segmentation method based on multi-scale feature enhancement and edge perception gating

Through the multi-scale feature enhancement and edge-aware gating method, the deficiencies in multi-scale feature fusion and edge detection in the existing technology are solved, and high-precision and low-latency cutting analysis are realized, which is suitable for real-time particle size analysis and geological parameter calculation of drilling cutting particles.

CN120355926AActive Publication Date: 2025-07-22SOUTHWEST PETROLEUM UNIV

Patent Information

Application Number
CN202510821287.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-19
Publication Date
2025-07-22
Estimated Expiration
2045-06-19

AI Technical Summary

Technical Problem

In the prior art, in the fragment image segmentation, there is a problem that multi-scale feature fusion cannot achieve pixel-level adaptation by using static weight allocation strategy, edge detection modules are not trained in a coordinated manner, and lightweight design leads to loss of detailed information.

Method used

The rock cutting image segmentation method with multi-scale feature enhancement and edge-aware gating is adopted. The space attention weight can be generated through four-level parallel depth separation. Combined with traditional edge operators and deep learning, the contribution of edge and semantic features is dynamically adjusted, and network parameters are optimized using lightweight strategies.

Benefits of technology

High-precision and low-latency rock chip analysis are realized, which is suitable for real-time particle size analysis and geological parameter calculation of drilling rock chip particles, improving the robustness of the model for complex textures and the adhesion rock chip segmentation effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120355926A_ABST
    Figure CN120355926A_ABST
Patent Text Reader

Abstract

The invention discloses a rock debris image segmentation method based on multi-scale feature enhancement and edge perception gating. The method comprises the following steps: covering 13 * 13 to 3 * 3 pixel receptive fields through four-stage parallel depth separable cavity convolution; the dynamic weight generation network generates a space attention weight to realize self-adaptive fusion of multi-branch features; a traditional edge operator kernel is initialized in a shallow network, and 5 * 5 learnable convolution is adopted in a deep layer to enhance edge continuity. Through channel grouping initialization and a random disturbance strategy, the direction sensitivity of a traditional operator is reserved. A mixed weight is generated through channel attention and space attention, and edge features are injected into a main path in a residual scaling mode. The attention weight dynamically adjusts the contribution degree of the edge and semantic features, and high-precision segmentation of a boundary region is ensured; the shallow edge features are optimized preferentially by combining the loss function, and the robustness of the model to complex textures is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical fields of computer vision and petroleum exploration, and in particular to a cuttings image segmentation method based on multi-scale feature enhancement and edge-aware gating, which is applicable to real-time particle size analysis of drilling cuttings and geological parameter calculation. Background Art

[0002] In the process of petroleum drilling exploration, the automated analysis of cuttings microscopic images is the core link for evaluating formation lithology, calculating porosity and particle size distribution. Cuttings are rock debris generated during drilling, and their morphological characteristics and distribution rules directly reflect the formation structure and oil and gas reservoir performance. Traditional analysis methods rely on manual microscope observation and manual annotation, and have problems such as low efficiency, strong subjectivity, and difficulty in processing large-scale data. With the development of computer vision technology, image segmentation methods based on deep learning have gradually replaced traditional means, but still face the following key challenges in practical applications: In recent years, researchers have tried to improve the above problems through multi-scale feature fusion, edge optimization modules and model compression, but there are still limitations: The multi-scale feature fusion adopts a static weight allocation strategy and cannot achieve pixel-level adaptability; The edge detection module does not co-train traditional operators with deep learning; The lightweight design ignores the dynamic calculation requirements of multiple branches, resulting in loss of detailed information. Summary of the Invention

[0003] In view of the above technical problems, the present invention provides a cuttings image segmentation method based on multi-scale feature enhancement and edge-aware gating, providing a set of high-precision and low-latency cuttings analysis tools for petroleum exploration.

[0004] The present invention is implemented by the following technical solutions: A cuttings image segmentation method based on multi-scale feature enhancement and edge-aware gating includes the following steps: Step S1: Input an RGB image and perform preprocessing, load the labeled three-channel semantic segmentation label, convert the RGB label into a single-channel class index matrix, extract edge features to generate a binary edge label, and jointly form a supervision signal with the semantic label; Step S2: Input the image processed in Step S1 into the main encoding path, and the features extracted by each layer are enhanced by the multi-scale feature extraction module ADP. The input features are preprocessed by the dynamic weight generation network to generate a spatial attention weight map, and finally the outputs of each branch are weighted and fused, and the original features are retained through residual connection; Step S3: Construct an edge encoder based on the deep residual network. Initialize the convolution kernels of the first, third, and fifth layers as traditional edge operators. Fusion the features of the main path and the edge path through the dual-path attention gating module DPAG. After enhancing the edge features through depthwise separable convolution, generate hybrid weights through channel attention and spatial attention, and finally fuse them into the main path features in a residual scaling manner; Step S4: Generate six-layer multi-scale supervision signals by average pooling the labeled binary edge map, and retain the edge density distribution of each layer. The output features of each layer of the edge encoder are convolved with a 3×3 kernel and activated by Sigmoid to generate a probability map. Calculate the binary cross-entropy loss layer by layer. The total loss function is composed of the weighted main segmentation task and the edge supervision loss; Step S5: Combine the main segmentation task and the edge supervision task, and adopt a lightweight strategy to optimize the network parameters; Step S6: Input the features of each layer processed in Step S3 into the decoder. The decoder gradually restores the feature resolution through bilinear interpolation, combines the features of each stage of the encoder through skip connections, and finally outputs a three-channel probability map. Extract the cuttings contour based on the segmentation result to calculate the image metrics.

[0005] Specifically, the Step S1 specifically includes the following steps: Step S11: Input a preset pixel image, and map the pixel values to the [0,1] interval through the Min-Max normalization formula. The formula is expressed as: ; where, is the input image tensor, and are the global minimum and global maximum values respectively; Step S12: Convert the RGB label to a single-channel category index matrix through a color mapping rule, use an edge detection algorithm to extract edge features from the grayscale image, generate a binary edge label, and jointly form a supervision signal with the semantic label.

[0006] Specifically, the Step S2 specifically includes the following sub-steps: Step S21: Input the image processed in Step S1 into the main encoding path. The features extracted by each layer are enhanced through the multi-scale feature extraction module ADP. The multi-scale feature extraction module ADP adopts a four-level parallel depthwise separable dilated convolution structure, and the dilation rates are configured in a geometric progression as ={1, 2, 4, 6}, and the calculation formula for the effective receptive field of a single branch is: ; where, is the dilation rate of the dilated convolution, is the number of convolution layers; Each branch uses depthwise separable convolution to reduce the computational complexity, and the amount of computation is reduced to: ; Among them, represents the spatial dimension of the feature map, represent the number of input and output channels respectively, represents the convolution kernel size; Each branch is followed by group normalization and the GELU activation function; Step S22: Design a dynamic weight generation mechanism. The depthwise separable convolution extracts local context information, and then the channel dimension is compressed to the number of branches through a learnable projection matrix to generate a spatial attention weight map; Step S23: Perform spatial attention weighting on the output of each branch The expression is: ; Among them, represents element-wise multiplication, is the channel adjustment matrix of the 1×1 convolution, represents the attention weight of the branch; The final output retains the original features through residual connection as: ; Among them represents the input feature, is the feature enhanced by the multi-scale feature extraction module ADP.

[0007] Specifically, the step S22 specifically includes: Step S221: Process the input feature through depthwise separable convolution to capture local context information and retain position-sensitive information. The expression is: ; Among them, the depthwise separable convolution is 3×3, is the batch size, is the spatial size, and the activation function , is the cumulative distribution function of the standard normal distribution N(0,1), represents the depthwise separable convolution operation, and the kernel function is decomposed into: ; Among them represents performing convolution operations on each input channel separately, and each input channel uses a separate convolution kernel for convolution, and the number of output channels is the same as the number of input channels; represents using The convolution kernel performs convolution on each position of the input feature map; Step S222: Initialize the convolution kernel weights using the He normal distribution, with the expression: ; where, is the number of input channels multiplied by the area of the convolution kernel, and the output shape after depthwise separable convolution is ; Compress the channels of the convolved features. The compression layer is implemented through a learnable projection matrix , expressed as: ; Step S223: The projection layer maps the features to the branch number dimension, with a dimension of 4; regard the weight generation as a mapping from spatial positions to the scale space, and the expression is: ; where, corresponds to the projection vector of the branch, represents the feature at the position after compression; Step S224: After Softmax normalization, perform probability normalization along the channel dimension to finally generate the attention weights , and the probability normalization expression is: .

[0008] Specifically, step S3 specifically includes the following steps: Step S31: Initialize the convolution kernel by fusing the prior knowledge of traditional edge detection operators with the adaptive feature learning ability of deep learning. The first-layer convolution kernel is initialized as operator horizontal kernel, the third layer uses operator vertical kernel, the fifth layer adopts operator diagonal kernel, and expand the kernel to , and the expressions are successively: , , ; Through hierarchical feature extraction, represent the feature calculation of each stage as: ; ; where, is the of the edge encoderLayer output features, indicating max pooling, kernel size , stride is 2, is the tensor after being processed by step S11, indicating depthwise separable convolution operation; Step S32: Through convolution, perform channel dimension matching on the main encoding path feature map and the edge path feature map, and the expression is: ; wherein, is group normalization, and the number of groups is fixed at 4; Step S33: Design a channel-spatial collaborative attention mechanism to generate dynamic weights through feature interaction, and the expression is: ; ; ; wherein, represents the Sigmoid function, is the activation function, is the channel concatenation operation, represents taking the average value, represents taking the maximum value, represents the encoding feature map of the main path; Step S34: Implement feature weighted fusion through a gating mechanism, enhance edge details while retaining the encoding semantic information of the main path, and the fused feature expression is: ; wherein, ⊙ represents element-wise multiplication, represents the edge path feature map after dimension matching.

[0009] Specifically, step S4 specifically includes the following steps: Step S41: Guide the model to learn refined boundary features through hierarchical edge supervision loss. The binary edge labels generated by the edge detection algorithm are downsampled to six scales through average pooling and used as the supervision signals for each layer of the edge encoder; Step S42: The features of each layer pass through convolution and the Sigmoid function to generate a probability map , and the weighted multi-scale loss calculation formula is expressed as: ; wherein, respectively represent the height and width of the feature map of the layer, represents the The layer at position The supervision signal, from the original edge map After Generated by average pooling, with a value range of ; Denote the layer at position The predicted probability; Step S43: Integrate the total loss and jointly optimize the objective, with the expression: ; Among them, Is the main encoder, which guides the model to learn the hierarchical features of cuttings boundaries through multi-scale feature alignment and dynamic weight allocation, forming complementary optimization with the main segmentation task.

[0010] Specifically, the step S5 specifically includes: Step S51: Initialize the weights of the convolutional layers in the main encoding path using the He normal distribution to ensure the stability of the variance of the activation values during forward propagation; Step S52: For the dynamic weight generation network in the multi-scale feature enhancement module, the first layer is initialized by the kaiming_normal method to match the non-linear characteristics of the GELU activation function; the second layer is initialized using the zero-mean normal distribution to avoid weight bias in the initial stage; Step S53: Use the Adam optimizer, set the initial learning rate to 1e-4, the weight decay coefficient to 1e-4, start from 1e-4 for the initial learning rate, and adopt the mixed precision and cosine annealing strategy.

[0011] Specifically, the step S6 specifically includes: Step S61: Based on the fused features generated in step S34 , Gradually upsample the feature map through bilinear interpolation, combine the features of each stage of the encoder with skip connections, and finally output a three-channel probability map; Generate the segmentation result through the Argmax operation, which acts on the three-channel probability values at each pixel position, selects the channel with the highest probability as the class label of the pixel, and then generates the final segmentation result map; Step S62: Extract the cuttings contour based on the segmentation result, calculate the equivalent circle diameter and count the particle size distribution.

[0012] The beneficial effects of the present invention are as follows: Through four - level parallel depth - separable dilated convolutions (dilation rates 1, 2, 4, 6), the present invention covers receptive fields from 13×13 to 3×3 pixels, adapting to a particle size range of 0.1 - 5 mm. The dynamic weight generation network generates spatial attention weights to achieve adaptive fusion of multi - branch features. Initialize the traditional edge operator kernel in the shallow network, and use a 5×5 learnable convolution in the deep layer to enhance edge continuity. Through channel - group initialization and random perturbation strategy, the direction sensitivity of the traditional operator is retained. Generate hybrid weights through channel attention (global average pooling + fully - connected layer) and spatial attention, and inject edge features into the main path in a residual scaling manner. The attention weights dynamically adjust the contribution degrees of edge and semantic features, ensuring high - precision segmentation in the boundary region. Downsample the binary edge labels generated by the Canny algorithm to 6 scales to constrain the outputs of each layer of the edge encoder. The joint loss function preferentially optimizes shallow - layer edge features, improving the robustness of the model to complex textures. Compared with existing segmentation models, this technology can better handle the segmentation of adhered cuttings and is applicable to real - time particle size analysis and geological parameter calculation of drilling cuttings particles. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] To more clearly illustrate the technical solutions in the embodiments of the present invention or in the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following - described drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on the structures shown in these drawings.

[0014] Figure 1 It is the overall flow structure diagram of the cutting image segmentation method with multi - scale feature enhancement and edge - aware gating in the embodiments of the present invention; Figure 2 It is the schematic diagram of the ADP of the multi - scale feature enhancement module in the embodiments of the present invention; Figure 3 It is the schematic diagram of the edge - aware gating in the embodiments of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0015] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. Usually, the components of the embodiments of the present invention described and illustrated in the drawings here can be arranged and designed in various different configurations.

[0016] It should be noted that: Similar reference numerals and letters denote similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings.

[0017] The following will, in conjunction with the accompanying Figures 1 to 3 , elaborate on some embodiments of the present invention. Without conflict, the following embodiments and the features in the embodiments can be combined with each other.

[0018] The present invention proposes a cuttings image segmentation method based on multi-scale feature enhancement and edge-aware gating. The overall process architecture is as Figure 1 shown, and specifically includes the following steps: S1: Input an RGB image of 3072×3072 pixels. First, perform Min-Max normalization processing on the image data to linearly map the pixel values to the interval [0, 1]. Load the labeled three-channel semantic segmentation labels (background, main body of cuttings, edge), and convert the RGB labels into a single-channel class index matrix through the color mapping rule. Use the edge detection algorithm to extract edge features from the grayscale image to generate a binary edge label, which together with the semantic label constitutes the supervision signal.

[0019] S2: The image processed in S1 is input into the main encoding path, and the features extracted by each layer are enhanced through the multi-scale feature extraction module ADP. The ADP module is designed as follows: First, construct a four-level parallel depthwise separable dilated convolution structure, and each branch adopts a combination of depth convolution and pointwise convolution. Preprocess the input features through the dynamic weight generation network: first extract local context information through depthwise separable convolution, then compress the channel dimension to the number of branches through a learnable projection matrix to generate a spatial attention weight map, and finally perform weighted fusion on the outputs of each branch and retain the original features through residual connection.

[0020] S3: Construct an edge encoder based on the deep residual network, and initialize the convolution kernels of the first, third, and fifth layers as traditional edge operators. Fuse the features of the main path and the edge path through the dual-path attention gating module (DPAG): After enhancing the edge features through depthwise separable convolution, generate a hybrid weight through channel attention and spatial attention, and finally fuse it into the main path features in a residual scaling manner.

[0021] S4: Generate a six-layer multi-scale supervision signal by average pooling the labeled binary edge map, and retain the edge density distribution of each layer. The features output by each layer of the edge encoder are convolved with a 3×3 convolution and activated by Sigmoid to generate a probability map, and the binary cross-entropy loss is calculated layer by layer. The total loss function is composed of the main segmentation task (Dice loss) and the edge supervision loss weighted. During the training process, the edge loss gradient acts on the shallow layer of the encoder first to strengthen the extraction of low-level edge features.

[0022] S5: Combine the main segmentation task and the edge supervision task, and adopt a lightweight strategy to optimize the network parameters.

[0023] S6: The features of each layer processed in step S3 are input into the decoder. The decoder gradually restores the feature resolution through bilinear interpolation, combines the features of each stage of the encoder with skip connections, and finally outputs a three-channel probability map (background, main body of cuttings, edge). Based on the segmentation result, the contour of the cuttings is extracted, and indexes such as equivalent circle diameter and pixel area are calculated.

[0024] In this embodiment, step S1 includes the following sub-steps: S11: Input an image of 3072×3072 pixels, and map the pixel values to the interval [0,1] through the Min-Max normalization formula:

[0025] where is the input image tensor, and are the global minimum and maximum values respectively.

[0026] S12: Convert the RGB labels into a single-channel category index matrix through the color mapping rule, use the Canny edge detection algorithm to extract edges from the grayscale image, generate a binary edge label (0 / 1), and jointly form a supervision signal with the semantic label.

[0027] In this embodiment, step S2 includes the following sub-steps: S21: The image processed in S11~S12 is input into the main encoding path. The features extracted by each layer are enhanced through the multi-scale feature extraction module ADP. The ADP module adopts a four-level parallel depthwise separable atrous convolution structure, and its atrous rate is configured in geometric progression as ={1,2,4,6}. The effective receptive field of a single branch is calculated as:

[0028] where is the atrous rate of the atrous convolution, is the number of convolutional layers. When =6, the actual receptive field expands to 13×13 (corresponding to a particle size of 5mm), while the standard 3×3 convolution can only cover particles of 0.2-1mm. Each branch adopts depthwise separable convolution to reduce the computational complexity, and its computational amount is reduced from that of the standard convolution:

[0029] to

[0030] where represents the spatial dimension of the feature map, represents the number of input and output channels, Represents the convolution kernel size. Each branch is followed by group normalization (GroupNorm) and GELU activation function.

[0031] S22: Design a dynamic weight generation mechanism for adaptive fusion of multi-scale features. First, the input features After 3×3 depth-separable convolution processing, local context information can be captured and position-sensitive information can be retained:

[0032] Where B is the batch size, H×W is the spatial size, and the activation function , is the cumulative distribution function of the standard normal distribution N(0,1), Represents a depth-separable convolution operation, whose kernel function is decomposed into:

[0033] in Indicates that convolution is performed on each input channel separately. That is, each input channel uses a separate The convolution kernel performs convolution, and the number of output channels is the same as the number of input channels. Indicates the use The convolution kernel is used to perform convolution on each position of the input feature map.

[0034] Since the particle size distribution of rock fragments in the data set is normally distributed, the convolution kernel weights are initialized using the He normal distribution:

[0035] in, It is the number of input channels multiplied by the area of the convolution kernel. After depth-wise separable convolution, the output shape is , the convolutional features are channel compressed, and the compression layer is passed through a learnable projection matrix accomplish:

[0036] The learnable projection matrix is a linear transformation matrix that takes a The convolutional layer is implemented, where , forcing the network to retain the most discriminative frequency components, and the lowest channel 4 to avoid gradient disappearance.

[0037] The projection layer maps the features to the branch number dimension (K=4), and its weight generation can be regarded as a mapping from spatial position to scale space:

[0038] in The projection vector corresponding to the kth branch, Indicates the feature at the position after compression. During the training process, at the edge of the cuttings, has a large projection in the high-frequency direction, resulting in (d = 1) obtaining higher weights at these positions.

[0039] Finally, after Softmax normalization, probability normalization is performed along the channel dimension

[0040] Finally, the attention weights are generated .

[0041] S23: Perform spatial attention weighting on the outputs of each branch :

[0042] Where represents element-wise multiplication, is the channel adjustment matrix of the 1×1 convolution, represents the attention weight of the branch. The final output retains the original features through a residual connection:

[0043] Where represents the input feature, is the feature enhanced by the ADP module.

[0044] In this embodiment, step S3 includes the following sub-steps: S31: Given that the main path performs poorly in extracting the edge features of cuttings and fails to fully enhance the ability to capture edge details, an edge path is designed to enhance the extraction of edge features. The edge path adopts a deep residual network architecture and generates a multi-scale edge response map through hierarchical feature extraction. In specific implementation, the edge encoder contains 6 downsampling stages, and the number of channels increases according to [4, 8, 12, 16, 20, 24] at each stage. The convolutional kernels are initialized by fusing the prior knowledge of traditional edge detection operators with the adaptive feature learning ability of deep learning. The first-layer convolutional kernel is initialized as operator horizontal kernel, and the mathematical expression is as follows:

[0045] The third layer uses operator vertical kernel, and the mathematical expression is as follows:

[0046] The fifth layer adopts The operator diagonal kernel extends the kernel to , and the mathematical expression is as follows:

[0047] Through hierarchical feature extraction, the feature calculation at each stage can be expressed as:

[0048]

[0049] where is the output feature of the th layer of the edge encoder, represents max pooling, with a kernel size of and a stride of 2. is the tensor after the original image is processed by step S11, represents the depthwise separable convolution operation, and its specific meaning is the same as described in step S22.

[0050] The following downsampling method forms spatial alignment with the features at each resolution stage of the main encoding path.

[0051] S32: Through convolution, the channel dimensions of the feature maps of the main encoding path and the edge path are matched:

[0052] where is GroupNorm, and the number of groups is fixed at 4. This operation projects the number of edge feature channels from to be the same as that of the backbone feature .

[0053] S33: Design a channel-spatial collaborative attention mechanism to generate dynamic weights through feature interaction:

[0054]

[0055]

[0056] where represents the Sigmoid function, is the activation function, is the channel concatenation operation, represents taking the average value, represents taking the maximum value, represents the encoded feature map of the main path.

[0057] S34: Implement feature weighted fusion through a gating mechanism to retain the semantic information encoded in the main path while enhancing edge details:

[0058] In the formula, ⊙ represents element-wise multiplication, represents the edge path feature map after dimension matching. This formula establishes a soft attention selection mechanism that enables the network to adaptively enhance.

[0059] In this embodiment, the step S4 includes the following sub-steps: S41: Guide the model to learn refined boundary features through hierarchical edge supervision loss.

[0060] The binary edge labels generated by the Canny edge detection algorithm are downsampled to six scales (the resolution is halved step by step) through average pooling (pooling kernel size , stride 2) as the supervision signals for each layer of the edge encoder.

[0061] S42: The features of each layer pass through convolution + Sigmoid to generate a probability map , and the weighted multi-scale loss calculation formula is as follows:

[0062] Where represents the height and width of the feature map of the th layer (as the number of layers increases, the size is halved through pooling operations), represents the supervision signal of the th layer at position , which is generated by the original edge map through average pooling, and the value range is , represents the predicted probability of the th layer at position .

[0063] S43: Total loss integration, joint optimization objective:

[0064] Where is the main encoder, which guides the model to learn hierarchical features of cuttings boundaries through multi-scale feature alignment and dynamic weight allocation, forming complementary optimization with the main segmentation task.

[0065] S51: The weights of the convolutional layers in the main coding path (encoder1 to encoder6 modules) are initialized with the He normal distribution to ensure the stability of the variance of the activation values during forward propagation.

[0066] S52: The dynamic weight generation network in the multi-scale feature enhancement module is initialized by the kaiming_normal method in its first layer to match the non-linear characteristics of the GELU activation function; the second layer is initialized with a zero-mean normal distribution to avoid weight bias in the initial stage.

[0067] S53: Use the Adam optimizer with an initial learning rate of 1e-4, a weight decay coefficient of 1e-4. The initial learning rate starts from 1e-4, and a mixed precision and cosine annealing strategy is adopted.

[0068] S61: The fused features generated in step S34 , are gradually upsampled through bilinear interpolation to combine the features of each stage of the encoder with skip connections. Finally, a three-channel probability map (background, main body of cuttings, edge) is output, and the segmentation result is generated through the Argmax operation. The Argmax acts on the three-channel probability values at each pixel position, and the channel with the highest probability is selected as the class label of the pixel, thus generating the final segmentation result map.

[0069] S62: Extract the contour of the cuttings based on the segmentation result, calculate the equivalent circle diameter, and statistically analyze the particle size distribution, etc.

[0070] In summary, the present invention proposes a method for segmenting microscopic images of cuttings based on multi-scale feature enhancement and edge-aware optimization. The multi-scale feature enhancement module dynamically fuses multi-scale features under different receptive fields. A learnable edge encoder is designed by combining a traditional edge operator kernel with a deep learnable convolution, and a depthwise separable convolution and dynamic group normalization strategy are adopted to significantly compress the model parameters. Through the multi-scale edge supervision mechanism and the dual-path attention gating, the robustness of the model to complex illumination and noise interference is enhanced, providing an efficient and accurate cutting analysis tool for oil exploration.

[0071] For the foregoing embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present application is not limited by the described action sequence, because according to the present application, some steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification belong to preferred embodiments, and the actions involved are not necessarily essential to the present application.

[0072] In the above embodiments, the basic principles, main features and advantages of the present invention are described. Those skilled in the art should understand that the present invention is not limited by the above embodiments. What is described in the above embodiments and the specification only illustrates the principles of the present invention. Without departing from the spirit and scope of the present invention, any modifications and changes made by those skilled in the art without departing from the spirit and scope of the present invention shall fall within the protection scope of the appended claims of the present invention.

Claims

1. A cutting image segmentation method based on multi-scale feature enhancement and edge-aware gating, characterized in that, It includes the following steps: Step S1: Input an RGB image and perform preprocessing. Load the annotated three-channel semantic segmentation label, convert the RGB label into a single-channel class index matrix, extract edge features to generate a binary edge label, and jointly form a supervision signal with the semantic label; Step S2: Input the image processed in Step S1 into the main encoding path. The features extracted at each layer are enhanced through the multi-scale feature extraction module ADP. The input features are preprocessed by the dynamic weight generation network to generate a spatial attention weight map. Finally, the outputs of each branch are weighted and fused, and the original features are retained through residual connections; Step S3: Construct an edge encoder based on the deep residual network. Initialize the convolution kernels of the first, third, and fifth layers as traditional edge operators. The features of the main path and the edge path are fused through the dual-path attention gating module DPAG. After the edge features are enhanced by depthwise separable convolution, a hybrid weight is generated through channel attention and spatial attention, and finally, it is fused into the main path features in a residual scaling manner; Step S4: Generate a six-layer multi-scale supervision signal by average pooling the annotated binary edge map, retain the edge density distribution of each layer. The output features of each layer of the edge encoder are convolved with a 3×3 convolution and activated by Sigmoid to generate a probability map. The binary cross-entropy loss is calculated layer by layer. The total loss function is composed of the weighted main segmentation task and the edge supervision loss; Step S5: Combine the main segmentation task and the edge supervision task, and adopt a lightweight strategy to optimize the network parameters; Step S6: Input the features of each layer processed in Step S3 into the decoder. The decoder gradually restores the feature resolution through bilinear interpolation, combines the features of each stage of the encoder through skip connections, and finally outputs a three-channel probability map. Calculate the image metrics by extracting the cuttings contour based on the segmentation result.

2. The cutting image segmentation method based on multi-scale feature enhancement and edge-aware gating according to claim 1, characterized in that The specific steps of Step S1 include the following steps: Step S11: Input a preset pixel image, and map the pixel values to the [0,1] interval through the Min-Max normalization formula. The formula is expressed as: ; Among them, is the input image tensor, and are the global minimum value and the global maximum value respectively; Step S12: Convert the RGB label into a single-channel class index matrix through the color mapping rule. Use an edge detection algorithm to extract edge features from the grayscale image to generate a binary edge label, and jointly form a supervision signal with the semantic label.

3. The method for cutting debris image segmentation based on multi-scale feature enhancement and edge-aware gating according to claim 2, wherein, The specific sub-steps of Step S2 include the following: Step S21: Input the image processed in Step S1 into the main encoding path. The features extracted at each layer are enhanced by the multi-scale feature extraction module ADP. The multi-scale feature extraction module ADP adopts a four-level parallel depthwise separable atrous convolution structure, and the atrous rates are configured in geometric progression as = {1, 2, 4, 6}, and the calculation formula for the effective receptive field of a single branch is: ; Among them, is the dilation rate of the dilated convolution, is the number of convolutional layers; Each branch uses depthwise separable convolution to reduce the computational complexity, and the computational amount is reduced to: ; Among them, represents the spatial dimension of the feature map, respectively represent the number of input and output channels, represents the convolutional kernel size; each branch is followed by group normalization and the GELU activation function; Step S22: Design a dynamic weight generation mechanism. The depthwise separable convolution extracts local context information, and then compresses the channel dimension to the number of branches through a learnable projection matrix to generate a spatial attention weight map; Step S23: Perform spatial attention weighting on the outputs of each branch The expression is as follows: ; Among them, represents element-wise multiplication, is the channel adjustment matrix for 1×1 convolution, represents the attention weight of the branch; the final output retains the original features through residual connection as: ; Among them represents the input feature is the feature enhanced by the multi-scale feature extraction module ADP 4. The method for cutting debris image segmentation based on multi-scale feature enhancement and edge-aware gating according to claim 3, characterized in that, The specific steps of Step S22 include: Step S221: The input features are processed by depthwise separable convolution to capture local context information and retain position-sensitive information. The expression is as follows: ; Among them, the depthwise separable convolution is 3×3, is the batch size, is the spatial dimension, and the activation function , is the cumulative distribution function of the standard normal distribution N(0,1), represents the depthwise separable convolution operation, and the kernel function is decomposed as: ; Among them means performing a convolution operation on each input channel separately, and using a separate convolution kernel for convolution on each input channel, and the number of output channels is the same as the number of input channels; means using convolution kernel to perform convolution on each position of the input feature map; Step S222: Initialize the convolution kernel weights using the He normal distribution. The expression is: ; Among them, is the number of input channels multiplied by the area of the convolution kernel. After depthwise separable convolution, the output shape is ; The features after convolution are compressed in channels. The compression layer is implemented by a learnable projection matrix and is expressed as: ; Step S223: The projection layer maps the features to the number of branch dimensions, and the dimension is 4. The weight generation is regarded as a mapping from spatial position to scale space. The expression is: ; Among them, corresponding to the projection vector of the branch, indicating the feature at the position after compression; Step S224: After Softmax normalization, probability normalization is performed along the channel dimension, and finally attention weights are generated. , and the probability normalization expression is: 。 5. The cutting image segmentation method based on multi-scale feature enhancement and edge-aware gating according to claim 4, wherein The specific steps of Step S3 include the following steps: Step S31: Initialize the convolutional kernel by integrating the prior knowledge of traditional edge detection operators with the adaptive feature learning ability of deep learning. The first-layer convolutional kernel is initialized as operator horizontal kernel, and the third layer uses operator vertical kernel. The fifth layer adopts operator diagonal kernel, and expand the kernel to . The expressions are as follows: , , ; Through hierarchical feature extraction, the feature calculation of each stage is expressed as: ; ; Among them, is the output feature of the layer of the edge encoder, represents max pooling, with a kernel size of , a stride of 2, is the tensor after being processed in step S11, represents a depthwise separable convolution operation; Step S32: Through performing convolution to match the channel dimensions of the main coding path feature map and the edge path feature map, with the expression: ; Among them, is group normalization, and the number of groups is fixed at 4; Step S33: Design a channel-spatial collaborative attention mechanism to generate dynamic weights through feature interaction. The expression is as follows: ; ; ; Among them, represents the Sigmoid function, is the activation function, is the channel concatenation operation, represents taking the average value, represents taking the maximum value, represents the encoded feature map of the main path; Step S34: Achieve feature weighted fusion through a gating mechanism, enhancing edge details while retaining the semantic information encoded in the main path. The expression for the fused features is as follows: ; where, ⊙ represents element-wise multiplication, represents the edge path feature map after dimension matching.

6. The cuttings image segmentation method based on multi-scale feature enhancement and edge-aware gating according to claim 5, characterized in that The specific steps of step S4 are as follows: Step S41: Guide the model to learn refined boundary features through a hierarchical edge supervision loss. The binary edge labels generated by the edge detection algorithm are downsampled to six scales through average pooling and used as the supervision signals for each layer of the edge encoder. Step S42: Each layer of features passes through convolution and the Sigmoid function to generate a probability map , and the weighted multi-scale loss calculation formula is expressed as: ; Among them, respectively represent the height and width of the feature map of the -th layer, represents the supervision signal of the -th layer at position , which is generated by performing average pooling on the original edge map , and the value range is ; represents the predicted probability of the -th layer at position ; Step S43: Integrate the total loss and jointly optimize the objective. The expression is as follows: ; Among them, is the main encoder, which guides the model to learn hierarchical features of cuttings boundaries through multi-scale feature alignment and dynamic weight allocation, forming complementary optimization with the main segmentation task.

7. The cutting image segmentation method based on multi-scale feature enhancement and edge-aware gating according to claim 1, characterized in that The specific steps of step S5 are as follows: Step S51: Initialize the weights of the convolutional layers in the main encoding path using the He normal distribution to ensure stable variance of the activation values during forward propagation. Step S52: For the dynamic weight generation network in the multi-scale feature enhancement module, the first layer is initialized using the kaiming_normal method to match the non-linear characteristics of the GELU activation function. The second layer is initialized using a zero-mean normal distribution to avoid weight bias in the initial stage. Step S53: Use the Adam optimizer with an initial learning rate of 1e-4, a weight decay coefficient of 1e-4. The initial learning rate starts from 1e-4, and a mixed precision and cosine annealing strategy is adopted.

8. The method for cutting debris image segmentation based on multi-scale feature enhancement and edge-aware gating according to claim 4, wherein, The specific steps of step S6 are as follows: Step S61: Based on the fused features generated in step S34 , gradually upsample the feature map through bilinear interpolation, combine the features of each stage of the encoder with skip connections, and finally output a three-channel probability map; generate the segmentation result through the Argmax operation. The Argmax acts on the three-channel probability values at each pixel position, selects the channel with the highest probability as the class label of the pixel, and then generates the final segmentation result map; Step S62: Extract the cuttings contour based on the segmentation result, calculate the equivalent circle diameter, and count the particle size distribution.

Citation Information

Patent Citations

  • RGB-D-oriented fusion model and target detection method thereof

    CN119963807A

  • An edge-guided RGBD underwater salient object detection method with multi-attention

    JP7605548B1

  • Three-dimensional point-cloud semantic segmentation method based on multi-level boundary enhancement for unstructured environment

    WO2024230038A1

Cited By

  • Colored textile fabric image retrieval method based on dynamic feature contribution degree

    CN120596697A

  • Rock joint and bedding segmentation method based on frequency-space learning

    CN120807539A

  • Rock joint and bedding segmentation method based on frequency-space learning

    CN120807539B

  • Inplanatory attribution method, system and device based on star catalogue semantic segmentation model and storage medium

    CN120976554A

  • An explainable attribution method, system, device and storage medium based on a star semantic segmentation model

    CN120976554B