A material microstructure segmentation method based on boundary superpixel interaction

CN122929568APending Publication Date: 2026-10-16ZHEJIANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611424686.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-15
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

而材料图像标注通常需要具备专业背景的人员逐像素完成,成本较高,导致可用于训练的标注数据规模受限

Benefits of technology

本发明提供了一种基于边界超像素交互的材料微观结构分割方法,构建了适用于材料扫描电子显微镜图像的材料微观结构分割模型;采用材料扫描电子显微镜图像进行自监督预训练;根据初始分割结果提取预测边界,并结合SLIC超像素划分确定边界超像素,将交互修正限定在少量标注数据训练时容易发生类别混淆的边界超像素区域;通过构建候选类别集合和类别代表特征,使边界超像素内像素特征与候选类别代表特征进行交互,并以残差方式修正初始预测分数,在保留基础分割结果的基础上完成边界超像素区域的补充修正;最终实现少量标注数据下材料微观结构的识别分割,为材料微观结构的表征和分析提供方法支撑,具备良好的应用前景。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122929568A_ABST
    Figure CN122929568A_ABST
Patent Text Reader

Abstract

The application discloses a material microstructure segmentation method based on boundary superpixel interaction, comprising the following steps: collecting scanning electron microscope images of an alloy material, labeling target microstructures in part of the images and performing image preprocessing; performing self-supervised pre-training based on a DINOv3 image encoder; constructing a material microstructure segmentation model and training the model on a labeled data set; extracting a predicted boundary according to an initial segmentation result and determining a boundary superpixel in combination with simple linear iterative clustering superpixels; making pixel features in the boundary superpixel interact with class representative features, and correcting a prediction result in a residual error manner; and using the trained model to recognize and segment a scanning electron microscope image to be analyzed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of computer vision and material microscopic image analysis technology, specifically a material microstructure segmentation method based on boundary superpixel interaction. Background Technology

[0002] The microstructure of materials is a crucial mesoscale information linking material preparation, microstructure, and macroscopic properties, reflecting the structural characteristics of grains, precipitates, interfaces, and defects in alloy materials. Scanning electron microscopy (SEM) can obtain high-resolution morphological images of material surfaces and is a commonly used characterization technique for observing and quantitatively analyzing the microstructure of alloy materials. Segmenting the target microstructure in SEM images is fundamental for subsequent size statistics, morphological analysis, and studies on the correlation between microstructure and properties.

[0003] Unlike natural image segmentation tasks, images of material microstructures are typically presented as grayscale images, with limited grayscale differences between the target and the background. Boundaries are easily affected by sample preparation, corrosion quality, imaging parameters, and noise. Target microstructures in alloy materials may also exhibit large scale differences, irregular shapes, curved boundaries, local adhesion, and uneven class areas, making segmentation models prone to missegmentation at target edges, boundaries between adjacent tissues, and small-sized structures. For these images, relying solely on overall semantic features often fails to reliably handle local confusion near boundaries.

[0004] Traditional methods for segmenting the microstructure of materials mainly rely on rules such as thresholding, edge detection, region growing, watersheds, or clustering. These methods typically require manual parameter setting based on the specific image. When the type of alloy material, magnification, imaging brightness, or microstructure changes, the segmentation results tend to fluctuate, making it difficult to maintain consistency across images of various alloy materials. With the development of deep learning in image segmentation, segmentation methods based on convolutional neural networks and visual Transformers have been gradually applied to the analysis of material microscopic images. These methods can learn the texture, morphology, and semantic features of material images through labeled data and leverage the feature representation capabilities of pre-trained models to complete downstream segmentation tasks, providing a new technical approach for the automatic recognition and segmentation of material microstructure images.

[0005] However, existing deep learning segmentation models mostly use pre-trained weights from natural images as their initialization basis. Natural images and scanning electron microscope (SEM) images of materials differ significantly in imaging methods, texture distribution, target morphology, and boundary representation. Direct transfer often requires a large number of labeled material microstructure images to obtain stable results. However, material image annotation typically requires specialized personnel to complete pixel-by-pixel annotation, which is costly and limits the scale of labeled data available for training. When labeled data is limited, the model struggles to fully learn the texture features, category differences, and boundary relationships in material microstructure images, easily leading to problems such as edge breakage, unclear delineation of adhered regions, and small target boundary shifts, thus affecting the accuracy of the segmentation results. Therefore, establishing a material microstructure segmentation method based on boundary superpixel interaction is of great significance to the field of material microstructure image segmentation. Summary of the Invention

