Semantic segmentation method for casting thin slices based on dense multi-scale and spatial information guidance

By constructing an empty cavity convolutional branch, DMFEM and SIFFM module, combined with the CBAM attention mechanism and encoder-decoder framework, the problem of low pore segmentation accuracy in the cast thin sheet image is solved. Explained.

CN119131404BActive Publication Date: 2025-01-24CHENGDU UNIVERSITY OF TECHNOLOGY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411642134.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-18
Publication Date
2025-01-24
Estimated Expiration
2044-11-18

AI Technical Summary

Technical Problem

The prior art is difficult to effectively segment the pores in the cast sheet images, mainly due to large color differences, scattered pore distribution, irregular pore shapes, resulting in low segmentation accuracy and strong dependence on the experimental environment.

Method used

Adopt a semantic segmentation method based on dense multi -scale and spatial information guidance, by constructing the feature fusion module (SIFFM) of the features (DMFEM) and spatial information guidance by constructing an empty -cave convocculating branch module, dense multi -scale feature extraction module (DMFEM), and space information guidance Device-decoder framework to enhance the fitting ability and segmentation accuracy of the model of the model to the cast body.

Benefits of technology

It effectively overcomes the problems of large color differences, variable pore scales, and blurred edges in cast thin-section images, achieving higher pore segmentation accuracy and model interpretability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119131404B_ABST
    Figure CN119131404B_ABST
Patent Text Reader

Abstract

The present invention discloses a semantic segmentation method for cast thin slices based on dense multi-scale and spatial information guidance, comprising the steps of: preparing a semantic segmentation data set based on cast thin slice images; constructing a dilated convolution branch module; constructing a DMFEM module for dense multi-scale feature extraction; constructing a SIFFM module for feature fusion guided by spatial information; using the DMFEM module in the encoder for feature extraction, using the SIFFM module in the decoder for feature fusion, and constructing a semantic segmentation network of an encoder-decoder framework; using the semantic segmentation data set to train a semantic segmentation model for cast thin slices for pore recognition in cast thin slice images to be recognized. The present invention can overcome the defects of unsatisfactory target segmentation caused by large color differences in cast thin slice images, variable pore scales, blurred edges, etc., can better fit the features of cast thin slices, and realize accurate detection and recognition of pores.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of image processing, and in particular to a semantic segmentation method of a casting thin slice based on dense multi-scale and spatial information guidance. Background Art

[0002] Cast thin sections are made by injecting colored liquid glue into the pore space of rocks under vacuum pressure and grinding it after the liquid glue solidifies. The pore microstructure of cast thin sections is one of the important parameters for characterizing the size and quality evaluation of rock reservoir space. In actual work, pore analysis can be measured by experimental methods or observed through a polarizing microscope. The former experiment has high economic costs, while the latter requires high operating experience and heavy workload from researchers, requires more effort, and is prone to human errors.

[0003] In recent years, with the significant progress of computer image technology, the analysis method of casting thin sections is gradually evolving from traditional manual observation to using high-definition cameras to capture casting images and conduct detailed analysis through digital image technology. The pores in casting thin section images usually appear red or blue, which provides the possibility of using color features to segment the pores of casting thin sections. However, the color difference between different batches is large, and there is uneven dyeing, which leads to the fact that traditional segmentation methods can only achieve good segmentation effects in certain specific occasions, have a strong dependence on the experimental environment, and have poor accuracy when processing complex and changeable casting thin section images. Deep learning can capture the complex characteristics of the data through its multi-layer network architecture, and has significantly enhanced the accuracy compared with traditional methods. However, due to the heterogeneity of rocks and the complexity of diagenetic evolution, the pore distribution observed in casting thin sections is scattered and the pore shape is irregular, which makes it difficult for many semantic segmentation technologies to achieve ideal segmentation effects in thin section image segmentation, resulting in large errors in the evaluation of face rate and the extraction of pore features. Therefore, enhancing the accuracy of the semantic segmentation model in the pore segmentation of cast thin sections and ultimately achieving high-precision pore segmentation of cast thin sections is of great significance to related work in the fields of geothermal and oil and gas resource exploration, engineering geology, sedimentary basin analysis and simulation, etc.

