Die steel liquation carbide image recognition and segmentation method, device, equipment and medium

By using an improved deep learning model and semantic segmentation technology, the problems of low efficiency and insufficient accuracy in identifying liquid carbides in mold steel have been solved, achieving high-precision and rapid quantitative analysis of liquid carbides, supporting quality control and process optimization of mold steel.

CN121564337APending Publication Date: 2026-02-24TSINGHUA UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511673689.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-14
Publication Date
2026-02-24

AI Technical Summary

Technical Problem

Existing analytical methods for the analysis of liquid carbides in mold steel are inefficient and lack precision, making it difficult to achieve rapid and quantitative product quality assessment. Traditional methods are also highly subjective and have limited model generalization ability.

Method used

An improved U-Net deep learning model and multiple semantic segmentation models are used, combined with data augmentation and feature fusion techniques, for iterative training to achieve automatic, accurate, and quantitative identification of liquid precipitated carbides.

Benefits of technology

It achieves high-precision identification of liquid-precipitated carbides, with a cross-union ratio of over 0.78, pixel-level accuracy exceeding 92%, and processing speed increased by tens of times, meeting the needs of industrial batch testing and providing reliable quality control indicators.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121564337A_ABST
    Figure CN121564337A_ABST
Patent Text Reader

Abstract

The invention relates to the cross technical field of computer vision and material science, in particular to a die steel liquation carbide image recognition and segmentation method, device and equipment and a medium, and the method comprises the steps: obtaining an original data set of a target die steel material, and carrying out the preprocessing of the original data set, so as to obtain a training data set and a test data set; performing iterative training on the U-Net deep learning model and the multiple semantic segmentation models by using the training data set to obtain a final image segmentation model; inputting a to-be-detected metallographic image into the final image segmentation model to obtain a preliminary segmentation result, and performing post-processing on the preliminary segmentation result to obtain a final segmentation result; and carrying out statistics on the liquation carbide pixel points and the total pixel points in the final segmentation result so as to calculate the liquation carbide area content of the metallographic image to be detected. Therefore, the problems of low efficiency, insufficient precision and the like of a traditional analysis method for the liquidation carbide in the die steel are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the interdisciplinary fields of computer vision and materials science, and in particular to a method, apparatus, equipment, and medium for image recognition and segmentation of liquid carbide in mold steel. Background Technology

[0002] Die steel is a key material for manufacturing molds such as cold stamping dies, hot forging dies, and die casting molds, and its performance directly affects the service life and processing quality of the molds. H13 hot work die steel, as a medium-alloy ultra-high-strength steel, is prone to metallurgical quality defects such as compositional segregation, eutectic carbides, and liquid carbides during smelting and electroslag processes. Impact fracture analysis of H13 hot work die steel shows that liquid carbides are the fundamental reason for the large dispersion of impact values. During service (500-600℃), liquid carbides easily lead to early failure phenomena such as cracking, surface cracking, and collapse of the mold. Therefore, quickly identifying and statistically analyzing the content and distribution of liquid carbides is an essential part of product quality monitoring in industrial production.

[0003] Currently, the analysis of liquid carbides in mold steel mainly faces the following problems: (1) Traditional metallographic analysis methods: rely on manual experience and microscopic observation, which is highly subjective, inefficient and cannot meet the needs of batch processing. The results of different operators vary greatly, making it difficult to achieve standardized analysis.

[0004] (2) Existing image processing technology: Based on traditional algorithms such as threshold segmentation and edge detection, it is inaccurate in detecting the boundary of irregularly shaped liquid carbide, sensitive to noise, prone to artifacts and breaks, requires manual adjustment of parameters, and lacks adaptive ability.

[0005] (3) Conventional deep learning models: When using standard semantic segmentation networks such as U-Net and DeepLab for material defect detection, the following limitations exist: standard networks are prone to losing detailed information when processing small carbides, lack a dedicated post-processing mechanism for carbide morphology characteristics, have limited generalization ability, and have unstable carbide recognition performance under different process conditions.

[0006] (4) Current status of industrial testing: Mold steel manufacturers lack effective liquid carbide analysis and testing methods. The judgment of the billet qualification rate is still mainly based on time-consuming and labor-intensive impact performance testing, which cannot achieve rapid and quantitative product quality assessment.

[0007] Therefore, there is an urgent need for an image recognition and segmentation method for liquid carbide in mold steel that can achieve automatic, accurate, and quantitative identification and analysis of liquid carbide, and solve the problems of low efficiency and insufficient accuracy of traditional methods. Summary of the Invention

[0008] This invention provides a method, apparatus, equipment, and medium for image recognition and segmentation of liquid carbides in mold steel, in order to solve the problems of low efficiency and insufficient accuracy in traditional methods for analyzing liquid carbides in mold steel.

