Efficient segmentation method for primary alpha phase of microstructure of small sample data titanium alloy

By using the MaterialAlphaSAM segmentation model, combined with the domain adaptation module and the geometric constraint hint prior module, the problems of insufficient segmentation accuracy and low versatility in the segmentation of primary α phase in titanium alloy microstructures are solved. This achieves efficient and accurate segmentation under conditions of few samples, improving the efficiency and accuracy of automated microstructure analysis.

CN122347682APending Publication Date: 2026-07-07西部超导材料科技股份有限公司

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
西部超导材料科技股份有限公司
Filing Date
2026-06-04
Publication Date
2026-07-07

AI Technical Summary

Technical Problem

Existing traditional metallographic image processing methods and deep learning-based methods suffer from problems such as strong dependence on image preprocessing, insufficient segmentation accuracy of microstructure boundaries, weak anti-interference ability, and low versatility and automation in the segmentation of primary α phase of titanium alloy microstructure. Furthermore, general visual basic models are difficult to generate high-quality cues that are spatially and semantically consistent under conditions of few samples, which limits the segmentation performance.

Method used

The MaterialAlphaSAM segmentation model is adopted, combined with a domain adaptation module and a geometric constraint hint prior module. By adaptively generating high-quality hints consistent with the semantic and morphological features of microstructures, the segmentation accuracy and stability are enhanced, and fine segmentation of primary α phase is achieved.

Benefits of technology

Efficient segmentation of primary α phase in titanium alloy microstructure was achieved under limited sample conditions, improving segmentation performance and the efficiency and accuracy of automated analysis, while maintaining semantic consistency and stability of the segmentation. This method is suitable for high-precision quantitative characterization of complex microstructures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122347682A_ABST
    Figure CN122347682A_ABST
Patent Text Reader

Abstract

The present application belongs to the technical field of image processing, and discloses a primary alpha phase efficient segmentation method for small sample data titanium alloy microstructure, comprising the following steps: S1, collecting and preprocessing the titanium alloy microstructure image, forming a training set, a verification set and a test set through artificial labeling and data enhancement, and constructing a microstructure segmentation data set; S2, building a MaterialAlphaSAM segmentation model, which is based on SAM, combined with a field adaptation module and a geometric constraint prompt prior module, so that the model can effectively locate the target area under the condition of few samples, and enhance the segmentation precision and stability; S3, model training and performance verification based on MaterialAlphaSAM; S4, inputting the test set image into the trained model, outputting the pixel-level segmentation result of the primary alpha phase, and further performing quantitative analysis. Under the premise of not introducing large-scale parameters and labeling costs, the present application adaptively generates high-quality prompts consistent with the microstructure semantics and topographic features, and effectively improves the segmentation performance in the few sample scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image processing technology, specifically relating to an efficient method for segmenting the primary α phase of titanium alloy microstructures for small sample data. Background Technology

[0002] In the aerospace manufacturing field, titanium alloys, with their high specific strength, excellent resistance to high and low temperatures, and corrosion resistance, have become the core material for critical load-bearing components in aircraft. To ensure the structural integrity and reliability of titanium alloy components in complex service environments, their material properties must meet stringent aerospace quality standards. According to the requirements of the international aerospace quality management system SAE 9100, titanium alloy components must undergo multi-dimensional, comprehensive quality control. Microstructural characterization, as a key means of evaluating the metallurgical quality and mechanical properties of materials, is integrated throughout all stages, including raw material acceptance, process verification, and finished product testing. Especially for duplex titanium alloys (such as TC4 and TC11), their room temperature strength, fracture toughness, fatigue crack propagation rate, and high-temperature stability are highly dependent on microstructural characteristics; therefore, precise control of microstructural parameters must be achieved through systematic metallographic analysis.

[0003] In practical applications, quantitative analysis of the primary α phase in titanium alloys mainly relies on metallographic microscopic image processing technology, the core of which lies in achieving accurate segmentation and statistical characterization of the primary α phase in the microstructure. Based on methodological differences, it can be divided into two main technical paths: metallographic analysis methods based on traditional image processing and intelligent segmentation methods based on deep learning.

[0004] Traditional metallographic image processing methods typically follow a three-stage analysis process: image preprocessing, phase segmentation, and quantitative analysis. As a fundamental method for determining the content of the primary α phase, it still holds significant application value in samples with distinct tissue characteristics. First, the quality of the original image is improved through methods such as median or Gaussian filtering to suppress noise, histogram equalization to enhance contrast, and homomorphic filtering to correct uneven illumination, laying the foundation for subsequent segmentation. Then, based on the differences in grayscale, edge, or region characteristics between the primary α phase and the β matrix, methods such as threshold segmentation (e.g., the Otsu algorithm), edge detection (e.g., the Canny operator), region growing, or morphological processing are used to separate the phase regions. Finally, by statistically analyzing the percentage of α phase pixels in the binary image and combining this with morphological parameters such as roundness, the results are filtered, and multi-view averaging is applied to obtain representative volume fraction data. This method has advantages such as clear principles, high computational efficiency, strong interpretability, and compatibility with current metallographic standards, and is widely used in routine quality inspection and industrial practice.

[0005] However, when faced with complex microstructures commonly found in aerospace manufacturing (such as blurred α-phase edges in bimorphic structures, adherence of strip-shaped α-phases after deformation, and a high proportion of secondary α-phase), the limitations of traditional methods become increasingly apparent. The core problems mainly include the following four points: 1. Strong dependence on image preprocessing: Metallographic images often suffer from uneven illumination, noise interference, and blurred edges. Traditional methods (such as thresholding and edge detection) require complex preprocessing procedures, and the selection of preprocessing parameters is highly dependent on human experience; even minor parameter adjustments can lead to deviations in the analysis results. 2. Insufficient accuracy in tissue boundary segmentation: When there are multiple phase intersections or intercalations in the metallographic structure, or when the grayscale differences at the phase interfaces are not obvious, traditional thresholding and region growing methods struggle to accurately distinguish the boundaries of different phases, easily resulting in segmentation or undersegmentation, directly affecting the accuracy of quantitative parameters. 3. Weak anti-interference ability: For metallographic images containing impurities, scratches, or pores, traditional methods cannot effectively distinguish between the target tissue and interfering substances, misjudging interfering areas as tissue phases, leading to distorted quantitative results. 4. Low versatility and automation: The metallographic morphology varies greatly among different materials and heat treatment processes. Traditional methods require the design of dedicated algorithms for specific microstructure types, making it difficult to adapt to diverse analytical needs. Furthermore, the process involves significant manual intervention, hindering large-scale, batch automated analysis. Traditional image processing methods are suitable for titanium alloy samples with simple microstructures and clear contrast, but their robustness and adaptability are clearly insufficient in the context of increasingly demanding complex microstructures and high-precision, high-consistency detection requirements.