[0004] CBAM (Convolutional Block Atention Module) is an attention mechanism module used to enhance the performance of convolutional neural networks (CNNs). Its main goal is to improve the perception of the model by introducing channel attention and spatial attention in CNNs, thereby improving performance without increasing network complexity. CBAM consists of two key parts: the channel attention module (C-channel) and the spatial attention module (S-channel), which can be embedded in different layers of CNNs to enhance feature representation.

[0005] DenseASPP (Densely connected Atrous Spatial Pyramid Pooling) is a densely connected atrous spatial pyramid pooling method. DenseASPP is a further development of AtrousSpatial Pyramid Pooling (ASPP). It connects a set of dilated convolutional layers (atrous convolutional layers) in a densely connected manner, so as to generate features covering a wider range of scales with higher density without significantly increasing the size of the model. Its core is a densely connected dilated convolutional layer. There are generally 5 dilated convolutional layers, and the dilation rate increases from front to back. This designed network can capture information from multiple different scales, effectively enhancing the model's adaptability to changes in object scale. Compared with traditional ASPP, DenseASPP improves the diversity and richness of features while maintaining similar size, further improving the accuracy of semantic segmentation.

[0006] Coordinate Attention (CA) module: CA encodes channel relationships and long-range dependencies through precise location information, allowing the network to focus on large important areas at a low computational cost. Its processing principle is as follows: (1) Globally pool the input feature map in both width (horizontal) and height (vertical) directions to obtain feature maps in the horizontal direction. And the feature map in the vertical direction ; (2) , Perform concat on the spatial dimension, use 1x1 convolution (Conv1×1) to compress the number of channels, and then use batch normalization (BN) and activation function (ReLU) operations to encode the spatial information in the horizontal and vertical directions to obtain the intermediate feature vector f; (3) Perform a split operation on f along the spatial dimension and redistribute it into a tensor in the horizontal direction and the tensor in the vertical direction ,right and , respectively, readjust the number of channels to be equal through 1×1 convolution, and then process them through Sigmoid function to obtain the corresponding horizontal output And the vertical output , , They can be regarded as the attention weights in the horizontal and vertical directions respectively; (4) applying the attention weights to the input feature map means that coordinate attention is performed on the input feature map. In the coordinate attention module, the purpose of steps (1), (2), and (3) is to obtain the horizontal and vertical attention weights from the input feature map, so they are defined as weight generation units; the purpose of step (4) is to perform feature fusion, so it is defined as a feature fusion layer.

[0007] The encoder-decoder is the most important structure in the field of semantic segmentation. Its core idea is to compress first and then decompress. Some excellent networks (such as U-Net, SegNet, etc.) are obtained by more detailed design and improvement based on the encoder-decoder structure. The encoder-decoder structure includes an encoder path, a decoder path, and a skip connection path. The encoder path is also called a contraction network. Through several consecutive downsampling operations, the image size is reduced, the number of channels is doubled, and one maximum pooling operation is performed. The decoder path is also called an expansion network. Through several consecutive upsampling operations, the image size is increased and the number of channels is halved. Skip connection path: A skip connection path is set up between each layer of the encoder and the encoder to connect the two, helping the model to splice image features of the same layer and the same size. Finally, the network will perform a 1×1 convolution and output the final segmented image. In this architecture, the encoder is responsible for feature extraction, and the decoder restores the original resolution. Summary of the invention

[0008] The purpose of the present invention is to provide a semantic segmentation method for cast thin slices based on dense multi-scale and spatial information guidance to solve the above-mentioned problems that the segmentation cannot be effectively performed due to large color differences, scattered pore distribution, irregular pore shapes, and strong dependence on the experimental environment.

[0009] In order to achieve the above object, the technical solution adopted by the present invention is as follows: a semantic segmentation method of cast thin slices based on dense multi-scale and spatial information guidance, comprising the following steps;

[0010] S1, create a semantic segmentation dataset;

[0011] Obtain casting thin-section images, pre-process each casting thin-section image, and mark pores as targets to obtain samples. All samples constitute a semantic segmentation dataset;

[0012] S2, construct a dilated convolution branch module;

[0013] The atrous convolution branch module is used to obtain a first feature by subjecting its input feature to atrous convolution, batch normalization and activation function processing, obtain a second feature by subjecting the first feature to convolution, batch normalization and activation function processing, and then obtain a point feature by performing residual connection on the first feature and the second feature, and then obtain an output feature of the atrous convolution branch module by the CBAM attention mechanism;

[0014] S3, constructing a DMFEM module for dense multi-scale feature extraction;