[0009] A first aspect of the present invention provides a method for image recognition and segmentation of carbide precipitation in mold steel, comprising the following steps: Obtain the original dataset of the target mold steel material and preprocess the original dataset to obtain the training dataset and the test dataset; The pre-built U-Net deep learning model and various semantic segmentation models are iteratively trained using the training dataset to obtain the final image segmentation model; The metallographic image to be detected is input into the final image segmentation model to obtain a preliminary segmentation result, and the preliminary segmentation result is post-processed to obtain the final segmentation result; The liquid carbide pixels and total pixels in the final segmentation result are counted to calculate the liquid carbide area content of the metallographic image to be detected.

[0010] Optionally, obtaining the original dataset of the target mold steel material includes: The target mold steel material was subjected to corrosion treatment to obtain a metallographic sample, and metallographic images of multiple different areas were acquired on the metallographic sample. The liquid carbide regions are labeled on the metallographic images of the multiple different regions to construct the original dataset, and the original dataset is preprocessed to obtain the training dataset and the test dataset.

[0011] Optionally, acquiring metallographic images of multiple different regions on the metallographic sample includes: The metallographic sample is magnified to a preset magnification to acquire a metallographic image for each region, wherein the number of liquid carbides in each metallographic image is not less than a preset value.

[0012] Optionally, the step of iteratively training the pre-built U-Net deep learning model and various semantic segmentation models using the training dataset to obtain the final image segmentation model includes: The pre-built U-Net deep learning model is trained using the training dataset to obtain the trained U-Net deep learning model. The training dataset is used to train various pre-built semantic segmentation models to obtain various trained semantic segmentation models; The trained U-Net deep learning model and the various trained semantic segmentation models are evaluated using the test dataset based on the average intersection-union ratio (IU / U) to determine the final image segmentation model.

[0013] Optionally, the step of inputting the metallographic image to be detected into the final image segmentation model to obtain a preliminary segmentation result, and post-processing the preliminary segmentation result to obtain the final segmentation result, includes: The metallographic image to be detected is input into the final image segmentation model to obtain the preliminary segmentation result; The preliminary segmentation results are subjected to color space conversion and morphological filtering to obtain the final segmentation results.

[0014] Optionally, performing color space conversion and morphological filtering on the preliminary segmentation result to obtain the final segmentation result includes: The preliminary segmentation results are converted to the HSV color space to obtain a three-channel image; Based on morphological filtering, the contour area of ​​the connected regions in the three-channel image is calculated, and regions with contour areas smaller than a preset number of pixels are removed to obtain the final segmentation result.

[0015] A second aspect of the present invention provides an image recognition and segmentation device for liquid carbide precipitation in mold steel, comprising: The acquisition module is used to acquire the original dataset of the target mold steel material and preprocess the original dataset to obtain the training dataset and the test dataset. The training module is used to iteratively train the pre-built U-Net deep learning model and various semantic segmentation models using the training dataset to obtain the final image segmentation model. The recognition module is used to input the metallographic image to be detected into the final image segmentation model to obtain a preliminary segmentation result, and to perform post-processing on the preliminary segmentation result to obtain the final segmentation result; The calculation module is used to count the liquid carbide pixels and total pixels in the final segmentation result, so as to calculate the liquid carbide area content of the metallographic image to be detected.

[0016] A third aspect of the present invention provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the image recognition and segmentation method for liquid carbide precipitation in mold steel as described in the above embodiments.

[0017] A fourth aspect of the present invention provides a computer program product, which, when executed by a processor, implements the above-described method for image recognition and segmentation of liquid carbide precipitation in mold steel.

[0018] A fifth aspect of the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method for image recognition and segmentation of liquid carbide precipitation in mold steel.

[0019] The image recognition and segmentation method, apparatus, equipment, and medium for liquid carbide in mold steel proposed in this invention, through an improved network architecture and feature fusion mechanism, effectively preserves the boundary details of liquid carbide, achieving an intersection-over-union ratio (IoU) of over 0.78 and a pixel-level accuracy exceeding 92%. Automated processing replaces manual analysis, and batch processing capabilities meet the needs of industrial applications, with detection speed increased by tens of times compared to traditional methods. It provides reliable quantitative indicators for mold steel quality control, supporting process parameter optimization and product quality prediction.

[0020] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0021] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein: Figure 1 This is a flowchart of an image recognition and segmentation method for liquid carbide precipitation in mold steel according to an embodiment of the present invention; Figure 2 This is a schematic diagram illustrating the specific execution of an image recognition and segmentation method for liquid carbide precipitation in mold steel according to an embodiment of the present invention; Figure 3 This is a schematic diagram of a U-Net model structure provided according to an embodiment of the present invention; Figure 4 This is a schematic diagram of the prediction results of different models according to an embodiment of the present invention, wherein (a) is the prediction accuracy of each model, (b) is the original image in the test set, (c) is the corresponding annotation information, (d) is the prediction result of the UNET model, (e) is the prediction result of the KNET model, (f) is the prediction result of the Mask2Former model, (g) is the prediction result of the DeepLabV3+ model, and (h) is the prediction result of the PSPNET model. Figure 5 This is a schematic diagram of the identification result of the current H13 mold steel microstructure according to an embodiment of the present invention, wherein (a) is a schematic diagram of the OM image and (b) is a schematic diagram of the identification result of the current model; Figure 6 This is a block diagram of an image recognition and segmentation device for liquid carbide precipitation in mold steel according to an embodiment of the present invention; Figure 7 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention.