[0006] The purpose of this invention is to provide a material microstructure segmentation method based on boundary superpixel interaction to solve the problems mentioned in the background art.

[0007] To achieve the above objectives, the present invention provides the following technical solution: A material microstructure segmentation method based on boundary superpixel interaction includes the following steps: S1. Acquire scanning electron microscope images of alloy materials, annotate the target microstructures in some scanning electron microscope images, construct a dataset and perform image preprocessing; S2. Based on the DINOv3 image encoder, a masked autoencoder is pre-trained using unlabeled scanning electron microscope images to obtain image encoder weights that are adapted to the microstructure images of materials. S3. Construct a material microstructure segmentation model that includes a DINOv3 image encoder, a ViT Adapter, and a UPerNet segmentation head, and train it on the constructed dataset to obtain the basic segmentation model; S4. Obtain the initial segmentation result of the scanning electron microscope image from the basic segmentation model, extract the predicted boundary based on the initial segmentation result, and perform simple linear iterative clustering superpixel division on the original image, and determine the superpixels that intersect with the predicted boundary as boundary superpixels. S5. Select boundary superpixels, construct candidate category sets and category representative features, enable pixel features within the boundary superpixels to interact with candidate category representative features, and correct the initial prediction score using residuals. S6. The trained material microstructure segmentation model is used to identify and segment the scanning electron microscope image to be analyzed, and the segmentation mask of the target microstructure is output.

[0008] Furthermore, S1 specifically includes: S1.1 Acquire scanning electron microscope images of the alloy material; S1.2. Label the target microstructure in some scanning electron microscope images and convert the labeling results into pixel-level mask images; S1.3 Divide the data with pixel-level masked images into training set, validation set and test set; S1.4 Perform grayscale normalization, contrast adjustment, histogram equalization, and edge sharpening on the scanning electron microscope images.

[0009] Furthermore, S2 specifically includes: S2.1. Use unlabeled scanning electron microscope images as a self-supervised pre-training dataset, and divide the self-supervised pre-training dataset into a pre-training training set and a pre-training validation set; S2.2 Construct a self-supervised pre-training model based on the DINOv3 image encoder, and perform self-supervised pre-training of the mask autoencoder on the pre-training training set; S2.3. Validate the self-supervised pre-trained model using the pre-trained validation set, and select the image encoder weights based on the validation results; S2.4 Save the selected image encoder weights.

[0010] Furthermore, in S3, the material microstructure segmentation model is trained on the dataset constructed in S1, specifically including: S3.1 Model initialization: The DINOv3 image encoder is initialized using the image encoder weights obtained in S2, and a material microstructure segmentation model including the DINOv3 image encoder, ViT Adapter, and UPerNet segmentation head is constructed. S3.2 Feature extraction: Input the scanning electron microscope images from the training set into the DINOv3 image encoder to extract image features; S3.3 Feature adaptation: The image features are converted into multi-scale features using the ViT Adapter. S3.4 Segmentation prediction: The multi-scale features are fused through the UPerNet segmentation head to output a pixel-level category prediction score; S3.5 Parameter update: Calculate the segmentation loss based on the pixel-level category prediction score and the corresponding pixel-level mask image in the training set, and perform backpropagation and parameter update on the material microstructure segmentation model; S3.6 Model Validation: The segmentation results of the material microstructure segmentation model are validated using a validation set. The model weights corresponding to the segmentation results of the validation set are saved to obtain the basic segmentation model.

[0011] Furthermore, the segmentation loss in S3.5 includes cross-entropy loss and Dice loss. During the training process, S3.2 to S3.5 are repeated using the training set data until the material microstructure segmentation model reaches the preset training rounds or the segmentation results of the validation set no longer improve.

