Metal material metallographic picture pearlite segmentation method based on multistage self-supervision
By using a multi-level self-supervised UNet model for pearlite segmentation in metallographic images, the problems of low efficiency and high manual cost in traditional methods are solved, and efficient segmentation and quantitative analysis are achieved under diverse imaging conditions.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2026-05-26
AI Technical Summary
Traditional metallographic quantitative analysis is inefficient and labor-intensive. Existing artificial intelligence models are difficult to adapt to changing imaging conditions, and training requires high-quality labeled data and manual annotation by domain experts, which makes application difficult.
We employ a UNet model based on multi-level self-supervision to segment pearlite in metallographic images through a self-supervised mechanism. The model is trained using a multi-level loss function and a self-supervised method, eliminating the need for manual annotation and adapting to various imaging conditions.
This study achieved efficient pearlite segmentation of metallographic images, reduced labor costs, improved the model's adaptability and resistance to background noise, and established a quantitative relationship between metallographic structure and the mechanical properties of steel.
Smart Images

Figure CN122089747A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of automatic metallographic inspection, and specifically to a method for pearlite segmentation of metallographic images of metallic materials based on multi-level self-supervision. Background Technology
[0002] In the safety and quality inspection of oil and gas pipelines, observing the microstructure of the pipelines using a metallographic microscope is a common method used by inspectors. This method is characterized by low cost and high accuracy. In most cases, inspectors only qualitatively judge the microstructure type appearing in the metallographic images. However, with the increasing demands of inspection, inspectors need to quantitatively analyze the microstructure distribution characteristics in the metallographic images. Hypoeutectoid steel is the most widely used steel in oil and gas pipelines. At room temperature, its microstructure consists of a ferrite matrix with pearlite of varying sizes distributed on top. The size and shape of the pearlite directly reflect the strength, toughness, and deformation degree of the steel; quantitative analysis of it can reflect the quality of the steel used in oil and gas pipelines.
[0003] Traditional quantitative metallographic analysis requires manual pixel-by-pixel annotation of metallographic images, resulting in low efficiency and high labor costs. With breakthroughs in computer image recognition technology, especially artificial intelligence (AI) image recognition, it has become possible to annotate metallographic images pixel-by-pixel using pre-trained AI computational models. Numerous reports on this technology have emerged both domestically and internationally. Training an AI computational model that meets practical application requirements typically requires a large amount of high-quality training data. In practice, inconsistent imaging conditions and sample contamination can compromise the quality of the obtained image data. Common solutions include limiting imaging conditions, such as standardizing the background light source of the metallographic microscope, specifying the image sharpness, and refining sample preparation methods. However, these methods also limit the model's capabilities; an AI model trained under specific conditions may struggle to achieve good predictive results under other conditions.
[0004] In addition to high-quality training data, training AI computational models also requires labeled data that matches each data point, serving as a blueprint to guide the self-optimization of the AI model. Labeled data is usually obtained through manual labeling by experts. However, a single metallographic image may contain millions of pixels, so labeling requires a significant amount of human and time resources. Furthermore, manual labeling inevitably introduces subjective labeling errors, which further reduce the prediction accuracy of the computational model.
[0005] It is evident that while traditional AI image recognition technology holds promise for achieving automatic pixel-by-pixel annotation of metallographic structures, it cannot adapt to the diverse imaging conditions encountered in practice. Furthermore, training AI models requires extensive manual annotation by domain experts, posing significant challenges to practical applications. Summary of the Invention
[0006] In practice, the quality of metallographic images varies considerably, and training AI models requires extensive manual annotation by domain experts. These two issues pose significant challenges to the practical application of AI in metallographic inspection. This invention addresses this issue by proposing an AI-based, multi-level self-supervised pearlite segmentation method for the pearlite-ferrite two-phase microstructure of hypoeutectoid steel, commonly used in oil and gas pipelines. This method is adaptable to various imaging conditions, requires no manual annotation, and is easy to train. The resulting pearlite data can be used to establish a quantitative relationship between the metallographic structure and the mechanical properties of the steel.
[0007] This invention is achieved through the following technical solution:
[0008] A method for pearlite segmentation in metallographic images of metallic materials based on multi-level self-supervised methods, comprising:
[0009] Initial metallographic image data of multiple metallic materials are acquired, and all the initial metallographic image data are preprocessed to obtain corresponding intermediate metallographic image data, so as to create a metallographic image dataset.
[0010] Generate label data for each intermediate metallographic image in the metallographic image dataset;
[0011] Design a multi-level self-supervised UNet model and the corresponding multi-level loss function for the multi-level self-supervised UNet model;
[0012] The intermediate metallographic image data is used as the input of the multi-level self-supervised UNet model, and the label data corresponding to the intermediate metallographic image data is used as the output of the multi-level self-supervised UNet model to train the multi-level self-supervised UNet model.
[0013] The trained multi-level self-supervised UNet model is used to segment the pearlite in the subsequent metallographic image data.
[0014] As an optimization, the specific process of acquiring multiple metallographic image data of metallic materials to create a metallographic image dataset is as follows:
[0015] A1. Select a metallic material and sample the metallic material to obtain initial metallographic image data of the metallic material;
[0016] A2. The initial metallographic image data is filtered and cropped to obtain intermediate metallographic image data, thereby forming a metallographic image dataset.
[0017] As an optimization, in A1, sampling and preparing the metal material to obtain initial metallographic image data specifically includes cutting, grinding, etching, polishing, metallographic microscopic observation, micro-area selection, and acquiring initial metallographic images of the metal material.
[0018] As an optimization, the specific process for generating label data for each intermediate metallographic image in the metallographic image dataset is as follows:
[0019] B1. Perform superpixel segmentation on each of the intermediate metallographic images to obtain superpixel samples of the intermediate metallographic images;
[0020] B2. Perform binary classification on the superpixel samples to generate the label dataset corresponding to the intermediate metallographic image.
[0021] As an optimization, the multi-level self-supervised UNet model includes an encoder and a decoder. The encoder includes multiple deep convolutional neural networks. Along the transmission direction of the image data, the deep convolutional neural network located downstream of the transmission direction downsamples the image data transmitted from the deep convolutional neural network upstream through strided convolution. The decoder includes multiple sequentially arranged decoding layers. Each deep convolutional neural network is connected to the corresponding decoding layer through skip connections, thereby outputting the downsampled image data from the deep convolutional neural network to the decoding layer. Each decoding layer upsamples the image data input to the decoding layer using bilinear interpolation.
[0022] As an optimization, the upsampling and downsampling of the encoder and decoder are set symmetrically.
[0023] As an optimization, the label data is downsampled sequentially in the reverse direction of the decoder's data stream to form downsampled labels corresponding to each decoding layer. The loss function of each decoding layer is obtained by combining the predicted value output by each decoding layer with the corresponding downsampled label. The multi-level loss function is obtained by summing the loss functions of each decoding layer in the decoder.
[0024] As an optimization, the loss function corresponding to each decoding layer is the cross-entropy loss function.
[0025] As an optimization, each of the deep convolutional neural networks consists of two regular convolutional blocks, and each regular convolutional block performs Normalization regularization, ReLU activation, and 3*3 convolution in sequence.
[0026] As an optimization, before the intermediate metallographic image data is input to the encoder, the pixel value of each pixel in the intermediate metallographic image data is normalized to data between 0 and 1 to obtain image data.
[0027] This invention also discloses a pearlite segmentation system for metallographic images of metallic materials based on multi-level self-supervision, used to implement the aforementioned pearlite segmentation method for metallographic images of metallic materials based on multi-level self-supervision, comprising:
[0028] The acquisition module is used to acquire initial metallographic image data of multiple metallic materials and preprocess all the initial metallographic image data to obtain corresponding intermediate metallographic image data, so as to create a metallographic image dataset.
[0029] A label data generation module is used to generate label data for each intermediate metallographic image in the metallographic image dataset.
[0030] The modeling module is used to design a multi-level self-supervised UNet model and the multi-level loss function corresponding to the multi-level self-supervised UNet model.
[0031] The training module is used to take the intermediate metallographic image data as the input of the multi-level self-supervised UNet model and the label data corresponding to the intermediate metallographic image data as the output of the multi-level self-supervised UNet model, so as to train the multi-level self-supervised UNet model.
[0032] The execution module is used to segment the pearlite in the subsequent metallographic image data using the trained multi-level self-supervised UNet model.
[0033] The present invention also discloses an electronic device, characterized in that it includes at least one processor and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform a multi-level self-supervised method for segmenting pearlite from metallographic images of metallic materials as described above.
[0034] The present invention also discloses a storage medium storing a computer program, characterized in that, when the computer program is executed by a processor, it implements the aforementioned method for segmenting pearlite from metallographic images of metallic materials based on multi-level self-supervision.
[0035] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0036] The present invention uses a multi-level self-supervised UNet model with a multi-level self-supervised mechanism, which is easier to train to convergence without manual annotation.
[0037] The multi-level self-supervised mechanism makes the model more adaptable to small samples, and the fully trained model is more resistant to background noise. Attached Figure Description
[0038] The accompanying drawings, which are included to provide a further understanding of embodiments of the invention and form part of this application, do not constitute a limitation thereof. In the drawings:
[0039] Figure 1 The flowchart illustrates the implementation of a pearlite segmentation method based on multi-level self-supervised metallographic images of hypoeutectoid steel in this embodiment.
[0040] Figure 2 This is a schematic diagram of superpixel segmentation;
[0041] Figure 3 For label image data;
[0042] Figure 4 Structure diagram of a multi-level self-supervised UNet model
[0043] Figure 5 Examples of images and prediction results are provided. Detailed Implementation
[0044] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the embodiments and accompanying drawings. The illustrative embodiments and descriptions of the present invention are only used to explain the present invention and are not intended to limit the present invention.
[0045] This embodiment 1 provides a method for pearlite segmentation from metallographic images of metallic materials based on multi-level self-supervised methods, such as... Figure 1 As shown, it includes:
[0046] S1. Obtain initial metallographic image data of multiple metal materials, and preprocess all the initial metallographic image data to obtain corresponding intermediate metallographic image data, so as to create a metallographic image dataset.
[0047] In some embodiments, the specific process of acquiring multiple metallographic image data of metallic materials to create a metallographic image dataset is as follows:
[0048] A1. Select a metallic material and sample the metallic material to obtain initial metallographic image data of the metallic material;
[0049] Specifically, this includes cutting, grinding, etching, polishing, metallographic microscopic observation, micro-area selection, and acquiring initial metallographic images of the metal material.
[0050] Taking hypoeutectoid steel as an example, the pearlite in the metallographic image of hypoeutectoid steel is segmented.
[0051] (1) First, samples of oil and gas pipeline steel are selected. The part that best represents the general situation is selected. Its metallographic structure at room temperature is based on ferrite with pearlite of different sizes and shapes distributed on it.
[0052] (2) Sampling and sample preparation of the pipe material. This includes steps such as cutting, grinding, etching, polishing, metallographic microscopic observation, micro-area selection, and image acquisition.
[0053] A2. The initial metallographic image data is filtered and cropped to obtain intermediate metallographic image data, thereby forming a metallographic image dataset.
[0054] The collected images were filtered and cropped to create a metallographic image dataset. Images with excessive scratches, excessive blurriness, or other poor quality were removed. The remaining images were then cropped to a size of 512 pixels in both width and height to create the metallographic image dataset.
[0055] S2. Generate label data for each intermediate metallographic image in the metallographic image dataset;
[0056] The specific process is as follows:
[0057] B1. Perform superpixel segmentation on each of the intermediate metallographic images to obtain superpixel samples of the intermediate metallographic images;
[0058] The SLIC algorithm is used to perform superpixel segmentation on metallographic images. Each superpixel is a high-dimensional array composed of pixels from the original image.
[0059] B2. Perform binary classification on the superpixel samples to generate the label dataset corresponding to the intermediate metallographic image.
[0060] The KMeans algorithm is used to classify superpixel samples into two categories and the average pixel value of each category is calculated. All superpixels in the category with the lower average value are labeled as 1 (pearlite), while those in the other category are labeled as 0 (ferrite). Finally, a binary label image with the same size as the original image is generated (pearlite region value is 1, ferrite region value is 0).
[0061] S3. Design a multi-level self-supervised UNet model and the corresponding multi-level loss function for the multi-level self-supervised UNet model;
[0062] S4. The intermediate metallographic image data is used as the input of the multi-level self-supervised UNet model, and the label data corresponding to the intermediate metallographic image data is used as the output of the multi-level self-supervised UNet model to train the multi-level self-supervised UNet model.
[0063] S5. The pearlite in the subsequent metallographic image data is segmented using the trained multi-level self-supervised UNet model.
[0064] The multi-level self-supervised UNet model applies a self-supervised method to each layer of the UNet model. Finally, a multi-level loss function combines the losses calculated from each layer, and then backpropagation is performed to optimize the parameters.
[0065] In some embodiments, the multi-level self-supervised UNet model includes an encoder and a decoder. The encoder includes multiple deep convolutional neural networks (DNNs). Downstream DNNs, along the image data transmission direction, downsample the image data transmitted from upstream DNNs using strided convolutions. The decoder includes multiple sequentially arranged decoding layers. Each DNN is connected to its corresponding decoding layer via skip connections, thereby outputting the downsampled image data to the decoding layer. Each decoding layer upsamples the input image data using bilinear interpolation. The upsampling and downsampling of the encoder and decoder are symmetrically configured.
[0066] The UNet model structure of this invention consists of an encoder and a decoder. The encoder is a four-layer convolutional neural network, with each layer consisting of two regularized convolutional blocks. Image downsampling is achieved between layers through strided convolutions. Each regularized convolutional block undergoes Normalization regularization, ReLU activation, and a 3x3 convolution in sequence. The decoder has a symmetrical structure to the encoder, but uses bilinear interpolation for upsampling. The output image of each layer of the encoder is connected to the input of each layer of the decoder via skip connections.
[0067] The label data is downsampled sequentially in the reverse direction of the decoder's data stream to form downsampled labels corresponding to each decoding layer. The loss function of each decoding layer is obtained by combining the predicted value output by each decoding layer with the corresponding downsampled label. The multi-level loss function is obtained by summing the loss functions of each decoding layer in the decoder.
[0068] Multi-level self-supervised processing: The intermediate metallographic images are superpixel sampled and unsupervised clustered to generate label images. These generated label images are directly used to calculate the loss with the output of the first layer of the UNet model. Subsequently, the label images are downsampled to align with the output sizes of other decoding layers, and then the loss is calculated with the outputs of those decoding layers. The final loss function is the sum of the losses calculated from each layer, serving as the starting point for backpropagation.
[0069] Multi-stage loss function: L = L1 + L2 + L3 + L4, where L i It is the loss calculated between the output of the i-th layer and the label image of the corresponding layer.
[0070] Specifically, the loss function corresponding to each decoding layer is the cross-entropy loss function.
[0071] Before the intermediate metallographic image data is input to the encoder, each pixel value in the intermediate metallographic image is normalized to data between 0 and 1 to obtain image data.
[0072] The training process for the convolutional neural network is as follows: All trainable parameters of the UNet model are initially distributed normally with a mean of 0 and a standard deviation of 0.02. The input to the UNet model is a three-channel RGB color image. Before input, each pixel value is normalized to between 0 and 1. The output of the last layer of the UNet model is a single-channel image, which is converted to a probability value between 0 and 1 by the sigmoid function, representing the probability that the point is a pearlite. The expression for the sigmoid function is:
[0073]
[0074] The loss function used at each level is the cross-entropy loss function, whose expression is:
[0075]
[0076] Among them, y i This represents the actual value, i.e., the label data, or the label image. This represents the predicted value, which is the output data of the decoding layer. `n` represents the total number of pixels, and `Loss` represents the prediction loss. During training, the initial learning rate and number of iterations are set to 0.0001 and 400, respectively. An adaptive learning strategy is employed: if the loss no longer decreases for 10 consecutive iterations, the learning rate is halved. The minimum learning rate is 10. -8 .
[0077] The multi-level self-supervised UNet model, fully trained through the above process, can predict pearlite in metallographic images of hypoeutectoid steel without manual annotation or additional traditional image processing.
[0078] Hypoeutectoid steel is the most commonly used steel in oil and gas pipelines. The size and distribution of pearlite directly affect the mechanical properties of hypoeutectoid steel. Therefore, the quantitative data of pearlite obtained by this method can be used to establish a quantitative relationship between oil and gas pipelines and their metallographic images, laying the foundation for quantitative quality inspection of oil and gas pipelines through metallographic testing.
[0079] Next, we will use a specific example to illustrate the segmentation of pearlite in a hypoeutectoid steel metallographic image using the segmentation method of the present invention.
[0080] The first phase involves establishing a metallographic image database, consisting of steps one, two, and three. Example metallographic images are attached. Figure 5 As shown in the left figure.
[0081] Step one: Select samples of steel for oil and gas pipelines. Choose the part of the steel body that best represents the general situation, namely the main structural steel of the pipeline, which is hypoeutectoid steel. At room temperature, its microstructure generally consists of a ferrite matrix with pearlite of varying sizes and uniform distribution.
[0082] Step two: Prepare samples of the selected steel and collect metallographic images. Cut the selected steel into appropriate sizes. First, polish it with 320-grit diamond sandpaper until the surface is smooth. Then, use 800-grit and 1200-grit diamond sandpaper to finely polish it until a mirror finish is achieved. Next, use a metallographic polishing machine to polish the mirror finish of the steel to eliminate most of the scratches. After rinsing and drying, etch it with a 4% nitric acid alcohol solution for 30-40 seconds, then wash it with anhydrous ethanol and dry it. Observe it with a bright-field metallographic microscope at a magnification of 200x, and randomly collect non-repeating metallographic images with a resolution of 1920*2560.
[0083] Step 3: Filter and crop the metallographic images; remove images with obvious quality defects, such as large scratches or poor clarity. Then, crop each of the remaining 1920*2560 metallographic images to 512*512 pixels to create a metallographic image dataset.
[0084] The second stage involves automatic labeling and building a labeled dataset, consisting of steps four and five. The attached image shows the labeled data obtained from the implementation example. Figure 3 As shown.
[0085] Step four: Perform superpixel segmentation to obtain superpixel samples. Taking a metallographic image as an example... Figure 2 As shown, the SLIC superpixel segmentation algorithm is used to perform superpixel segmentation on metallographic images. Two key parameters determine the segmentation quality: the initial number of superpixels, n, and the balance factor, m. After optimization, n = 1200 and m = 0.5 were selected. Each superpixel in the segmented superpixel samples is a high-dimensional array, where each element of the array is a pixel value from the original metallographic image.
[0086] Step 5: Perform binary classification on the superpixel samples obtained in Step 4 to classify ferrite and pearlite.
[0087] The KMeans algorithm, an unsupervised clustering method, is used to perform binary classification on the obtained superpixel samples. After classification, based on the average value of all pixels in each superpixel class, all pixels with a large average value are labeled as 0 (ferrite), and all pixels with a small average value are labeled as 1 (pearlite), thus obtaining the labeled image data, such as... Figure 3 As shown.
[0088] The third stage involves training the multi-level self-supervised UNet model using the established metallographic image dataset (containing 1100 metallographic images of size 512*512) and the corresponding labeled image dataset (calculated from the metallographic images). This stage consists of steps six, seven, and eight, and the model structure is shown in the attached figure. Figure 4 As shown.
[0089] Step six: The three-channel RGB metallographic image data with a size of 512*512 is first input into the encoder, and features at different levels of the metallographic image are extracted through four layers of encoder. The first layer obtains a feature image with a size of 256*256*32; the second layer obtains a feature image with a size of 128*128*64; the third layer obtains a feature image with a size of 64*64*128; and the fourth layer obtains a feature image with a size of 32*32*256.
[0090] Step 7: Integrate and decode the feature images at different levels extracted by the encoder to obtain the prediction results. The fourth decoder decodes the output of the fourth layer of the encoder, obtaining a feature map of size 64*64*128. This feature map is then passed through a 1*1 convolution and a sigmoid activation function to obtain an output map of size 64*64*1. The third decoder concatenates the feature map of the fourth decoder with the output of the third encoder, using this as input to obtain a feature map of size 128*128*64. This feature map is then passed through a 1*1 convolution and a sigmoid activation function to obtain an output map of size 128*128*1. The second decoder concatenates the output of the third decoder with the output of the second encoder, using this as input to obtain a feature map of size 256*256*32. This feature map is then passed through a 1*1 convolution and a sigmoid activation function to obtain an output map of size 256*256*1. The first decoder concatenates the feature map of the second decoder with the output of the first encoder, using this as input. This feature map is then passed through a 1*1 convolution and a sigmoid activation function to obtain an output map of size 512*512*1. On the other hand, the original label image generated in the first stage will be directly used to calculate the loss L1 with the output of the first layer decoder. After the original label image is downsampled one, two, and three times, downsampled label images with sizes of 256*256*1, 128*128*1, and 64*64*1 are obtained, and the losses L2, L3, and L4 are calculated with the output images of the second, third, and fourth layers of the decoder, respectively. Finally, the losses of each layer are summed to obtain the final loss function L.
[0091] Step 8: During model training, calculate the cross-entropy loss between the predicted probability map and the corresponding label data map. The calculation formula is as follows:
[0092]
[0093] Among them, y i Indicates the tag value. This represents the prediction probability, where n represents the total number of pixels, and Loss represents the prediction loss. During training, after calculating the loss function, the entire network is iteratively optimized using the Adam optimizer in the PyTorch framework. After sufficient training, the resulting UNet model parameters are saved.
[0094] The fourth stage uses a pre-trained multi-level self-supervised model to predict metallographic images. This stage consists of step nine, and the prediction results for an example are attached. Figure 5 As shown.
[0095] Step nine, the prediction process, involves binarizing the final prediction probability map with a threshold of 0.5. This means that the part of the prediction probability value greater than 0.5 is assigned a value of 1, and the part less than or equal to 0.5 is assigned a value of 0, thus obtaining the prediction result.
[0096] Example 2 also discloses a pearlite segmentation system for metallographic images of metallic materials based on multi-level self-supervision, used to implement the aforementioned method, including:
[0097] The acquisition module is used to acquire initial metallographic image data of multiple metallic materials and preprocess all the initial metallographic image data to obtain corresponding intermediate metallographic image data, so as to create a metallographic image dataset.
[0098] A label data generation module is used to generate label data for each intermediate metallographic image in the metallographic image dataset.
[0099] The modeling module is used to design a multi-level self-supervised UNet model and the multi-level loss function corresponding to the multi-level self-supervised UNet model.
[0100] The training module is used to take the intermediate metallographic image data as the input of the multi-level self-supervised UNet model and the label data corresponding to the intermediate metallographic image data as the output of the multi-level self-supervised UNet model, so as to train the multi-level self-supervised UNet model.
[0101] The execution module is used to segment the pearlite in the subsequent metallographic image data using the trained multi-level self-supervised UNet model.
[0102] The present invention also discloses an electronic device, including at least one processor and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the pearlite segmentation method for metallographic images of metallic materials based on multi-level self-supervised methods as described in Embodiment 1.
[0103] The present invention also discloses a storage medium storing a computer program, which, when executed by a processor, implements the pearlite segmentation method for metallographic images of metallic materials based on multi-level self-supervision as described in Embodiment 1.
[0104] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for pearlite segmentation from metallographic images of metallic materials based on multi-level self-supervised methods, characterized in that, include: Initial metallographic image data of multiple metallic materials are acquired, and all the initial metallographic image data are preprocessed to obtain corresponding intermediate metallographic image data, so as to create a metallographic image dataset. Generate label data for each intermediate metallographic image in the metallographic image dataset; Design a multi-level self-supervised UNet model and the corresponding multi-level loss function for the multi-level self-supervised UNet model; The intermediate metallographic image data is used as the input of the multi-level self-supervised UNet model, and the label data corresponding to the intermediate metallographic image data is used as the output of the multi-level self-supervised UNet model to train the multi-level self-supervised UNet model. The trained multi-level self-supervised UNet model is used to segment the pearlite in the subsequent metallographic image data.
2. The method for pearlite segmentation of metallographic images of metallic materials based on multi-level self-supervised methods according to claim 1, characterized in that, The specific process of acquiring multiple metallographic image data of metallic materials to create a metallographic image dataset is as follows: A1. Select a metallic material and sample the metallic material to obtain initial metallographic image data of the metallic material; A2. The initial metallographic image data is filtered and cropped to obtain intermediate metallographic image data, thereby forming a metallographic image dataset.
3. The method for pearlite segmentation of metallographic images of metallic materials based on multi-level self-supervised methods according to claim 2, characterized in that, In A1, sampling and preparing the metal material to obtain initial metallographic image data specifically includes cutting, grinding, etching, polishing, metallographic microscopic observation, micro-area selection, and acquiring initial metallographic images of the metal material.
4. The method for pearlite segmentation of metallographic images of metallic materials based on multi-level self-supervised methods according to claim 1, characterized in that, The specific process for generating label data for each intermediate metallographic image in the metallographic image dataset is as follows: B1. Perform superpixel segmentation on each of the intermediate metallographic images to obtain superpixel samples of the intermediate metallographic images; B2. Perform binary classification on the superpixel samples to generate the label dataset corresponding to the intermediate metallographic image.
5. The method for pearlite segmentation of metallographic images of metallic materials based on multi-level self-supervised methods according to claim 1, characterized in that, The multi-level self-supervised UNet model includes an encoder and a decoder. The encoder includes multiple deep convolutional neural networks. Along the transmission direction of image data, the deep convolutional neural network located downstream of the transmission direction downsamples the image data transmitted from the deep convolutional neural network upstream through strided convolution. The decoder includes multiple sequentially arranged decoding layers. Each deep convolutional neural network is connected to the corresponding decoding layer through skip connections, thereby outputting the downsampled image data from the deep convolutional neural network to the decoding layer. Each decoding layer upsamples the image data input to the decoding layer using bilinear interpolation.
6. The method for pearlite segmentation of metallographic images of metallic materials based on multi-level self-supervised methods according to claim 5, characterized in that, The encoder and decoder are configured with symmetrical upsampling and downsampling.
7. The method for segmenting pearlite from metallographic images of metallic materials based on multi-level self-supervised methods according to claim 5, characterized in that, The label data is downsampled sequentially in the reverse direction of the decoder's data stream to form downsampled labels corresponding to each decoding layer. The loss function of each decoding layer is obtained by combining the predicted value output by each decoding layer with the corresponding downsampled label. The multi-level loss function is obtained by summing the loss functions of each decoding layer in the decoder.
8. The method for pearlite segmentation of metallographic images of metallic materials based on multi-level self-supervised methods according to claim 7, characterized in that, The loss function corresponding to each of the decoding layers is the cross-entropy loss function.
9. The method for pearlite segmentation of metallographic images of metallic materials based on multi-level self-supervised methods according to claim 5, characterized in that, Each of the deep convolutional neural networks consists of two regular convolutional blocks, each of which performs Normalization, ReLU activation, and 3x3 convolution operations in sequence.
10. The method for pearlite segmentation of metallographic images of metallic materials based on multi-level self-supervised methods according to claim 1, characterized in that, Before the intermediate metallographic image data is input to the encoder, each pixel value in the intermediate metallographic image is normalized to data between 0 and 1 to obtain image data.
11. A pearlite segmentation system for metallographic images of metallic materials based on multi-level self-supervised methods, used to implement the pearlite segmentation method for metallographic images of metallic materials based on multi-level self-supervised methods according to any one of claims 1-10, characterized in that, include: The acquisition module is used to acquire initial metallographic image data of multiple metallic materials and preprocess all the initial metallographic image data to obtain corresponding intermediate metallographic image data, so as to create a metallographic image dataset. A label data generation module is used to generate label data for each intermediate metallographic image in the metallographic image dataset. The modeling module is used to design a multi-level self-supervised UNet model and the corresponding multi-level loss function of the multi-level self-supervised UNet model. The training module is used to take the intermediate metallographic image data as the input of the multi-level self-supervised UNet model and the label data corresponding to the intermediate metallographic image data as the output of the multi-level self-supervised UNet model, so as to train the multi-level self-supervised UNet model. The execution module is used to segment the pearlite in the subsequent metallographic image data using the trained multi-level self-supervised UNet model.
12. An electronic device, characterized in that, The method includes at least one processor and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform a multi-level self-supervised method for segmenting pearlite from metallographic images of metallic materials as described in any one of claims 1 to 10.
13. A storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the pearlite segmentation method for metallographic images of metallic materials based on multi-level self-supervised methods as described in any one of claims 1 to 10.