A metallographic structure segmentation method
The improved FastSAM model for metallographic structure segmentation solves the three-fold dilemma of accuracy, efficiency, and generalization in traditional methods, achieving high-precision and rapid metallographic structure segmentation and quantitative characterization, and supporting batch processing and visualization analysis.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA RAILWAY CONSTR HEAVY IND
- Filing Date
- 2026-04-17
- Publication Date
- 2026-07-14
AI Technical Summary
Existing technologies face a triple challenge in metallographic segmentation: accuracy, efficiency, and generalization. Traditional methods struggle to achieve high accuracy, speed, and broad applicability simultaneously, and manual annotation is costly and difficult to perform high-order distribution analysis.
An improved FastSAM model is used for metallographic structure segmentation, including a full instance segmentation stage, a guiding stage, and a post-processing stage. Through block processing, instance mask generation, and unit conversion, automatic segmentation and statistical analysis of grain boundaries and carbides are achieved.
It achieves stable segmentation of large-size images, outputs instance-level statistical information, enables rapid batch processing, significantly saves time and manpower costs, forms a closed loop of segmentation-unit conversion-statistics-distribution, and supports quantitative characterization and visualization.
Smart Images

Figure CN122391262A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent metallographic image analysis and quantitative characterization of material structure, and particularly to a method for metallographic structure segmentation. Background Technology
[0002] Material microstructure refers to the arrangement and morphological characteristics of a material's internal structure, including phase composition, grain boundary morphology and size, and the shape and distribution of second phases (carbides, inclusions, etc.). These factors collectively determine the physical, chemical, and mechanical properties of a material. Therefore, quantitative characterization of microstructure is a crucial foundational task in the field of materials science.
[0003] The existing technology has the following limitations: 1. Limitations of traditional grain boundary characterization methods. Grain boundaries are typically graded after polishing and etching using methods such as direct methods, comparative methods, and cross-sectional methods. These methods can be abstracted as low-dimensional compression of microstructural geometry information: Its output is a hierarchy rather than a set of instances, making it difficult to obtain fine-grained statistical information on the "quantity-scale-distribution" of grain boundaries simultaneously.
[0004] 2. Limitations of traditional digital image processing and software-interactive segmentation. Carbide characterization often involves thresholding, filtering, morphological processing, and manual repair using software such as Photoshop. This type of method belongs to parameter-driven weak generalization methods, which can be formalized as: ,in: The threshold, filtering, and morphological operators are combined, and λ is a set of empirically dependent parameters. Due to significant variations in corrosion depth, contrast, noise, and imaging conditions, λ is often difficult to reuse stably across images, leading to statistical drift, and manual repair is costly.
[0005] 3. Limitations of manual labeling. Analysis often uses manual labeling for semi-quantitative statistics. While manual methods offer high accuracy, they are time-consuming, often taking hours, making them unsuitable for statistical analysis of batches of samples or large fields of view.
[0006] Based on the above, the core contradiction of existing technologies lies in the three-fold dilemma of "accuracy-efficiency-generalization": ① High accuracy (manual) → high time cost; ② Fast time (threshold / morphology) → poor generalization and parameter sensitivity; ③ Graded output (grain rating) → insufficient information and difficulty in performing high-order distribution analysis. Therefore, a new metallographic structure segmentation method is urgently needed to solve the above technical problems. Summary of the Invention
[0007] The main objective of this invention is to provide a metallographic tissue segmentation method that features zero sample migration capability, instance-level statistical output, and scalable batch processing. The specific technical solution is as follows: A method for metallographic structure segmentation includes the following steps: Step 1: Cut the bearing steel sample into cubic specimens by wire cutting; polish the specimens; perform grain boundary etching on the polished specimens to create grain boundaries. Step 2: Take images of grain boundaries to obtain a grain boundary image set; prepare an electron microscope sample; take images of carbides to obtain a carbide image set; Step 3: Use the improved FastSAM model to segment and statistically analyze the images in the grain boundary image set and carbide image set, and output the results; The improved FastSAM model includes a full instance segmentation phase, a bootstrapping phase, and a post-processing phase, wherein: The full instance segmentation stage includes dividing the images in the image set into blocks to obtain full instance segmented images; The guidance phase includes point hints for obtaining inclusion mask images, segmentation hints for obtaining grain boundary mask images, and box hints for obtaining carbide mask images; The post-processing stage includes image combination, unit conversion, statistical analysis, and visualization.
[0008] Preferably, the image is segmented into blocks during the full instance segmentation stage as follows: Image segmentation and the image segmentation operator are shown in the following equation: ; in: The original image is a two-dimensional matrix composed of pixels, which is the original input for the model processing. for The result of the image segmentation operator on the original image represents the result of dividing the original image... according to The grid is divided into a set of multiple sub-blocks; Original image The segmented first Line 1 The smallest image unit after the sub-block image is divided is independently fed into the FastSAM model for processing; and The row and column indices of the segmented image are positive integers. These are the vertical pixels in the original image; These are the horizontal pixels in the original image; The number of rows and columns for dividing the image into blocks; The boundary uses equidistant sampling to ensure pixel coverage, as shown in the following formula: , ; in: Original image The height of pixels and the total number of pixels vertically; Original image Width in pixels, total pixels horizontally; This is the floor operator; The image block segmentation operator backfill stitching satisfies the following formula: ; in: for The block backfill splicing operator will process the blocks... The operation of reassembling each sub-block into a complete image based on its original row and column indices; For the stitching process, the stitched image has the same dimensions as the original image, achieving lossless restoration of the image after block processing.
[0009] The preferred strategy for generating and prompting large model instance sets during the guidance phase is as follows: FastSAM is viewed as an instance set generation operator, as shown in the following equation: ; in: For parameters The FastSAM model inference operator, These are the weight parameters after model training; For sub-blocks The instance mask set mask, taking carbides as an example, uses different methods for grain boundary segmentation and statistical hints, but the processing flow is the same. Specifically, the carbide mask is assigned yellow, while the background color remains unchanged (the grain mask is randomly assigned a color and then binarized, with white representing grain boundaries). For sub-blocks The Middle The mask of each carbide instance enables instance-level segmentation, with each carbide corresponding to an independent mask; For sub-blocks The total number of carbide instances detected in the sub-block changes dynamically with the amount of carbide in the sub-block; when there are no carbides... =0; Through prompting strategies The target adaptation of the output set is as follows: ; in: To provide the policy operator, target adaptation is performed on the mask set; This is the set of sub-block masks after being filtered by the hint strategy; The sub-block mask is used to embed the coordinates to obtain the full image set, as shown in the following formula: ; in: represents the set of original masks for the entire image after coordinate embedding; U is the union operator, which concatenates all sub-block masks according to global coordinates to form the entire image; This is a splicing operator with coordinate transformation, which converts the local coordinates of sub-blocks into global coordinates for the entire image; The post-processing stage is as follows: ; in: For the first The area of a carbide pixel corresponding to a mask; For mask Pixel coordinates; To sum over all pixels within the mask; For mask The value at pixel coordinates (u,v); Introducing the hyperparameter area threshold The effective mask set is as follows: ; in: The effective carbide mask set for the entire graph is ultimately used as the mask for subsequent statistics; The original full-image mask after coordinate embedding is obtained by concatenating the masks of all sub-blocks; The set belongs to the symbol.
[0010] Preferably, the unit conversions in the post-processing stage are as follows: The pixel density factor is obtained from the scale as follows: ; in: This is the pixel density factor, with units of μm / : The actual physical length of the scale in the metallographic image. The pixels of the scale in the metallographic image; The dimensional propagation of area and perimeter is as follows: ; in: For the first The actual physical area of a carbide after unit conversion; The actual physical perimeter of the kth carbide is the perimeter after unit conversion; Let be the perimeter of the k-th carbide in the image pixel coordinate system.
[0011] Preferably, the statistics in the post-processing stage include effective size statistics and area fraction, as follows: ; in: For the first The equivalent circle diameter of a carbide; The mean and variance are as follows: ; ; in: The arithmetic mean of carbide size reflects the average size of the carbide. The sample variance of carbide size reflects the degree of dispersion of carbide size; The total number of effective carbides, i.e., the effective mask set. Number of masks in the array; Area fraction of carbides Calculate using the following formula: ; in: The total physical area of the field of view of the metallographic image; for The total area of all effective carbides within the field of view; And Save each instance to Excel.
[0012] Preferably, the visualization operations in the post-processing stage are as follows: For size sequence { Plotting histograms and fitting probabilistic models, the size distribution in material microstructure statistics often exhibits a log-normal distribution, defined as follows: ; in: It follows a normal distribution; The population mean of the logarithmic dimension; The population variance is the logarithmic size. The density is as follows: ; The maximum likelihood estimation method yields the following results: ; ; in: The maximum likelihood estimate of the logarithmic particle size mean (i.e., the sample mean after taking the natural logarithm of the k-th carbide particle size dk); K is the total number of observed carbide particles (i.e., the total number of carbide particles included in the statistics). This is the maximum likelihood estimate of the variance of the logarithmic particle size (i.e., the sample variance after taking the natural logarithm of the kth carbide particle size dk).
[0013] Preferably, in step one: The bearing steel sample was wire-cut into 15mm×15mm×20mm cube samples. The cubic sample was ground, specifically by grinding it on sandpaper with grits ranging from low to high: 50, 100, 200, 500 and 1000 grit, until the surface was smooth and flat. Polishing is performed using a polishing machine. Specifically, the sample surface is first pre-polished with a coarse polishing cloth, and then switched to a fine polishing cloth until there are no obvious scratches. The polished sample was subjected to grain boundary etching, specifically by immersing it in a 10% picric acid aqueous solution for 5-10 seconds to etch out grain boundaries.
[0014] Preferably, in step two: Grain boundary images are taken using an optical microscope to observe and photograph the grain boundaries at magnifications of 100-1000. The specific steps for preparing electron microscope samples are as follows: polishing is performed to remove the etched layer; a 10% (v / v) nitric acid alcohol solution is used as the etching solution for etching, and the etching time is 5-12 seconds.
[0015] The effect of applying the technical solution of this invention is: The metallographic structure segmentation method disclosed in this invention includes: wire-cutting a bearing steel sample into a cubic sample; polishing the sample; etching the polished sample to form grain boundaries; capturing grain boundary images; preparing an electron microscope sample; capturing carbide images to obtain a carbide image set; and using an improved FastSAM model to segment and statistically analyze the images in the carbide image set, outputting the results. Specifically, the improved FastSAM model includes a full-instance segmentation stage, a guiding stage, and a post-processing stage. The full-instance segmentation stage includes block processing of the images in the carbide image set to obtain full-instance segmented images; the guiding stage includes point hints for obtaining inclusion mask images, segmentation hints for obtaining grain boundary mask images, and bounding box hints for obtaining carbide mask images; the post-processing stage includes image combination, unit conversion, statistical analysis, and visualization operations. The effect is: 1. Solve the challenge of organizing and segmenting large-size images: By using block inference and scale-preserving stitching, large models can stably output instance sets on large-view images.
[0016] 2. Form a closed loop of "segmentation-unit conversion-statistics-distribution": output quantity, area, equivalent diameter, variance, area fraction and distribution fitting parameters to achieve quantitative characterization and visualization.
[0017] 3. It can process a large number of images quickly in batches, significantly saving time and labor costs. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the structures shown in these drawings without creative effort.
[0019] Figure 1 This is a schematic diagram illustrating the process of segmenting and statistically analyzing images in a set of carbide and grain boundary images using an improved FastSAM model in the metallographic structure segmentation method of this invention. Figure 2 This is a schematic diagram of the carbide segmentation effect in an embodiment of the present invention, wherein: (a) is the original image; (b) is the result of manual segmentation; (c) is the result of digital image processing segmentation; and (d) is the result of the segmentation scheme of the present invention. Figure 3 This is the original grain boundary diagram in an embodiment of the present invention; Figure 4 These are different color mask images of grain boundaries after segmentation in this embodiment of the invention; Figure 5 It is a grain boundary map after binarizing the mask image; Figure 6 This is a grain boundary size distribution diagram in an embodiment of the present invention; Figure 7 This is the original carbide diagram in the embodiments of the present invention; Figure 8 These are color masks of the segmented carbides in this embodiment of the invention; Figure 9 This is a carbide size distribution diagram in an embodiment of the present invention; Figure 10 These are images of inclusions in embodiments of the present invention; Figure 11 The image shown is a masked image of inclusions obtained by pointing to the prompt in an embodiment of the present invention. Figure 12 These are images of the inclusions extracted separately.
[0020] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0021] 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 a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0022] Example: This invention provides a method for metallographic structure segmentation, comprising the following steps: Step 1: Cut the bearing steel sample into cubic specimens by wire cutting; polish the specimens; perform grain boundary etching on the polished specimens to create grain boundaries. Step 2: Take images of grain boundaries to obtain a grain boundary image set; prepare an electron microscope sample; take images of carbides to obtain a carbide image set; Step 3: Use the improved FastSAM model to segment and statistically analyze the images in the grain boundary image set and carbide image set, and output the results. See details. Figure 1 Specifically, it includes: The improved FastSAM model includes a full instance segmentation phase, a bootstrapping phase, and a post-processing phase, wherein: The full instance segmentation stage includes dividing the images in the image set into blocks to obtain full instance segmented images; The guidance phase includes point hints for obtaining inclusion mask images, segmentation hints for obtaining grain boundary mask images, and box hints for obtaining carbide mask images; The post-processing stage includes image combination, unit conversion, statistical analysis, and visualization.
[0023] In this preferred embodiment, step one includes: The grinding process involves cutting the bearing steel sample into 15mm×15mm×20mm cubes, chamfering them, and then grinding them on sandpaper with grits ranging from low to high: 50, 100, 200, 500, and 1000 grit, until the surface is smooth and flat.
[0024] Polishing, specifically, involves using a metallographic polishing machine to first pre-polish with a coarse polishing cloth, and then switching to a fine polishing cloth until the sample surface is free of obvious scratches.
[0025] Grain boundary corrosion is specifically performed by immersing the inclusions in a 10% (volume fraction) picric acid aqueous solution for 5-10 seconds after the inclusions are photographed, thereby creating grain boundaries.
[0026] In this preferred embodiment, in step two: Grain boundary images were taken using an optical microscope, and grain boundary photographs were taken at a magnification of 500x. The specific steps for preparing electron microscope samples are as follows: re-polishing to remove the etched layer; using a 10% (v / v) nitric acid alcohol solution as the etching solution for etching, with an etching time of 5-12 seconds.
[0027] The process of capturing carbide images involves using an electron microscope at 3000x magnification to obtain carbide images.
[0028] In this embodiment, step three is as follows: The open-source FastSAM model can be downloaded from GitHub-CASIA-IVA-Lab / FastSAM:FastSegmentAnything.
[0029] An improved FastSAM model is used to segment and statistically analyze images in a carbide image set. This includes a full instance segmentation stage, a guidance stage, and a post-processing stage. Specifically, in the full instance segmentation stage, the obtained image is first divided into blocks (blocking can be performed depending on processing requirements; blocking can improve processing accuracy and speed), and then fed into the system to obtain a full instance segmented image. Then, different guidance methods such as point hints, all-inclusive segmentation, and bounding box hints are used to obtain a mask image (point hints are suitable for images with inclusions; see details). Figure 10 , Figure 11 and Figure 12 (Segmentation is suitable for grain boundary images; bounding boxes are suitable for mask images). Subsequent image combination yields a complete image, followed by unit conversion, statistical analysis, and visualization modules to obtain the final result. Details are as follows: 1. Image segmentation and the image segmentation operator are shown in the following formula: ; in: The original image is a two-dimensional matrix composed of pixels, which is the original input for the model processing. for The result of the image segmentation operator on the original image represents the result of dividing the original image... according to The grid is divided into a set of multiple sub-blocks; Original image The segmented first Line 1 The smallest image unit after the sub-block image is divided is independently fed into the FastSAM model for processing; and The row and column indices of the segmented image are positive integers. These are the vertical pixels in the original image; These are the horizontal pixels in the original image; The number of rows and columns for dividing the image into blocks; The boundary uses equidistant sampling to ensure pixel coverage, as shown in the following formula: , ; in: Original image The height of pixels and the total number of pixels vertically; Original image Width in pixels, total pixels horizontally; This is the floor operator; The image block segmentation operator backfill stitching satisfies the following formula: ; in: for The block backfill splicing operator will process the blocks... The operation of reassembling each sub-block into a complete image based on its original row and column indices; For the stitching process, the stitched image has the same dimensions as the original image, achieving lossless restoration of the image after block processing.
[0030] 2. The strategy for generating and prompting large model instance sets is as follows: FastSAM is viewed as an instance set generation operator, as shown in the following equation: ; in: For parameters The FastSAM model inference operator, These are the weight parameters after model training; For sub-blocks The instance mask set mask is a binary image, where the white areas represent the segmented carbides (taking carbides as an example, the same applies to grain boundaries), and the black areas represent the background; For sub-blocks The Middle The mask of each carbide instance enables instance-level segmentation, with each carbide corresponding to an independent mask; For sub-blocks The total number of carbide instances detected in the sub-block changes dynamically with the amount of carbide in the sub-block; when there are no carbides... =0; Through prompting strategies The target adaptation of the output set is as follows: ; in: To provide the policy operator, target adaptation is performed on the mask set; This is the set of sub-block masks after being filtered by the hint strategy; The sub-block mask is used to embed the coordinates to obtain the full image set, as shown in the following formula: ; in: represents the set of original masks for the entire image after coordinate embedding; U is the union operator, which concatenates all sub-block masks according to global coordinates to form the entire image; This is a splicing operator with coordinate transformation, which converts the local coordinates of sub-blocks into global coordinates for the entire image.
[0031] 3. Quality gate control and robust post-processing, i.e., the post-processing stage mentioned above, is shown in the following formula: ; in: For the first The area of a carbide pixel corresponding to a mask; For mask Pixel coordinates; To sum over all pixels within the mask; For mask The value at pixel coordinates (u,v); Introducing the hyperparameter area threshold The effective mask set is as follows: ; in: The effective carbide mask set for the entire graph is ultimately used as the mask for subsequent statistics; The original full-image mask after coordinate embedding is obtained by concatenating the masks of all sub-blocks; The set belongs to the symbol.
[0032] 4. Pixel-to-micron scale factor propagation, i.e. (unit conversion performed by the unit conversion module), as follows: The pixel density factor is obtained from the scale as follows: ; in: This is the pixel density factor, with units of μm / : The actual physical length of the scale in the metallographic image. The pixels of the scale in the metallographic image; The dimensional propagation of area and perimeter is as follows: ; in: For the first The actual physical area of a carbide after unit conversion; The actual physical perimeter of the kth carbide is converted to a unit perimeter (unit: μm). This represents the perimeter (in pixels) of the k-th carbide in the image pixel coordinate system.
[0033] 5. Equivalent size statistics and area fraction, i.e., statistical analysis, are as follows: Effective size statistics and area fraction are as follows: ; in: For the first The equivalent circle diameter of a carbide; The mean and variance are as follows: ; ; in: The arithmetic mean of carbide size reflects the average size of the carbide. The sample variance of carbide size reflects the degree of dispersion of carbide size; The total number of effective carbides, i.e., the effective mask set. Number of masks in the array; Area fraction of carbides Calculate using the following formula: ; in: The total physical area of the field of view of the metallographic image; for The total area of all effective carbides within the field of view; And Save each instance to Excel.
[0034] 6. Distribution visualization, as follows: For size sequence { Plotting histograms and fitting probabilistic models, the size distribution in material microstructure statistics often exhibits a log-normal distribution, defined as follows: ; in: It follows a normal distribution; The population mean of the logarithmic dimension; The population variance is the logarithmic size. The density is as follows: ; The maximum likelihood estimation method yields the following results: ; ; in: The maximum likelihood estimate is the logarithmic mean of the particle size, which is the sample mean after taking the natural logarithm of the k-th carbide particle size dk; K is the total number of observed carbide particles, i.e., the total number of carbide particles included in the statistics. This is the maximum likelihood estimate of the variance of the logarithmic particle size, i.e., the sample variance after taking the natural logarithm of the k-th carbide particle size dk.
[0035] The original carbide image, manual segmentation, digital image processing segmentation, and the method of this embodiment are used for segmentation, such as... Figure 2 As shown in Table 1: Table 1. Comparison of segmentation methods: manual segmentation, digital image processing segmentation, and the method described in this embodiment.
[0036] The segmentation of grain boundary diagrams using the method of this invention is shown in the figure. Figure 3 , Figure 4 and Figure 5 ,in: Figure 3 The original diagram of the grain boundary is shown. Figure 4 The diagram illustrates the grain boundary mask after segmentation. Figure 5 The diagram illustrates the binarized grain boundary map after segmentation. Figure 6 The diagram illustrates the grain boundary size distribution.
[0037] For details on segmenting the carbide diagram using the method of this invention, please refer to [link / reference]. Figure 7 , Figure 8 and Figure 9 ,in: Figure 7 The original diagram of the carbide is shown. Figure 8 The diagram illustrates the different color masks of the segmented carbides. Figure 9 The diagram illustrates the carbide size distribution. Figure 8 The data corresponding to the segmented carbide diagrams shown in the figure are detailed in Table 2: Table 2 Carbide data in the segmented carbide diagram
[0038] Based on the results obtained from grain boundary and carbide segmentation and comparative statistics, it can be seen that the size distribution of grain boundaries and carbides conforms to a normal distribution, verifying the feasibility of the technical solution of the present invention.
[0039] The above description is merely a preferred embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural transformations made using the contents of the present invention's specification and drawings under the inventive concept of the present invention, or direct / indirect applications in other related technical fields, are included within the patent protection scope of the present invention.
Claims
1. A method for metallographic structure segmentation, characterized in that, Includes the following steps: Step 1: Wire-cut the bearing steel sample into a cube; polish the sample. The polished sample was subjected to grain boundary etching to create grain boundaries. Step 2: Take images of grain boundaries to obtain a grain boundary image set; prepare an electron microscope sample; take images of carbides to obtain a carbide image set; Step 3: Use the improved FastSAM model to segment and statistically analyze the images in the grain boundary image set and carbide image set, and output the results; The improved FastSAM model includes a full instance segmentation phase, a bootstrapping phase, and a post-processing phase, wherein: The full instance segmentation stage includes dividing the images in the image set into blocks to obtain full instance segmented images; The guidance phase includes point hints for obtaining inclusion mask images, segmentation hints for obtaining grain boundary mask images, and box hints for obtaining carbide mask images; The post-processing stage includes image combination, unit conversion, statistical analysis, and visualization.
2. The metallographic structure segmentation method as described in claim 1, characterized in that, The image is segmented into blocks during the full instance segmentation stage as follows: Image segmentation and the image segmentation operator are shown in the following equation: ; in: The original image is a two-dimensional matrix composed of pixels, which is the original input for the model processing. for The result of the image segmentation operator on the original image represents the result of dividing the original image... according to The grid is divided into a set of multiple sub-blocks; Original image The segmented first Line 1 The smallest image unit after the sub-block image is divided is independently fed into the FastSAM model for processing; and The row and column indices of the segmented image are positive integers. These are the vertical pixels in the original image; These are the horizontal pixels in the original image; The number of rows and columns for dividing the image into blocks; The boundary uses equidistant sampling to ensure pixel coverage, as shown in the following formula: , ; in: Original image The height of pixels and the total number of pixels vertically; Original image Width in pixels, total pixels horizontally; This is the floor operator; The image block segmentation operator backfill stitching satisfies the following formula: ; in: for The block backfill splicing operator will process the blocks... The operation of reassembling each sub-block into a complete image based on its original row and column indices; For the stitching process, the stitched image has the same dimensions as the original image, achieving lossless restoration of the image after block processing.
3. The metallographic structure segmentation method as described in claim 2, characterized in that, The strategy for generating and prompting large model instance sets during the guidance phase is as follows: FastSAM is viewed as an instance set generation operator, as shown in the following equation: ; in: For parameters The FastSAM model inference operator, These are the weight parameters after model training; For sub-blocks The instance mask set mask is a binary image where white areas represent segmented carbides and black areas represent the background. For sub-blocks The Middle The mask of each carbide instance enables instance-level segmentation, with each carbide corresponding to an independent mask; For sub-blocks The total number of carbide instances detected in the sub-block changes dynamically with the amount of carbide in the sub-block; when there are no carbides... =0; Through prompting strategies The target adaptation of the output set is as follows: ; in: To provide the policy operator, target adaptation is performed on the mask set; This is the set of sub-block masks after being filtered by the hint strategy; The sub-block mask is used to embed the coordinates to obtain the full image set, as shown in the following formula: ; in: represents the set of original masks for the entire image after coordinate embedding; U is the union operator, which concatenates all sub-block masks according to global coordinates to form the entire image; This is a splicing operator with coordinate transformation, which converts the local coordinates of sub-blocks into global coordinates for the entire image; The post-processing stage is as follows: ; in: For the first The area of a carbide pixel corresponding to a mask; For mask Pixel coordinates; To sum over all pixels within the mask; For mask The value at pixel coordinates (u,v); Introducing the hyperparameter area threshold The effective mask set is as follows: ; in: The effective carbide mask set for the entire graph is ultimately used as the mask for subsequent statistics; The original full-image mask after coordinate embedding is obtained by concatenating the masks of all sub-blocks; The set belongs to the symbol.
4. The metallographic structure segmentation method as described in claim 3, characterized in that, The unit conversions during the post-processing stage are as follows: The pixel density factor is obtained from the scale as follows: ; in: This is the pixel density factor, with units of μm / : The actual physical length of the scale in the metallographic image. The pixels of the scale in the metallographic image; The dimensional propagation of area and perimeter is as follows: ; in: For the first The actual physical area of a carbide after unit conversion; The actual physical perimeter of the kth carbide is the perimeter after unit conversion; Let be the perimeter of the k-th carbide in the image pixel coordinate system.
5. The metallographic structure segmentation method as described in claim 4, characterized in that, The post-processing stage includes statistical analysis of effective dimensions and area fractions, as follows: ; in: For the first The equivalent circle diameter of a carbide; The mean and variance are as follows: ; ; in: The arithmetic mean of carbide size reflects the average size of the carbide. The sample variance of carbide size reflects the degree of dispersion of carbide size; The total number of effective carbides, i.e., the effective mask set. Number of masks in the array; Area fraction of carbides Calculate using the following formula: ; in: The total physical area of the field of view of the metallographic image; for The total area of all effective carbides within the field of view; And Save each instance to Excel.
6. The metallographic structure segmentation method as described in claim 5, characterized in that, The specific visualization operations in the post-processing stage are: For size sequence { Plotting histograms and fitting probabilistic models, the size distribution in material microstructure statistics often exhibits a log-normal distribution, defined as follows: ; in: It follows a normal distribution; The population mean of the logarithmic dimension; The population variance is the logarithmic size. The density is as follows: ; The maximum likelihood estimation method yields the following results: ; ; in: The maximum likelihood estimate is the logarithmic mean of the particle size, which is the sample mean after taking the natural logarithm of the k-th carbide particle size dk; K is the total number of observed carbide particles, i.e., the total number of carbide particles included in the statistics. This is the maximum likelihood estimate of the variance of the logarithmic particle size, i.e., the sample variance after taking the natural logarithm of the k-th carbide particle size dk.
7. The metallographic structure segmentation method according to any one of claims 1-6, characterized in that, In step one: The bearing steel sample was wire-cut into 15mm×15mm×20mm cube samples. The cubic sample is chamfered by grinding it on sandpaper with grits ranging from low to high: 50, 100, 200, 500 and 1000 grit, until the surface is smooth and flat. Polishing is performed using a metallographic polishing machine. Specifically, the sample surface is first pre-polished with a coarse polishing cloth, and then switched to a fine polishing cloth until there are no obvious scratches. The polished sample was subjected to grain boundary etching, specifically by immersing it in a 10% picric acid aqueous solution for 5-10 seconds to etch out grain boundaries.
8. The metallographic structure segmentation method as described in claim 7, characterized in that, In step two: Grain boundary images are taken using an optical microscope to observe and photograph the grain boundaries at magnifications of 100-1000. The specific steps for preparing electron microscope samples are as follows: polishing is performed to remove the etched layer; a 10% (v / v) nitric acid alcohol solution is used as the etching solution for etching, and the etching time is 5-12 seconds.