Simulation and Prediction of the Vickers Hardness of AZ91 Magnesium Alloy Using Artiﬁcial Neural Network Model

: In this study, an artiﬁcial neural network (ANN) model was used to simulate and predict the Vickers hardness of AZ91 magnesium alloy. The samples of AZ91 alloy were aged at di ﬀ erent temperatures ( T a = 100 to 300 ◦ C) for di ﬀ erent durations ( t a = 4 to 192 h) followed by water quenching at 25 ◦ C. The age-hardening response of the samples was investigated by hardness measurements. The microstructure investigations showed that only discontinuous precipitates formed at low aging temperatures (100 and 150 ◦ C), while continuous precipitates invaded all the samples at a high aging temperature (300 ◦ C). Both discontinuous and continuous precipitates formed at the intermediate aging temperatures (200 and 250 ◦ C). X-ray di ﬀ raction (XRD) analysis revealed that the microstructure comprised two phases: The α -Mg matrix and intermetallic β -Mg 17 Al 12 phase. The alteration of the crystalline lattice parameters a , c , and c / a ratio with the aging time at various aging temperatures was also investigated. Both c and c / a ratio had the same behavior with aging time while a had an inverse trend. The observed variations of the lattice parameters were attributed to the mode of precipitation in AZ91 alloy. The ANN ﬁndings for the simulation and prediction perfectly conformed to the experimental data.


Introduction
Magnesium alloys play an important role in engineering applications, on account of their excellent properties such as high specific strength, high specific stiffness, good castability, excellent machinability, and abundant resources. These properties improve energy efficiency and decrease carbon dioxide emissions as well as other greenhouse gases [1,2]. Among various magnesium alloys, AZ91 alloy (Mg-9 wt.% Al-1 wt.% Zn) has superior resistance to corrosion and good mechanical characteristics [3]. It is well established [4] that the solid solubility of Al in α-Mg matrix attains its maximum value (12.7 wt.%) at 437 • C for the Mg-Al binary system. Zinc is added to this binary system to reduce the high solid solubility of Al during the aging process. As the Al/Zn ratio exceeds 3:1, only β-Mg 17 Al 12 phase precipitates. Consequently, corrosion resistance and mechanical properties will be improved [2].
The β-Mg 17 Al 12 phase can be precipitated in the AZ91 alloys continuously or discontinuously. The lamellar structure of discontinuous precipitation (DP) forms along the grain boundaries of α-Mg [5][6][7][8][9][10]. The continuous precipitation (CP) occurs in the form of lath-type or fine plate-type morphologies inside α-Mg grains which have not been occupied by DP [11][12][13][14]. At low aging temperatures, DP is favored while CP invades all samples at high aging temperatures. The continuous, as well as the annealing, the specimens were exposed to solution heat treatment at a temperature of 420 • C for 24 h in a protective argon atmosphere. The annealing furnace (model no. T-5.0x10-w-200, Heraeus type, Germany), power 380 V/50 Hz, 80 Amp was used in the present work. Temperature variations during heat treatment were recorded by a 0.8-mm diameter chromel-alumel (type K) thermocoupler, which was connected to a computer-based acquisition system. Later, all samples were dropped into the water at 25 • C (room temperature) so as to quench and conserve the supersaturated solid solution. Finally, the solution-treated specimens were aged at various temperatures (T a = 100, 150, 200, 250, and 300 • C) for different durations (t a = 4, 8, 12, 24, 48, 96, 144, and 192 h) followed by water quenching at 25 • C in order to study the age-hardening response of AZ91 alloy as shown in Figure 1. The temperature measurement accuracy was ±1 • C. 420 °C for 24 h in a protective argon atmosphere. The annealing furnace (model no. T-5.0x10-w-200, Heraeus type, Germany), power 380 V/50 Hz, 80 Amp was used in the present work. Temperature variations during heat treatment were recorded by a 0.8-mm diameter chromel-alumel (type K) thermocoupler, which was connected to a computer-based acquisition system. Later, all samples were dropped into the water at 25 °C (room temperature) so as to quench and conserve the supersaturated solid solution. Finally, the solution-treated specimens were aged at various temperatures (Ta = 100, 150, 200, 250, and 300 °C) for different durations (ta = 4, 8, 12, 24, 48, 96, 144, and 192 h) followed by water quenching at 25 °C in order to study the age-hardening response of AZ91 alloy as shown in Figure 1. The temperature measurement accuracy was ±1 °C.
To reveal the microstructure of the investigated samples, they were ground and polished according to the usual magnesium alloys' procedures [31]. Then, the prepared specimens were etched for about 90 s in a nitric acid solution (4 mL HNO3 and 96 mL C2H5OH). Afterward, the samples were cleaned with anhydrous ethyl alcohol and then dried with air blast. The microstructure examinations were performed on a light microscope Olympus BH2 (Olympus Co., Ltd., Bangkok, Thailand) equipped with a Leica DC 200 MTV-3 camera. A Shimadzu D6000 X-ray diffractometer (Shimadzu Corporation, Tokyo, Japan) with Cu-Kα radiation operated at 30 kV and 30 mA (with wavelength λ of 0.15406 nm) was used to distinguish the formed phases.  The age-hardening response was investigated using a Vickers hardness testing machine under a load of 0.5 kg for 10 s at room temperature. To ensure reproducibility, the average of 10 random indentations was taken to calculate each reported hardness value.