[0015] Select 5 dilated convolution branch modules and mark them as ~ , ~ The void ratios are 1, 2, 3, 4, and 5 respectively;

[0016] Select a DenseASPP network, which includes 5 densely connected dilated convolutional layers. ~ Replace the five dilated convolutional layers from front to back, and connect a 1×1 convolutional layer to the output of the DenseASPP network to obtain the DMFEM module;

[0017] S4, constructs a SIFFM module for feature fusion guided by spatial information;

[0018] It includes a weight generation unit based on a coordinate attention module, a shallow feature extraction module, a first feature fusion layer, and a second feature fusion layer;

[0019] The weight generation unit is used to input deep features of size H×W×C , output horizontal attention weight and vertical attention weight , H, W, and C are deep features respectively The height, width and number of channels;

[0020] The shallow feature extraction module is used for inputting Shallow features , after 3×3 convolution, batch normalization and activation function processing, the shallow feature output is obtained , for The number of channels, ;

[0021] The first feature fusion layer is used to , get the first fusion feature SI;

[0022] The second feature fusion layer is used according to the formula , get the output of the SIFFM module ;

[0023] S5, use the DMFEM module in the encoder for feature extraction, use the SIFFM module in the decoder for feature fusion, and construct a semantic segmentation network of the encoder-decoder framework;

[0024] S6, inputting the semantic segmentation data set into the semantic segmentation network, taking the samples as input and the sample annotations as the expected output to train the semantic segmentation network until convergence or satisfying the preset conditions, and obtaining the semantic segmentation model of the casting thin slice;

[0025] S7, obtaining a casting thin slice image to be identified, inputting a casting thin slice semantic segmentation model, and outputting a semantic segmentation result.

[0026] Preferably, the atrous convolution branch module includes a atrous convolution module, a second convolution module, a residual connection layer and a CBAM attention layer;

[0027] The dilated convolution module includes a dilated convolution layer, a BN layer and a ReLU layer connected in sequence, wherein the dilated convolution layer is used to perform a dilated convolution with a convolution kernel of 3×3 and a dilation rate of n on the input features of the dilated convolution branch module, and the BN layer and the ReLU layer perform batch normalization and activation function processing respectively;

[0028] The second convolution module includes a convolution layer, a BN layer, and a ReLU layer connected in sequence, which respectively perform 3×3 convolution, batch normalization, and activation function processing;

[0029] The residual connection layer is used to perform residual connection on the first feature and the second feature to obtain a third feature;

[0030] The CBAM attention layer is used to perform channel attention and spatial attention on the third feature to obtain the output feature of the hole convolution branch module.

[0031] As a preference: the weight generating unit inputs , output horizontal attention weight and vertical attention weight The methods include S41~S43;

[0032] S41, will The horizontal global average pooling layer and the vertical global average pooling layer perform global average pooling in the horizontal and vertical directions respectively to obtain the feature map in the horizontal direction. And the feature map in the vertical direction ;

[0033] S42, use the Concat layer , The intermediate feature vector f is obtained by concatenating in the spatial dimension and then passing through a 1×1 convolutional layer, a BN layer, and a ReLU layer;

[0034] S43, split the intermediate feature vector f into horizontal tensors along the spatial dimension through the segmentation layer and the tensor in the vertical direction ,Will and , and the horizontal attention weights are output through the 1×1 convolution layer and the Sigmoid function layer respectively. and vertical attention weight .

[0035] Preferably: S5 is specifically, the semantic segmentation network includes an encoder and a decoder;

[0036] The encoder includes five downsampling units, respectively marked as ~ ,Each downsampling unit includes a DMFEM module and a pooling layer connected in sequence;

[0037] The decoder includes four ~ An upsampling unit and a classifier, each upsampling unit includes an upsampling layer and a SIFFM module connected in sequence;

[0038] ~ Connect in sequence, The DMFEM module is used to input samples, The pooling layer The upsampling layer, ~ Connect in sequence, The SIFFM module is connected to the classifier, and The pooling layer and The DMFEM modules are skipped and connected, k is a variable, 1≤k≤4.

[0039] Preferably, in S1, the image preprocessing is to convert the casting thin slice image from RGB color space to HSV color space, and then perform noise reduction, and the noise reduction is a Fourier transform denoising method.

[0040] Compared with the prior art, the advantages of the present invention are:

