A method for predicting magnesium alloy second phases based on "composition and process-aware" deep learning
By converting magnesium alloy composition and processing into text information and fine-tuning it using the GPT-2 model, the accuracy and efficiency issues of second-phase prediction in magnesium alloys in existing technologies are solved, achieving high-precision multi-label classification and supporting rapid iterative material design.
Patent Information
- Application Number
- CN202411899777.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2044-12-20
AI Technical Summary
Existing technologies struggle to quickly and accurately predict the second phase in magnesium alloys, especially in environments with diverse compositions and complex processing. Traditional methods are time-consuming and costly, and they neglect the interaction between material composition and processing.
Natural language processing technology is used to convert alloy composition data into text information, which is combined with the processing process to form comprehensive input features. The pre-trained generative pre-trained model GPT-2 is then fine-tuned to achieve multi-label classification and prediction of the second phase type in magnesium alloys.
It improves the accuracy and generalization ability of second-phase prediction in magnesium alloys, supports multi-label classification, reduces the complexity and cost of experimental design, and adapts to the needs of rapid iterative material design.
Smart Images

Figure CN119833016B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of material science and artificial intelligence, and particularly relates to a method for predicting a second phase of a magnesium alloy by fusing alloy composition and process information and based on deep learning technology. BACKGROUND
[0002] Magnesium alloys are widely used in aerospace, automotive manufacturing, medical devices and other fields due to their low density, excellent mechanical properties and excellent biocompatibility. The second phase in magnesium alloys has an important influence on the overall performance of the alloy. By controlling 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 is expected to quickly improve the application performance, providing strong support for the development and application of high-performance magnesium alloy materials.
[0003] Traditional second phase prediction methods mainly rely on phase diagram calculation and tedious experimental verification. Such methods not only take a long time and cost a lot, but also are difficult to adapt to the rapid iteration of material design requirements. 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 performance of magnesium alloys by analyzing existing experimental data, but most existing models ignore the linkage between material composition and processing, especially the processing conditions, which are often in the form of text and are difficult to be directly used by conventional numerical models. This leads to limitations in prediction results, especially in diversified magnesium alloy compositions and complex processing environments.
[0004] The deep learning model based on "composition and process perception" proposed in the application can fully understand the changes in alloy composition and also convert the information of the processing environment into natural language input that can be processed by the deep learning model. By fine-tuning the pre-trained generative pre-training model, the model can accurately predict the type of the second phase, improve the prediction accuracy and generalization ability of the model, and cope with complex and diverse magnesium alloy combinations and their processing. 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
[0005] The application proposes a deep learning model that fuses alloy composition and process description for predicting the type of the second phase in magnesium alloys. Compared with the prior art, the method innovatively uses natural language processing technology to convert alloy composition data into descriptive text information, and combines it with the processing of the material to generate comprehensive input features. Finally, by fine-tuning the generative pre-training model (GPT-2), the method realizes multi-label classification prediction of complex multi-phase in magnesium alloys, effectively improving the prediction accuracy.
[0006] A method for predicting the second phase of magnesium alloys based on "composition and process-aware" deep learning, comprising the following steps:
[0007] (1) Textual 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 represented in numerical form; Convert these numerical data into natural language description form; For example, 2.5wt.% Sn is converted to "2.5wt.% Sn". At the same time, for each alloy sample, all existing elements and their mass fractions are 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 processing process to form a complete description: Combine the textual alloy composition description and processing technology description to form a complete natural language input. For example: "Magnesium alloy containing 2.5wt.% Sn and 1.5wt.% Zn. Process: The alloy was homogenized at 380℃ for 12h. Then, the alloy was extruded at 360℃ with the extrusion ratio of 32:1." This text input contains the composition information and processing technology information of the material, so that the model can understand the overall characteristics of the material using the natural language processing capability.
[0009] (3) Use pre-trained GPT model: Divide the test and training sets in the ratio of 8:2; Use the pre-trained GPT-2 model as the basic model of the text feature, the pre-trained GPT-2 model is based on the transformer model, with its powerful text generation ability and wide application prospects, it is concerned, it is pre-trained on a large amount of text data through unsupervised learning, it can understand the internal rules and structure of language, so it performs well in various natural language processing tasks; Through the collected data set to train the GPT-2 model, the training process 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 have multiple different second phases), which can ultimately be used for multi-label classification tasks;
[0010] The multi-label classification: the prediction target is to predict the second phase type in the magnesium alloy. 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 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] Further, in the training process, data with real labels (i.e. the second phase actually existing in the alloy) is 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 according to the natural language description; the performance of the model is evaluated by precision, recall and F1 score multiple indicators to measure the overall performance of the model under different labels, the specific calculation formula is:
[0012] (a) Precision: Precision is the ratio of the number of samples correctly predicted by the model to the number of all samples predicted as positive by the model. The calculation formula is:
[0013] Precision = TP / (TP+FP)
[0014] Where TP (True Positive) represents the true positive, i.e. the number of samples correctly predicted as positive by the model; FP (False Positive) represents the false positive, i.e. the number of samples incorrectly predicted as positive by the model.
[0015] (b) Recall: Recall is the ratio of the number of samples correctly predicted as positive by the model to the number of all samples actually positive. The calculation formula is:
[0016] Recall = TP / (TP+FN)
[0017] Where FN (False Negative) represents the false negative, i.e. the number of positive samples incorrectly predicted as negative by the model.
[0018] (c) F1 score: F1 score is the harmonic mean of precision and recall, which considers precision and recall comprehensively. The calculation formula is:
[0019] F1 = 2 x Precision x Recall / (Precision + Recall)
[0020] Where the F1 score ranges from 0 to 1, and the closer the value is to 1, the better the model performance. Finally, balance the training period and performance parameters, achieve the highest prediction performance in the smallest possible training period, to realize the fine-tuning of the model.
[0021] (4) Prediction of unknown samples: Using the fine-tuned model from step (3) to predict new alloy data (unseen data), the new alloy samples also need to go through the same processing procedure: convert the composition data into text description, combine the processing process to generate feature input, and then input into the fine-tuned GPT model for prediction; the final output of the model is the possible second phase type of the sample. For example: "Predicted second phases: Mg2Ca, MgZn2".
[0022] (5). Melting to prepare samples for verification and evaluation: Based on the composition ratio of unseen data in step (4), alloys are prepared by selecting pure magnesium, pure metals and intermediate alloys as raw materials, and under a protective atmosphere, magnesium is melted with pure metals and intermediate alloys, and stirring is used to ensure uniform distribution of alloy composition; the molten alloy is cast into ingots to obtain alloy materials, i.e. materials with unseen data composition; the type of second phase is determined by electron diffraction spot marking using a transmission electron microscope, and then compared with the predicted output of the second phase type in step (4) for evaluation.
[0023] Application: This method can be applied to the research and design of new magnesium alloys, especially for application scenarios that require rapid optimization of second phase types to improve performance, such as biomedical magnesium alloys, corrosion-resistant magnesium alloys, and lightweight high-strength magnesium alloys, etc.
[0024] Advantages of the invention:
[0025] 1. High precision prediction: Through the fusion of alloy composition and processing process text, the precision of magnesium alloy second phase prediction is improved.
[0026] 2. Multi-label classification: Supports simultaneous prediction of multiple second phase labels for alloy samples, meeting the needs of complex multi-phase materials in actual applications.
[0027] 3. High degree of automation: Through deep learning algorithms, large-scale alloy data can be automatically processed, reducing the complexity and cost of experimental design. BRIEF DESCRIPTION OF DRAWINGS
[0028] Figure 1 : Based on the flowchart of the invention, the complete process from data preparation, model training to final prediction and evaluation is shown.
[0029] Figure 2 : Model prediction performance evaluation, showing the evolution of model prediction ability under different training cycles.
[0030] Figure 3 : Experimental preparation of Mg-1Ca-1In (unseen data), transmission electron microscopy characterization of its morphology and determination of its second phase type. DETAILED DESCRIPTION:
[0031] The application will be further described with reference to the following examples, but the application is not limited to the following examples.
[0032] Example 1:
[0033] 1. Textual processing of ingredient data: Figure 1 The flowchart of the whole process is shown in FIG. 1. First, 1661 samples were collected to form a dataset, and part of the examples are given in Table 1. The dependent variables are alloy composition, process, and second phase type, in which the alloying elements include Sn, Ga, In, Al, La, Mn, Zn, Y, Zr, Ca, Gd, Nd, Fe, Ni, Cu, Si, and Sr. The ingredient information is converted into a textual alloy composition description.
[0034] Table 1: Part of the dataset examples
[0035]
[0036]
[0037] 2. Form a complete description by combining the processing process: combine the textual alloy composition description and the processing process description to form a complete natural language input.
[0038] 3. Use a pre-trained GPT model: the change rule of the prediction ability of the model with the training period is shown in FIG. 2. When the training period is greater than 11, the prediction ability of the model begins to decline. In order to realize the fine-tuning of the model, and in the premise of weighing the prediction ability, the training period is set to 11. At this time, the F1 score, accuracy and recall rate correspond to 0.787, 0.831 and 0.772 respectively. Figure 2
[0039] 4. Multi-label classification: To increase the readability of the output results, the output is changed to be like "Predicted second phases: ('Mg3Zn3Y2', 'MgZn', 'MgZn6Y')". The second phase that is not identified is marked as "Unknown". 6. Prediction for unknown samples: Magnesium alloys are prepared with Sn, Ga, In, Al, La, Mn, Zn, Y, Zr, Ca, Gd, Nd, Fe, Ni, Cu, Si, Sr as alloying elements. These elements are used alone or mixed in two or three kinds, and the rest is pure magnesium, for example, one, two, or three alloying elements are added to the pure magnesium. Explore all possible combinations, and each element is increased by 0.5% as a unit. After calculation, there are 2668150 different combinations, which are the composition space to be screened. To evaluate the generalization prediction ability of the model, Mg-1Ca-1In is randomly selected from the composition space to be screened as the test object, which is not included in the data set. The prediction result of the model for this alloy is "Predicted second phases: ('Mg2Ca')".
[0040] 7. Melting to prepare samples for verification and evaluation: The alloy is prepared according to the ratio of Mg-1Ca-1In. Pure magnesium, pure indium and Mg-10Ca intermediate alloy are selected as raw materials. Under the protection of atmosphere, magnesium is melted with other metals or intermediate alloy, and stirring is used to ensure uniform distribution of alloy composition. The molten alloy is cast into ingots. Then, electron diffraction spot calibration is performed by transmission electron microscopy (TEM) to determine the type of second phase. The TEM result shows 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.
[0041] Although the preferred embodiments have been described in detail hereinabove, various modifications, additions and substitutions are intended in the scope of the application, which should not be limited to the above.
Claims
1. A method for predicting the second phase of a magnesium alloy based on "composition and process-aware" deep learning, characterized in that, The method comprises the following steps: (1) Text processing of component data: Collect historical data sets of magnesium alloy components, processing technology and second phase types; The alloy components in the data set are represented in numerical form; Convert these numerical data into natural language description; At the same time, for each alloy sample, all existing elements and their mass fractions are combined into a complete sentence to describe the component characteristics of the magnesium alloy; (2) Form a complete description by combining the processing process: Combine the text description of the alloy components and the processing technology description to form a complete natural language input; This text input contains the component information and processing technology information of the material, so that the model can use the natural language processing capability to understand the overall characteristics of the material; (3) Use the pre-trained GPT model: Divide the test and training sets; Use the pre-trained GPT-2 model as the base model of the text features, the pre-trained GPT-2 model is based on the Transformer model, which has attracted attention due to its powerful text generation capabilities and wide application prospects, it is pre-trained on a large amount of text data through unsupervised learning, and can understand the internal rules and structure of language, so as to perform well in various natural language processing tasks; Through the collected data set, the GPT-2 model is fine-tuned, the training process enables the GPT model to learn how to understand and process these alloy descriptions and associate them with the output, which can ultimately be used for multi-label classification tasks; The multi-label is the type of second phase, which may have multiple different second phases; (4) Prediction of unknown samples: Use the model fine-tuned in step (3) to predict new alloy data, the new alloy sample also needs to go through the same processing procedure: convert the component data into text description, combine the processing process to generate feature input, and then input into the fine-tuned GPT model for prediction; The final output of the model is the possible second phase type of the sample; (5) Melting and preparing samples for verification and evaluation: Based on the new alloy data component ratio in step (4), prepare the alloy by selecting pure magnesium, pure metal and intermediate alloy raw materials, melt the magnesium and pure metal and intermediate alloy under a protective atmosphere, and ensure uniform distribution of alloy components by stirring; Cast the molten alloy into ingots to obtain alloy materials, i.e. materials with the composition of new alloy data; Use transmission electron microscopy and electron diffraction spot marking to determine the type of second phase, and then compare it with the second phase type predicted in step (4) for evaluation.
2. The method of claim 1, wherein, Multi-label classification: The prediction target is to predict the second phase type in the magnesium alloy, which may contain multiple second phases, and is a typical multi-label classification problem; The fine-tuned GPT model processes the natural language description of the alloy components and processing technology, and finally outputs the second phase prediction result of each sample; Each sample corresponds to multiple labels, and the model outputs multiple possible second phase types.
3. The method of claim 1, wherein, During the training process, data with real labels, i.e., the second phase actually existing in the alloy, is 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 according to the natural language description; the performance of the model is evaluated by multiple indicators such as precision, recall and F1 score to measure the overall performance of the model under different labels, and the specific calculation formula is: (a) Precision: Precision is the ratio of the number of samples correctly predicted by the model to the number of all samples predicted as positive by the model, and its calculation formula is: Precision = TP / (TP+FP) Where TP (True Positive) represents the true positive, i.e., the number of samples correctly predicted as positive by the model; FP (False Positive) represents the false positive, i.e., the number of samples incorrectly predicted as positive by the model; (b) Recall: Recall is the ratio of the number of samples correctly predicted as positive by the model to the number of all samples actually positive, and its calculation formula is: Recall = TP / (TP+FN) Where FN (False Negative) represents the false negative, i.e., the number of positive samples incorrectly predicted as negative by the model; (c) F1 score: F1 score is the harmonic mean of precision and recall, which considers both precision and recall, and its calculation formula is: F1 = 2*Precision*Recall / (Precision+Recall), Where the value of F1 score ranges from 0 to 1, and the closer the value is to 1, the better the performance of the model; finally, balance the training period and performance parameters, achieve the highest prediction performance in the smallest possible training period, and fine-tune the model.
4. The method according to any one of claims 1 to 3, characterized in that, This method is applied to the research and design of new magnesium alloys.
5. The method of claim 4, wherein, For application scenarios that require rapid optimization of second phase types to improve performance.
6. The method according to any one of claims 1 to 3, characterized in that, This method is applied to the research and design of biomedical magnesium alloys, corrosion-resistant magnesium alloys and lightweight high-strength magnesium alloys.
Citation Information
Patent Citations
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