[0022] Explanation of reference numerals in the attached figures: 60-Image recognition and segmentation device for liquid carbide in mold steel, 601-Acquisition module, 602-Training module, 603-Recognition module, 604-Calculation module, 701-Memory, 702-Processor, 703-Communication interface. Detailed Implementation

[0023] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.

[0024] The following description, with reference to the accompanying drawings, outlines an embodiment of the method, apparatus, equipment, and medium for image recognition and segmentation of liquid carbide in mold steel according to the present invention.

[0025] Figure 1 This is a flowchart illustrating an image recognition and segmentation method for liquid carbide precipitation in mold steel, provided in an embodiment of the present invention.

[0026] like Figure 1 As shown, the image recognition and segmentation method for liquid carbide precipitation in mold steel includes the following steps: In step S101, the original dataset of the target mold steel material is obtained, and the original dataset is preprocessed to obtain the training dataset and the test dataset.

[0027] In some embodiments, obtaining the original dataset of the target mold steel material includes: The target mold steel material was subjected to corrosion treatment to obtain metallographic specimens, and metallographic images of multiple different areas were acquired on the metallographic specimens. Liquid carbide regions were labeled on metallographic images of multiple different regions to construct the original dataset. The original dataset was then preprocessed to obtain the training and test datasets.

[0028] In some embodiments, metallographic images of multiple different regions are acquired on the metallographic sample, including: The metallographic sample is magnified to a preset magnification so that a metallographic image is acquired for each region, wherein the number of liquid carbides in each metallographic image is not less than a preset value.

[0029] In actual implementation, such as Figure 2 As shown, a metallographic sample is prepared on the target mold steel material, and image data is collected from N different regions on the metallographic sample. At a magnification of X (X must be able to clearly distinguish the characteristics of liquid carbides), one metallographic image is collected for each region, and the number of liquid carbides in each metallographic image is not less than 50. Furthermore, the metallographic images of regions 1 to N are over-etched to enhance the contrast between the liquid carbide and the matrix, and the liquid carbide regions are labeled based on material science standards (such as size greater than 5μm and irregular shape) to form a "label map", which serves as the output data of the deep learning model, while the metallographic photographs serve as the input data of the deep learning model. Furthermore, image processing software is used to resize the over-etched "annotation image" to match the pixel size of the metallographic image, achieving a one-to-one correspondence between the pixels of the metallographic image and the "annotation image". Then, the metallographic image and the "annotation image" are cropped into M sub-images (M=N×E, where E represents the number of sub-images per image), establishing the original dataset for the deep learning model. The original dataset contains M metallographic sub-images and M annotation sub-images, divided into training and testing datasets in a 6:4 ratio.

[0030] Finally, data augmentation methods were used to expand the samples in the original dataset, including rotating them clockwise by 90°, 180° and 270°, and adding the rotated images to the original dataset, which increased the number of training set samples by 3 times and improved the model's generalization ability.

[0031] In step S102, the pre-built U-Net deep learning model and various semantic segmentation models are iteratively trained using the training dataset to obtain the final image segmentation model.

[0032] In some embodiments, a pre-built U-Net deep learning model and various semantic segmentation models are iteratively trained using a training dataset to obtain a final image segmentation model, including: The pre-built U-Net deep learning model is trained using the training dataset to obtain the trained U-Net deep learning model. Multiple pre-built semantic segmentation models are trained using a training dataset to obtain multiple trained semantic segmentation models; The average intersection-over-union ratio (IoU) was used to evaluate the trained U-Net deep learning model and various trained semantic segmentation models using a test dataset to determine the final image segmentation model.

[0033] In actual implementation, such as Figure 3As shown, a U-Net deep learning model is constructed, which consists of an encoder path (compression path) and a decoder path (expansion path). The encoder path contains four convolutional layers, each followed by a max-pooling operation; the decoder path contains four deconvolutional layers, each followed by an upsampling operation; feature fusion is performed between corresponding layers in the encoder and decoder through skip connections.

[0034] The convolution operation uses a 3×3 convolution kernel, and its mathematical expression is:

[0035] in, x For the input feature map, For convolution kernel weights, b For bias terms, y To output the feature map, i To output the row index of a pixel in the feature map. j To output the column index of a pixel in the feature map, k This refers to the channel index or filter index of the output feature map. m This is the row index in the convolution kernel. n For column indices in the convolution kernel, c The channel index of the input feature map.