[0041] (1) The present invention constructs a dilated convolution branch in the encoding stage, and adopts dilated convolution and channel-space attention mechanism to solve the problem of large pore scale variation. Then, a DMFEM module for dense multi-scale feature extraction is constructed by densely cascading multiple branches with different dilation rates, which improves the model's ability to obtain contextual information and extract features, alleviates the problem of sparse sampling of dilated convolution, and improves the prediction accuracy of the model.

[0042] (2) The SIFFM module for spatial information-guided feature fusion is introduced to enhance spatial detail information and solve the problem of information fusion noise in the decoding stage. The attention mechanism is introduced in the SIFFM module to solve the problem of difficult identification due to complex background and blurred pore edges of cast thin sections.

[0043] In summary, the present invention can effectively overcome the defects of unsatisfactory target segmentation caused by large color differences in cast thin slice images, variable pore scales, blurred edges, etc., can better fit the characteristics of cast thin slices, and realize accurate detection and identification of pores. The model design of the present invention increases the interpretability. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 Schematic diagram of the structure of the hollow convolution branch module in the present invention;

[0045] Figure 2 It is a structural schematic diagram of the DMFEM module in the present invention;

[0046] Figure 3 It is a structural schematic diagram of the SIFFM module in the present invention;

[0047] Figure 4 Schematic diagram of the structure of the semantic segmentation network in the present invention;

[0048] Figure 5 This is a comparison of the results of pore identification using different methods on a casting thin section image.

[0049] Figure 6 The comparison diagram of pore identification results of casting thin section image 2 by different methods;

[0050] Figure 7 The comparison diagram of pore identification results of casting thin section image 3 by different methods;

[0051] Figure 8 This is a comparison chart of the pore identification results of casting thin section image 4 using different methods. DETAILED DESCRIPTION

[0052] The present invention will be further described below in conjunction with the accompanying drawings.

[0053] Example 1: See Figures 1 to 4 ,A semantic segmentation method for cast thin slices based on dense multi-scale and spatial information guidance, comprises the following steps;

[0054] S1, create a semantic segmentation dataset;

[0055] Obtain casting thin-section images, pre-process each casting thin-section image, and mark pores as targets to obtain samples. All samples constitute a semantic segmentation dataset;

[0056] S2, construct a dilated convolution branch module;

[0057] The atrous convolution branch module is used to obtain a first feature by subjecting its input feature to atrous convolution, batch normalization and activation function processing, obtain a second feature by subjecting the first feature to convolution, batch normalization and activation function processing, and then obtain a point feature by performing residual connection on the first feature and the second feature, and then obtain an output feature of the atrous convolution branch module by the CBAM attention mechanism;

[0058] S3, constructing a DMFEM module for dense multi-scale feature extraction;

[0059] Select 5 dilated convolution branch modules and mark them as ~ , ~ The void ratios are 1, 2, 3, 4, and 5 respectively;

[0060] Select a DenseASPP network, which includes 5 densely connected dilated convolutional layers. ~ Replace the five dilated convolutional layers from front to back, and connect a 1×1 convolutional layer to the output of the DenseASPP network to obtain the DMFEM module;

[0061] S4, constructs a SIFFM module for feature fusion guided by spatial information;

[0062] It includes a weight generation unit based on a coordinate attention module, a shallow feature extraction module, a first feature fusion layer, and a second feature fusion layer;

[0063] The weight generation unit is used to input deep features of size H×W×C , output horizontal attention weight and vertical attention weight , H, W, and C are deep features respectively The height, width and number of channels;

[0064] The shallow feature extraction module is used for inputting Shallow features , after 3×3 convolution, batch normalization and activation function processing, the shallow feature output is obtained , for The number of channels, ;

[0065] The first feature fusion layer is used to , get the first fusion feature SI;

[0066] The second feature fusion layer is used according to the formula , get the output of the SIFFM module ;

[0067] S5, use the DMFEM module in the encoder for feature extraction, use the SIFFM module in the decoder for feature fusion, and construct a semantic segmentation network of the encoder-decoder framework;

[0068] S6, inputting the semantic segmentation data set into the semantic segmentation network, taking the samples as input and the sample annotations as the expected output to train the semantic segmentation network until convergence or satisfying the preset conditions, and obtaining the semantic segmentation model of the casting thin slice;

[0069] S7, obtaining a casting thin slice image to be identified, inputting a casting thin slice semantic segmentation model, and outputting a semantic segmentation result.