[0006] With the rapid development of computer technology, deep learning-based methods have been widely applied to image segmentation tasks of metallic material microstructures to achieve automated and quantitative microstructural characterization. Currently, deep learning models based on encoder-decoder architectures and their various variants have made significant progress in the segmentation of titanium alloys and other multiphase metal microstructures. These methods have achieved remarkable results in both segmentation accuracy and stability under complex microstructural conditions. However, these approaches generally rely on supervised learning frameworks specific to material systems, corrosion conditions, or imaging modes, leading to significant limitations in applications spanning different alloy compositions, processing conditions, and imaging modalities. Furthermore, the high dependence of these methods on large-scale, high-quality pixel-level labeled data further restricts their practical application scope and efficiency.

[0007] In recent years, general-purpose visual foundational models, represented by the Segment Anything Model (SAM), have attracted widespread attention in the field of computer vision and provided a new research paradigm for microscopic tissue image analysis. These models, through pre-training on large-scale, multi-source datasets (such as the SA-1B dataset containing approximately 1.1 billion high-quality mask annotations), learn visual representations with strong transfer and generalization capabilities, demonstrating segmentation potential under zero-shot or few-shot conditions. Theoretically, these foundational models possess general segmentation capabilities across tasks and object categories, offering a new possible path to reduce the reliance of specialized fields on large-scale manually labeled data.

[0008] However, the segmentation of primary α phase in microscopic tissue images exhibits significant domain specificity in terms of imaging features, morphological features, and semantic definition. On the one hand, primary α phase in high-magnification tissues presents diverse morphologies, including equiaxed, short rod-shaped, and irregular polygonal forms, with highly discrete scale distributions. The equivalent diameter typically exhibits significant multimodal characteristics, ranging from fine grains to coarse equiaxed crystals, with a scale span exceeding one order of magnitude. On the other hand, due to limitations imposed by corrosion conditions and imaging mechanisms, the phase boundary between the primary α phase and the transformed β matrix often exhibits weak contrast and gradual transition characteristics, with significantly lower boundary clarity than the target contours commonly found in natural images, thus increasing the difficulty of accurate segmentation. Furthermore, existing research indicates that SAM (Segmentation Awareness Model) is highly sensitive to the spatial distribution of input prompts and their implied semantic priors; its segmentation results largely depend on whether the prompts effectively indicate the target region. In microscopic tissue images, due to the highly discrete scale, uneven spatial distribution, and weak boundary contrast of the primary α phase, fixed-density grid prompts struggle to simultaneously capture both fine particles and complex boundary regions under few-shot conditions. On the one hand, sparse sampling easily misses fine-scale α phases; on the other hand, blindly increasing sampling density introduces a large number of invalid or semantically ambiguous prompts, weakening the model's ability to discriminate target regions. This problem is particularly prominent in lightweight adaptation scenarios, becoming a key bottleneck restricting the performance of general-purpose base models in microscopic tissue segmentation. Against this backdrop, how to adaptively generate high-quality prompts that are spatially and semantically consistent with the domain priors of microscopic tissues has gradually become a key issue restricting the performance of general-purpose base models in this field. Therefore, how to adaptively generate high-quality prompts consistent with the semantic and morphological features of microscopic tissues without introducing large-scale parameters and annotation costs, and effectively improve segmentation performance in few-shot scenarios, has become an urgent problem to be solved. Summary of the Invention

[0009] The purpose of this invention is to provide an efficient segmentation method for primary α phase of titanium alloy microstructures with small sample data. Without introducing large-scale parameters and annotation costs, it adaptively generates high-quality prompts that are consistent with the semantic and morphological features of the microstructure, and effectively improves the segmentation performance in scenarios with few samples.

[0010] To achieve the above objectives, the technical solution adopted by the present invention is as follows: An efficient method for segmenting the primary α phase in titanium alloy microstructures for small sample data includes the following steps: S1. Collect and preprocess images of titanium alloy microstructure, and form training, validation and test sets through manual annotation and data augmentation to construct a complete microstructure segmentation dataset. S2, build the MaterialAlphaSAM segmentation model, based on SAM, combined with the domain adaptation module and the geometric constraint hint prior module, so that the model can effectively locate the target region under the condition of few samples, and enhance the segmentation accuracy and stability. S3, based on MaterialAlphaSAM for model training and performance verification; S4 inputs the test set images into the trained model, outputs the pixel-level segmentation results of the initial α phase, and performs further quantitative analysis.

[0011] Preferably, in S2, the MaterialAlphaSAM segmentation model is specifically: S201, the domain adaptation module is embedded into the predetermined feature layer of the visual encoder through residual method, and uses channel compression and multi-scale feature extraction mechanism to perform domain adaptation and enhancement on the microscopic tissue features output by the visual encoder. S202, the geometric constraint cue prior module provides accurate and semantically consistent cues to the cue encoder by adaptively predicting key points from image features; S203 indicates that the encoder forms both sparse and dense embeddings, providing stronger semantic priors for the subsequent mask decoder; S204 applies a binary cross-entropy loss to the foreground / background confidence map predicted by the model and the foreground / background core region generated by the ground truth mask, thereby improving the semantic consistency and spatial representativeness of the cue points.

[0012] Preferably, the specific steps of S201 are as follows: S20101 performs channel compression and dimensionality transformation on the output features of the visual encoder through a linear layer; S20102 introduces a dual-scale depthwise separable convolutional branch to achieve multi-scale feature modeling; S20103 uses a channel adaptive remapping mechanism to normalize, nonlinearly activate, and restore the channels of the spliced ​​multi-scale features, so as to perform residual fusion with the backbone features.

[0013] Preferably, the specific steps of S202 are as follows: S20201, the feature map output by the image encoder, after being predicted by the model, yields the foreground / background confidence map; S20202, geometric constraint sampling is performed on the foreground / background confidence maps using an iterative greedy algorithm to obtain the foreground / background sampling point set; S20203 generates low-resolution mask cues from the foreground / confidence map.