Artificial Neural Network (ANN)
A nonlinear function mapping of the input variables in the corresponding network output variables was provided by the artificial neural network (ANN), and it was not required to have the real mathematics form of the relation between the input and output variables [30]. The most commonly used type of feedforward neural network is multilayer perceptron (MLP). MLP neural network has many layers of simple neurons which are coordinated in a manner that every neuron in a layer is linked to every neuron in the following by weight (see Figure 2). These layers are an input layer, at least one hidden layer, and an output layer. The sum of weighted inputs was calculated by all neuron and then converted by the next transfer function: To reveal the microstructure of the investigated samples, they were ground and polished according to the usual magnesium alloys' procedures [31]. Then, the prepared specimens were etched for about 90 s in a nitric acid solution (4 mL HNO3 and 96 mL C2H5OH). Afterward, the samples were cleaned with anhydrous ethyl alcohol and then dried with air blast. The microstructure examinations were performed on a light microscope Olympus BH2 (Olympus Co., Ltd., Bangkok, Thailand) equipped with a Leica DC 200 MTV-3 camera. A Shimadzu D6000 X-ray diffractometer (Shimadzu Corporation, Tokyo, Japan) with Cu-Kα radiation operated at 30 kV and 30 mA (with wavelength λ of 0.15406 nm) was used to distinguish the formed phases.
The age-hardening response was investigated using a Vickers hardness testing machine under a load of 0.5 kg for 10 s at room temperature. To ensure reproducibility, the average of 10 random indentations was taken to calculate each reported hardness value.