[0012] Furthermore, S4 specifically includes: S4.1 Input the scanning electron microscope image into the basic segmentation model to obtain the initial segmentation result; S4.2 Compare the predicted categories of adjacent pixels in the initial segmentation results. When the predicted categories of adjacent pixels are different, the corresponding position is determined as the prediction boundary. S4.3. Perform simple linear iterative clustering superpixel division on the original image to obtain multiple local continuous regions; S4.4. Define the local continuous regions that intersect with the prediction boundary as boundary superpixels, and define the local continuous regions that do not intersect with the prediction boundary as non-boundary regions.

[0013] Furthermore, S5 specifically includes: S5.1 Construct a candidate category set based on the predicted categories that have already appeared inside the boundary superpixels; S5.2. Use the pixel features of non-boundary regions to perform a weighted average to obtain the category representative features corresponding to the candidate categories; and make the pixel features within the boundary superpixels interact with the category representative features corresponding to the candidate category set to obtain the category context features; S5.3. Concatenate the pixel features within the boundary superpixel with the category context features and input them into the lightweight correction module to generate the boundary correction amount; add the boundary correction amount to the residual of the initial prediction score to obtain the corrected prediction score.

[0014] Further, in S5.2, the pixel features are derived from the intermediate feature map output by the UPerNet segmentation head, and the category representation features are obtained by weighted averaging of pixel features belonging to the corresponding predicted category in non-boundary regions, specifically satisfying: , Among them, F k Ω represents the category representative feature of category k. n Let F(x) represent the set of pixel locations in the non-boundary region, x represent the pixel location, and F(x) represent the pixel feature at pixel location x. k (x) represents the predicted score for pixel location x belonging to category k. It is a constant; The pixel features within the boundary superpixel are mapped to query features, and the category representative features corresponding to the candidate category set are mapped to key features and value features. The candidate category weights are calculated based on the similarity between the query features and the key features, and the category context features are obtained based on the candidate category weights and value features.

[0015] Further, in S5.3, the lightweight correction module consists of convolutional layers or linear layers; the pixel features within the boundary superpixel are concatenated with the category context features and then input into the lightweight correction module, which outputs the boundary correction amount Δ; the corrected prediction score P final satisfy: , Among them, P initial λ represents the initial predicted score, and λ represents the corrected intensity coefficient.

[0016] Furthermore, S6 specifically includes: S6.1 Input the scanning electron microscope image of the alloy material to be analyzed; S6.2 Load the trained material microstructure segmentation model; S6.3. The material microstructure segmentation model is used to identify and segment the SEM image to be analyzed. S6.4. Output the segmentation mask of the target's microstructure after inference.

[0017] Compared with the prior art, the beneficial effects of the present invention are: This invention provides a material microstructure segmentation method based on boundary superpixel interaction. A material microstructure segmentation model suitable for scanning electron microscope (SEM) images is constructed. Self-supervised pre-training is performed using SEM images. Predicted boundaries are extracted based on the initial segmentation results, and boundary superpixels are determined by combining SLIC superpixel partitioning. Interaction correction is limited to boundary superpixel regions prone to class confusion during training with limited labeled data. By constructing a candidate class set and class representative features, pixel features within the boundary superpixels interact with candidate class representative features, and the initial prediction score is corrected using residuals. Supplementary correction of the boundary superpixel regions is completed while preserving the basic segmentation results. Ultimately, the method achieves the identification and segmentation of material microstructures with limited labeled data, providing methodological support for the characterization and analysis of material microstructures and demonstrating promising application prospects. Attached Figure Description

[0018] Figure 1 This is a flowchart of the method of the present invention; Figure 2 This is a schematic diagram of the material's microstructure segmentation model. Figure 3 A schematic diagram illustrating the selection of predicted boundaries and boundary superpixels; Figure 4 This is a schematic diagram of boundary superpixel interaction and residual correction. Figure 5 This is a schematic diagram of the segmentation results. Detailed Implementation

[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] The purpose of this invention is to provide a material microstructure segmentation method based on boundary superpixel interaction. The method uses the DINOv3 model to extract features from scanning electron microscope images of materials; determines boundary superpixels based on predicted boundaries and SLIC superpixels; constructs a candidate category set and category representative features, enabling pixel features within the boundary superpixels to interact with each other, and corrects the initial prediction score using a residual method, thereby achieving the identification and segmentation of material microstructures under conditions of limited labeled data.