[0014] Preferably, the specific steps of S20201 are as follows: S2020101, Prediction head mapping of three-layer convolutional structure (2-channel plot) F logit The mathematical description is as follows: in, Represents the prediction head, F sam The feature map output by the image encoder; S2020102, the 2-channel image output by the prediction head. Channel splitting is performed to obtain the confidence maps of foreground and background cue points. The original image resolution is restored by bilinear upsampling to obtain the foreground confidence map and the background confidence map.

[0015] Preferably, the specific steps of S20202 are as follows: select a prompt point at the current highest response position, and perform circular suppression with a minimum distance threshold to ensure that the sampling points are spatially dispersed. Assuming a minimum distance threshold is taken... N pos Taking the foreground cue point sampling process as an example, its mathematical description can be as follows: initialization For the first Next iteration: in, For Euclidean distance d min A minimum distance threshold set manually. f sign Represents a symbolic function; Euclidean distance The calculation is as follows: If after 50 iterations N pos If the sample is still not full, continue to take the maximum remaining value to finally obtain the foreground sampling point set. : in, N pos Indicates the assumption N pos One forward-looking point of reference; Similarly, the final set of background sampling points is obtained. : in, N neg Indicates the assumption N neg A background cue point.

[0016] Preferably, the specific step of S20203 is: by analyzing the foreground confidence map... F fg Thresholding segmentation is performed to obtain a binary foreground mask, which is then downsampled to a size of 256×256. Its mathematical description is as follows: in, f interpolate,d This indicates a downsampling operation. f sign Represents a symbolic function. F fg This represents a prospect confidence plot.

[0017] Preferably, the specific steps of S203 are as follows: Mask hint F mask With the already sampled foreground sampling point set P fg Background sampling point set P bg The common input cue encoder forms both sparse and dense embeddings, thus providing a stronger semantic prior for the subsequent mask decoder. Its mathematical description is expressed as follows: in, For SAM's prompt encoder, E sparse This is the encoded sparse coded vector. E dense This is the encoded dense encoded vector. P fgForeground sampling point set, P bg For the background sampling point set, F mask This is a mask hint.

[0018] Preferably, in step S204, the mathematical description is as follows: in, To indicate potential losses, To provide background information on the loss, F fg For the foreground confidence plot, F bg For the background confidence plot, As the core area of ​​the future, The core area serves as the background.

[0019] Preferably, in step S204, the foreground / background core region generated by the truth mask specifically includes: An auxiliary supervision branch based on distance transformation is introduced. This branch takes the ground truth image as input and uses Euclidean distance transformation to characterize the spatial distance distribution from foreground and background cue point pairs to the primary α phase boundary. Based on this, through core region extraction, foreground core regions and background core regions with high semantic certainty are obtained, and their mathematical description is expressed as follows: in, p For the future F fg Any pixel in q Background F bg Any pixel in F fg For the foreground confidence plot, F bg For the background confidence plot, d fg ( p ) is a point p The shortest Euclidean distance to the foreground d bg ( q ) is a point q The shortest Euclidean distance to the background, τ fg τ is the threshold for the foreground core region. bg The threshold value is set for the core background region.

[0020] The beneficial effects of this invention are as follows: By introducing a geometric constraint cue prior module and a domain adaptation module on the basis of SAM, this invention achieves fine segmentation and domain feature adaptation of primary α phase in high-magnification titanium alloy microstructure. Under conditions of few samples, it can accurately locate the target region, enhance the perception of fine particles and weak contrast complex phase boundaries, maintain the semantic consistency and stability of the segmentation, and output high-precision pixel-level results to support quantitative characterization of area, size and morphology. Under the premise of controlled parameter increment, it also has a lightweight design and wide applicability, thereby significantly improving the efficiency, accuracy and engineering usability of automated microstructure analysis. Attached Figure Description

[0021] Figure 1 This is a flowchart of the method of the present invention.

[0022] Figure 2 This is a schematic diagram of the MaterialAlphaSAM model architecture.

[0023] Figure 3 Detailed flowchart for the domain adaptation module.

[0024] Figure 4 Detailed flowchart of the prior module for geometric constraint hints.

[0025] Figure 5 The results of segmentation of the metallographic dataset by various comparison methods are shown.

[0026] Figure 6 These are the results of high-magnification tissue analysis. Detailed Implementation

[0027] To make the objectives, technical solutions, and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings.

[0028] like Figures 1-6 As shown, an efficient method for segmenting the primary α phase in titanium alloy microstructures with small sample data includes the following steps: S1. Acquire and preprocess images of titanium alloy microstructures. Through manual annotation and data augmentation, training, validation, and test sets are formed to construct a complete microstructure segmentation dataset.

[0029] (1) Collect titanium alloy samples after specific heat treatment process, and obtain microstructure images using metallographic microscope or electron microscopy imaging equipment. The images mainly contain the primary α phase and its surrounding area.

[0030] (2) Preprocess the acquired microscopic tissue images.

[0031] To enhance the generalization ability and robustness of the segmentation model under limited sample conditions, the acquired microscopic tissue images are preprocessed. The preprocessing includes at least image size normalization, noise suppression, and brightness and contrast correction to reduce the impact of different imaging conditions on model training. At the same time, data augmentation is performed through cropping, random horizontal flipping, and other methods to expand the diversity of training data.

[0032] (3) Based on manual or semi-automatic annotation, pixel-level annotation is performed on the primary α phase region in the microscopic tissue image to generate the corresponding segmentation mask.

[0033] (4) The preprocessed and labeled samples are divided into training set, validation set and test set in proportions of 80%, 15% and 5% respectively, for subsequent model training, parameter selection and performance evaluation.

[0034] The preprocessed and labeled samples were divided into 80% training set, 15% validation set, and 5% test set. The training set was used for model parameter optimization, the validation set was used for hyperparameter tuning and model selection, and the test set was used for final performance evaluation to ensure the reliability of the model under complex microscopic tissue conditions.

[0035] S2 builds a MaterialAlphaSAM segmentation model, based on SAM, and combines a domain adaptation module and a geometric constraint hint prior module to enable the model to effectively locate the target region under conditions of few samples, thereby enhancing segmentation accuracy and stability.