[0036] The activation function used is LeakyReLU, defined as:

[0037] in, Setting it to 0.1 allows for small gradients with negative inputs.

[0038] Batch normalization is applied to the training dataset to obtain a new training dataset, as shown in the formula:

[0039] in, For the first i One data point, This is the average of the batch data. The variance of the batch data. It is a constant, taking the value 10. -5 , and These are the training parameters for the network. The normalized data is then subjected to scaling and translation operations, resulting in the final output.

[0040] Furthermore, the input data (metallographic sub-images) and output data (labeled sub-images) from the new training dataset are input into the U-Net model, and the Adam optimizer is used for training and parameter optimization. The parameter update formula for the Adam optimizer is:

[0041] in, and These are the first and second moments of the gradient, respectively. For a moment t gradient, and The decay rate (default 0.9 and 0.999). The learning rate (initially set to 0.0001). It is the numerical stability constant. In the first t The model parameter vector at each iteration (time step) contains the current values ​​of all weights and biases in the neural network. This is the first-order moment estimate after bias correction, representing the exponentially weighted moving average of the gradient direction.

[0042] The loss function is solved using the mean absolute error (MAE). The specific expression is as follows:

[0043] in, For real labels, These are the model's predicted values. N This represents the number of samples.

[0044] During training, the batch size was set to 8, the number of iterations was 10,000, and the model performance was monitored using a validation set. An early stopping strategy was adopted to prevent overfitting.

[0045] Furthermore, multiple semantic segmentation models, including U-Net, KNET, Mask2Former, DeepLabV3+, and PSPNet, were trained using the same training dataset. Finally, the performance of each model was systematically evaluated using metrics such as intersection-over-union ratio, pixel accuracy, and relative error, and the most suitable model and parameters were selected, as detailed below: The trained U-Net deep learning model and various trained semantic segmentation models were evaluated using the test dataset based on the average intersection-over-union (MIoU) metric, as shown in the following formula:

[0046] in, Indicates category a Predicted as category b Quantity, This represents the number of categories for the classification task (3 in this example: background, matrix, and liquid carbides). If the mean MIoU of the test set data is greater than 75%, the model meets the application requirements; otherwise, adjust the optimizer learning rate, loss function, or number of iterations and retrain.

[0047] Finally, the following evaluation function is used to select the final image segmentation model from the trained U-Net deep learning model and various trained semantic segmentation models:

[0048] in, These are adjustable weighting coefficients. Accuracy For accuracy, RelativeError This represents the relative error.

[0049] In step S103, the metallographic image to be detected is input into the final image segmentation model to obtain a preliminary segmentation result, and the preliminary segmentation result is post-processed to obtain the final segmentation result.

[0050] In some embodiments, the metallographic image to be detected is input into the final image segmentation model to obtain a preliminary segmentation result, and the preliminary segmentation result is post-processed to obtain a final segmentation result, including: The metallographic image to be detected is input into the final image segmentation model to obtain preliminary segmentation results; The initial segmentation results are subjected to color space conversion and morphological filtering to obtain the final segmentation results.

[0051] In step S104, the liquid carbide pixels and total pixels in the final segmentation result are counted to calculate the liquid carbide area content of the metallographic image to be detected.

[0052] In some embodiments, color space conversion and morphological filtering are performed on the preliminary segmentation results to obtain the final segmentation results, including: The initial segmentation results are converted to the HSV color space to obtain a three-channel image; Based on morphological filtering, the contour area of ​​the connected regions in the three-channel image is calculated, and regions with contour areas smaller than a preset number of pixels are removed to obtain the final segmentation result.

[0053] In actual execution, the metallographic image to be detected is input into the final image segmentation model to obtain preliminary segmentation results, and then the preliminary segmentation results are post-processed as follows: The formula for converting an RGB image to the HSV color space is:

[0054] Where R, G, and B are normalized RGB channel values, and H, S, and V are the hue, saturation, and brightness of the image, respectively.

[0055] Furthermore, threshold detection of the liquid-precipitated carbide region is set based on the HSV color space:

[0056] Morphological operations are used to filter noisy regions, and the area of ​​the connected region contour is calculated. If the filtered area is less than a threshold, the region is filtered out. The final segmentation result is obtained by dividing the region into 100 pixels. The specific formula is as follows:

[0057] Based on the final segmentation results, the quantitative characteristics of the precipitated carbides are statistically analyzed. Specifically, the area content of the precipitated carbides is obtained by calculating the proportion of pixels containing precipitated carbides to the total number of pixels, using the following formula:

[0058] in, This refers to the content of carbides obtained from liquid precipitation. This represents the number of pixels in the liquid-precipitated carbide. This represents the total number of pixels in the image.

[0059] Finally, the quantity, size distribution, and other characteristics of the liquid-precipitated carbides can be statistically analyzed to generate a quantitative analysis report.