Artificial Neural Network (ANN)
A nonlinear function mapping of the input variables in the corresponding network output variables was provided by the artificial neural network (ANN), and it was not required to have the real mathematics form of the relation between the input and output variables [30]. The most commonly used type of feedforward neural network is multilayer perceptron (MLP). MLP neural network has many layers of simple neurons which are coordinated in a manner that every neuron in a layer is linked to every neuron in the following by weight (see Figure 2). These layers are an input layer, at least one Crystals 2020, 10, 290 4 of 14 hidden layer, and an output layer. The sum of weighted inputs was calculated by all neuron and then converted by the next transfer function: where n j is the output of the j-th neuron, and x is provided with: where w ij is the weights applied from the i-th neurons in the previous layer to the j-th neurons, p i is the output from the i-th neuron, and b is a bias term.
Crystals 2020, 10, x FOR PEER REVIEW 4 of 15 where nj is the output of the j-th neuron, and x is provided with: where wij is the weights applied from the i-th neurons in the previous layer to the j-th neurons, pi is the output from the i-th neuron, and b is a bias term. The MLP networks utilize a supervised learning technique. Both back propagation error (BPE) and training data, in the training algorithm, are provided to the networks by the weights adjustment and biases until the expected values for the network are consistent with the actual values. This adjustment is made with the BPE training algorithm by the comparison between the actual value tij and the expected values aij of the network by calculating the total sum of the square error (SSE) for the n data of the training dataset,  In this study, the ANN model based on multilayer perceptron was used to compute Vickers hardness values. The ANN model was configured to have aging temperatures and aging times as inputs and Vickers hardness values as output, as shown in Figure 3. Various network settings were attempted to provide the best mean square errors (MSE) and the best results using the input-output scheme. The three hidden layers' configuration with different neurons were chosen. In every hidden The MLP networks utilize a supervised learning technique. Both back propagation error (BPE) and training data, in the training algorithm, are provided to the networks by the weights adjustment and biases until the expected values for the network are consistent with the actual values. This adjustment is made with the BPE training algorithm by the comparison between the actual value t ij and the expected values a ij of the network by calculating the total sum of the square error (SSE) for the n data of the training dataset, In this study, the ANN model based on multilayer perceptron was used to compute Vickers hardness values. The ANN model was configured to have aging temperatures and aging times as inputs and Vickers hardness values as output, as shown in Figure 3. Various network settings were attempted to provide the best mean square errors (MSE) and the best results using the input-output scheme. The three hidden layers' configuration with different neurons were chosen. In every hidden layer, the number of neurons was 34, 24, and 25, respectively. The transfer functions were logsig function for all hidden layers and linear pureline function for output layer.  In this study, the ANN model based on multilayer perceptron was used to compute Vickers hardness values. The ANN model was configured to have aging temperatures and aging times as inputs and Vickers hardness values as output, as shown in Figure 3. Various network settings were attempted to provide the best mean square errors (MSE) and the best results using the input-output scheme. The three hidden layers' configuration with different neurons were chosen. In every hidden  Figure 4 depicted the age-hardening response of AZ91 magnesium alloy at various aging temperatures. The dashed lines interpolate the experimental points represented by the markers. A little augment in the hardness with increasing aging time was detected for specimens aged at 100 • C. The hardness values started to increase considerably when aging at 150 • C without the attainment of its peak hardness within the examined time interval. After aging at 200 • C, the hardness considerably improved with the extension of aging time, achieving its peak value after 24 hours, and, subsequently, further aging times reduced the hardness values. The same tendency was found at the 250 • C aging curve as that at 200 • C, but with the lower hardness values. For 250 • C aging curve, the peak hardness was reached after about 12 h, which was 12 h earlier than that at 200 • C. This points out that the age-hardening response of AZ91 was accelerated at a higher temperature. No major hardness changes were observed for the AZ91 alloy aged at 300 • C.  Figure 4 depicted the age-hardening response of AZ91 magnesium alloy at various aging temperatures. The dashed lines interpolate the experimental points represented by the markers. A little augment in the hardness with increasing aging time was detected for specimens aged at 100 °C.