[0036] A lightweight, domain-adaptive segmentation framework is constructed for the segmentation and quantitative characterization of primary α-phase in high-magnification titanium alloy microstructures. Based on the Surface Aspect Mechanism (SAM), this framework retains its visual encoder, cue encoder, and mask decoder structure to inherit the powerful representational capabilities of general-purpose visual models. Building upon this, a Domain Adaptation (DAA) module is introduced, embedded into a predetermined feature layer of the visual encoder via residual methods. Channel compression and multi-scale feature extraction mechanisms are used to domain-adapt and enhance microstructure features, significantly improving the model's ability to perceive fine primary α-phase particles and complex phase boundary regions under controlled parameter increments. Simultaneously, an Adaptive Geometric Constraint Cue Prior (GCPP) module is designed. This module adaptively predicts keypoints to provide accurate and semantically consistent cues to the SAM, enabling the model to effectively locate target regions even with limited samples. This replaces the traditional fixed-density grid cue strategy, enhancing segmentation accuracy and stability.

[0037] A schematic diagram of the MaterialAlphaSAM model architecture is shown below. Figure 2 As shown, specifically: S201, the domain adaptation module uses channel compression and multi-scale feature extraction mechanisms to perform domain adaptation and enhancement on the microscopic tissue features output by the visual encoder. The enhanced features are input into the ViT neck network to obtain a latent feature map, which is then input into the geometric constraint hint prior module.

[0038] The input image is sequentially processed through an image patch embedding layer and a visual encoder, and the output is microscopic tissue features. The input image size is: .

[0039] To effectively alleviate the significant domain bias problem faced by SAM in the field of material microstructure, this invention introduces a domain adaptation module after the SAM visual encoder (ViT Encoder). This module is inserted in the form of residuals, and with minimal parameters and computational overhead, it selectively modulates and compensates intermediate features. This allows for the maximum preservation of the general visual representation capabilities of SAM pre-training while incorporating prior knowledge of multi-scale textures and weak contrast structures unique to material microstructure. The specific process is as follows: like Figure 3 As shown, S20101 performs channel compression and dimension transformation on the output features of the visual encoder through a linear layer.

[0040] The domain adaptation module first performs channel compression on the microscopic tissue features output by the visual encoder through a linear layer, mapping the original 768-dimensional features to a 128-dimensional bottleneck space, and then performs dimensionality transformation to adapt to subsequent convolution operations. This significantly reduces the computational complexity of subsequent operations while ensuring sufficient preservation of discriminative information. Its mathematical description is as follows: (1) in, This is the output of SAM's ViT Backbone. This is a compression feature.

[0041] S20102 introduces a dual-scale depthwise separable convolution branch to achieve multi-scale feature modeling.

[0042] A dual-scale depthwise separable convolution branch is introduced within this low-dimensional feature space to achieve multi-scale feature modeling. The small-scale branch focuses on extracting high-frequency detail information such as fine equiaxed crystals, locally rough boundaries, and micro-texture intersections; the large-scale branch employs a 3×3 depthwise separable convolution with a dilation rate of 2 (dilation = 2, padding = 2) to expand the receptive field, thereby more effectively capturing the overall morphological structure and weak-contrast region distribution features of the primary α phase. Its mathematical description is as follows: (2) (3) in, For compression features, The features extracted are from the small-scale branch and the large-scale branch, respectively.

[0043] S20103 uses a channel adaptive remapping mechanism to normalize, nonlinearly activate, and restore the channels of the spliced ​​multi-scale features, so as to perform residual fusion with the backbone features.

[0044] The two scale branches are concatenated along the channel dimension, and then subjected to batch normalization and GeLU activation function to complete normalization and non-linear mapping. Finally, a 1×1 convolution is used to restore the feature dimension to the original number of channels, so as to perform residual fusion with the backbone features. (4) (5) (6) in, The features extracted are from the small-scale branch and the large-scale branch, respectively. F fuse Features after splicing F act Features after activation function F adapter This is the final output feature of the domain adaptation module.

[0045] Through the aforementioned dual-scale feature modeling and channel adaptive remapping mechanism, this adaptation module can effectively enhance the model's ability to represent the multi-scale distribution characteristics of primary α phase in material microstructure images, and perform targeted feature compensation for weak contrast boundary regions, thereby significantly reducing the representation gap between general visual priors and specific structural features in the material domain.

[0046] S202, the geometric constraint cue prior module generates spatially dispersed and semantically consistent high-quality mask cues and foreground / background sampling point sets by adaptively predicting key points from image features.

[0047] In microscopic tissue images, primary α phases often exhibit highly discrete scale distribution and non-uniform spatial characteristics: fine particles coexist with coarse equiaxed crystals, and targets are sparsely and randomly distributed within the field of view. In small-sample tasks, grid-based prompts are insufficient to effectively address this characteristic. On one hand, low grid density easily misses a large number of fine α phases, leading to a significant decrease in recall for small-scale targets. On the other hand, blindly increasing grid density introduces a large number of invalid prompts located in background regions or areas with blurred boundaries. These semantically ambiguous prompts not only fail to provide effective supervision but also interfere with the model's discrimination of real target regions, weakening the MaskDecoder's focusing ability. Especially in small-sample scenarios with lightweight adaptation and minimal annotations, this decline in prompt quality directly amplifies gradient noise, severely restricting the model's rapid convergence and final segmentation performance. To address this issue, this invention designs a Geometrically Constrained Prompt Prior (GCPP) module. By adaptively predicting foreground / background prompt point pair confidence maps from image features and combining this with an iterative greedy sampling strategy, it generates spatially dispersed, semantically consistent, high-quality point prompts.

[0048] like Figure 4 As shown in Figure S20201, the feature map output by the image encoder is used to obtain the foreground / background confidence map after prediction by the model.

[0049] S2020101, Prediction head mapping of three-layer convolutional structure (2-channel plot) F logit .

[0050] The Geometric Constraint Cueing Prior Module (GCPP) comprises a lightweight prediction head and an iterative diversity sampler. The prediction head uses feature maps output from the SAM image encoder (ViT Backbone). As input, a 2-channel image is mapped through a three-layer convolutional structure. Its mathematical description is as follows: (7) in, Represents the prediction head, F sam The feature map output by the image encoder (ViT Backbone).

[0051] The three-layer convolutional structure consists of three layers: the first layer is a convolutional layer followed by batch normalization and ReLU activation; the second layer is a convolutional layer followed by batch normalization and ReLU activation; and the third layer is a convolutional layer.

[0052] S2020102, the 2-channel image output by the prediction head. F logitChannel splitting is performed to obtain the confidence maps of foreground and background cue points. The original image resolution is restored by bilinear upsampling to obtain the foreground confidence map and the background confidence map.

