Method for predicting second phase of magnesium alloy based on deep learning of component and process perception
Through deep learning models, the magnesium alloy composition and processing process are converted into natural language descriptions, and the pre-trained GPT-2 model is used for fine-tuning, which realizes accurate multi-label prediction of the second phase type of magnesium alloy, solves the problems of time-consuming and limited prediction effects of traditional methods, and improves the efficiency and accuracy of material design.
Patent Information
- Application Number
- CN202411899777.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2044-12-20
AI Technical Summary
The traditional second-phase prediction method of magnesium alloys takes time, is expensive and difficult to adapt to the demands of rapid iteration of material design. The existing machine learning model ignores the linkage between material composition and processing process, resulting in limited prediction effects.
The ‘component and process perception’ model based on deep learning is used to convert the alloy component data into natural language descriptions, and combined with the processing process information, the pre-trained GPT-2 model is fine-tuned to achieve multi-label accurate prediction of the second phase type of magnesium alloy.
It improves the accuracy and generalization ability of the second phase prediction of magnesium alloys, can effectively deal with complex and diverse magnesium alloy combinations and processing processes, and promotes the intelligent design of magnesium alloy materials.
Smart Images

Figure BDA0005202845430000041 
Figure BDA0005202845430000051 
Figure HDA0005202845460000011
Abstract
Description
Technical field:
[0001] The present invention belongs to the field of material science and artificial intelligence technology, and specifically relates to a method for integrating alloy composition and processing process information and predicting the second phase of a magnesium alloy based on deep learning technology. Background technology:
[0002] Magnesium alloys are widely used in aerospace, automobile manufacturing, medical devices and other fields due to their low density, excellent mechanical properties and outstanding biocompatibility. The second phase in magnesium alloys has an important influence on the overall performance of the alloy. By regulating the type and distribution of the second phase, the mechanical strength, corrosion resistance and biodegradability of magnesium alloys can be effectively improved. Therefore, accurately predicting the second phase that may be formed in magnesium alloys can accelerate the research and development of new magnesium alloys, and thus is expected to quickly improve the application performance, providing strong support for the development and application expansion of high-performance magnesium alloy materials.
[0003] Traditional second phase prediction methods mainly rely on phase diagram calculations and tedious experimental verification. Such methods are not only time-consuming and costly, but also difficult to adapt to the needs of rapid iteration of material design. Although machine learning technology has gradually emerged in the field of materials science in recent years, some progress has been made in predicting the second phase and its properties of magnesium alloys by analyzing existing experimental data, but most existing models ignore the linkage between material composition and processing, especially processing conditions often exist in text form, which is difficult to be directly used by conventional numerical models. This leads to limitations in prediction results, especially in the case of diverse magnesium alloy compositions and complex processing environments.
[0004] The deep learning model based on "composition and process perception" proposed in the present invention can fully understand the changes in alloy composition, and can also convert information about the processing environment into natural language input that can be processed by the deep learning model, and use the pre-trained generative pre-trained model for fine-tuning, thereby achieving multi-label accurate prediction of the second phase type. The prediction accuracy and generalization ability of the model are improved, and it can cope with complex and diverse magnesium alloy combinations and their processing processes. This will greatly promote the intelligent design of magnesium alloy materials and lay a solid technical foundation for the development and application of high-performance magnesium alloys. Summary of the invention:
[0005] The present invention proposes a deep learning model that integrates alloy composition and processing description to predict the second phase type in magnesium alloys. Compared with the prior art, this method innovatively uses natural language processing technology to convert alloy composition data into descriptive text information, and combines it with the material processing process to generate comprehensive input features. Finally, by fine-tuning the generative pre-training model (GPT-2), multi-label classification prediction of complex multiphases in magnesium alloys is achieved, effectively improving the prediction accuracy.
[0006] A method for predicting the second phase of magnesium alloy based on "composition and process perception" deep learning, comprising the following steps:
[0007] (1) Text processing of composition data: Collect historical data sets of magnesium alloy composition, processing technology and second phase type; the alloy composition in the data set is expressed in numerical form; convert these numerical data into natural language descriptions; for example, Sn with a mass fraction of 2.5% is converted to "2.5wt.%Sn". At the same time, for each alloy sample, all the existing elements and their mass fractions will be combined into a complete sentence to describe the composition characteristics of the magnesium alloy. For example, "Magnesium alloy containing 2.5wt.%Sn and 1.5wt.%Zn";
[0008] (2) Combine the processing process to form a complete description: Combine the textual description of the alloy composition and the processing technology to form a complete natural language input. For example: "Magnesium alloy containing 2.5wt.%Snand 1.5wt.%Zn.Process:The alloy was homogenized at 380℃ for 12h.Then,thealloy was extruded at 360℃ with the extrusion ratio of 32:1." This textual input contains the material composition information and processing technology information, so that the model can use the power of natural language processing to understand the overall characteristics of the material.
[0009] (3) Use the pre-trained GPT model: split the test set and the training set in a ratio of 8:2; use the pre-trained GPT-2 model as the basic model for text features. The pre-trained GPT-2 model is built based on the Transformer model and has attracted attention for its powerful text generation capabilities and broad application prospects. It is pre-trained on a large amount of text data through unsupervised learning and can understand the inherent laws and structures of language, thus performing well in a variety of natural language processing tasks; fine-tune the GPT-2 model through training with the collected data set. During the training process, the GPT model can learn how to understand and process these alloy descriptions and associate them with the output multi-label (i.e., the type of second phase, which may be multiple different second phases), and finally can be used for multi-label classification tasks;
[0010] The multi-label classification: The prediction goal is to predict the second phase type in magnesium alloys. A magnesium alloy may contain multiple second phases, which is a typical multi-label classification problem. The fine-tuned GPT model processes the natural language description of the alloy composition and processing technology, and finally outputs the second phase prediction result of each sample. Each sample can correspond to multiple labels, and the model will output multiple possible second phase types.
[0011] Furthermore, during the training process, data with real labels (i.e., the second phase actually present in the alloy) are used to guide the learning of the model. By continuously adjusting the parameters of the model, the GPT model gradually learns how to predict the second phase based on natural language descriptions. The performance of the model is evaluated through multiple indicators such as precision, recall, and F1 score to measure the overall performance of the model under different labels. The specific calculation formula is:
[0012] (a) Precision: Precision refers to the ratio of the number of samples predicted correctly by the model to the number of samples predicted as positive by the model. The calculation formula is:
[0013] Precision = TP / (TP+FP)
[0014] Among them, TP (True Positive) represents true positive examples, that is, the number of samples correctly predicted by the model as positive; FP (False Positive) represents false positive examples, that is, the number of samples incorrectly predicted by the model as positive.
[0015] (b) Recall rate: Recall rate refers to the ratio of the number of samples predicted by the model as positive and correct to the number of samples that are actually positive. Its calculation formula is:
[0016] Recall = TP / (TP+FN)
[0017] Among them, FN (False Negative) represents false negative examples, that is, the number of positive samples that the model mistakenly predicts as negative samples.
[0018] (c) F1 score: The F1 score is the harmonic mean of precision and recall, which is used to comprehensively consider precision and recall. Its calculation formula is:
[0019] F1 = 2 × precision × recall / (precision + recall)
[0020] The F1 score ranges from 0 to 1. The closer the value is to 1, the better the model performance is. Finally, balance the training cycle and performance parameters to achieve the highest possible prediction performance in the smallest possible training cycle to achieve fine-tuning of the model.
[0021] (4) Prediction of unknown samples: Use the model fine-tuned in step (3) to predict new alloy data (unseen data). New alloy samples also need to go through the same processing flow: convert the composition data into text descriptions, combine the processing process to generate feature inputs, and then input them into the fine-tuned GPT model for prediction; the model finally outputs the possible second phase type of the sample. For example: "Predicted second phases:Mg2Ca,MgZn2".
[0022] (5) Smelting and preparing samples for verification and evaluation: preparing alloys based on the unseen data component ratio of step (4), selecting raw materials such as pure magnesium, pure metal and intermediate alloy, melting magnesium with pure metal and intermediate alloy under a protective atmosphere, and ensuring uniform distribution of alloy components by stirring; casting the molten alloy into ingots to obtain alloy materials, i.e. materials with unseen data components; using projection electron microscopy electron diffraction spots to calibrate the type of the second phase and then comparing and evaluating it with the second phase type predicted and outputted in step (4).
[0023] Application: This method can be applied to the research and development and design of new magnesium alloys, especially for application scenarios that require rapid optimization of the second phase type to improve performance, such as biomedical magnesium alloys, corrosion-resistant magnesium alloys, and lightweight and high-strength magnesium alloys.
[0024] Advantages of the invention:
[0025] 1. High-precision prediction: The accuracy of second phase prediction of magnesium alloy is improved by integrating the text of alloy composition and processing process.
[0026] 2. Multi-label classification: supports simultaneous prediction of multiple second phase labels for alloy samples to meet the needs of complex multiphase materials in practical applications.
[0027] 3. High degree of automation: Through deep learning algorithms, large-scale alloy data can be processed automatically, reducing the complexity and cost of experimental design. Description of the drawings:
[0028] Figure 1 :The flowchart based on the present invention shows the complete process from data preparation, model training to final prediction and evaluation.
[0029] Figure 2 : Evaluation of the model’s predictive performance, showing the evolution of the model’s predictive ability under different training cycles.
[0030] Figure 3 : Mg-1Ca-1In (unseen data) was prepared experimentally, and its morphology was characterized by transmission electron microscopy and its second phase type was identified. Specific implementation method:
[0031] The present invention will be further described below in conjunction with examples, but the present invention is not limited to the following examples.
[0032] Embodiment 1:
[0033] 1. Text processing of ingredient data: Figure 1 The flowchart of the whole process is shown in . First, a total of 1661 samples were collected to form a data set, and some examples are given in Table 1. The dependent variables are alloy composition, process, and second phase type, where the alloying elements include: Sn, Ga, In, Al, La, Mn, Zn, Y, Zr, Ca, Gd, Nd, Fe, Ni, Cu, Si, Sr. The composition information is converted into a textual description of the alloy composition.
[0034] Table 1: Some examples of datasets
[0035]
[0036]
[0037] 2. Combine the processing process to form a complete description: Combine the textual alloy composition description and the processing process description to form a complete natural language input.
[0038] 3. Use the pre-trained GPT model: The predictive ability of the model changes with the training cycle as follows Figure 2 As shown in the figure, when the training cycle is greater than 11, the prediction ability of the model begins to decline. In order to fine-tune the model and balance the prediction ability, the training cycle is set to 11. At this time, the F1 score, precision and recall rate are 0.787, 0.831 and 0.772 respectively.
[0039] 4. Multi-label classification: Increase the readability of the output results and change the output implementation, such as "Predicted secondphases:('Mg3Zn3Y2','MgZn','MgZn6Y')". Unidentified second phases are marked as "Unknown". 6. Prediction of unknown samples: Magnesium alloys are prepared using Sn, Ga, In, Al, La, Mn, Zn, Y, Zr, Ca, Gd, Nd, Fe, Ni, Cu, Si, and Sr as alloying elements. Use these elements alone, or mix two or three of them together, and the rest is pure magnesium. For example, one, two, or three of the alloying elements are added, and the rest is pure magnesium. Explore all possible combinations, with the content of each element increasing by 0.5%. After calculation, there are a total of 2,668,150 different combinations, which are the composition space to be screened. To evaluate the generalization prediction ability of the model, Mg-1Ca-1In was randomly selected as the test object in the composition space to be screened. This alloy composition is not included in the data set. The model's prediction result for this alloy is "Predicted second phases: ('Mg2Ca')".
[0040] 7. Melt and prepare samples for verification and evaluation: Prepare alloys according to the ratio of Mg-1Ca-1In. Pure magnesium, pure indium and Mg-10Ca master alloy are selected as raw materials. Under a protective atmosphere, magnesium and other metals or master alloys are melted, and the alloy components are evenly distributed by stirring. The molten alloy is cast to make ingots. Subsequently, electron diffraction spots are calibrated using a transmission electron microscope (TEM) to determine the type of the second phase. TEM results show that the second phase of the alloy is Mg2Ca( Figure 3 ). This further verifies the accuracy of the prediction of the second phase of magnesium alloy based on the "composition and process perception" deep learning model of the present invention.
[0041] Although preferred implementation cases have been listed and described in detail herein, those skilled in the art will appreciate that various improvements, additions, substitutions, etc. may be made without departing from the spirit of the invention, and these contents are considered to be within the scope of the invention as defined by the claims.
Claims
1. A method for predicting the second phase of magnesium alloy based on deep learning of "composition and process perception", characterized in that: The following steps are involved: (1) Text processing of composition data: Collect historical data sets of magnesium alloy composition, processing technology and second phase type; the alloy composition in the data set is expressed in numerical form; these numerical data are converted into natural language descriptions; at the same time, for each alloy sample, all the existing elements and their mass fractions will be combined into a complete sentence to describe the composition characteristics of the magnesium alloy; (2) Combine the processing process to form a complete description: Combine the textual description of the alloy composition and the processing technology description to form a complete natural language input; this textual input contains the composition information of the material and the processing technology information, so that the model can use the power of natural language processing to understand the overall characteristics of the material; (3) Use the pre-trained GPT model: split the test set and the training set; use the pre-trained GPT-2 model as the basic model for text features. The pre-trained GPT-2 model is built based on the Transformer model and has attracted attention for its powerful text generation capabilities and broad application prospects. It is pre-trained on a large amount of text data through unsupervised learning and can understand the inherent laws and structures of language, thus performing well in a variety of natural language processing tasks; fine-tune the GPT-2 model by training with the collected data set. During the training process, the GPT model can learn how to understand and process these alloy descriptions and associate them with the output, and finally can be used for multi-label classification tasks; the multi-label refers to the type of second phase, and there may be multiple different second phases; (4) Prediction of unknown samples: Use the model fine-tuned in step (3) to predict new alloy data (unseen data). New alloy samples also need to go through the same processing flow: convert the composition data into text descriptions, combine the processing process to generate feature inputs, and then input them into the fine-tuned GPT model for prediction; The final output of the model is the type of second phase that the sample may have; (5) Smelting and preparing samples for verification and evaluation: preparing alloys based on the unseen data component ratio of step (4), selecting raw materials such as pure magnesium, pure metal and intermediate alloy, melting magnesium with pure metal and intermediate alloy under a protective atmosphere, and ensuring uniform distribution of alloy components by stirring; casting the molten alloy into ingots to obtain alloy materials, i.e. materials with unseen data components; using projection electron microscopy electron diffraction spots to calibrate the type of the second phase and then comparing and evaluating it with the second phase type predicted and outputted in step (4).
2. The method according to claim 1, characterized in that The multi-label classification: The prediction goal is to predict the second phase type in magnesium alloys. A magnesium alloy may contain multiple second phases, which is a typical multi-label classification problem. The fine-tuned GPT model processes the natural language description of the alloy composition and processing technology, and finally outputs the second phase prediction result of each sample. Each sample can correspond to multiple labels, and the model will output multiple possible second phase types.
3. The method according to claim 1, characterized in that During the training process, data with real labels, i.e., the second phase actually existing in the alloy, are used to guide the learning of the model. By continuously adjusting the parameters of the model, the GPT model gradually learns how to predict the second phase based on natural language descriptions. The performance of the model is evaluated through multiple indicators such as precision, recall, and F1 score to measure the overall performance of the model under different labels. The specific calculation formula is: (a) Precision: Precision refers to the ratio of the number of samples predicted correctly by the model to the number of samples predicted as positive by the model. The calculation formula is: Precision = TP / (TP+FP) Among them, TP (True Positive) represents true positive examples, that is, the number of samples correctly predicted by the model as positive; FP (False Positive) represents false positive examples, that is, the number of samples incorrectly predicted by the model as positive. (b) Recall rate: Recall rate refers to the ratio of the number of samples predicted by the model as positive and correct to the number of samples that are actually positive. The calculation formula is: Recall = TP / (TP+FN) Among them, FN (False Negative) represents false negative examples, that is, the number of positive samples that the model incorrectly predicts as negative; (c) F1 score: The F1 score is the harmonic mean of precision and recall, which is used to comprehensively consider precision and recall. Its calculation formula is: F1 = 2 × precision × recall / (precision + recall) Among them, the value range of F1 score is 0 to 1, and the closer the value is to 1, the better the model performance; finally, balance the training cycle and performance parameters to achieve the highest possible prediction performance with the smallest possible training cycle to achieve fine-tuning of the model.
4. The method according to any one of claims 1 to 3, characterized in that: This method is used in the research and development and design of new magnesium alloys, especially for application scenarios that require rapid optimization of the second phase type to improve performance.
5. The method according to any one of claims 1 to 3, characterized in that: This method is applied to the research, development and design of biomedical magnesium alloys, corrosion-resistant magnesium alloys and lightweight high-strength magnesium alloys.
Citation Information
Patent Citations
Method for predicting response of corrosion performance of microalloyed magnesium alloy to heat treatment
CN116046653A
Copper-free ultrahigh-strength aluminum alloy and preparation method thereof
CN118166247A
Method and system for automatically generating production plan of heat treatment furnace
CN118333785A
Systems and methods for computationally developing manufacturable and durable cast components
US20120232685A1
System and predictive modeling method for smelting process control based on multi-source information with heterogeneous relatedness
US20180081339A1