[0060] The following detailed description of the image recognition and segmentation method for liquid carbide precipitation in mold steel proposed in this invention is illustrated by a specific embodiment.

[0061] Step 1: Establish the original dataset for the target mold steel material through metallographic experiments and over-etching treatment. The original dataset includes metallographic photographs and labeled images. In this embodiment, the metallographic photographs are 2758×2208 pixels. The specific steps are as follows: Step 1.1: Conduct metallographic experiments to acquire image data of the target mold steel material.

[0062] A 4% nitric acid alcohol solution was used to extend the etching time to 1.5 times the standard time, enhancing the contrast between the precipitated carbides and the matrix. Image data was collected from N different regions on the metallographic sample after etching. At X magnification, one metallographic photograph was taken from each region (region 1 to region N), with a resolution of no less than 2758×2208 pixels. The X-ray magnification should be sufficient to clearly distinguish the characteristics of liquid carbides, with the number of liquid carbides in each metallographic photograph not less than 50. In this embodiment, H13 hot work die steel was used. The magnification selected for the metallographic experiment was X = 500, and a total of 40 regions were selected for image acquisition. The image resolution was 2758 × 2208 pixels.

[0063] Step 1.2: Annotate the metallographic photographs Based on materials science standards, metallographic photographs of regions 1 to N were labeled by metallographic experts with the following criteria: size greater than 5μm, irregular shape, and significant contrast difference with the matrix.

[0064] In this example, the region N=40 is labeled with a magnification of X=500 to establish the original dataset of the target mold steel material. The original dataset contains 40 metallographic photographs and their corresponding labeled images.

[0065] Step 2: Preprocess the original dataset and build the training dataset.

[0066] Step 2.1: Use the OpenCV toolbox image processing software to process the pixel size of the labeled image to form an image with the same pixel size as the metallographic image, so as to achieve the correspondence between the pixels of the metallographic image and the labeled image; In this example, the processed labeled image is processed into a 128×128 pixel image using the OpenCV toolbox, which is consistent with the preprocessed metallographic image.

[0067] Step 2.2: Crop the metallographic photographs and labeled images into M 128×128 pixel sub-images, where M = N×E, and E represents the number of 128×128 pixel sub-images to be cut from each metallographic image or labeled image. Establish a new original dataset for the deep learning model. The new original dataset contains M 128×128 pixel metallographic sub-images and M 128×128 pixel labeled sub-images. Divide the established new original dataset into training set and test set using a 6:4 ratio. In this example, E = 792, so after cropping, a total of M = 31680 sub-images of 128×128 pixels can be obtained. Of the forty original images, 32 are used for the training set (25344 sub-images) and 8 are used for the test set (6336 sub-images).

[0068] Step 2.3: Using data augmentation, all samples in the new original dataset are rotated clockwise by 90°, 180° and 270° respectively. Then, these rotated images are added to the new original dataset, increasing the number of samples in the original training set by 4 times.

[0069] The generated subimages were cleaned by removing problematic labels, as some subimages might lack labels or have very small labels. This resulted in a training set of 5424 images and a test set of 211 images. In this example, data augmentation increased the number of samples in the training set to 5635.

[0070] Step 3: Build a U-Net deep learning model based on the training dataset from Step 2. Since the current training dataset contains a limited amount of image data, the U-Net deep learning model, which is suitable for few-shot problems, was chosen. Figure 3 As shown; Step 3.1: Build an improved U-Net deep learning model. The encoder path contains a four-level downsampling structure, with each level using two convolutional layers and one max-pooling layer. The number of channels increases progressively from 64 to 512. The convolutional layers use 3×3 convolutional kernels, batch normalization is used to accelerate the training process, and linear units with leakage correction are used as activation functions.

[0071] The bottleneck layer employs 1024 feature channels and includes two convolutional layers, using random deactivation to prevent overfitting. The decoder path contains a four-stage upsampling structure, with each stage using a transposed convolutional layer for 2x upsampling, followed by two convolutional layers. Skip connections are used to concatenate the feature maps of each layer in the encoder with the corresponding feature maps in the decoder, preserving spatial details. This operation allows features extracted during convolution to be directly superimposed into the image reconstruction during deconvolution, thus preserving image details and making full use of small sample data.

[0072] The output layer uses 1×1 convolutions to map the number of feature channels to the number of target categories, and uses a sigmoid activation function to output the probability of each pixel belonging to each category. The model training uses mean absolute error as the loss function, employs adaptive moment estimation for parameter optimization, sets the batch size to 8, and performs 10,000 training iterations.

[0073] The convolutional layer uses a 3×3 convolutional kernel, and the activation function chosen is LeakyReLU. The LeakyReLU formula is as follows:

[0074] in, x To improve the convergence rate and accuracy of the model by using numerical inputs, batch normalization is employed, as shown in the following formula:

[0075] in, For the first i One data point, This is the average of the batch data. The variance of the batch data. It is a constant, taking the value 10. -5 , and These are the training parameters for the network. The normalized data is then subjected to scaling and translation operations, resulting in the final output.