[0053] The 2-channel image output by the prediction head F logit Channel splitting was performed to obtain the confidence maps of foreground and background cue points, with the following dimensions: The foreground and background cue point pair confidence maps are restored to the original image resolution through bilinear upsampling (upsampling × 16), resulting in the foreground confidence map. Background confidence plot .

[0054] S20202, geometric constraint sampling is performed on the foreground / background confidence maps using an iterative greedy algorithm to obtain the foreground / background sampling point set.

[0055] For both the foreground and background confidence maps, an iterative greedy algorithm is used for geometrically constrained sampling. A cue point is selected at the current highest response position, and circular suppression is applied using a minimum distance threshold to ensure spatial dispersion of sampling points and avoid information redundancy and redundant supervision. Assuming... N pos Taking the foreground cue point sampling process as an example, its mathematical description can be as follows: initialization For the first Next iteration: (8) (9) (10) in, For Euclidean distance d min A minimum distance threshold set manually. f sign Represents a symbolic function.

[0056] Euclidean distance The calculation is as follows: (11) If after 50 iterations N pos If the set is still not full, continue taking the maximum remaining value. This ultimately yields the foreground sampling point set. : (12) in, N pos Indicates the assumption Npos A foreground indicator.

[0057] Similarly, the final set of background sampling points is obtained. : (13) in, N neg Indicates the assumption N neg A background cue point.

[0058] Foreground sampling point set P fg Positive points are the sample points, while the background sampling point set is the background sampling point set. P bg These are negative sample points.

[0059] S20203 generates a low-resolution mask cue using the foreground confidence map.

[0060] To further improve the stability of the prompts, a low-resolution mask prompt is generated using the foreground confidence map. The specific steps are as follows: By analyzing the foreground confidence map... F fg Thresholding segmentation is performed to obtain a binary foreground mask, which is then downsampled to a size of 256×256. Its mathematical description is as follows: (14) in, f interpolate,d This indicates a downsampling operation. f sign Represents a symbolic function. F fg This represents a prospect confidence plot.

[0061] S203, the mask cue and foreground / background sampling point set input cue encoder, forms two types of embeddings: sparse and dense, providing stronger semantic priors for the subsequent mask decoder.

[0062] Mask hint F mask With the already sampled foreground sampling point set P fg Background sampling point set P bg The common input prompt encoder forms both sparse and dense embeddings, thus providing a stronger semantic prior for the subsequent mask decoder. Its mathematical description is as follows: (15) in, This is the prompt encoder for SAM. E sparse This is the encoded sparse coded vector. E dense This is the encoded dense encoded vector. P fg Foreground sampling point set, P bg For the background sampling point set, F mask This is a mask hint.

[0063] Sparse embedding, dense embedding, and latent feature map are input to the mask decoder to decode the predicted segmentation mask.

[0064] The predicted segmentation mask is upsampled by a factor of 4, and the final predicted segmentation result is output. The size of the final predicted segmentation result image is: .

[0065] S204 applies a binary cross-entropy loss to the foreground / background confidence map predicted by the model and the foreground / background core region generated by the ground truth mask, thereby improving the semantic consistency and spatial representativeness of the cue points.

[0066] To ensure that the adaptively generated prompts stably point to the semantic core region of the nascent α phase, this invention further introduces an auxiliary supervision branch based on distance transform. This branch takes the ground truth image as input, and the size of the ground truth image is: The spatial distance distribution from foreground and background cue point pairs to the primary α phase boundary was characterized using Euclidean Distance Transform (EDT). Based on this, a foreground core region with high semantic certainty is obtained through core region extraction (dist>τ). With background core area Its mathematical description is expressed as follows: (16) (17) (18) in, p For the future F fg Any pixel in q Background F bg Any pixel in F fg For the foreground confidence plot,F bg For the background confidence plot, d fg ( p ) is a point p The shortest Euclidean distance to the foreground d bg ( q ) is a point q The shortest Euclidean distance to the background, τ fg τ is the threshold for the foreground core region. bg The threshold value is set for the core background region.

[0067] The dimensions of the foreground core area and the background core area are respectively .

[0068] In microscopic tissue images, the phase boundary between the primary α phase and the β matrix often exhibits a gradual transition and weak contrast, making pixels near the boundary inherently uncertain in a physical sense, even though they are rigidly labeled as foreground or background in the ground truth mask. Applying pixel-level supervision directly to such ambiguous regions can induce the generation of semantically ambiguous or spatially unstable cue points. In small-sample scenarios with very few labeled samples, this problem further amplifies gradient noise, significantly limiting the convergence behavior of the cue generation module and the final segmentation performance.

[0069] Therefore, to alleviate the above problems, this invention treats the core region as a morphologically adaptive erosion, retaining only stable internal pixels with sufficient thickness and far from phase boundaries. Based on this region, a binary cross-entropy loss (BCE Loss) is applied to the foreground / background confidence map predicted by the model and the foreground / background core region generated by the ground truth mask. This loss explicitly constrains the network to produce high responses in semantically defined core regions, while suppressing uncertain responses in non-core and boundary transition regions, thereby improving the semantic consistency and spatial representativeness of the cue points. The mathematical description is as follows: (19) (20) in, To indicate potential losses, To provide background information on the loss, F fg For the foreground confidence plot, F bg For the background confidence plot, As the core area of ​​the future, The core area serves as the background.

[0070] The model performs cross-entropy loss on the final predicted segmentation result and the ground truth image, and adds the binary cross-entropy loss from the geometric constraint cue prior module, and then applies an overall loss to the sum.

[0071] S3 uses MaterialAlphaSAM for model training and performance verification.

[0072] After data preprocessing and model architecture construction, this embodiment uses the AdamW optimizer to iteratively train the model. During training, the initial learning rate is set to 1e-3, the batch size to 2, and an early stopping mechanism is used to monitor the model's convergence status. After the model training converges, the performance of the trained model is validated using a reserved test set.

[0073] To verify the effectiveness of the proposed MaterialAlphaSAM, this paper uses evaluation metrics such as Intersection Over Union (IoU) and F1 score to compare and evaluate the effectiveness of the algorithms. The formulas for each metric are as follows: (twenty one) (twenty two) In the formula, TP is the total number of pixels correctly segmented in the primary α phase category in the microscopic tissue image segmentation result, FP is the total number of pixels incorrectly segmented in the primary α phase category in the microscopic tissue image segmentation result, and FN is the total number of pixels incorrectly segmented in the background category in the microscopic tissue image segmentation result.