Results and Discussion
The hardness values started to increase considerably when aging at 150 °C without the attainment of its peak hardness within the examined time interval. After aging at 200 °C, the hardness considerably improved with the extension of aging time, achieving its peak value after 24 hours, and, subsequently, further aging times reduced the hardness values. The same tendency was found at the 250 °C aging curve as that at 200 °C, but with the lower hardness values. For 250 °C aging curve, the peak hardness was reached after about 12 h, which was 12 h earlier than that at 200 °C. This points out that the age-hardening response of AZ91 was accelerated at a higher temperature. No major hardness changes were observed for the AZ91 alloy aged at 300 °C. The vital agents that dominate the characteristics of precipitation-hardened alloys are the size, type, distribution, and morphology of the new strengthening precipitates in the original matrix [32]. The variations in the age-hardening curves at various aging temperatures can be ascribed to the interaction between the moving dislocations and β-Mg17Al12 precipitates. At the lower aging temperature of 100 °C, the hardness increased slightly with an increase in aging time from 4 to 192 h. The microstructure of AZ91 samples aged at 100 °C for 4 and 192 h are, respectively, shown in Figure  5a,b. The microstructure investigation showed the existence of α-Mg as a matrix and there was no β-Mg17Al12 phase for sample aged for 4 h (Figure 5a). This may be rendered to that 4 hours were insufficient aging time to produce the DP. With the increment in the aging duration up to 192 h, the discontinuous precipitation colonies of the β (Mg17Al12) phase (dark contrast of the second phase) started to form within the primary α-Mg matrix (light background) (Figure 5b). The existence of a The vital agents that dominate the characteristics of precipitation-hardened alloys are the size, type, distribution, and morphology of the new strengthening precipitates in the original matrix [32]. The variations in the age-hardening curves at various aging temperatures can be ascribed to the interaction between the moving dislocations and β-Mg 17 Al 12 precipitates. At the lower aging temperature of 100 • C, the hardness increased slightly with an increase in aging time from 4 to 192 h. The microstructure of AZ91 samples aged at 100 • C for 4 and 192 h are, respectively, shown in  (Figure 5a). This may be rendered to that 4 hours were insufficient aging time to produce the DP. With the increment in the aging duration up to 192 h, the discontinuous precipitation colonies of the β (Mg 17 Al 12 ) phase (dark contrast of the second phase) started to form within the primary α-Mg matrix (light background) (Figure 5b). The existence of a slight volume fraction of the second phase (β-Mg 17 Al 12 ) would lead to a little increase in the hardness. When the samples aged at 150 °C, the hardness values improved continuously with the aging time increment. No peak hardness was detected for AZ91 samples aged at 150 °C even after aging for 192 h. Our results are consistent with those reported by Celotto [33], who found that the peak hardness at 150 °C reached 100 HV after aging for 10,000 h. Figure 6a−d displays typical optical images of samples aged at 150 °C for 4, 24, 96, and 192 h, respectively. It is obviously seen that the microstructure containing the β (Mg17Al12) phase existed at the α-Mg grain boundaries. By extending aging time, the nucleation sites of DP increased and the previously formed DP continued to expand towards the inside grains and into the adjacent grains as distinguished from the microstructures of samples aged for 24 and 96 h (Figure 6b,c). After aging for 192 h, the sample was invaded by the DP (Figure 6d). It has been reported [34] that the β (Mg17Al12) phase nucleated at the grain boundaries then developed as the grain boundaries, migrating towards the adjacent grains. The depletion of Al solute atoms behind grain boundaries should associate this migration. Zheng et al. [35] indicated that the migration of the grain boundary would enhance the nucleation and growth of DP. Therefore, the grain boundary migration performed a significant role in the nucleation and growth of DP [36]. Figure 6 confirms that the volume fraction of DPs increased with the aging time, resulting in higher hardness values (Figure 4). Figure 7 exhibits typical optical images of samples aged at 200 °C for different times. After the aging treatment for 4 h, it was detected the lamellar structure of the DPs distributed along the grain boundaries of the α-Mg matrix (Figure 7a). The microstructure evolution showed that the whole sample had been invaded by the DP as the aging time increased from 4 to 24 hours (Figure 7b). However, when the sample aged for 24 hours, the maximum hardness value was achieved. The DPs that acted as an impediment to dislocation motion led to a maximum hardness value. The reduction in the hardness values with the aging period interval (24−92 h) might be attributed to the existence of both CPs and DPs (Figure 7c). It has been stated [37,38] that the growth rate of discontinuous precipitates would terminate if the grains were filled with the DPs or if CPs began to grow considerably and hinder the propagation of the discontinuous precipitates. Thus, the volume fraction of continuous precipitates grew as the aging time increased from 24 to 96 h, and that of discontinuous precipitation gradually reduced, resulting in lower hardness values. Earlier studies [39,40] declared that discontinuous precipitates were effectively inhibited as the continuous precipitates were formed. Dissimilar to the microstructure of the sample aged for 92 h (Figure 7c), plenty of lath-shaped precipitates occupied the whole sample, and no discontinuous precipitates were detected (Figure 7d). Since the CPs consisting of coarsely lath-shaped precipitates lie on the base plane of matrix, there are great opportunities for dislocations to bypass the obstacles leading to lower hardness values. Comparing the micrographs shown in Figures 7 and 8, it is clear that the microstructure is identical, while the volume fraction of β-phase differs. The samples aged at 200 °C had volume fraction of β- When the samples aged at 150 • C, the hardness values improved continuously with the aging time increment. No peak hardness was detected for AZ91 samples aged at 150 • C even after aging for 192 h. Our results are consistent with those reported by Celotto [33], who found that the peak hardness at 150 • C reached 100 HV after aging for 10,000 h. Figure 6a−d displays typical optical images of samples aged at 150 • C for 4, 24, 96, and 192 h, respectively. It is obviously seen that the microstructure containing the β (Mg 17 Al 12 ) phase existed at the α-Mg grain boundaries. By extending aging time, the nucleation sites of DP increased and the previously formed DP continued to expand towards the inside grains and into the adjacent grains as distinguished from the microstructures of samples aged for 24 and 96 h (Figure 6b,c). After aging for 192 h, the sample was invaded by the DP (Figure 6d). It has been reported [34] that the β (Mg 17 Al 12 ) phase nucleated at the grain boundaries then developed as the grain boundaries, migrating towards the adjacent grains. The depletion of Al solute atoms behind grain boundaries should associate this migration. Zheng et al. [35] indicated that the migration of the grain boundary would enhance the nucleation and growth of DP. Therefore, the grain boundary migration performed a significant role in the nucleation and growth of DP [36]. Figure 6 confirms that the volume fraction of DPs increased with the aging time, resulting in higher hardness values ( Figure 4). Figure 7 exhibits typical optical images of samples aged at 200 • C for different times. After the aging treatment for 4 h, it was detected the lamellar structure of the DPs distributed along the grain boundaries of the α-Mg matrix (Figure 7a). The microstructure evolution showed that the whole sample had been invaded by the DP as the aging time increased from 4 to 24 hours (Figure 7b). However, when the sample aged for 24 hours, the maximum hardness value was achieved. The DPs that acted as an impediment to dislocation motion led to a maximum hardness value. The reduction in the hardness values with the aging period interval (24−92 h) might be attributed to the existence of both CPs and DPs (Figure 7c). It has been stated [37,38] that the growth rate of discontinuous precipitates would terminate if the grains were filled with the DPs or if CPs began to grow considerably and hinder the propagation of the discontinuous precipitates. Thus, the volume fraction of continuous precipitates grew as the aging time increased from 24 to 96 h, and that of discontinuous precipitation gradually reduced, resulting in lower hardness values. Earlier studies [39,40] declared that discontinuous precipitates were effectively inhibited as the continuous precipitates were formed. Dissimilar to the microstructure of the sample aged for 92 h (Figure 7c), plenty of lath-shaped precipitates occupied the whole sample, and no discontinuous precipitates were detected (Figure 7d). Since the CPs consisting of coarsely lath-shaped precipitates lie on the base plane of matrix, there are great opportunities for dislocations to bypass the obstacles leading to lower hardness values. Comparing the micrographs shown in Figures 7  and 8, it is clear that the microstructure is identical, while the volume fraction of β-phase differs. The samples aged at 200 • C had volume fraction of β-phase that was considerably denser than that of the 250 • C samples, which could explain the higher hardness values for samples aged at 200 • C. The hardness response for all the AZ91 samples aged at 300 • C for various times (4-192 h) was nearly constant, and it was found to be lower than that of the samples aged at 250 • C. The low hardness response for aging at 300 • C may be rendered to the formation, growth, and coarsening of CPs. The CPs of the small number and large size were less effective to prevent the dislocations' motion. This trend would lead to a loss of hardness. The CPs' precipitating during aging at 300 • C in the present work agrees with the previous results of AZ91 alloy investigations [8,33,41].
Crystals 2020, 10, x FOR PEER REVIEW 7 of 15 samples aged at 250 °C. The low hardness response for aging at 300 °C may be rendered to the formation, growth, and coarsening of CPs. The CPs of the small number and large size were less effective to prevent the dislocations' motion. This trend would lead to a loss of hardness. The CPs' precipitating during aging at 300 °C in the present work agrees with the previous results of AZ91 alloy investigations [8,33,41].      X-ray diffraction (XRD) measurements were applied for the studied samples aged at different temperatures for various aging durations. The recorded XRD series for all the investigated samples included both α-Mg with hcp crystal structure according to JCPDS card no. 65-3365 and bodycentered cubic crystal structured (β-Mg17Al12 phase) according to JCPDS card no. 73-1148. The crystalline lattice parameters a, c, and c/a ratio were calculated for α-Mg matrix at different aging X-ray diffraction (XRD) measurements were applied for the studied samples aged at different temperatures for various aging durations. The recorded XRD series for all the investigated samples included both α-Mg with hcp crystal structure according to JCPDS card no. 65-3365 and body-centered cubic crystal structured (β-Mg 17 Al 12 phase) according to JCPDS card no. 73-1148. The crystalline lattice parameters a, c, and c/a ratio were calculated for α-Mg matrix at different aging temperatures and indexed with errors in Table 2 by the aid of X-ray data. The errors were calculated for a, c, and c/a ratio with respect to their standard values recorded in JCPDS card no. 65-3365 for α-Mg phase (a = 3.208 Å, c = 5.21 Å, and c/a = 1.62406). For α-Mg phase of hcp crystal structure, the interplanar distance, d, between these two planes (100) and (101) can be correlated to a and c lattice parameters through the following equation: 1   [39,41]. The separation of aluminum to form β-Mg 17 Al 12 phase may be held responsible for the alteration in the lattice parameter values. Moreover, the precipitation mechanism was improved at 200 • C, which strongly affected the hardness values of the investigated alloy.  The ANN model was used to simulate and predict the Vickers hardness of AZ91 magnesium alloy. Two inputs parameters, aging time (t a ) and aging temperature (T a ), were taken into account to simulate the Vickers hardness as an output parameter. The data were taken from the experimental results. The transfer function was selected as a logsig and pureline for hidden layers and output layer, respectively. Experimental data were used for training the model. The ANN was trained with measured datasets at 100, 150, 200, and 250 • C. The training was carried out for 541 iterations (epochs). The artificial neural network was endeavoring to get a better mean square error (MSE) and best execution for the network. The goal of the training was 10 −5 (MSE = 10 −5 ) and we reached the nearest value (best) to this goal.
The result of training is shown in Figure 10. It is clearly seen that the mean squared error of the network decreased from a large value to a smaller value. Moreover, the network was learning. After the network memorized the training set, training was completed. The obtained equation (which represents the hardness, H v ) for network is represented in Appendix A. The best ANN model training was obtained according to the value of MSE (9.8256 × 10 −6 ) which represented the difference between simulation results and experimental data. The performance of the ANN model was validated by comparing the prediction values at 300 • C with the measured experimental data. The predicted values were in good agreement with the measured dataset at 300 • C. Results of simulation, prediction, and experimental values are shown in Figure 11. The age-hardening response was simulated at temperatures of 100, 150, 200, and 250 • C and predicted at temperature of 300 • C. Figure 11 depicts that the simulation and prediction results of the ANN were in good agreement with experimental data of the age-hardening response of the investigated alloy. Comparison between the ANN results and experimental data is depicted in Table 3. In summary, the present study showed that the ANN model can effectively simulate and predict the age-hardening response of AZ91 magnesium alloy.

Conclusions
In this article, the artificial neural network (ANN) model was adopted to simulate and predict the hardness profiles of AZ91 magnesium alloy. The results of ANN were compared with the experimental data and the following conclusions could be drawn from this study: (1) The microstructure evolutions revealed that the mode of precipitation in AZ91 alloy was strongly affected by aging temperature and time of aging. The discontinuous precipitation was favored at low temperatures of aging (100 and 150 • C), while at high aging temperature (300