[0070] See also Figure 1 , the hole convolution branch module includes a hole convolution module, a second convolution module, a residual connection layer and a CBAM attention layer;

[0071] The dilated convolution module includes a dilated convolution layer, a BN layer and a ReLU layer connected in sequence, wherein the dilated convolution layer is used to perform a dilated convolution with a convolution kernel of 3×3 and a dilation rate of n on the input features of the dilated convolution branch module, and the BN layer and the ReLU layer perform batch normalization and activation function processing respectively;

[0072] The second convolution module includes a convolution layer, a BN layer, and a ReLU layer connected in sequence, which respectively perform 3×3 convolution, batch normalization, and activation function processing;

[0073] The residual connection layer is used to perform residual connection on the first feature and the second feature to obtain a third feature;

[0074] The CBAM attention layer is used to perform channel attention and spatial attention on the third feature to obtain the output feature of the hole convolution branch module.

[0075] See also Figure 2 ,DMFEM module includes 5 dilated convolution branch modules, Figure 2In the above, concatenation refers to the cascade mode of the existing DenseASPP network itself.

[0076] See also Figure 3 , the weight generation unit input , output horizontal attention weight and vertical attention weight The methods include S41~S43;

[0077] S41, will The horizontal global average pooling layer and the vertical global average pooling layer perform global average pooling in the horizontal and vertical directions respectively to obtain the feature map in the horizontal direction. And the feature map in the vertical direction ;

[0078] S42, use the Concat layer , The intermediate feature vector f is obtained by splicing in the spatial dimension, and then passing through the 1×1 convolution layer, the BN layer, and the ReLU layer. In this process, the 1×1 convolution layer will adjust the number of channels of the feature, and the number of channels of the intermediate feature vector f is finally reduced by r times to C / r;

[0079] S43, split the intermediate feature vector f into horizontal tensors along the spatial dimension through the segmentation layer and the tensor in the vertical direction ,Will and , and the horizontal attention weights are output through the 1×1 convolution layer and the Sigmoid function layer respectively. and vertical attention weight Here the 1×1 convolutional layer is used to restore the number of channels.

[0080] See also Figure 4 , step S5 specifically includes: the semantic segmentation network includes an encoder and a decoder;

[0081] The encoder includes five downsampling units, respectively marked as ~ ,Each downsampling unit includes a DMFEM module and a pooling layer connected in sequence;

[0082] The decoder includes four ~ An upsampling unit and a classifier, each upsampling unit includes an upsampling layer and a SIFFM module connected in sequence;

[0083] ~ Connect in sequence, The DMFEM module is used to input samples, The pooling layer The upsampling layer, ~ Connect in sequence, The SIFFM module is connected to the classifier, and The pooling layer and The DMFEM modules are skipped and connected, k is a variable, 1≤k≤4.

[0084] In step S1, the image preprocessing is to convert the casting thin slice image from the RGB color space to the HSV color space, and then perform noise reduction processing, and the noise reduction processing is a Fourier transform denoising method.

[0085] About image preprocessing: Due to the influence of grinding, instrument jitter and other factors in the thin slice image preparation process, the collected thin slice image inevitably contains noise. These noises will cause the grayscale values ​​of some pixels in the image histogram to change, resulting in an unbalanced grayscale distribution, thereby interfering with the selection of the threshold value for the maximum inter-class variance. Fourier denoising is an image denoising method based on the frequency domain. Since noise often exists in high-frequency bands, the basic idea is to convert the image to a spectrum, remove the high-frequency information in the spectrum through a filter, and then convert the image back to the spatial domain to realize the Fourier denoising function of the image. Therefore, in the image preprocessing process, the present invention first performs color space conversion and then uses the Fourier transform method for denoising.

[0086] Example 2: See Figures 1 to 8 On the basis of Example 1, in order to make a more comprehensive evaluation of the network, the network is compared with the existing semantic segmentation method model, and the methods involved in the comparison include: UNet, PSPNet, DeepLabV3+, HRNet and SegForm models. The quantitative experimental results of the network models involved in the comparison on the semantic segmentation data set consisting of cast thin slices are shown in Table 1 below:

[0087] Table 1 Model comparison experiment

