CN-122024229-A - Complex phase composition metallographic phase identification method and system based on partition labeling and regression
Abstract
The invention relates to the technical field of computer image processing and artificial intelligence, and discloses a complex phase composition metallographic recognition method and a complex phase composition metallographic recognition system based on partition labeling and regression, wherein the complex phase composition metallographic recognition method based on partition labeling and regression comprises the steps of defining a phase composition mother set of a microstructure, constructing a data set containing a microstructure image, then performing partition labeling on the microstructure image to obtain a label set, superposing basic calculation blocks based on multi-scale window attention, capturing microstructure characteristics under different scales, and enhancing the adaptability of a model to the microstructures of different scales; meanwhile, a multi-scale window attention superposition transformation model is built, the capability of the model in processing complex phase composition is improved, the mixed condition of multiple phase compositions can be more accurately identified, and a microstructure composition result can be rapidly and accurately output through predicting the trained multi-scale window attention superposition transformation model, so that the processing efficiency is improved.
Inventors
- LIU QING
- TONG KE
- BAI XIAOLIANG
- CONG SHEN
- ZHANG YINGJUN
Assignees
- 中国石油天然气集团有限公司
- 中国石油集团工程材料研究院有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20241112
Claims (10)
- 1. The complex phase composition metallographic phase identification method based on partition labeling and regression is characterized by comprising the following steps of: defining a phase composition mother set of the microstructure, and constructing a data set containing a microstructure image based on the phase composition mother set; Carrying out partition labeling on a data set of the microstructure image to obtain a label set; Constructing a multi-scale window attention superposition transformer model based on the multi-scale window attention superposition basic block; Training the model to obtain a multi-scale window attention superposition transformer model after training; Inputting the microstructure image to be analyzed into a trained model, carrying out model prediction and post-processing, and outputting a microstructure composition result according to the tag set.
- 2. The complex phase composition metallographic recognition method based on partition annotation and regression according to claim 1, wherein the step of constructing a dataset comprising a microstructure image based on a phase composition parent set specifically comprises: A microstructure comprising K different constituent phases is defined, the phase constituent parent set of which is p= [ P 1 ,P 2 ,...,P K ], wherein the index value corresponding to each constituent is k= [1,2,3,..k ], i.e. P 1 =P(1),P 2 =P(2),...,P K =p (K), and one of the phases is searched through the corresponding index to form a data set, which is denoted as dataset= { I 0 ~I N }.
- 3. The method for identifying complex phase composition metallographic phase based on partition labeling and regression according to claim 1, wherein the step of labeling the data set of the microstructure image in a partition manner to obtain a label set specifically comprises the following steps: Partitioning and labeling each image I (3, H, W), partitioning the images by using windows with the sizes (H, W) and using step sizes (H, W) to form a group of partitioning graphs with the number (HW)/(HW) and recorded as Icrop, wherein H/h=W/w=r, wherein r is an image partitioning proportionality coefficient, and the shape of a partitioning graph tensor Icrop is (r, r,3, H, W); Defining a label tensor L (K, r, r), observing each segmentation map Icrop (i, j,) in Icrop, when one phase P k in P 1 ~P K exists, let L (K, i, j) =1, otherwise let L (K, i, j) =0; Performing the above operation on all r 2 segmentation graphs in Icrop according to the sequence of segmentation positions to obtain a complete labeling result L of the image I, and performing the above operation on all images in the DataSet to obtain a tag set LabelSet = { L 0 ~L N }; In the step of labeling each image in a partitioning manner, the image is segmented by adopting a window with a fixed size in a fixed step length in the image partitioning manner, wherein H and W are the width and the height of the microstructure image.
- 4. The method for identifying complex phase composition metallographic phase based on partition labeling and regression according to claim 1, wherein the step of constructing a multi-scale window attention superposition transform model based on a multi-scale window attention superposition basic block specifically comprises the following steps: Carrying out parallel multi-scale window attention calculation, and particularly dividing the parallel multi-scale window attention calculation into three branches, wherein a branch I structure is large-size (W1 xW 1) window segmentation, in-window self-attention calculation and window reduction, a branch II structure is small-size (W2 xW 2) window segmentation, in-window self-attention calculation and window reduction, and a branch three structure is average pooling, KQV attention calculation and up-sampling; adding the output characteristic graphs of the three branches to perform characteristic fusion, and performing layer standardization; the output of the layer normalization operation is input to a multi-layer feed forward network (MLP) or a multi-layer 1 x 1 convolutional layer.
- 5. The method for identifying complex phase composition metallographic phase based on partition labeling and regression according to claim 1, wherein in the step of constructing a multi-scale window attention superposition transformation model, the multi-scale window attention superposition transformation model specifically comprises a head part, a multi-stage backbone network and a tail part; The head performs visual embedding on the input microstructure image and outputs an embedded feature map; the multi-stage backbone network inputs an embedded feature map to perform feature extraction and attention modeling; And the tail part is connected with the multi-stage backbone network, then post-processing is carried out on the result, and a prediction result is output.
- 6. The method for identifying complex phase composition metallographic phase based on partition annotation and regression according to claim 1, wherein the training of the model comprises the following steps: deforming each label tensor in the label set to obtain a label vector with the shape of (1, kr 2 ); Sorting the data set and the label vector according to a one-to-one correspondence mode, dividing the data set and the label vector into a training set, a verification set and a test set according to the proportion of 7:2:1, and taking the image in the data set as a model to be input; constructing a mean square error loss function: , Wherein Y is the output of the model, For the label vector, sum () is the element sum; Training the model by adopting an adam optimizer and matching with a mean square error loss function, stopping training after a certain period of time or after the relative error of the model on the verification set is lower than a critical value, and if the relative error on the verification set does not reach the design requirement, continuing to perform testing until a trained multi-scale window attention superposition transformer model is obtained.
- 7. The method for identifying complex phase composition metallographic phase based on partition labeling and regression according to claim 1, wherein the step of inputting the microstructure image to be analyzed into a trained model to perform model prediction and post-processing and outputting the microstructure composition result according to the tag set specifically comprises the steps of: loading a trained model, and operating an image input model to obtain an output vector with the shape of (1, kr 2 ); Transforming the vector into (K, r, r) which is marked as X, rounding all elements in the X, then summing all elements in the width and height directions to obtain X 1 (K, 1), sorting all elements from large to small in the X 1 channel direction, and recording the index value sequence of k_sort= [ ks 1 ,ks 2 ,...,ks K ]; Outputting a microstructure composition result according to the ordered index value sequence, and marking as: P(ks 1 )+P(ks 2 )+...+P(ks K )。
- 8. complex phase composition metallographic recognition system based on partition labeling and regression, which is characterized by comprising the following modules: The data set construction module is used for defining a phase composition mother set of the microstructure and constructing a data set containing a microstructure image based on the phase composition mother set; The labeling module is used for carrying out partition labeling on the data set of the microstructure image to obtain a label set; The model construction module is used for constructing a multi-scale window attention superposition transformation model based on the multi-scale window attention superposition basic block; the model training module is used for training the model to obtain a multi-scale window attention superposition transformer model after training; And the result output module is used for inputting the microstructure image to be analyzed into the trained model, carrying out model prediction and post-processing, and outputting a microstructure composition result according to the tag set.
- 9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor, when executing the computer program, implements the steps of the complex phase composition metallographic recognition method based on partition labeling and regression according to any one of claims 1 to 7.
- 10. A computer readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the steps of the partition annotation and regression based complex phase composition metallographic recognition method according to any one of claims 1 to 7.
Description
Complex phase composition metallographic phase identification method and system based on partition labeling and regression Technical Field The invention belongs to the technical field of computer image processing and artificial intelligence, and particularly relates to a metallographic recognition method and system for complex phase composition based on partition labeling and regression. Background The microscopic analysis of the metal material is a detection process for judging the microstructure category composition of the prepared material sample after microscopic imaging is carried out on the surface of the prepared material sample through an optical microscope and analyzing the category, the form and the distribution state of the composition phase in the image, and is an important detection means for evaluating the technological process, the material state and the product quality of the metal material and the product. According to metallographic requirements, the identification result of the microstructure of the metal material is written in the form of an additive formula by the alphabetical expression of the constituent phases after the relative contents of the constituent phases are arranged from high to low, for example, the microstructure of ferrite (alphabetical expression is F) and pearlite (alphabetical expression is P) which are most typical in steel materials, and when the ferrite content is greater than the pearlite, the structure composition is written as F+P, and otherwise, as P+F. The traditional microscopic analysis process is mainly completed by technicians through visual observation and experience judgment, and the process has a high technical threshold and is easily influenced by subjective judgment of the technicians. The accuracy and efficiency of manual analysis are both compromised for complex microstructures composed of multiple constituent phases. With the development of artificial intelligence technology in recent years, an intelligent analysis method represented by a deep learning image recognition technology is applied to microscopic analysis of metal materials, and a deep learning image classification model obtains larger accuracy and efficiency improvement on the identification of simple constitution tissues. However, conventional image classification methods have encountered great difficulties in complex tissue recognition problems with multiphase construction. Because the composition phase of the complex tissue can be 1-4 kinds and any combination of the composition phases, in order to obtain higher accuracy, a plurality of categories need to be designed according to a free combination mode. For example, for an organization that may be composed of 4 phases, the categories need to be designed according to different combinations of single phase, two phase, three phase and four phase, the total number of categories will be more than 10. The method not only improves the data labeling cost, but also makes the model difficult to accurately classify because the difference between different categories is often smaller. Disclosure of Invention The invention aims to overcome the problems, and provides a metallographic recognition method and a metallographic recognition system for complex phase composition based on partition labeling and regression, which solve the problems that the characteristics between adjacent windows are extracted in window attention calculation, and the microstructure classification of the complex phase composition is difficult and the composition phases cannot be correctly arranged according to metallographic requirements. In order to achieve the above purpose, the invention adopts the following technical scheme: in a first aspect, the invention provides a complex phase composition metallographic recognition method based on partition labeling and regression, comprising the following steps: defining a phase composition mother set of the microstructure, and constructing a data set containing a microstructure image based on the phase composition mother set; Carrying out partition labeling on a data set of the microstructure image to obtain a label set; Constructing a multi-scale window attention superposition transformer model based on the multi-scale window attention superposition basic block; Training the model to obtain a multi-scale window attention superposition transformer model after training; Inputting the microstructure image to be analyzed into a trained model, carrying out model prediction and post-processing, and outputting a microstructure composition result according to the tag set. The invention further improves that in the step of constructing the data set containing the microstructure image based on the phase composition mother set, the method specifically comprises the following steps: A microstructure comprising K different constituent phases is defined, the phase constituent parent set of which is p= [ P 1,P2,...,PK ], wherein the index valu