[0021] like Figure 1 As shown, a material microstructure segmentation method based on boundary superpixel interaction includes the following steps: S1. Acquire scanning electron microscope (SEM) images of alloy materials, annotate the target microstructures in some SEM images, construct a dataset, and perform image preprocessing.

[0022] This step specifically includes: S1.1 Acquire scanning electron microscope images of various alloy materials; S1.2. Using LabelMe, pixel-level annotations are performed on the target microstructures in some scanning electron microscope images. The annotation results are then converted into pixel-level mask images corresponding to the original image size. The pixel-level mask images are then converted into category label images required for model training, and a correspondence is established between the category labels and the target microstructure categories, ensuring that the pixel-level category labels remain consistent with the predicted categories during subsequent model training.

[0023] Labelme is an open-source image annotation tool primarily used for pixel-level or region-level semantic annotation of images in computer vision tasks.

[0024] S1.3 Divide the data with pixel-level masked images into training set, validation set and test set according to a ratio of 1:1:5; S1.4. Crop the scanning electron microscope image and its corresponding pixel-level mask image to a size of 512×512 pixels; perform grayscale normalization, contrast adjustment, histogram equalization and edge sharpening on the scanning electron microscope image to obtain the input image for model training and recognition segmentation.

[0025] S2. Based on the DINOv3 image encoder, a masked autoencoder (MAE) is pre-trained using unlabeled scanning electron microscope images to obtain image encoder weights that adapt to the microstructure images of the material.

[0026] Among them, the DINOv3 image encoder is a general vision foundation model based on self-supervised learning (SSL).

[0027] This step specifically includes: S2.1. Use unlabeled scanning electron microscope images as a self-supervised pre-training dataset, and divide the self-supervised pre-training dataset into a pre-training training set and a pre-training validation set in a 5:1 ratio; S2.2. Construct a self-supervised pre-training model based on the DINOv3 image encoder, and perform self-supervised pre-training of the mask autoencoder on the pre-training training set.

[0028] After adjusting the unlabeled scanning electron microscope image to 224×224 pixels, it is divided into 14×14 non-overlapping image blocks arranged in two-dimensional positions. Each image block retains its two-dimensional position in the original image for subsequent encoding and reconstruction. The image blocks are randomly occluded, with an occlusion ratio of 75%. The unoccluded image blocks are input into the DINOv3 image encoder to obtain the corresponding encoded features. Since the input image comes from a material scanning electron microscope image, the encoded features can gradually incorporate grayscale texture, morphological structure, and boundary change information from the material image during self-supervised pre-training. The self-supervised pre-training loss is calculated based on the difference between the reconstructed image block and the original image block, and the self-supervised pre-training loss satisfies the following conditions:

[0029] Among them, L MAE Let M represent the self-supervised pre-training loss of the mask autoencoder, and M represent the set of occluded image patch locations. R represents the number of occluded image patches. i X represents the reconstruction result of the i-th occluded image patch. i This represents the original pixel content of the i-th occluded image patch. The DINOv3 image encoder parameters are updated according to the self-supervised pre-training loss, and the image encoder weights are saved.

[0030] S2.3. Validate the self-supervised pre-trained model using the pre-trained validation set, and select the image encoder weights based on the validation results.

[0031] S2.4 Save the selected image encoder weights.

[0032] S3. Construct a material microstructure segmentation model that includes a DINOv3 image encoder, a ViT Adapter, and a UPerNet segmentation head, and train it on the constructed dataset to obtain the basic segmentation model.

[0033] ViT-Adapter and UPerNet are two commonly used components in computer vision. They work together to achieve more powerful image semantic segmentation performance. ViT-Adapter is an adapter used to enhance the dense prediction capabilities of the base model (such as ViT); while UPerNet is a decoder (segmentation head) responsible for mapping the extracted features to the final pixel-level segmentation results.

[0034] like Figure 2 As shown, the material microstructure segmentation model includes a DINOv3 image encoder, a ViT Adapter, and a UperNet segmentation head. The material microstructure segmentation model is trained on the dataset constructed in S1, specifically including the following steps: S3.1 Model initialization: The DINOv3 image encoder is initialized using the image encoder weights obtained in S2, and constructed as follows. Figure 2 The image shown is a material microstructure segmentation model that includes a DINOv3 image encoder, a ViT Adapter, and a UPerNet segmentation head.