[0074] 1. Ablation experiment To verify the effectiveness of the proposed geometric constraint cueing prior module and domain adaptation module, ablation experiments were conducted on a titanium alloy microstructure dataset. The ablation experiments mainly compared the segmentation results based on metrics such as IoU and F1-score. In all experiments, all model variants used the same data partitioning, parameter size, and training strategy, with differences only in network structure or encoder freezing strategy.

[0075] 1.1 Module-level ablation experimental results and analysis Table 1 provides a description of the structural configurations of various network variants of MaterialAlphaSAM, and Table 2 summarizes the corresponding ablation experimental results.

[0076] Table 1 MaterialAlphaSAM variant structure table

[0077] Table 2 Ablation Experiment Results (↑ indicates the best performance)

[0078] Table 2 shows that Baseline + GCPP improves performance by 3.86% (IoU) and 2.55% (F1-Score) compared to Baseline; Baseline + DAA improves performance by 3.73% (IoU) and 2.44% (F1-Score) compared to Baseline; and Baseline + GCPP + DAA improves performance by 5.3% (IoU) and 3.77% (F1-Score) compared to Baseline. Analysis of Table 2 shows that both the geometric constraint cue prior module and the domain adaptation module can independently improve model performance under the condition of a fully frozen encoder, and they have a significant complementary gain effect. Specifically, GCPP, by introducing structured geometric priors, effectively enhances the model's spatial attention to the nascent α-phase core region and boundary contours; while DAA, by aligning intermediate features to their respective domains, alleviates the domain offset problem between the pre-trained representation of natural images and the distribution of microscopic tissue textures.

[0079] 1.2 Analysis of the impact of encoder unfreezing strategy on model performance As demonstrated by the aforementioned ablation experiments, introducing the GCPP and DAA modules significantly improves the model's ability to focus on the primary α-phase region and boundaries under fully frozen encoder conditions. However, SAM's pre-training is primarily based on natural images, and the representations learned by its encoder differ significantly from the texture, scale, and structural features of microscopic metal structures. Under small sample conditions, this neighborhood shift may further limit model performance, making strategies relying solely on backbone freezing and lightweight fine-tuning insufficient for downstream tasks. Therefore, this paper further designs various encoder layer-by-layer unfreezing strategies and analyzes the complementary effects and gain of the GCPP and DAA modules under different unfreezing settings. Specific unfreezing configurations are shown in Table 3, and the comparison results are shown in Tables 4 to 7.

[0080] Table 3. Configuration Description of Different Thawing Strategies

[0081] Table 4 Comparison of different unfreezing strategies in the baseline (↑ represents the best performance)

[0082] Table 5 Comparison of different unfreezing strategies using Baseline + DAA (↑ indicates the best performance)

[0083] Table 6 Comparison of different unfreezing strategies for Baseline + GCPP (↑ indicates the best performance)

[0084] Table 7 Comparison of different unfreezing strategies for Baseline + GCPP + DAA (↑ indicates the best performance)

[0085] Ablation experiments show that in the baseline model, as the number of encoder unfrozen layers gradually increases from E0 to E2, the model performance continuously improves, indicating that moderately unfreezing high-level Transformer Blocks helps alleviate the domain offset problem between pre-trained features and downstream tasks. However, when the unfreezing depth is further extended to E3 and above, the model performance significantly decreases, suggesting that under limited training samples, too many trainable parameters can easily lead to overfitting, thereby weakening the stability of pre-trained representations.

[0086] After introducing the DAA module, the model achieves optimal performance with a shallower thawing strategy, and the overall performance fluctuation with thawing depth is significantly smaller than that of the baseline, demonstrating stronger robustness. Nevertheless, at a medium thawing depth (E3), performance still degrades to some extent, indicating that although DAA can effectively alleviate the inter-domain shift of feature distribution, its ability to suppress overfitting is still insufficient when the encoder is over-thawn.

[0087] In contrast, Baseline + GCPP not only maintained high segmentation performance at a moderate thawing depth (E3), but also achieved further performance improvements, significantly outperforming Baseline and Baseline + DAA. This phenomenon indicates that geometric constraints, by providing prior information, also have a regularization effect in guiding feature learning, effectively enhancing the model's ability to focus on key information about the microstructure of the nascent α phase, thereby improving model plasticity while suppressing overfitting.

[0088] When GCPP and DAA are used together, the model achieves the best overall segmentation performance under the E3 unfreezing strategy, achieving a good balance between accuracy and the scale of trainable parameters. The geometric prior guidance and the domain adaptation mechanism have a significant synergistic gain effect.

[0089] 1.3 Analysis of the impact of different Grid Prompt sizes on model performance To further analyze the impact of cue design strategies on the performance of SAM-based microstructure segmentation and to verify the applicability and limitations of traditional fixed-mesh cueing in high-magnification metallographic image scenarios, this paper designs ablation experiments under different fixed-mesh cue configurations. Fixed-mesh cueing, as the most commonly used unsupervised cueing method in SAM, relies on the core assumption of covering potential target regions through regularized spatial sampling, thereby guiding the model to complete segmentation. However, in nascent α-phase microstructure images, target regions typically exhibit irregular morphology, significant scale differences, and highly non-uniform spatial distribution. Fixed-mesh sampling struggles to balance target integrity with background interference suppression, potentially leading to cue points falling within phase boundaries, background, or noise regions, thus weakening the model's effective response.

[0090] Based on this, this section mainly considers the impact of different grid sampling densities on segmentation performance and compares and analyzes them with the GCPP strategy proposed in this paper. The SAM unfreezing strategy remains at E2 (the optimal performance of Grid Prompt).

[0091] Table 8 Comparison of sampling densities for different grids (↑ indicates optimal performance)

[0092] Based on the experimental results in Table 8, it can be seen that the inherent limitations of fixed grid prompts are particularly prominent in the microstructural segmentation task of high-magnification metallographic images. In primary α-phase microstructural images, the target region usually exhibits irregular shapes, significant scale differences, and weak contrast, making it difficult for fixed grid sampling to effectively cover the target region and easily positioning prompt points in irrelevant areas such as the background or phase boundaries, thus affecting the segmentation accuracy of the model. Although Grid Prompt can maintain relatively stable performance at lower sampling densities (such as Grid 4 and Grid 8), its performance improvement gradually plateaus with increasing grid density (such as Grid 128), indicating that the fixed grid sampling method is insufficiently adaptable to complex target scenes. In contrast, the GCPP strategy proposed in this paper effectively solves the local noise problem that may occur in complex images by adaptively generating prompt points, and can more accurately capture the details of the target region, especially the fine particles and blurred phase boundary regions in the primary α-phase. In summary, the GCPP strategy not only overcomes the inherent limitations of fixed grid cues, but also significantly improves the accuracy and robustness of segmentation through adaptive cue point generation, providing a more flexible and efficient solution for metallographic image analysis tasks.