[0076] Step 3.2: Input the input and output data of the deep learning model from Step 2 into the deep learning model respectively, train the deep learning model using the Adam optimizer, and optimize the parameters. The formula for the Adam optimizer is as follows:

[0077] in, and These are the first and second moments of the gradient, respectively. For learning rate, For the first t The mean of the sample loss with respect to the parameter gradient during each training iteration. It is a very small positive number, taking the value 10. -7 , and The attenuation rate is represented by values ​​of 0.9 and 0.999, respectively. In the first t The model parameter vector at each iteration (time step) contains the current values ​​of all weights and biases in the neural network. This is the first-order moment estimate after bias correction, representing the exponentially weighted moving average of the gradient direction; The mean absolute error was used as the performance metric during parameter optimization; the number of training iterations was set to [number missing]. n .

[0078] In this example, the learning rate Set to 10 -4 To ensure model convergence, the number of training iterations... n The maximum value is set to 10000. The mean absolute error is used as the evaluation metric for model performance during training.

[0079] Step 3.3: Train multiple semantic segmentation models on the same dataset, including U-Net, KNET, Mask2Former, DeepLabV3+, and PSPNet. After the deep learning models are trained, test their predictive capabilities using data from the test set. The accuracy of the prediction results is evaluated using the MIoU metric to determine the final image segmentation model. The MIoU metric characterizes the proportion of overlap between the model's predictions and the actual results for different categories, and the formula is as follows:

[0080] in, Indicate category a Predicted as category b Quantity, The number of categories representing the classification task. For category a The number of all pixels; if the mean MIoU of the prediction results in the test set is greater than 75%, the model accuracy meets the application requirements; otherwise, return to step 3.2, and retrain the deep learning model by adjusting the optimizer learning rate, changing the training process evaluation function, and adjusting the number of iterations until the application requirements are met.

[0081] Comparative analysis shows that the KNET model performs best in the liquid carbide identification task, with the smallest relative error and the highest identification accuracy. Therefore, KNET was selected as the final deployment model. This model can accurately identify liquid carbides larger than 5 micrometers in size, and its segmentation effect on irregular boundaries is significantly better than traditional methods.

[0082] In this example, the training model achieved a prediction accuracy (MIoU) of 78.4% on the test set data, indicating high prediction precision. This means the model can accurately identify liquid carbides in H13 die steel. Specific prediction results are as follows: Figure 4 As shown.

[0083] Step 4: Calculate the content of precipitated carbides by statistically predicting the proportion of pixels in the image to achieve tissue quantification. Based on the U-Net deep learning model, the metallographic image is input, and the corresponding segmented image is output after semantic segmentation. The segmentation results output by the model are post-processed and optimized. First, the image in RGB color space is converted to HSV color space, and precipitated carbide regions are detected based on hue, saturation, and lightness components. By setting a color threshold, red areas are identified as precipitated carbides, blue areas as background, and white areas as matrix tissue. Morphological operations are used to filter noise regions, and the contour area of ​​each connected region is calculated. Regions with an area less than 100 pixels are identified as noise and removed. Boundary regions are smoothed to improve the visual quality and quantitative statistical accuracy of the segmentation results. The content of precipitated carbides is calculated by statistically analyzing the proportion of pixels with precipitated carbides to the total number of pixels using the OpenCV image processing software. The calculation formula is as follows:

[0084] in, This refers to the content of carbides obtained from liquid precipitation. This represents the number of pixels in the liquid-precipitated carbide. This represents the total number of pixels in the image.

[0085] In this example, the test set images were calculated to contain 2.1% liquid carbide; traditional manual metallographic analysis yielded a quantification result of 2.3% for the same liquid carbide in the same image. This demonstrates that the current method's quantitative result is very close to the manual analysis result, exhibiting excellent accuracy and practicality. Specific identification results are as follows... Figure 5 As shown, the method of the present invention can effectively identify liquid carbides in H13 mold steel, providing a reliable technical means for the quality control of mold steel.

[0086] In summary, the image recognition and segmentation method for liquid carbide precipitation in mold steel proposed in this embodiment of the invention has the following beneficial effects: (1) In terms of recognition accuracy: On the test set, the cross-union ratio reached 0.7843, the pixel-level accuracy reached 0.9215, and the detection rate of liquid precipitated carbides with a size greater than 5 micrometers reached 100%; (2) In terms of processing efficiency: Compared with traditional manual analysis methods, the processing speed is increased by more than 25 times, which can meet the needs of industrial batch testing; (3) Industrial applications: Successfully implemented in mold steel manufacturing enterprises, the results of liquid carbide identification are highly consistent with the judgment of metallographic experts, providing a reliable basis for process optimization and quality control; (4) Economic benefits: By identifying and controlling liquid carbides in advance, the yield of products can be improved and early mold failure can be reduced, resulting in significant economic benefits.