[0035] S3.2 Feature extraction: Input the scanning electron microscope images from the training set into the DINOv3 image encoder to extract image features.

[0036] S3.3 Feature adaptation: The image features are converted into multi-scale features using the ViT Adapter.

[0037] S3.4 Segmentation prediction: The multi-scale features are fused through the UPerNet segmentation head to output pixel-level category prediction scores.

[0038] S3.5 Parameter Update. The training rounds are set to 10 rounds. The basic segmentation loss is calculated based on the pixel-level category prediction scores and the corresponding pixel-level mask images in the training set. The AdamW optimizer is used to perform backpropagation and parameter updates on the DINOv3 image encoder, ViTAdapter adapter, and UPerNet segmentation head.

[0039] The segmentation loss includes cross-entropy loss and Dice loss. During training, the training set data is used to repeat steps S3.2 to S3.5 until the material microstructure segmentation model reaches the preset training rounds or the segmentation results on the validation set no longer improve.

[0040] S3.6 Model Validation: The segmentation results of the material microstructure segmentation model are validated using a validation set. The model weights corresponding to the segmentation results of the validation set are saved to obtain the basic segmentation model.

[0041] S4. Obtain the initial segmentation result of the scanning electron microscope image from the basic segmentation model, extract the predicted boundary based on the initial segmentation result, and perform simple linear iterative clustering (SLIC) superpixel division on the original image, and determine the superpixels that intersect with the predicted boundary as boundary superpixels.

[0042] like Figure 3 As shown, this step specifically includes: S4.1 Input the scanning electron microscope image into the basic segmentation model to obtain the initial segmentation result and the initial prediction score; S4.2. Compare the predicted categories of the top and bottom adjacent pixels and the left and right adjacent pixels in the initial segmentation result. When the predicted categories of the top and bottom adjacent pixels are different, or the predicted categories of the left and right adjacent pixels are different, the corresponding pixel position is determined as the prediction boundary, and the prediction boundary is extended by 2 pixels around the prediction boundary as the center to obtain the prediction boundary band.

[0043] S4.3. Perform simple linear iterative clustering (SLIC) superpixel partitioning on the original image to obtain multiple local continuous regions. In one implementation, the original image is first converted to a grayscale image, and the grayscale values ​​are normalized to the range of 0 to 1; then, the number of SLIC superpixels is determined based on the image area, and the number of SLIC superpixels satisfies:

[0044] Where, N sp This represents the number of SLIC superpixels, where H and W represent the height and width of the input image, respectively. `round(·)` is a rounding function used to convert the calculated number of superpixels to an integer, and `clip(·)` limits the number of superpixels to a preset range. The SLIC compactness parameter is set to 0.08, and the smoothness coefficient is set to 1.0.

[0045] Simple Linear Iterative Clustering (SLIC) is an efficient and widely used image preprocessing algorithm, mainly used to segment images into "superpixel" regions composed of spatially adjacent pixels with similar features such as color, brightness, and texture.

[0046] S4.4. Local continuous regions that intersect with the predicted boundary band are defined as boundary superpixels, and local continuous regions that do not intersect with the predicted boundary band are defined as non-boundary regions.

[0047] S5. Select boundary superpixels, construct a candidate category set and category representative features, enable the pixel features within the boundary superpixels to interact with the candidate category representative features, and correct the initial prediction score using residuals.

[0048] like Figure 4 As shown, this step specifically includes: S5.1 Construct a candidate category set based on the predicted categories that have appeared inside the boundary superpixel. For a boundary superpixel, count the predicted categories that have appeared in the initial segmentation results inside the boundary superpixel, and use the predicted categories as the candidate category set corresponding to the boundary superpixel.

[0049] S5.2. Use the pixel features of non-boundary regions to perform weighted averaging to obtain the category representative features corresponding to the candidate categories; and make the pixel features within the boundary superpixels interact with the category representative features corresponding to the candidate category set to obtain the category context features.

[0050] The pixel features are derived from the intermediate feature map output by the UPerNet segmentation head. The category representation features are obtained by weighted averaging of pixel features belonging to the corresponding predicted category in non-boundary regions, specifically satisfying the following:

