{'fraction_non_alphanumeric': 0.037925364598227054, 'fraction_numerical': 0.011080926508435802, 'mean_word_length': 4.999785545785975, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 1, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A machine learning-based classification approach for phase diagram prediction

Knowledge of phase diagrams is essential for material design as it helps in understanding microstructure evolution during processing. The determination of phase diagrams is thus one of the central tasks in materials science. When exploring new materials for which the phase diagram is unknown, experimentalists often try to determine the key experiments that should be performed by referencing known phase diagrams of similar systems. To enhance this practical strategy, we attempted to estimate unknown phase diagrams based on known phase diagrams using a machine learning-based classification approach. As a proof of concept, we focused on predicting the number of coexisting phases across the 800 K isothermal section of each of the 10 ternaries of the Al-Cu-Mg-Si-Zn system from the other 9 sections. To increase the prediction accuracy, we introduced new descriptors generated from the thermodynamic properties of the elements and CALPHAD extrapolations from lower-order systems. Using the random forest method, the presence of single-, two-, and three-phase domains was predicted with an average accuracy of 84% across all 10 considered sections with a standard deviation of 11%. The proposed approach represents a promising tool for assisting the investigator in developing new materials and determining phase equilibria efficiently.


Introduction
Phase diagrams are widely used as roadmaps to support the development of materials, from their synthesis to their applications. Detailed knowledge of phase equilibria and the underlying thermodynamics enables the establishment of the link between processing and microstructure, which is a crucial step in modern material design [1][2][3][4]. Thus, the development of new strategies based on machine learning (ML) to promote more efficient determination of phase diagrams is of significant interest. Recently, two main approaches have been found to be particularly promising.
On the one hand, the combination of high-throughput experimentation (HTE) and ML has attracted attention. HTE techniques usually involve the synthesis of thin-film libraries using combinational sputtering [5][6][7] or diffusion multiples [8][9][10]. ML approaches then enable the rapid analysis of large volumes of data from HTE, further automating the phase diagram determination [11,12]. On the other hand, ML predictions can help in reducing the number of experiments required to explore unknown material systems. There have already been several successful studies in which new compounds were discovered based on these predictions [13].
In addition, an uncertainty sampling-based active learning strategy for recommending the most informative experiments to be performed for efficient determination of the phase diagrams has been proposed [14][15][16] and demonstrated in practice [17].
In this study, we attempt to estimate unknown phase diagrams based on known phase diagrams using a machine learning-based classification approach. Compared with the prediction of a given material property, the classification problem is complicated because a variety of phases may be stable depending on the constituent elements. Two ingenuities were introduced to succeed in this task. Although this is a simplified representation of phase diagrams, it still contains essential information on phase equilibria, and the predictions can thus be relevant for planning experiments. An overview of the workflow of this study is presented in Fig. 1. As a demonstration, we focus on the constitutive ternary phase diagrams of the Al-Cu-Mg-Si-Zn system. This practical case is selected because reliable thermodynamic descriptions are available for each of these 10 ternaries, which are of significant industrial importance for light alloys. More specifically, the prediction of their 800 K isothermal section is examined. At this temperature, the descriptions are generally supported by many measurements, and the liquid phase begins to stabilize in the majority of systems. To predict ternary sections, the random forest [18] and support vector machine (SVM) [19] classifiers are adopted, which are implemented using Scikit-learn [20].

Target ternary phase diagrams
The 10 ternary subsystems of the Al-Cu-Mg-Si-Zn quinary are set as the target for the present investigation. For each phase diagram, the phase equilibria data are retrieved across the entire 800 K isothermal section with steps of 2 at.% using the high-throughput calculation function of the Pandat software [21]. The thermodynamic descriptions adopted in the calculations are as follows: Al-Cu-Mg [22], Al-Cu-Si [23], Al-Cu-Zn [24], Al-Si-Zn [25], Al-Mg-Si [26], Al-Mg-Zn [27], Cu-Mg-Si [28], Cu-Mg-Zn [29], Cu-Si-Zn [30], and Mg-Si-Zn [31]. As a result, 1326 datapoints per system are obtained. For each point, the number of coexisting phases (one, two, or three) obtained by the CALPHAD calculations is used as the label corresponding to the category in the classification problem. In total, the number of single-, two-, and three-phase domains in the dataset is 2263, 6063, and 4934, respectively. The distribution of the classes for each of the 10 isothermal sections is presented in Supplementary Note A (Table S.1).

Compositional descriptors
To predict the phase diagrams with a high accuracy, we use three types of descriptors called "Magpie," "Thermo," and "CALPHAD." These are generated based on the composition of each element. For the "CALPHAD" descriptors, CALPHAD assessments of lower-order systems are necessary, while the properties of the pure elements are used for "Magpie" and "Thermo."

"Magpie" descriptors
For each datapoint investigated, five features are first obtained from the atomic concentration of the elements (at.% Al, Cu, Mg, Si, and Zn). In addition, the mean and absolute deviation of the properties referred to as "Magpie" in Table 1 are calculated from their values for the pure elements and the composition using the Magpie library [32]. This 37-dimensional descriptor set is referred to as the "Magpie" descriptor set. It is noted that this type of descriptor is widely used to predict material properties [13,32].

"Thermo" descriptors
The "Magpie" descriptors do not include any thermodynamic properties. However, such information can be expected to be useful for phase diagram prediction. Thus, in the second descriptor set, 10 new related features are introduced. The five thermodynamic properties referred to as "Thermo" in Table 1 are prepared for the pure elements using the SGTE database [33] in its 5.0 version. Their mean and absolute deviation are then calculated at each composition point as for the "Magpie" case. We refer to these 10 descriptors as the "Thermo" descriptor set. A Python script, DesPD (Descriptors for Phase Diagrams), is available at https://github.com/GuillaumeDeffrennes/DesPD to easily obtain these descriptors at any temperature and composition.

"CALPHAD" descriptors
At constant temperature, pressure, and composition, thermodynamic equilibrium is characterized by a minimum of the Gibbs energy. Therefore, once this thermodynamic potential is known for all the phases of a system, its phase diagram can be accessed. Within the CALPHAD framework, the Gibbs energy of the phases is modeled based on a buildingblock approach. For instance, the Gibbs energy of the quinary Al-Cu-Mg-Si-Zn liquid is obtained from the description of the pure elements in the phase, their two-by-two interactions, and their relatively small ternary interactions. This implies that the thermodynamic description of a multicomponent system can be approximated using its subsystems. Herein, we propose the use of the information extrapolated from lower-order systems, i.e., from the binaries in the present case, as descriptors. Specifically, we introduce three features: (i) the number of coexisting phases extrapolated from binary descriptions, (ii) the Gibbs energy extrapolated from binary descriptions, and (iii) the excess Gibbs energy in the liquid phase extrapolated from binary descriptions. These are referred to as the "CALPHAD" descriptor set (Table 1). To obtain this type of descriptor, CALPHAD assessments of lower-order systems (here, the binaries) are necessary. Furthermore, the first two features, i.e., "Extrapolated n_phase" and "Extrapolated Gibbs," have to be calculated using a thermodynamic calculation software, such as those listed in [34]. This is not a requirement for "Extrapolated Ex G Liq" as this descriptor can be obtained via a direct calculation from the interaction parameters (Appendix).
For our demonstration target, the thermodynamic description of the constitutive binaries of the Al-Cu-Mg-Si-Zn system are gathered into a database: Al-Cu [24], Al-Mg [35], Al-Si [36] (based on [37]), Al-Zn [38], Cu-Mg [36] (based on [39]), Cu-Si [23], Cu-Zn [40], Mg-Si [41], Mg-Zn [27], and Si-Zn [25]. On this basis, for each of the 10 ternaries considered in this study, point calculations are performed every 2 at.% across the 800 K isothermal section that is obtained by extrapolation from the binaries. It is emphasized that, when a ternary phase diagram is extrapolated from its binary subsystems, any ternary compounds or solutions of a third element in a binary phase will be missing (these two cases will be simply referred to as ternary phases hereafter). However, a reasonable estimate of the Gibbs energy of the phases that already exist in the unaries (e.g., the liquid phase) can be obtained.
A Python script is available at https://github.com/GuillaumeDeffrennes/DesPD to easily obtain the excess thermodynamic properties in the liquid phase as extrapolated from the binaries.

. Random forest classifier
The random forest classifier (RFC) [18] is an ensemble learning algorithm in which a large number of decision trees are individually trained using random subsamples of the dataset. For an input sample, the probability of each class is calculated by averaging the votes of the trees.
One advantage of using RFCs is that they provide a measure of the relative importance of each descriptor to the prediction model, thereby facilitating a straightforward feature selection. Besides, RFCs naturally provide probability estimates for each class. In this study, the RFC is implemented using the Scikit-learn library [20]. In the RFC, there are two important hyperparameters: the number of trees in the forest (n_estimators) and the fraction of samples randomly drawn from the dataset to train each tree (max_samples). Thus, these are tuned by following the procedure described in Section 2.3.2.

Model optimization and performance evaluation
The ML workflow used in the present study is schematized in Fig. 2 and detailed below. To evaluate the performance of the models, a 10-fold cross-validation is used: each of the 10 ternaries of the Al-Cu-Mg-Si-Zn system is in turn considered unknown, and its 800 K isothermal section is predicted using the classification model trained by the 9 other ternaries.
The optimization of each classification model is performed by non-random nine-fold crossvalidation; that is, each of the nine known ternaries is in turn taken as the validation set, while the remaining eight others form the training set. During this stage, hyperparameters are tuned, and features are selected such that the prediction accuracy is maximized following a threestep process. 3. The final hyperparameter tuning is performed based on the optimal set of features using a grid search approach. "n_estimators" is varied from 100 to 400 in steps of 100, and "max_samples" is varied from 0.2 to 0.8 in steps of 0.1. All the other parameters are set to default values in Scikit-learn [20].
A classification model with a high predictive potential is thus obtained from the nine ternaries and applied to the prediction of the phase diagram that is considered unknown. A practical example of the model optimization procedure can be referred to in Supplementary Note B.

Classification performance
The average of prediction accuracies realized using RFCs across the 10 considered ternary sections is summarized in Fig. 3(a). It is calculated from the confusion matrices presented in Supplementary Note A (Tables S2-4). It is noted that this metric corresponds to the accuracy calculated using nested cross-validation [42], which is also called double cross-validation ( Fig. 2). Here, we compare the results obtained using three different feature sets: "Magpie," "Magpie + Thermo," and "Magpie + Thermo + CALPHAD." In addition, the results obtained when extrapolating the ternaries from their constitutive binaries using CALPHAD calculations are also presented for comparison. It is emphasized that, in this study, a given A-  Firstly, each of the investigated RFCs significantly outperformed the benchmark case, for which classes were attributed randomly, as presented in Fig. 3(a). This is an evidence that the prediction strategy used in this study is working as expected.
Although the prediction accuracy is slightly increased, the "Magpie + Thermo" model does not significantly outperform the model trained using "Magpie" features only. However, as is presented shortly, "Thermo" descriptors rank high in the calculated feature importance, which implies that these descriptors must be important for predicting phase diagrams.
It is also noted that the isothermal sections obtained using CALPHAD extrapolations from the binaries are on average more accurate than the ones predicted based on the "Magpie" and "Magpie + Thermo" descriptor sets. However, it is emphasized that CALPHAD extrapolations and RFC predictions are fundamentally different; each approach has its own strengths, as is discussed in Section 4. Moreover, these first two RFCs result in relatively accurate predictions based only on the composition and properties of the pure elements, whereas additional information is required to perform CALPHAD extrapolations.
The ternary isotherms are on average best predicted by the RFC trained using the "Magpie + Thermo + CALPHAD" descriptor set. A 20% increase in the accuracy is observed as compared to the two other investigated models, i.e., "Magpie" and "Magpie + Thermo." This significant improvement resulted mainly from the addition of only three features. Among them, the number of coexisting phases calculated by extrapolation from the binaries ("Extrapolated n_phase") can be considered to be an estimate of the target variable.
Therefore, the last RFC can be considered as a simplified case wherein the error from the CALPHAD extrapolations must be predicted rather than the number of coexisting phases.
This is similar to the so-called crude estimation of property strategy used in ML [43,44]. It is emphasized that, as shown in Fig. 3(b), when the CALPHAD extrapolations from the binaries are accurate, as in the Al-Mg-Si case, the results of the "Magpie + Thermo + CALPHAD" RFC are equally good. However, when they are inaccurate, as in the Al-Cu-Mg case, this RFC still performs better than the other two RFCs. The only case wherein CALPHAD extrapolations are found to be significantly more accurate than the "Magpie + Thermo + CALPHAD" RFC is the Mg-Si-Zn system. For this ternary, the probabilities of having twoor three-phase domains are both calculated to be close to 50% in the central part of its 800 K section (Supplementary Note D, Fig. S13). As a result, the predicted section is less accurate, although a precise understanding of the phase equilibria is still obtained by observing the probability distribution of each label. It is noted that, in addition to the RFC, we also use the SVM classifier [19] for these prediction problems, and slightly lower performances are obtained (Supplementary Note C). score of the "three-phase domain" class is undefined for two systems out of the 10 systems examined, wherein this outcome is never predicted. Thus, these cases are omitted from the calculation of the mean F1 score, which possibly results in an optimistically biased performance evaluation of this class. As shown in Fig. 3(c), the prediction of three-phase domains is the most difficult task. For this class, we confirmed that the precision of the RFCs is generally relatively high, but their recall is low. This indicates that insufficient points are labeled as three-phase domains in the predicted phase diagrams. In contrast, the single-phase domains are best predicted. This is especially true when using the "Magpie + Thermo + CALPHAD" descriptor set, wherein an average F1 score of 0.85 is obtained. This is a better performance than those of both CALPHAD extrapolations and other RFCs. We confirmed that adoption as a feature of the excess Gibbs energy in the liquid phase, as extrapolated from the binaries, played an important role in achieving this outcome. It is interesting to discuss this positive result in the context of the prediction of single-phase solid solution for multiprincipal element alloys (MPEAs, also referred to as high-entropy alloys). In related studies, the enthalpy of mixing is often considered as a descriptor [45][46][47][48][49][50]. However, it is calculated based on Miedema's scheme with the use of enthalpy data for liquids [51], and it was noted [51] that this treatment generally results in relatively large errors. Furthermore, only the configurational entropy is usually considered. It has been highlighted [51,52] that this ideal behavior is more of an exception than the norm in MPEAs. Therefore, it is expected that an enhanced performance can be realized by considering the excess thermodynamic properties as calculated using the CALPHAD framework. It is expected that a reliable thermodynamic description of these complex multicomponent solutions can be obtained via extrapolation from binaries and ternaries, as suggested by a recent study on the enthalpy of mixing of the Co-Cr-Fe-Mn-Ni FCC phase [53]. It is emphasized that both the mixing enthalpy and entropy can be calculated in a spreadsheet directly from the composition and interaction parameters found in published thermodynamic databases. For materials informatics studies wherein a large compositional space is investigated, simply considering extrapolations from binaries may be an interesting compromise. Because this is a nontrivial task for those unfamiliar with the CALPHAD formalism, the calculation of the excess thermodynamic properties by extrapolation from the binaries is detailed in the appendix. Furthermore, a Python script is made available to obtain these easily (Section 2.2.3).

Important features
For the present classification task, we consider feature selection to be a critical part of the model optimization. Indeed, before and after this stage, which is described as step 2 in Section 2.2.2, a flat increase in accuracy of 8.4% is observed on average. In comparison, hyperparameter tuning performed during steps 1 and 3 only resulted in variations in accuracy of approximately 1%. After the feature selection, 11 features remained on average without any significant shift for the three descriptor sets. Figure 4 presents the selected features for each descriptor set. Only the features that are selected in at least two of the 10 cases are presented herein. On comparing the results obtained using the "Magpie" and "Magpie + Thermo" descriptor sets, it is found that the selected features differ significantly, although the prediction accuracies are close (Fig. 2). Indeed, in the case of "Magpie + Thermo," the thermodynamic properties tend to be selected as important features. These "Thermo" descriptors are also actively selected with the use of the "Magpie + Thermo + CALPHAD" descriptor set. This implies that these thermodynamic descriptors are useful for predicting phase diagrams. For the RFC trained using the "Magpie + Thermo + CALPHAD" set, the number of coexisting phases calculated by extrapolation from the binaries is the most important feature. Another noteworthy feature is the excess Gibbs energy in the liquid phase as extrapolated from the binaries. Indeed, this descriptor is selected in all 10 cases and ranked third on average in terms of feature importance.

Use of predictions to guide experiments
These predictions provide insights into phase equilibria and can thus be useful for planning experiments. To illustrate this, the Cu-Mg-Zn ternary system is considered as an example.
This system is rather complicated, notably owing to the formation of the ternary Laves C36 phase and the significant solubility of Zn in the Cu2Mg (Laves C15) phase. As a result, the 800 K isothermal section presented in Fig. 5 (a) differs significantly from that extrapolated from the binaries presented in Fig. 5 (b). As discussed in Section 3.1, the RFC tends to underestimate the probability of having three-phase domains. As a result, this class is almost absent from the section predicted using the "Magpie + Thermo + CALPHAD" descriptor set presented in Fig. 5 (c). In contrast, the prediction of single-phase domains is significantly better.

Discussion
The results obtained for each of the 10 isothermal sections and three descriptor sets Therefore, a better performance is expected at relatively high temperatures close to the liquidus, where solutions extend into the diagram, but some compounds remain stable.
Furthermore, the best prediction results are obtained when using the "Magpie + Thermo + CALPHAD" descriptor set for the Al-Mg-Si, Al-Si-Zn, and Mg-Si-Zn systems. In all three cases characterized by the absence of ternary phases, the 800 K isothermal section is predicted not only with a high level of accuracy, but also with a high level of confidence. In the present dataset, the classes are relatively well-balanced. However, for other systems and temperatures, class imbalance can become a problem, in which case undersampling and oversampling techniques may be important in achieving good results.
This study is focused on cases wherein the phase diagram of interest is completely unknown, except for its constitutive binaries. If partial data are available in the ternary phase diagram, they can be directly included in the training set. The strategies for guiding the experiments discussed herein can thus become part of an iterative process, such as black-box optimization [54,55], wherein the newly obtained data are used to refine the predictions before planning for the next step. It would be interesting to investigate the extent to which the performance of the model could be improved at each iteration.
We should emphasize that this study is our first attempt at predicting unknown phase diagrams from known phase diagrams. A certain degree of success is achieved, although only nine phase diagrams are used to train the models, and the prediction target is the number of coexisting phases. Future perspectives for improving the present approach include increasing the size of the dataset, introducing other appropriate labels for each phase, and accounting for temperature variations. To achieve this, the phase diagram data for various systems must be collected by performing CALPHAD calculations. These potential research directions are being considered for future works.

Conclusions
Phase diagram prediction using ML was investigated by focusing on the ternary subsystems of the Al-Cu-Mg-Si-Zn quinary. Each of the 10 ternaries was considered to be unknown, and the number of coexisting phases across its 800 K isothermal section was predicted from the 9 others. Special emphasis was placed on introducing new descriptors for predicting the phase diagrams. It is emphasized that impactful features were obtained from CALPHAD extrapolations from the binary systems. To the best of our knowledge, this is a new strategy for generating descriptors, and it significantly improved the model performance in the present study. Using the most complete set of descriptors and a random forest algorithm, an average accuracy of 84% with a standard deviation of 11% was obtained across the 10 considered ternary sections. It should be noted that the accuracy is dependent on the system, temperature, and training set. It was demonstrated that the predictions can provide insights into phase equilibria in unknown materials systems, especially when combined with CALPHAD extrapolations. It is thus concluded that the proposed approach is promising for promoting more efficient determination of phase diagrams. We are currently working on the construction of a larger dataset to expand our approach to other elements.
Appendix. CALPHAD extrapolation of the excess thermodynamic properties of a substitutional solution from its binary subsystems For a given A-B binary substitutional solution denoted by φ, the molar excess Gibbs energy is modeled within the CALPHAD framework using a Redlich-Kister polynomial that includes interaction parameters: with the molar fraction of constituent , and an integer. , and , form the interaction parameters of order , which can be obtained from CALPHAD publications in tables under the notation , . In thermodynamic databases in TDB format such as those available in NIMS CPDDB [56], binary interaction parameters are found after the keyword "PARAMETER ( , , ; )".
For a substitutional solution of constituents ( > 2), the main contribution to the excess Gibbs energy is obtained by extrapolation from its binary subsystems. Various extrapolation methods are available, as discussed in [57,58]. The Muggianu formalism is most commonly used because the contribution from each binary can be directly calculated using Eq. (1), without the requirement for any weighting. Thus, the contribution to the excess thermodynamic properties from the binaries is obtained by the summation of Eq. (1) across all the cases as follows: where , and , are the excess enthalpy and excess entropy as extrapolated from the binaries, i.e., on disregarding ternary and eventual higher-order interactions between the elements. The excess enthalpy directly corresponds to the enthalpy of mixing, whereas the configurational entropy must be added to the excess entropy to obtain the entropy of mixing. In addition to random forest, phase diagram prediction was also investigated using support vector machine (SVM) while focusing on the case wherein the "Magpie + Thermo + CALPHAD" dataset is used. The C-support vector classifier (SVC) was implemented using the Scikit-learn library [1]. The model was optimized following a procedure similar to that described in Section 2.3.2 of the manuscript for the RFC; however, the feature selection was not performed as the strategy used was not transposable to the SVM case. An "rbf" kernel was selected. Only the gamma and C hyperparameters were tuned in the inner crossvalidation loop. This optimization procedure is illustrated in Fig. S2 while using the prediction of the Al-Cu-Zn system as an example.   2 nd row : (From left to right) Sections predicted using the "Magpie," "Magpie + Thermo," and "Magpie + Thermo + CALPHAD" descriptor sets, respectively.
 3 rd row : (From left to right) Probabilities across the section of having a single-phase domain as predicted using the "Magpie," "Magpie + Thermo," and "Magpie + Thermo + CALPHAD" descriptor sets, respectively.
 4 th row : (From left to right) Probabilities across the section of having a two-phase domain as predicted using the "Magpie," "Magpie + Thermo," and "Magpie + Thermo + CALPHAD" descriptor sets, respectively.
 5 th row : (From left to right) Probabilities across the section of having a three-phase domain as predicted using the "Magpie," "Magpie + Thermo," and "Magpie + Thermo + CALPHAD" descriptor sets, respectively.
 6 th row : (From left to right) Probabilities across the section of having another class than the one obtained using CALPHAD extrapolation as predicted using the "Magpie," "Magpie + Thermo," and "Magpie + Thermo + CALPHAD" descriptor sets, respectively.