[0087] Next, referring to the accompanying drawings, we describe the mold steel liquid carbide image recognition and segmentation device proposed according to an embodiment of the present invention.

[0088] Figure 6 This is a block diagram illustrating an image recognition and segmentation method for liquid carbide precipitation in mold steel according to an embodiment of the present invention.

[0089] like Figure 6 As shown, the mold steel liquid carbide image recognition and segmentation device 60 includes: an acquisition module 601, a training module 602, a recognition module 603, and a calculation module 604.

[0090] The acquisition module 601 acquires the original dataset of the target mold steel material and preprocesses it to obtain training and testing datasets. The training module 602 iteratively trains a pre-built U-Net deep learning model and various semantic segmentation models using the training dataset to obtain the final image segmentation model. The recognition module 603 inputs the metallographic image to be detected into the final image segmentation model to obtain preliminary segmentation results and performs post-processing on these results to obtain the final segmentation result. The calculation module 604 counts the liquid carbide pixels and total pixels in the final segmentation result to calculate the liquid carbide area content of the metallographic image to be detected.

[0091] In some embodiments, the acquisition module 601 includes: The acquisition unit is used to perform over-etching treatment on the target mold steel material to obtain a metallographic sample, and to acquire metallographic images of multiple different areas on the metallographic sample. The annotation unit is used to annotate the liquid carbide regions on metallographic images of multiple different regions to construct the original dataset, and to preprocess the original dataset to obtain the training dataset and the test dataset.

[0092] In some embodiments, the metallographic sample is magnified to a preset magnification in the acquisition unit to acquire a metallographic image for each region, wherein the number of liquid carbides in each metallographic image is not less than a preset value.

[0093] In some embodiments, the training module 602 includes: The first training unit is used to train the pre-built U-Net deep learning model using the training dataset to obtain the trained U-Net deep learning model. The second training unit is used to train multiple pre-built semantic segmentation models using the training dataset to obtain multiple trained semantic segmentation models. The comparison unit is used to evaluate the trained U-Net deep learning model and various trained semantic segmentation models using the test dataset, based on the average intersection-over-union (IoU) metric, in order to determine the final image segmentation model.

[0094] In some embodiments, the identification module 603 includes: The segmentation unit is used to input the metallographic image to be detected into the final image segmentation model to obtain preliminary segmentation results; The transformation and filtering unit is used to perform color space transformation and morphological filtering on the preliminary segmentation results to obtain the final segmentation results.

[0095] In some embodiments, the conversion and filtering unit includes: The transformation subunit is used to transform the initial segmentation results to the HSV color space to obtain a three-channel image; The filtering subunit is used to calculate the contour area of ​​the connected regions in the three-channel image based on morphological filtering, and remove regions with contour areas smaller than a preset number of pixels to obtain the final segmentation result.

[0096] It should be noted that the foregoing explanation of the embodiment of the image recognition and segmentation method for liquid carbide in mold steel also applies to the image recognition and segmentation device for liquid carbide in mold steel in this embodiment, and will not be repeated here.

[0097] The image recognition and segmentation device for liquid carbide precipitation in mold steel proposed in the embodiments of the present invention has the following beneficial effects: (1) In terms of recognition accuracy: On the test set, the cross-union ratio reached 0.7843, the pixel-level accuracy reached 0.9215, and the detection rate of liquid precipitated carbides with a size greater than 5 micrometers reached 100%; (2) In terms of processing efficiency: Compared with traditional manual analysis methods, the processing speed is increased by more than 25 times, which can meet the needs of industrial batch testing; (3) Industrial applications: Successfully implemented in mold steel manufacturing enterprises, the results of liquid carbide identification are highly consistent with the judgment of metallographic experts, providing a reliable basis for process optimization and quality control; (4) Economic benefits: By identifying and controlling liquid carbides in advance, the yield of products can be improved and early mold failure can be reduced, resulting in significant economic benefits.

[0098] Figure 7 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention.

[0099] The electronic device may include: a memory 701, a processor 702, and a computer program stored on the memory 701 and capable of running on the processor 702.

[0100] When the processor 702 executes the program, it implements the image recognition and segmentation method for liquid carbide precipitation in mold steel provided in the above embodiments.

[0101] Furthermore, electronic devices also include: Communication interface 703 is used for communication between memory 701 and processor 702.

[0102] The memory 701 is used to store computer programs that can run on the processor 702.

[0103] The memory 701 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.

[0104] If the memory 701, processor 702, and communication interface 703 are implemented independently, then the communication interface 703, memory 701, and processor 702 can be interconnected via a bus to complete communication between them. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, Figure 7 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0105] Optionally, in a specific implementation, if the memory 701, processor 702, and communication interface 703 are integrated on a single chip, then the memory 701, processor 702, and communication interface 703 can communicate with each other through an internal interface.

[0106] The processor 702 may be a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention.