[0088] Experimental model Pixel accuracy (%) Average pixel accuracy (%) Average intersection ratio (%) Frequency weighted crossover ratio (%) PSPNet 97.02 83.30 76.41 94.47 HrNet 97.96 87.93 82.58 96.11 SegForm 97.49 85.66 79.49 95.84 UNet 97.89 87.55 82.01 89.58 DeepLab v3+ 97.12 82.91 76.77 94.61 The present invention 98.37 91.14 85.94 96.88

[0089] As can be seen from Table 1, the proposed semantic segmentation method has achieved the best recognition accuracy in all evaluation indicators. Its pixel accuracy, average pixel accuracy, average intersection-over-union ratio and frequency-weighted intersection-over-union ratio are 98.37%, 91.14%, 85.94% and 96.88% respectively. Compared with PSPNet, the present invention has improved by 1.35, 7.84, 9.53 and 2.41 percentage points respectively; compared with HRNet, it has improved by 0.41, 3.21, 3.36 and 0.77 percentage points respectively; compared with SegForm, it has improved by 0.88, 5.48, 6.45 and 1.04 percentage points respectively; compared with DeepLabv3+, it has improved by 1.25, 8.23, 9.17 and 2.27 percentage points respectively; compared with the benchmark network UNet, it has improved by 0.48, 3.59, 3.93 and 7.3 percentage points respectively. It shows that the designed semantic segmentation network can better fit the characteristics of cast thin slices compared with other networks, and is a better solution to the problems of variable pore scales and blurred pore edges.

[0090] In addition, in order to see the recognition results of each segmentation model more intuitively, we conduct a visualization experiment. Figure 5-8 The comparison charts of pore identification results of four different cast iron slice images using several different experimental models are listed. In the charts, the black background is shown.

[0091] From the overall segmentation effect, the present invention can accurately capture both large and small pores and has accurate pore edge depiction, and its recognition result is most consistent with the real label; additive fusion models such as DeepLab v3+ and PSPNet have rough edges in pore segmentation. HrNet shows similar performance to the present invention in some scenarios due to its multi-resolution interaction and strong position information; UNet and SegForm can obtain better pore edge features, but there are more missed detections and false detections.

[0092] In the comparison of segmentation effects in some specific details, such as Figure 5 In the simple scenario shown, all networks can effectively identify the pore area, but only the present invention completes the detection of fine rocks in the pores. This shows that the model ensures the removal of fine rocks while ensuring the detection accuracy of large pores, and is more suitable for scenarios with variable pore sizes.

[0093] exist Figure 6 Among them, only SegForm and the present invention obtain the black non-porous area shown in the positioning box in the true label, which is closer to the result of the true label, while other models rarely identify black holes and produce more over-segmentation.

[0094] exist Figure 7In the rightmost positioning box of the third cast thin section image, the fusion of rock and pores poses a great challenge to segmentation. Only HrNet, Unet and DMFENet obtain clearer pore edges, while the segmentation of other models is too rough.

[0095] exist Figure 8 The pore structure showed a long strip shape which was rare in the data set, and there was a common problem in pores that the pore color characteristics became lighter with the storage time. Under such a complex situation, the quality of the visualization recognition results of the other five comparison methods dropped sharply, and irregularly shaped pore targets were missed. Only the present invention completed the line segmentation shown in the positioning box in the real label.

[0096] The above quantitative experiments and visualization experiments show that the present invention can better fit the characteristics of cast thin slices compared with other network segmentation methods, and is a better solution to the problems of variable pore scales and blurred edges.