[0051] Among them, F k Ω represents the category representative feature of category k. n Let F(x) represent the set of pixel locations in the non-boundary region, x represent the pixel location, and F(x) represent the pixel feature at pixel location x. k (x) represents the predicted score for pixel location x belonging to category k. It is a constant.

[0052] Pixel features within the boundary superpixel are mapped to query features, and category-representative features corresponding to the candidate category set are mapped to key and value features. For pixel position x within the boundary superpixel, its query features, key features, and value features respectively satisfy:

[0053] Where Q(x) represents the query feature corresponding to pixel position x, and K k V represents the key feature corresponding to category k. k W represents the value feature corresponding to category k. q W represents the trainable mapping parameters that map pixel features within a boundary superpixel to query features. kW represents the trainable mapping parameters that map category-representation features to key features. v This represents the trainable mapping parameters that map category-representation features to value features. The query and key features have a dimension of 128, while the value features have the same dimension as the pixel features.

[0054] Candidate category weights are calculated based on the similarity between query features and key features, and category context features are obtained based on the candidate category weights and value features, specifically satisfying the following:

[0055] Among them, a k (x) represents the candidate class weight of pixel position x with respect to class k, exp(·) is the exp function, d represents the key feature dimension, C(x) represents the candidate class set corresponding to the boundary superpixel to which pixel position x belongs, j represents the index of the candidate class participating in the summation in the candidate class set C(x), and K j Let H(x) represent the key feature corresponding to candidate category j, and H(x) represent the category context feature corresponding to pixel position x. Through this step, the pixel features within the boundary superpixel can establish a correspondence with the representative features of the candidate category.

[0056] S5.3. Concatenate the pixel features within the boundary superpixel with the category context features and input them into the lightweight correction module to generate the boundary correction amount; add the boundary correction amount to the residual of the initial prediction score to obtain the corrected prediction score.

[0057] The pixel features F(x) within the boundary superpixel are concatenated with the category context features H(x), and then input into a lightweight correction module to generate the boundary correction value. The lightweight correction module includes a 1×1 convolutional layer, a normalization layer, an activation function, and a classification convolutional layer, outputting a correction value corresponding to the number of categories. The parameters of the last layer of the lightweight correction module are initialized to zero at the beginning of training, making the boundary correction value close to 0 in the early stages of training. The boundary correction value is then added to the residual of the initial prediction score to obtain the corrected prediction score, satisfying:

[0058] Among them, P final P represents the corrected predicted score. initial Let represent the initial prediction score, △ represent the boundary correction amount, and λ represent the correction intensity coefficient. λ is set to 0.1, and △ is subjected to amplitude limiting before the residuals are summed. The amplitude limiting range is [-1, 1]. Through residual summation, the initial prediction score of the basic segmentation model is used as the main prediction result, and the boundary correction amount is used as the supplementary correction result within the boundary superpixels.

[0059] During the training of the overall model, the joint training total loss is calculated based on the initial prediction score and the corrected prediction score. The joint training total loss L... total satisfy:

[0060] Where Y represents the pixel-level mask image, L CE L represents the cross-entropy loss. Dice Let α and β represent the Dice loss, and let α and β represent the preset weights; in one implementation, α is set to 1.0 and β is set to 0.1. The AdamW optimizer is used for backpropagation and parameter updates, and the image encoder learning rate is set to 1.2 × 10⁻⁶. -5 The UPerNet segmentation head learning rate was set to 1.2 × 10⁻⁶. -4 The learning rate for the boundary superpixel interaction structure is set to 5×10. -5 The minimum learning rate is set to 8×10. -7 The weight decay coefficient is set to 0.05, the training batch size is set to 4, the validation batch size is set to 4, the training epochs are set to 100 epochs, and the segmentation results of the overall model are validated using the validation set. The model weights corresponding to the segmentation results of the validation set are saved.

[0061] S6. The trained material microstructure segmentation model is used to identify and segment the scanning electron microscope image to be analyzed, and the segmentation mask of the target microstructure is output.

[0062] This step specifically includes: S6.1 Input the scanning electron microscope image of the alloy material to be analyzed.

[0063] S6.2 Load the trained material microstructure segmentation model.

[0064] S6.3. The material microstructure segmentation model is used to identify and segment the SEM image to be analyzed.

[0065] S6.4. Output the segmentation mask of the target's microstructure after inference.