[0107] This invention also provides a computer program product, which, when executed by a processor, implements the above-described method for image recognition and segmentation of liquid carbide deposits in mold steel.

[0108] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method for image recognition and segmentation of liquid carbide deposits in mold steel.

[0109] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0110] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "N" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0111] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or N executable instructions for implementing custom logic functions or processes, and the scope of preferred embodiments of the invention includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as will be understood by those skilled in the art to which embodiments of the invention pertain.

[0112] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.

[0113] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the N steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. If implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0114] Those skilled in the art will understand that all or part of the steps of the methods described in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it includes one or a combination of the steps of the method embodiments.

[0115] Furthermore, the functional units in the various embodiments of the present invention can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.

[0116] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present invention.

Claims

1. A method for image recognition and segmentation of liquid carbide precipitation in mold steel, characterized in that, Includes the following steps: Obtain the original dataset of the target mold steel material and preprocess the original dataset to obtain the training dataset and the test dataset; The pre-built U-Net deep learning model and various semantic segmentation models are iteratively trained using the training dataset to obtain the final image segmentation model; The metallographic image to be detected is input into the final image segmentation model to obtain a preliminary segmentation result, and the preliminary segmentation result is post-processed to obtain the final segmentation result; The liquid carbide pixels and total pixels in the final segmentation result are counted to calculate the liquid carbide area content of the metallographic image to be detected.

2. The method for image recognition and segmentation of liquid carbide precipitation in mold steel according to claim 1, characterized in that, The process of obtaining the original dataset of the target mold steel material includes: The target mold steel material was subjected to corrosion treatment to obtain a metallographic sample, and metallographic images of multiple different areas were acquired on the metallographic sample. The liquid carbide regions are labeled on the metallographic images of the multiple different regions to construct the original dataset, and the original dataset is preprocessed to obtain the training dataset and the test dataset.

3. The method for image recognition and segmentation of liquid carbide precipitation in mold steel according to claim 2, characterized in that, The acquisition of metallographic images of multiple different regions on the metallographic sample includes: The metallographic sample is magnified to a preset magnification to acquire a metallographic image for each region, wherein the number of liquid carbides in each metallographic image is not less than a preset value.

4. The method for image recognition and segmentation of liquid carbide precipitation in mold steel according to claim 1, characterized in that, The step of iteratively training a pre-built U-Net deep learning model and various semantic segmentation models using the training dataset to obtain the final image segmentation model includes: The pre-built U-Net deep learning model is trained using the training dataset to obtain the trained U-Net deep learning model. The training dataset is used to train various pre-built semantic segmentation models to obtain various trained semantic segmentation models; The trained U-Net deep learning model and the various trained semantic segmentation models are evaluated using the test dataset based on the average intersection-union ratio (IU / U) to determine the final image segmentation model.

5. The method for image recognition and segmentation of liquid carbide precipitation in mold steel according to claim 1, characterized in that, The step of inputting the metallographic image to be detected into the final image segmentation model to obtain a preliminary segmentation result, and then post-processing the preliminary segmentation result to obtain the final segmentation result, includes: The metallographic image to be detected is input into the final image segmentation model to obtain the preliminary segmentation result; The preliminary segmentation results are subjected to color space conversion and morphological filtering to obtain the final segmentation results.

6. The method for image recognition and segmentation of liquid carbide precipitation in mold steel according to claim 4, characterized in that, The step of performing color space conversion and morphological filtering on the preliminary segmentation result to obtain the final segmentation result includes: The preliminary segmentation results are converted to the HSV color space to obtain a three-channel image; Based on morphological filtering, the contour area of ​​the connected regions in the three-channel image is calculated, and regions with contour areas smaller than a preset number of pixels are removed to obtain the final segmentation result.

7. A device for image recognition and segmentation of liquid carbide precipitation in mold steel, characterized in that, include: The acquisition module is used to acquire the original dataset of the target mold steel material and preprocess the original dataset to obtain the training dataset and the test dataset. The training module is used to iteratively train the pre-built U-Net deep learning model and various semantic segmentation models using the training dataset to obtain the final image segmentation model. The recognition module is used to input the metallographic image to be detected into the final image segmentation model to obtain a preliminary segmentation result, and to perform post-processing on the preliminary segmentation result to obtain the final segmentation result; The calculation module is used to count the liquid carbide pixels and total pixels in the final segmentation result, so as to calculate the liquid carbide area content of the metallographic image to be detected.

8. An electronic device, characterized in that, include: The method includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the image recognition and segmentation method for liquid carbide precipitation in mold steel as described in any one of claims 1-6.

9. A computer program product, characterized in that, When the computer program / instruction is executed by the processor, it implements the image recognition and segmentation method for liquid carbide in mold steel as described in any one of claims 1-6.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, The program is executed by the processor to implement the image recognition and segmentation method for liquid carbide in mold steel as described in any one of claims 1-6.