[0097] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A semantic segmentation method for cast thin slices based on dense multi-scale and spatial information guidance, characterized by: The steps include: S1, create a semantic segmentation dataset; Obtain casting thin-section images, pre-process each casting thin-section image, and mark pores as targets to obtain samples. All samples constitute a semantic segmentation dataset; S2, construct a dilated convolution branch module; The atrous convolution branch module is used to obtain a first feature by subjecting its input feature to atrous convolution, batch normalization and activation function processing, obtain a second feature by subjecting the first feature to convolution, batch normalization and activation function processing, and then obtain a point feature by performing residual connection on the first feature and the second feature, and then obtain an output feature of the atrous convolution branch module by the CBAM attention mechanism; S3, constructing a DMFEM module for dense multi-scale feature extraction; Select 5 hole convolution branch modules and mark them as ~ , ~ The void ratios are 1, 2, 3, 4, and 5 respectively; Select a DenseASPP network, which includes 5 densely connected dilated convolutional layers. ~ Replace the five dilated convolutional layers from front to back, and connect a 1×1 convolutional layer to the output of the DenseASPP network to obtain the DMFEM module; S4, constructs a SIFFM module for feature fusion guided by spatial information; It includes a weight generation unit based on a coordinate attention module, a shallow feature extraction module, a first feature fusion layer, and a second feature fusion layer; The weight generation unit is used to input deep features of size H×W×C , output horizontal attention weight and vertical attention weight , H, W, and C are deep features respectively The height, width and number of channels; The shallow feature extraction module is used for inputting Shallow features , after 3×3 convolution, batch normalization and activation function processing, the shallow feature output is obtained , for The number of channels, ; The first feature fusion layer is used to , get the first fusion feature SI; The second feature fusion layer is used according to the formula , get the output of the SIFFM module ; S5, use the DMFEM module in the encoder for feature extraction, use the SIFFM module in the decoder for feature fusion, and construct a semantic segmentation network of the encoder-decoder framework; S6, inputting the semantic segmentation data set into the semantic segmentation network, taking the samples as input and the sample annotations as the expected output to train the semantic segmentation network until convergence or satisfying the preset conditions, and obtaining the semantic segmentation model of the casting thin slice; S7, obtaining a casting thin slice image to be identified, inputting a casting thin slice semantic segmentation model, and outputting a semantic segmentation result.

2. The method for semantic segmentation of cast thin slices based on dense multi-scale and spatial information guidance according to claim 1, characterized in that: The hole convolution branch module includes a hole convolution module, a second convolution module, a residual connection layer and a CBAM attention layer; The dilated convolution module includes a dilated convolution layer, a BN layer and a ReLU layer connected in sequence, wherein the dilated convolution layer is used to perform a dilated convolution with a convolution kernel of 3×3 and a dilation rate of n on the input features of the dilated convolution branch module, and the BN layer and the ReLU layer perform batch normalization and activation function processing respectively; The second convolution module includes a convolution layer, a BN layer, and a ReLU layer connected in sequence, which respectively perform 3×3 convolution, batch normalization, and activation function processing; The residual connection layer is used to perform residual connection on the first feature and the second feature to obtain a third feature; The CBAM attention layer is used to perform channel attention and spatial attention on the third feature to obtain the output feature of the hole convolution branch module.

3. The method for semantic segmentation of cast thin slices based on dense multi-scale and spatial information guidance according to claim 1, characterized in that: The weight generation unit inputs , output horizontal attention weight and vertical attention weight The method includes S41~S43; S41, will The horizontal global average pooling layer and the vertical global average pooling layer perform global average pooling in the horizontal and vertical directions respectively to obtain the feature map in the horizontal direction. And the feature map in the vertical direction ; S42, use the Concat layer , The intermediate feature vector f is obtained by concatenating in the spatial dimension and then passing through a 1×1 convolutional layer, a BN layer, and a ReLU layer; S43, split the intermediate feature vector f into horizontal tensors along the spatial dimension through the segmentation layer and the tensor in the vertical direction ,Will and , and the horizontal attention weights are output through the 1×1 convolution layer and the Sigmoid function layer respectively. and vertical attention weight .

4. The method for semantic segmentation of cast thin slices based on dense multi-scale and spatial information guidance according to claim 1, characterized in that: S5 specifically includes: the semantic segmentation network includes an encoder and a decoder; The encoder includes five downsampling units, respectively marked as ~ ,Each downsampling unit includes a DMFEM module and a pooling layer connected in sequence; The decoder includes four ~ An upsampling unit and a classifier, each upsampling unit includes an upsampling layer and a SIFFM module connected in sequence; ~ Connect in sequence, The DMFEM module is used to input samples, The pooling layer The upsampling layer, ~ Connect in sequence, The SIFFM module is connected to the classifier, and The pooling layer and The DMFEM modules are skipped and connected, k is a variable, 1≤k≤4.

5. The method for semantic segmentation of cast thin slices based on dense multi-scale and spatial information guidance according to claim 1, characterized in that: In S1, the image preprocessing is to convert the casting thin slice image from the RGB color space to the HSV color space, and then perform noise reduction processing, and the noise reduction processing is a Fourier transform denoising method.

Citation Information

Patent Citations

  • Image classification method and device based on deep learning network

    CN117095225A

  • Method for glass detection in real scenes

    US20220148292A1