[0066] This section details the comparative implementation method of the present invention: To verify the effectiveness of the material microstructure segmentation method proposed in this application with limited labeled data, comparative experiments were conducted on the alloy material scanning electron microscope image dataset constructed in S1. A basic segmentation model consisting of a DINOv3 image encoder, a ViT Adapter, and a UPerNet segmentation head was constructed using the self-supervised pre-trained DINOv3 image encoder weights as initialization. The material microstructure segmentation model was trained using the parameter configuration set in S3. During training, the predicted boundaries of the initial segmentation results were extracted according to S4, and boundary superpixels were determined by combining SLIC superpixel partitioning. Then, a candidate category set and category representative features were constructed according to S5, allowing the pixel features within the boundary superpixels to interact with the candidate category representative features, and the initial prediction scores were corrected using residuals. A segmentation loss consisting of cross-entropy loss and Dice loss was used, and the AdamW optimizer was used for backpropagation and parameter updates. Under the same test set, uniform image preprocessing method, and the same input size, the method was compared with the basic segmentation model consisting of a DINOv3 image encoder, a ViT Adapter, and a UPerNet segmentation head without boundary superpixel interaction correction. The segmentation visualization results on the test set are reported.

[0067] In this embodiment, Figure 5 The image comparison results are shown, including the original image, the DINO segmentation mask image, and the material microstructure segmentation mask image with a small amount of labeled data proposed in this invention. It can be seen that the segmentation results of the target microstructure region by this method under the condition of a small amount of labeled data are better than the basic segmentation model without the addition of boundary superpixel interaction correction, which shows the reliability of this method.

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

Claims

1. A method for segmenting material microstructures based on boundary superpixel interaction, characterized in that, Includes the following steps: S1. Acquire scanning electron microscope images of alloy materials, annotate the target microstructures in some scanning electron microscope images, construct a dataset and perform image preprocessing; S2. Based on the DINOv3 image encoder, a masked autoencoder is pre-trained using unlabeled scanning electron microscope images to obtain image encoder weights that are adapted to the microstructure images of materials. S3. Construct a material microstructure segmentation model that includes a DINOv3 image encoder, a ViT Adapter, and a UPerNet segmentation head, and train it on the constructed dataset to obtain the basic segmentation model; S4. Obtain the initial segmentation result of the scanning electron microscope image from the basic segmentation model, extract the predicted boundary based on the initial segmentation result, and perform simple linear iterative clustering superpixel division on the original image, and determine the superpixels that intersect with the predicted boundary as boundary superpixels. S5. Select boundary superpixels, construct candidate category sets and category representative features, enable pixel features within the boundary superpixels to interact with candidate category representative features, and correct the initial prediction score using residuals. S6. The trained material microstructure segmentation model is used to identify and segment the scanning electron microscope image to be analyzed, and the segmentation mask of the target microstructure is output.

2. The material microstructure segmentation method based on boundary superpixel interaction according to claim 1, characterized in that, S1 specifically includes: S1.1 Acquire scanning electron microscope images of the alloy material; S1.

2. Label the target microstructure in some scanning electron microscope images and convert the labeling results into pixel-level mask images; S1.3 Divide the data with pixel-level masked images into training set, validation set and test set; S1.4 Perform grayscale normalization, contrast adjustment, histogram equalization, and edge sharpening on the scanning electron microscope images.

3. The material microstructure segmentation method based on boundary superpixel interaction according to claim 1, characterized in that, S2 specifically includes: S2.

1. Use unlabeled scanning electron microscope images as a self-supervised pre-training dataset, and divide the self-supervised pre-training dataset into a pre-training training set and a pre-training validation set; S2.

2. Construct a self-supervised pre-training model based on the DINOv3 image encoder, and perform self-supervised pre-training of the mask autoencoder on the pre-training training set; S2.

3. Validate the self-supervised pre-trained model using the pre-trained validation set, and select the image encoder weights based on the validation results; S2.4 Save the selected image encoder weights.