[0093] 2. Comparative Experiment To further validate the effectiveness of the proposed MaterialAlphaSAM, segmentation comparison experiments were conducted on a metal microstructure dataset, comparing it with several mainstream advanced semantic segmentation networks. The comparison methods included FCN, Unet, SegNet, DeeplabV3, PSPNet, and SAM Baseline. Table 9 presents the quantitative comparison results on the titanium alloy microstructure dataset. Figure 5 The image shows the segmentation results of various comparison methods on the metallographic dataset. From left to right, the first column, Raw Image, represents the microstructure image of the titanium alloy used in the input test; the second column, Ground Truth, represents the ground truth label image. Columns 3 to 8 show the semantic segmentation results of FCN, SegNet, UNet, DeepLabV3, PSPNet, and SAM Baseline algorithms, respectively. The ninth column, OURS, shows the semantic segmentation results of MaterialAlphaSAM proposed in this paper. The tenth column, Generated Prompt Points, represents the prompt points automatically generated during the training process of the GCPP module proposed in this paper.

[0094] Table 9. Quantitative Comparison Experimental Results of Titanium Alloy Microstructure Datasets (↑ indicates the best performance)

[0095] Quantitative Analysis: As shown in Table 9, MaterialAlphaSAM achieved the best performance in the titanium alloy microstructure segmentation task. Specifically, traditional convolutional networks such as FCN performed the weakest, with IoU of 73.56% and F1-score of 82.65%, mainly due to insufficient local receptive field and global context modeling capabilities. UNet and SegNet improved in local structure capture, with IoU of 80.10% and 79.46%, respectively, but still lower than MaterialAlphaSAM. DeepLabV3 and PSPNet, employing dilated convolutions or pyramid pooling, enhanced global information perception, with IoU of 81.12% and 81.24%, and F1-scores of 88.79% and 88.97%, respectively, showing significant improvement over FCN, but still significantly lower than MaterialAlphaSAM. Based on the ablation experiment configuration, SAM Baseline achieved an IoU of 86.75% and an F1-score of 92.64%, demonstrating its advantage in global structure modeling. However, the proposed MaterialAlphaSAM further introduces domain adaptation and adaptive prompt mechanisms, achieving significant improvements in local detail and weak boundary segmentation, with IoU and F1-score reaching 89.53% and 94.40%, respectively, representing improvements of 3.2% and 1.90% compared to SAM Baseline. Overall, MaterialAlphaSAM achieved the highest IoU and F1-score among all compared methods, proving that the proposed module can significantly improve the performance of titanium alloy microstructure segmentation under low sample conditions.

[0096] Qualitative analysis: Figure 5 (a)~ Figure 5 (g) The seven rows show the segmentation results of MaterialAlphaSAM compared with various mainstream semantic segmentation methods under complex conditions in primary α-phase microstructures, including uneven scale distribution, occlusion, complex background texture, and weak boundary contrast. Overall, compared with methods such as FCN, UNet, SegNet, DeepLabV3, PSPNet, and SAM Baseline, MaterialAlphaSAM can more effectively integrate local geometric details and global semantic priors in microstructures, enabling the model to maintain high segmentation accuracy and stability even when facing problems such as blurred α-phase boundaries, drastic scale changes, and background noise interference.

[0097] For situations with complex background textures and low local contrast, such as Figure 5As shown in (b), traditional CNN methods tend to misclassify some β matrix textures as α phases within the red-marked area, while the SAM Baseline segmentation results are more sensitive to cue point locations. In contrast, the proposed method can more accurately focus on the core region and true boundary morphology of the α phase, thus achieving fine segmentation of the α phase boundary in weak-contrast regions. Figure 5 In complex scenarios such as local adhesion of α phases, dense distribution of small-scale α phases, and irregular morphology, methods like FCN and UNet generally suffer from oversegmentation or missed detection. DeepLabV3 and PSPNet have insufficient response capabilities to small-scale targets. MaterialAlphaSAM, on the other hand, can effectively separate adjacent α phases and preserve fine structures while maintaining the integrity of large-scale α phases, significantly improving the geometric consistency of the segmentation results. Furthermore, as shown in (a), (d), (f), and (g), in complex scenarios such as local adhesion of α phases, dense distribution of small-scale α phases, and irregular morphology, methods like FCN and UNet generally exhibit oversegmentation or missed detection. Figure 5 (c) and Figure 5 As shown in (e), some samples exhibit occlusion and interference issues caused by magnification markers. Compared to methods such as FCN, SegNet, DeepLabV3, PSPNet, and SAM Baseline, these models generally misclassify magnification markers as nascent α phases within the region, leading to significant false detections. In contrast, the MaterialAlphaSAM method proposed in this paper can effectively distinguish non-organic semantic information from real microscopic tissue structures, exhibiting stronger suppression capabilities for magnification marker regions, and its segmentation results more accurately reflect the morphological features of real tissues. In summary, the qualitative comparison results from the metallographic microstructure dataset show that the MaterialAlphaSAM proposed in this paper, based on adaptive prompt generation and domain adaptation, can effectively improve the segmentation stability and refinement of SAM in complex microscopic tissue scenes, and has a significant advantage in the accurate segmentation of nascent α phases.

[0098] S4 inputs the test set images into the trained model, outputs the pixel-level segmentation results of the nascent α phase, and further performs quantitative analysis on area, size, and morphology.

[0099] Based on this, to verify the model's practical application capabilities and achieve efficient detection, this embodiment encapsulates the trained model as an inference service and deploys it to the backend. A rapid detection platform for primary α-phase tissues at high magnification is built based on the frontend framework. In specific implementation, the user uploads a high-magnification image of the tissue to be tested through the platform. The system calls the model to perform forward inference on the image, outputting a pixel-level segmentation mask for the primary α-phase. Then, the platform's built-in quantitative analysis module, based on the pixel connected components of the segmentation mask and the image calibration ratio, statistically analyzes and displays key indicators such as the area ratio, equivalent size, and morphological factors of the primary α-phase in real time. This integrated deployment scheme not only automates and visualizes the detection process but also verifies the algorithm's robustness and processing efficiency in real-world engineering scenarios through real-time quantitative feedback. For detailed high-magnification tissue analysis results, please refer to [link to relevant documentation]. Figure 6 .

