Intelligent method and system for rating grain size of medium-low carbon steel
By employing deep learning and mathematical statistics, the problems of low detection accuracy and poor consistency in traditional methods have been solved, enabling automated rating of grain size in medium and low carbon steel and improving detection efficiency and accuracy.
Patent Information
- Application Number
- CN202210967339.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-12
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2042-08-12
AI Technical Summary
In existing technologies, grain size detection methods are time-consuming and highly subjective, and existing image analysis algorithms cannot effectively solve the problems of blurred grain boundaries and missing grain boundaries, resulting in low detection accuracy and poor result consistency.
Using deep learning and mathematical statistics, a database of image-label-magnification-grain size levels is established. An improved neural network is used for grain boundary extraction, and combined with mathematical statistics, the grain size of low-carbon steel is automatically rated.
It improves the efficiency and accuracy of grain size detection, reduces human error, and achieves highly efficient and automated grain size rating, saving time and labor costs.
Smart Images

Figure CN115345846B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of metal average grain size calculation, in particular to a low-carbon steel grain size intelligent determination method and system based on deep learning and mathematical statistics, which is suitable for the rating of medium and low carbon content hot-rolled, annealed and normalized steel products. BACKGROUND
[0002] Microstructure is known as the genetic code of metal materials. Metallographic analysis is a science that studies the microstructure of metal materials and determines the relationship between such microstructure and macroscopic performance. There is a corresponding function relationship between the microstructure characteristics of microstructure features, quantity, morphology, size, distribution, orientation, spatial arrangement state and the macroscopic mechanical and physical properties of the material. Grain size is a parameter for describing the grain size of polycrystalline materials, and is one of the most important indicators in the microstructure of materials. Grain size has an important influence on the performance of metal materials. Generally, the smaller the grain size, the higher the strength, plasticity and toughness of the metal material, and the better the comprehensive mechanical properties of the material. Therefore, grain size is a technical index that needs to be strictly controlled in metal material processing, especially in hot processing technology, and is also a necessary inspection item for metallographic analysis in various metal material standards.
[0003] According to the national standard GB6394-2017 "Metal Average Grain Size Rating Method", the commonly used rating methods for metal material average grain size are comparison method, intercept method and area method. The comparison method is to compare with the standard series rating chart to give the closest level; the intercept method is to calculate the intercept number of the experimental line segment with a known length intersecting the grain boundary, and to determine the grain size level by the intercept number per unit length; and the area method is to count the number of grains in a given area, and then calculate the average area of the grains to determine the grain size level.
[0004] In the existing rating methods, the accuracy of the intercept method and the area method is higher. At present, these two methods are mainly measured, calculated and rated by artificial. This traditional rating method is time-consuming, subjective, has the problems of poor measurement accuracy, non-uniform statistical results and low efficiency, and seriously affects the research and application of metal materials in production and life.
[0005] With the development of machine learning, image processing and other technologies, intelligent detection gradually emerges in various fields. The use of image processing technology to analyze the microstructure of metals has been widely used in industry, and has high automation and can obtain accurate measurement results in a short time. However, the algorithms used for average grain size rating at present still have the problems of low detection accuracy and inability to solve the missing grain boundary, and further research is still needed to improve the accuracy of intelligent detection. SUMMARY
[0006] The purpose of the present application is to solve the problems of existing technology, such as the dependence on manual operation for solving grain size, high work intensity, low detection efficiency, large grain boundary recognition and statistical error, and low result consistency, especially in the calculation of grain size under the interference of fuzzy grain boundaries and missing grain boundaries in part of metallographic photos.
[0007] To achieve the above purpose, the technical scheme adopted by the present application is as follows:
[0008] On the one hand, the present application proposes an intelligent rating method for medium and low carbon steel grain size based on deep learning and mathematical statistics, which includes the following steps:
[0009] Step 1: Collect metallographic pictures, and perform data set annotation on the pictures, including clear grain boundaries, fuzzy grain boundaries and discontinuous (partly missing) grain boundaries, and establish a database of image-label-magnification-grain size level;
[0010] Step 2: Use an improved neural network based on CNN to extract grain boundaries, divide the input picture into sub-pictures with a size of 256x256 using equal step, obtain a complete grain boundary extraction graph of the original input size by training a grain boundary extraction model and then testing it;
[0011] Step 3: Use the four-circle intercept point method to perform preliminary intercept point statistics in the graph;
[0012] Step 4: Numerically infer the missing grain boundaries by a mathematical statistics method, and infer the intercept point number of the large carbon block area based on the confidence;
[0013] Step 5: Use the formula
[0014]
[0015] N=N1+N2
[0016] to solve the grain size corresponding to each circle; wherein G is the number of crystal levels, M is the magnification, L is the circumference of the circular grid, N is the number of nodes on the circle, N1 is the preliminary statistical intercept point number, and N2 is the number of hidden intercept points inferred by mathematical statistics.
[0017] Step 6: Average the grain sizes corresponding to the four circles to obtain the final grain size.
[0018] Further, in step 1, the data set annotation is completed using Labelme, and in addition to visible grain boundaries, fuzzy and missing grain boundaries need to be manually annotated.
[0019] Further, in the database of step 1, the image is the original picture of the metallographic picture, the label is the picture after manually marking the grain boundaries (including clear grain boundaries, fuzzy grain boundaries and discontinuous missing grain boundaries), and the magnification is the microscope magnification when the original picture is taken.
[0020] Further, in step 2, during training, the neural network structure is implemented using the pytorch framework, and the network is trained using GPU resources to obtain a grain boundary extraction model; during testing, the divided pictures are subjected to grain boundary extraction, and each segmented grain boundary extraction image is fused based on the Bulgaga method to finally obtain a complete grain boundary extraction image of the original input size;
[0021] Further, in step 2, the basic network uses CNN as the skeleton, and the CNN network is optimized by modifying the number of intermediate layers and the number of neurons in each layer.
[0022] Further, in step S2, the input picture is subjected to equal-width segmentation based on a step size during grain boundary extraction, and the results are combined after being extracted respectively.
[0023] Further, the centers of the four concentric circles are located at the center of the input picture, and the visible intercept point number of each circle is preliminarily counted using the intercept point counting module.
[0024] Further, the radii of the four circles are 84.85mm, 60.6mm, 40.37mm and 20.12mm respectively.
[0025] On the other hand, the present application proposes a low-carbon steel grain size intelligent measurement system based on deep learning and mathematical statistics, which comprises a metallographic image acquisition module, a grain boundary extraction network module, and a mathematical statistics-based intercept point estimation module and an automatic rating module. The system is labeled and trained by collecting a large amount of metallographic image data, gradually optimizing the network, and combining mathematical statistics to optimize the intercept point statistics of the missing grain boundaries to obtain the grain size.
[0026] Further, the metallographic image acquisition module is used to acquire metallographic images, label the data set of the images, and establish a database of image-label-magnification-grain size level;
[0027] The grain boundary extraction network module uses the pytorch framework to build and train the model, and saves the trained model file. After the model is trained, the complete grain boundary extraction image is obtained through testing.
[0028] The intercept point estimation module comprises a visible intercept point number counting module and a hidden intercept point number counting module. The visible intercept point number counting module counts the visible intercept points based on the edge grain boundary binary image output by the grain boundary extraction network and the four-circle intercept point method. The hidden intercept point number counting module inputs the edge grain boundary binary image output by the grain boundary extraction network and estimates the hidden intercept points based on the mathematical statistics method.
[0029] The automatic rating module accumulates the obtained visible intercept number and hidden intercept number to obtain a final intercept number, and then calculates the grain size by using the formula.
[0030] The beneficial effects of the present application are as follows:
[0031] The present application can effectively solve the problems of low efficiency and high labor intensity in manual detection of medium and low carbon steel grain size, and the existing image analysis algorithm cannot solve the problems of extracting fuzzy grain boundaries and missing grain boundaries, thereby improving the detection efficiency and reducing the detection error, and having important pioneering significance in practical application.
[0032] The model training and prediction of the present application are performed in an end-to-end manner, the extraction of grain boundaries greatly reduces the training complexity of the model and improves the running speed of the model by using the block idea. Meanwhile, the entire use process is automatically performed by software, and only the path of the picture to be rated needs to be inputted to automatically process, and finally a rating report is obtained. Under the condition of training by a high-quality data set, the model can stably run, greatly reduces the error of manual rating, and saves the labor cost and time cost. BRIEF DESCRIPTION OF DRAWINGS
[0033] Figure 1 The figure is a model architecture diagram of the present application;
[0034] Figure 2 The figure is a grain size diagram used in the embodiment of the present application;
[0035] Figure 3 The figure is an intercept statistical diagram obtained by the embodiment of the present application; DETAILED DESCRIPTION
[0036] The present application will be described in detail below in combination with the drawings and specific embodiments.
[0037] Embodiment one
[0038] The embodiment provides a medium and low carbon steel grain size intelligent rating method based on deep learning and mathematical statistics, and comprises the following steps:
[0039] Step 1: Collecting metallographic pictures, performing data set labeling on the pictures, including clear grain boundaries, fuzzy grain boundaries and discontinuous (partially missing) grain boundaries, using Labelme to label the grain boundaries, and establishing a database of image-label-magnification-grain size level, wherein the image is an original picture of the metallographic picture, the label is a picture labeled by artificial grain boundaries, and the magnification is a microscope magnification when the original picture is taken;
[0040] Step 2: Extracting grain boundaries using an improved neural network based on CNN, dividing the input picture into sub-pictures with a size of 256x256 using equal step length, using the pytorch framework to realize the neural network structure during training, using GPU resources for network training to obtain the grain boundary extraction model; during testing, the divided picture is subjected to grain boundary extraction, and the extracted grain boundaries of each sub-picture are fused based on the Boolean method to obtain the complete grain boundary extraction picture of the original input size;
[0041] Step 3: Preliminary intercept statistics in the figure using the four-circle intercept point method, with the centers of the four concentric circles located at the center of the input picture, and the intercept point statistics module is used to preliminarily count the number of visible intercept points of each circle.
[0042] Step 4: Numerical speculation of missing grain boundaries by mathematical statistics method, and speculation of intercept points in large carbon block area based on confidence.
[0043] Step 5: Using the formula
[0044]
[0045] N=N1+N2
[0046] Solve the grain size corresponding to each circle; where G is the crystal level number, M is the magnification, L is the circumference of the circular grid, N is the number of nodes on the circle, N1 is the preliminary intercept point count, and N2 is the number of hidden intercept points speculated by mathematical statistics.
[0047] Step S6: Average the grain sizes corresponding to the four circles to obtain the final grain size.
[0048] In step 1 above, the data set annotation is completed using Labelme, and in addition to visible grain boundaries, missing grain boundaries need to be manually annotated.
[0049] In step 2 above, the basic network uses CNN as the skeleton, and the CNN network is optimized by modifying the number of intermediate layers and the number of neurons in each layer.
[0050] In step 2 above, the input picture is divided into equal length and width based on step length during grain boundary extraction, and the results are combined after extraction.
[0051] In step 3 above, the radii of the four circles used are 84.85mm, 60.6mm, 40.37mm, and 20.12mm.
[0052] In step 4 above, the confidence-based method is used to speculate the number of hidden intercept points.
[0053] Example Two
[0054] The embodiment provides an intelligent determination system for grain size of medium and low carbon steel based on deep learning and mathematical statistics, which comprises a metallographic image acquisition module, a grain boundary extraction network module, a cut point speculation module based on mathematical statistics and an automatic rating module. The system gradually optimizes the network through marking and training of a large amount of data, and simultaneously combines mathematical statistics to optimize the cut point number statistics of the missing grain boundaries, so that the whole process is highly automated, the participation of artificial is reduced, and the efficiency of metallographic analysis is improved. Among them:
[0055] The metallographic picture acquisition module is used for acquiring metallographic pictures, performing data set labeling on the pictures, including clear grain boundaries, fuzzy grain boundaries and discontinuous (partially missing) grain boundaries, and establishing a database of image-label-magnification-grain size level;
[0056] In the grain boundary extraction network module, the training of the model is the most critical operation, and the specific training steps are as follows:
[0057] Step 1: use Labelme software to calibrate the original data, the picture size is 2048x1536, mark the visible grain boundaries and fill the extendable grain boundaries. Meanwhile, the picture is named as id_magnification_level.png;
[0058] Step 2: divide the marked picture into 256x256 size pictures with 128 as the step length, and divide the labels in the same way;
[0059] Step 3: input the data set into the neural network for training, use the pytorch framework to build and train the model, and save the trained model file.
[0060] After the model is trained, the test can be started, the 2048x1536 size metallographic picture is input, the program is firstly divided into 256x256 slices with 128 as the step length, the grain boundary extraction model is run for grain boundary extraction, and finally a complete grain boundary extraction picture is obtained.
[0061] The cut point speculation module comprises a visible cut point number statistics module and a hidden cut point number statistics module; wherein:
[0062] The visible cut point number statistics module inputs the edge grain boundary binary graph output by the grain boundary extraction network, and performs preliminary statistics of the cut points based on the four-circle cut point method, and the four circle radii used are 84.85mm, 60.6mm, 40.37mm and 20.12mm.
[0063] The hidden cut point number statistics module inputs the edge grain boundary binary graph output by the grain boundary extraction network, and speculates the hidden cut points based on the mathematical statistics method.
[0064] The automatic rating module accumulates the obtained visible intercept number and hidden intercept number to obtain a final intercept number, and calculates the grain size by using a formula. The grain size chart used in the embodiment is rated, the manual standard level is 12.41, the level tested by using the method is 12.329475, and the error is 0.080524.
[0065] The basic principles, main features and advantages of the present application are shown and described above. It should be understood by those skilled in the art that the above examples do not limit the protection scope of the present application in any form, and any technical solutions obtained by using equivalent replacement or the like fall within the protection scope of the present application.
[0066] The parts not involved in the present application are the same as or can be realized by using the prior art.
Claims
1. A method for intelligently rating the grain size of medium and low carbon steel, characterized in that, Includes the following steps: Step 1: Collect metallographic images, label the images with datasets, including clear grain boundaries, blurred grain boundaries, and discontinuous grain boundaries, and establish a database of image-label-magnification-grain size level; Step 2: Use an improved neural network based on CNN to extract grain boundaries. Divide the input image into sub-images of size 256×256 with equal step size. Train the grain boundary extraction model and then test to obtain the complete grain boundary extraction map of the original input size. Step 3: Output the edge grain boundary binary map through the grain boundary extraction network, and use the four-circle intercept method to perform preliminary statistics on visible intercept points in the edge grain boundary binary map to obtain the preliminary count of intercept points; Step 4: Output the edge grain boundary binary map through the grain boundary extraction network, and use mathematical statistics to numerically infer the missing grain boundaries in the edge grain boundary binary map, and infer the number of cutoff points in the large carbon block region based on the confidence level to obtain the number of hidden cutoff points. Step 5: Use the formula The grain size corresponding to each circle is calculated; where G is the number of crystal levels, M is the magnification factor, L is the perimeter of the circular grid, N is the number of intercept points on the circle, N1 is the preliminary count of intercept points, and N2 is the number of hidden intercept points. Step 6: Average the grain size corresponding to the four circles to obtain the final grain size; In step 1, the dataset is labeled using Labelme. In addition to clearly visible grain boundaries, blurred grain boundaries and missing grain boundaries need to be manually labeled. In the database of step 1, the images are the original metallographic images, the labels are the images after the grain boundaries are manually labeled, and the magnification is the microscope magnification when the original images were taken. In step 2, during model training, the PyTorch framework is used to implement the neural network structure, and GPU resources are used for network training to obtain the grain boundary extraction model. During model testing, grain boundaries are extracted from the segmented images, and the grain boundary extraction maps of each segment are fused based on Boolean addition to obtain a complete grain boundary extraction map of the original input size. The basic network is based on CNN as the skeleton, and the CNN network is optimized by modifying the number of intermediate layers and the number of neurons in each layer, finally obtaining an improved neural network based on CNN. In step 2, the input image is divided into equal length and width segments based on step size during grain boundary extraction, and the results are then merged after extraction.
2. The intelligent grain size rating method for medium and low carbon steel according to claim 1, characterized in that, In step 3, the centers of the four concentric circles are located at the exact center of the input image. The intercept point statistics module is used to perform a preliminary count of the number of visible intercept points for each circle. The radii of the four circles used are 84.85mm, 60.6mm, 40.37mm, and 20.12mm, respectively.
3. A smart grain size determination system for medium and low carbon steel, characterized in that, The system includes a metallographic image acquisition module, a grain boundary extraction network module, a cutoff point prediction module, and an automated rating module. The system collects a large amount of metallographic image data for labeling and training, gradually optimizes the network, and combines mathematical statistics to optimize the count of cutoff points of missing grain boundaries to obtain the grain size. The metallographic image acquisition module is used to acquire metallographic images, annotate the images with datasets, and establish a database of image-label-magnification-grain size level. The grain boundary extraction network module uses the PyTorch framework for model building and training, saves the trained model file, and tests it after the model is trained to finally obtain a complete grain boundary extraction map. The intercept point prediction module includes a visible intercept point count module and a hidden intercept point count module. The visible intercept point count module outputs an edge grain boundary binary map through a grain boundary extraction network and performs preliminary statistics on visible intercept points in the edge grain boundary binary map using the four-circle intercept method to obtain a preliminary count of intercept points. The hidden intercept point count module outputs an edge grain boundary binary map through a grain boundary extraction network and performs numerical prediction of missing grain boundaries in the edge grain boundary binary map using mathematical statistics methods, as well as predicting the number of intercept points in large carbon block regions based on confidence levels to obtain the number of hidden intercept points. The automated rating module uses a formula The grain size corresponding to each circle is calculated; where G is the number of crystal levels, M is the magnification factor, L is the perimeter of the circular grid, N is the number of intercept points on the circle, N1 is the preliminary count of intercept points, and N2 is the number of hidden intercept points; then the grain size corresponding to the four circles is averaged to obtain the final grain size. The dataset annotation was completed using Labelme. In addition to clearly visible grain boundaries, blurred grain boundaries and missing grain boundaries need to be manually labeled. In the database of step 1, the images are the original metallographic images, the labels are the images after the grain boundaries are manually marked, and the magnification is the microscope magnification when the original images were taken. During model training, the PyTorch framework is used to implement the neural network structure, and GPU resources are used for network training to obtain the grain boundary extraction model. During model testing, grain boundaries are extracted from the segmented images, and the grain boundary extraction maps of each segment are fused based on Boolean addition to obtain a complete grain boundary extraction map of the original input size. The basic network is based on CNN as the skeleton, and the CNN network is optimized by modifying the number of intermediate layers and the number of neurons in each layer, finally obtaining an improved neural network based on CNN. In the grain boundary extraction process, the input image is divided into equal length and width segments based on the step size, and the results are then merged after extraction.
Citation Information
Patent Citations
Metallographic grain boundary extraction and communication method based on deep learning
CN113506240A
Method and apparatus for grain size rating of polycrystalline material
CN114140370A
Rock and mine recognition and extraction system and method based on UNET convolutional neural network
CN114663414A