4. The material microstructure segmentation method based on boundary superpixel interaction according to claim 1, characterized in that, In step S3, the material microstructure segmentation model is trained on the dataset constructed in S1, specifically including: S3.1 Model initialization: The DINOv3 image encoder is initialized using the image encoder weights obtained in S2, and a material microstructure segmentation model including the DINOv3 image encoder, ViT Adapter, and UPerNet segmentation head is constructed. S3.2 Feature extraction: Input the scanning electron microscope images from the training set into the DINOv3 image encoder to extract image features; S3.3 Feature adaptation: The image features are converted into multi-scale features using the ViT Adapter. S3.4 Segmentation prediction: The multi-scale features are fused through the UPerNet segmentation head to output pixel-level category prediction scores; S3.5 Parameter update: Calculate the segmentation loss based on the pixel-level category prediction score and the corresponding pixel-level mask image in the training set, and perform backpropagation and parameter update on the material microstructure segmentation model; S3.6 Model Validation: The segmentation results of the material microstructure segmentation model are validated using a validation set. The model weights corresponding to the segmentation results of the validation set are saved to obtain the basic segmentation model.

5. The material microstructure segmentation method based on boundary superpixel interaction according to claim 4, characterized in that, The segmentation loss in S3.5 includes cross-entropy loss and Dice loss. During the training process, S3.2 to S3.5 are repeated using the training set data until the material microstructure segmentation model reaches the preset training rounds or the segmentation results of the validation set no longer improve.

6. The material microstructure segmentation method based on boundary superpixel interaction according to claim 1, characterized in that, S4 specifically includes: S4.1 Input the scanning electron microscope image into the basic segmentation model to obtain the initial segmentation result; S4.2 Compare the predicted categories of adjacent pixels in the initial segmentation results. When the predicted categories of adjacent pixels are different, the corresponding position is determined as the prediction boundary. S4.

3. Perform simple linear iterative clustering superpixel division on the original image to obtain multiple local continuous regions; S4.

4. Define the local continuous regions that intersect with the prediction boundary as boundary superpixels, and define the local continuous regions that do not intersect with the prediction boundary as non-boundary regions.

7. The material microstructure segmentation method based on boundary superpixel interaction according to claim 1, characterized in that, S5 specifically includes: S5.1 Construct a candidate category set based on the predicted categories that have already appeared inside the boundary superpixels; S5.

2. Use the pixel features of non-boundary regions to perform a weighted average to obtain the category representative features corresponding to the candidate categories; and make the pixel features within the boundary superpixels interact with the category representative features corresponding to the candidate category set to obtain the category context features; S5.

3. Concatenate the pixel features within the boundary superpixel with the category context features and input them into the lightweight correction module to generate the boundary correction amount; add the boundary correction amount to the residual of the initial prediction score to obtain the corrected prediction score.

8. The material microstructure segmentation method based on boundary superpixel interaction according to claim 7, characterized in that, In step S5.2, the pixel features are derived from the intermediate feature map output by the UPerNet segmentation head, and the category representation features are obtained by weighted averaging of pixel features belonging to the corresponding predicted category in non-boundary regions, specifically satisfying the following: , Among them, F k Ω represents the category representative feature of category k. n Let F(x) represent the set of pixel locations in the non-boundary region, x represent the pixel location, and F(x) represent the pixel feature at pixel location x. k (x) represents the predicted score for pixel location x belonging to category k. It is a constant; The pixel features within the boundary superpixel are mapped to query features, and the category representative features corresponding to the candidate category set are mapped to key features and value features. The candidate category weights are calculated based on the similarity between the query features and the key features, and the category context features are obtained based on the candidate category weights and value features.

9. A material microstructure segmentation method based on boundary superpixel interaction according to claim 7, characterized in that, In step S5.3, the lightweight correction module consists of convolutional layers or linear layers; the pixel features within the boundary superpixel are concatenated with the category context features and then input into the lightweight correction module, which outputs the boundary correction amount Δ; the corrected prediction score P final satisfy: , Among them, P initial λ represents the initial predicted score, and λ represents the corrected intensity coefficient.

10. The material microstructure segmentation method based on boundary superpixel interaction according to claim 1, characterized in that, S6 specifically includes: S6.1 Input the scanning electron microscope image of the alloy material to be analyzed; S6.2 Load the trained material microstructure segmentation model; S6.

3. The material microstructure segmentation model is used to identify and segment the SEM image to be analyzed. S6.

4. Output the segmentation mask of the target's microstructure after inference.