Claims

1. A method for efficient segmentation of primary α-phase in titanium alloy microstructures for small sample data, characterized in that, Includes the following steps: S1. Collect and preprocess images of titanium alloy microstructure, and form training, validation and test sets through manual annotation and data augmentation to construct a complete microstructure segmentation dataset. S2, build the MaterialAlphaSAM segmentation model, based on SAM, combined with the domain adaptation module and the geometric constraint hint prior module, so that the model can effectively locate the target region under the condition of few samples, and enhance the segmentation accuracy and stability. S3, based on MaterialAlphaSAM for model training and performance verification; S4 inputs the test set images into the trained model, outputs the pixel-level segmentation results of the initial α phase, and performs further quantitative analysis.

2. The efficient segmentation method for primary α-phase in titanium alloy microstructures for small sample data as described in claim 1, characterized in that, In S2, the MaterialAlphaSAM segmentation model is specifically as follows: S201, the domain adaptation module is embedded into the predetermined feature layer of the visual encoder through residual method, and uses channel compression and multi-scale feature extraction mechanism to perform domain adaptation and enhancement on the microscopic tissue features output by the visual encoder. S202, the geometric constraint cue prior module provides accurate and semantically consistent cues to the cue encoder by adaptively predicting key points from image features; S203 indicates that the encoder forms both sparse and dense embeddings, providing stronger semantic priors for the subsequent mask decoder; S204 applies a binary cross-entropy loss to the foreground / background confidence map predicted by the model and the foreground / background core region generated by the ground truth mask, thereby improving the semantic consistency and spatial representativeness of the cue points.

3. The efficient segmentation method for primary α-phase in titanium alloy microstructures for small sample data as described in claim 2, characterized in that, The specific steps of S201 are as follows: S20101 performs channel compression and dimensionality transformation on the output features of the visual encoder through a linear layer; S20102 introduces a dual-scale depthwise separable convolutional branch to achieve multi-scale feature modeling; S20103 uses a channel adaptive remapping mechanism to normalize, nonlinearly activate, and restore the channels of the spliced ​​multi-scale features, so as to perform residual fusion with the backbone features.

4. The efficient segmentation method for primary α-phase in titanium alloy microstructures for small sample data as described in claim 2, characterized in that, The specific steps of S202 are as follows: S20201, the feature map output by the image encoder, after being predicted by the model, yields the foreground / background confidence map; S20202, geometric constraint sampling is performed on the foreground / background confidence maps using an iterative greedy algorithm to obtain the foreground / background sampling point set; S20203 generates low-resolution mask cues from the foreground / confidence map.

5. The efficient segmentation method for primary α-phase in titanium alloy microstructures for small sample data as described in claim 4, characterized in that, The specific steps of S20201 are as follows: S2020101, Prediction head mapping of three-layer convolutional structure (2-channel plot) F logit The mathematical description is as follows: in, Represents the prediction head, F sam The feature map output by the image encoder; S2020102, the 2-channel image output by the prediction head. Channel splitting is performed to obtain the confidence maps of foreground and background cue points. The original image resolution is restored by bilinear upsampling to obtain the foreground confidence map and the background confidence map.

6. The efficient segmentation method for primary α-phase in titanium alloy microstructures for small sample data as described in claim 4, characterized in that, The specific steps of S20202 are as follows: Select a prompt point at the current highest response position, and perform circular suppression using the minimum distance threshold to ensure that the sampling points are spatially dispersed. Assuming that... N pos Taking the foreground cue point sampling process as an example, its mathematical description can be as follows: initialization For the first Next iteration: in, For Euclidean distance d min A minimum distance threshold set manually. f sign Represents a symbolic function; Euclidean distance The calculation is as follows: If after 50 iterations N pos If the sample is still not full, continue to take the maximum remaining value to finally obtain the foreground sampling point set. : in, N pos Indicates the assumption N pos One forward-looking point of reference; Similarly, the final set of background sampling points is obtained. : in, N neg Indicates the assumption N neg A background cue point.

7. The efficient segmentation method for primary α-phase in titanium alloy microstructures for small sample data as described in claim 4, characterized in that, The specific steps in S20203 are as follows: By analyzing the foreground confidence map... F fg Thresholding segmentation is performed to obtain a binary foreground mask, which is then downsampled to a size of 256×256. Its mathematical description is as follows: in, f interpolate,d This indicates a downsampling operation. f sign Represents a symbolic function. F fg This represents a prospect confidence plot.

8. The efficient segmentation method for primary α-phase in titanium alloy microstructures for small sample data as described in claim 2, characterized in that, The specific steps of S203 are as follows: Mask hint F mask With the already sampled foreground sampling point set P fg Background sampling point set P bg The common input cue encoder forms both sparse and dense embeddings, thus providing a stronger semantic prior for the subsequent mask decoder. Its mathematical description is expressed as follows: in, For SAM's prompt encoder, E sparse This is the encoded sparse coded vector. E dense This is the encoded dense encoded vector. P fg Foreground sampling point set, P bg For the background sampling point set, F mask This is a mask hint.

9. The efficient segmentation method for primary α-phase in titanium alloy microstructures for small sample data as described in claim 2, characterized in that, In S204, the mathematical description is as follows: in, To indicate potential losses, To provide background information on the loss, F fg For the foreground confidence plot, F bg For the background confidence plot, As the core area of ​​the future, The core area serves as the background.

10. The efficient segmentation method for primary α-phase in titanium alloy microstructures for small sample data as described in claim 9, characterized in that, In step S204, the foreground / background core region generated by the truth mask is specifically as follows: An auxiliary supervision branch based on distance transformation is introduced. This branch takes the ground truth image as input and uses Euclidean distance transformation to characterize the spatial distance distribution from foreground and background cue point pairs to the primary α phase boundary. Based on this, through core region extraction, foreground core regions and background core regions with high semantic certainty are obtained, and their mathematical description is expressed as follows: in, p For the future F fg Any pixel in q Background F bg Any pixel in F fg For the foreground confidence plot, F bg For the background confidence plot, d fg ( p ) is a point p The shortest Euclidean distance to the foreground d bg ( q ) is a point q The shortest Euclidean distance to the background, τ fg τ is the threshold for the foreground core region. bg The threshold value is set for the core background region.