The Evaluation of the Corrosion Rates of Alloys Applied to the Heating Tower Heat Pump (HTHP) by Machine Learning

The corrosion rate is an important indicator describing the degree of metal corrosion, and quantitative analysis of the corrosion rate is of great significance. In the present work, the support vector machine (SVM) and the artificial neural network (ANN) integrating the k-fold split method and the root-mean-square prop (RMSProp) optimizer are used to evaluate the corrosion rates of alloys, i.e., copper H65, aluminum 3003, and 20# steel, applied to the heating tower heat pump (HTHP) in various anti-freezing solutions at different corrosion times, flow velocities, and temperatures. The mean-square error (MSE) versus the epoch of the ANN model shows that the result breaks the local minimum and is at or close to the global minimum. Comparisons of the SVM-/ANN-evaluated corrosion rates and the measured ones show good agreements, demonstrating the good reliability of the obtained SVM and ANN models. Moreover, the ANN model is recommended since it performs better than the SVM model according to the obtained R2 value. The present work can be further applied to predicting the corrosion rate without any prior experiment for improving the service life of the HTHP.


Introduction
According to the International Energy Agency (IEA), calculation results for the global energy consumption in the field of construction, the global construction industry (including house construction and infrastructure construction), and end-use energy related to building operation accounted for 35% of the global energy consumption in 2018. Among these, the end-use energy of building construction and infrastructure construction accounted for 6%, while the energy consumed by building operation accounted for 30% of the global energy consumption. Moreover, in the construction sector, heating and cooling consume more than 60% of the overall energy consumption [1]. Therefore, reducing air-conditioning energy consumption and developing renewable energy are critical ways to building a resource-saving and environment-friendly society.
The heating tower heat pump (HTHP) is a convenient heating and cooling source for air-conditioning. The detailed strategy of the HTHP system is illustrated in Figure 1. As shown in Figure 1, the cold anti-freezing solution is sprayed from the top of the tower during heating; this solution comes in contact with air and thus absorbs the sensible and latent heat energy from the air. Subsequently, the solution is sent into the evaporator, where the heat energy can be transferred from the solution to the refrigerant. Therefore, the anti-freezing solution is cold again and then is pumped back to the heating tower for the next circulation. In the heat pump system, the heat energy absorbed by the heating tower is transferred to the indoor environment through the reverse Carnot cycle. In summer, the system stores the anti-freezing solution in a liquid storage tank to avoid solution waste and environmental pollution. Meanwhile, the system injects water into circulation, and the heat source tower Therefore, the HTHP has unique advantages and has been widely researched and applied. However, the current research on HTHP mainly focuses on operating characteristics and structural optimization [5][6][7]. To summarize, Liang et al. [8] built an experimental platform for the HTHP to study the heat transfer performance of the open heating tower at different temperatures of the inlet solutions. Huang [9] studied the laws and design methods of heat and mass transfer, the characteristics and optimization of system operation, and the performance evaluations of the heating tower by combining theory, simulation, and experiment. Su [10] used a 25% NaCl solution as the anti-freezing solution to build a cross-flow HTHP system in Tianjin, China, to explore the feasibility of the HTHP system in winter, when the temperature and humidity are low. Lv [11] studied the optimization of the structure of the heating tower. However, in the HTHP system, the key equipment, such as heat exchangers and pipelines, is all metal and anti-freezing solutions (such as calcium chloride, ethylene glycol, lithium bromide, and other salt solutions) are corrosive to metals. The corrosion of the HTHP system can not only reduce the productivity during running but also increase the energy consumption and maintenance costs and even lead to the loss of commercial income during downtime. Figure 2 was shot for the HTHP system applied in one project in Changsha, China, in which Figure 2a presents the part inside the removed pipe from the HTHP system and Figure 2b shows the antifreezing solution dissolving the corrosion product. From Figure 2, it can be clearly seen that the corrosion problems for the HTHP system are serious, which can lead to not only wastage of resources but also pollution of the environment. Thus, corrosion of the HTHP system should receive more attention from researchers [12,13]. Corrosion is commonly referred to as rust. BS EN ISO 8044 formally defines corrosion as "physicochemical interaction between a metal and its environment that leads to changes in properties of the metal and that may result in the significant impairment of the function of the metal, the environment, or the technical system, of which these form a part" [14]. Corrosion of metals and alloys is a critical issue in industry fields worldwide that is deleterious to both safety and environment and can also generate huge economic and energy costs [15,16]. Therefore, study of the methods to accurately measure and predict corrosion can contribute to saving both economic and energy costs. Therefore, the HTHP has unique advantages and has been widely researched and applied. However, the current research on HTHP mainly focuses on operating characteristics and structural optimization [5][6][7]. To summarize, Liang et al. [8] built an experimental platform for the HTHP to study the heat transfer performance of the open heating tower at different temperatures of the inlet solutions. Huang [9] studied the laws and design methods of heat and mass transfer, the characteristics and optimization of system operation, and the performance evaluations of the heating tower by combining theory, simulation, and experiment. Su [10] used a 25% NaCl solution as the anti-freezing solution to build a cross-flow HTHP system in Tianjin, China, to explore the feasibility of the HTHP system in winter, when the temperature and humidity are low. Lv [11] studied the optimization of the structure of the heating tower. However, in the HTHP system, the key equipment, such as heat exchangers and pipelines, is all metal and anti-freezing solutions (such as calcium chloride, ethylene glycol, lithium bromide, and other salt solutions) are corrosive to metals. The corrosion of the HTHP system can not only reduce the productivity during running but also increase the energy consumption and maintenance costs and even lead to the loss of commercial income during downtime. Figure 2 was shot for the HTHP system applied in one project in Changsha, China, in which Figure 2a presents the part inside the removed pipe from the HTHP system and Figure 2b shows the anti-freezing solution dissolving the corrosion product. From Figure 2, it can be clearly seen that the corrosion problems for the HTHP system are serious, which can lead to not only wastage of resources but also pollution of the environment. Thus, corrosion of the HTHP system should receive more attention from researchers [12,13]. Corrosion is commonly referred to as rust. BS EN ISO 8044 formally defines corrosion as "physicochemical interaction between a metal and its environment that leads to changes in properties of the metal and that may result in the significant impairment of the function of the metal, the environment, or the technical system, of which these form a part" [14]. Corrosion of metals and alloys is a critical issue in industry fields worldwide that is deleterious to both safety and environment and can also generate huge economic and energy costs [15,16]. Therefore, study of the methods to accurately measure and predict corrosion can contribute to saving both economic and energy costs.
where ± (g/m 2 h) represents the rate of weight loss/gain, W1 (g) the initial mass of the metal, W2 (g) the mass of the metal after corrosion treatment and drying, A (m 2 ) the surface area of the test piece, and t (h) the corrosion time of the coupon [17].
(a) (b) By using this method, Zhang [18] measured the corrosion rates of copper H65, aluminum 3003, and 20# steel in different anti-freezing solutions at various temperatures, corrosion times, and flow velocities. Zhang selected sodium acetate, magnesium chloride, and ethylene glycol as the primary materials and prepared six anti-freezing solutions of different compositions. Since the thermal conductivities of these prepared solutions are close to that of water and the thermophysical properties are generally good, these antifreezing solutions are suitable for the HTHP system and should be further investigated. However, no quantitative analysis has been given in the available literature of the relationship between the corrosion rate and the various conditions. It is well known that the support vector machine (SVM) and the artificial neural network (ANN) are powerful mathematical methods to find the mapping relationship between input parameters and output parameters and have already been used in many fields, such as biology, medicine, and economy. [19][20][21][22]. Therefore, to perform quantitative analysis of the corrosion rate that can contribute to the prediction without any prior experiment, both SVM and ANN models are applied in the present work.

Support Vector Machine
The support vector machine (SVM) is one of the common machine learning methods that can be applied to conduct classification and regression. In this work, for regression, the SVM is applied, which can map the input space to a high-dimension space by using a kernel function. In the high-dimension space, linear regression is then performed to obtain The most commonly used method of measuring the corrosion rate is the corrosion coupon, which involves suspending a metal coupon with the same components as the ones for the practical application, such as pipes and heat exchangers, in a suitable solution. After some time, the metal coupon is taken out and the corresponding weight loss is measured, which can be then transformed into the corrosion rate using the following equations: Rate of weight loss : Rate of weight gain : where V ± (g/m 2 h) represents the rate of weight loss/gain, W 1 (g) the initial mass of the metal, W 2 (g) the mass of the metal after corrosion treatment and drying, A (m 2 ) the surface area of the test piece, and t (h) the corrosion time of the coupon [17]. By using this method, Zhang [18] measured the corrosion rates of copper H65, aluminum 3003, and 20# steel in different anti-freezing solutions at various temperatures, corrosion times, and flow velocities. Zhang selected sodium acetate, magnesium chloride, and ethylene glycol as the primary materials and prepared six anti-freezing solutions of different compositions. Since the thermal conductivities of these prepared solutions are close to that of water and the thermophysical properties are generally good, these anti-freezing solutions are suitable for the HTHP system and should be further investigated. However, no quantitative analysis has been given in the available literature of the relationship between the corrosion rate and the various conditions. It is well known that the support vector machine (SVM) and the artificial neural network (ANN) are powerful mathematical methods to find the mapping relationship between input parameters and output parameters and have already been used in many fields, such as biology, medicine, and economy. [19][20][21][22]. Therefore, to perform quantitative analysis of the corrosion rate that can contribute to the prediction without any prior experiment, both SVM and ANN models are applied in the present work.

Support Vector Machine
The support vector machine (SVM) is one of the common machine learning methods that can be applied to conduct classification and regression. In this work, for regression, the SVM is applied, which can map the input space to a high-dimension space by using a kernel function. In the high-dimension space, linear regression is then performed to obtain Energies 2021, 14,1972 4 of 13 the best model [23]. In the present work, the radial basis function (RBF) [24] is selected as the kernel function, which can be expressed as follows: The final model represented by the kernel function is where α i and α * i are Lagrange multipliers and b the bias. After optimization using the experimental data, all the parameters can be obtained and the corresponding values can then be predicted by Equation (4) and the input x.

Artificial Neural Network
The artificial neural network includes three layers and several neurons in each layer. As shown in Figure 3, the first layer is the input layer, which contains the input features, i.e., the kind of metal material and anti-freezing solution, flow velocity, temperature, and corrosion time. The second layer is the hidden layer, which is used to connect the input layer and the output layer. The last one is the output layer, which represents the corrosion rate in the present work.
Energies 2021, 14, x FOR PEER REVIEW 4 of 13 the best model [23]. In the present work, the radial basis function (RBF) [24] is selected as the kernel function, which can be expressed as follows: The final model represented by the kernel function is where i α and * i α are Lagrange multipliers and b the bias. After optimization using the experimental data, all the parameters can be obtained and the corresponding values can then be predicted by Equation (4) and the input x.

Artificial Neural Network
The artificial neural network includes three layers and several neurons in each layer. As shown in Figure 3, the first layer is the input layer, which contains the input features, i.e., the kind of metal material and anti-freezing solution, flow velocity, temperature, and corrosion time. The second layer is the hidden layer, which is used to connect the input layer and the output layer. The last one is the output layer, which represents the corrosion rate in the present work. The number of hidden layers and the number of neurons in each hidden layer can critically affect the quality of the model, which can be adjusted according to the training performance. In each neuron, the linear superposition of all the connected neurons in the last layer and the activation function should be performed as shown in Figure 4, where w is the weight and b is the bias. It should be noted that the weights and bias in the linear superposition are what we should train and validate by the experimental data in order to find out the correct connection of the input and output layers. Meanwhile, in this work, the sigmoid function is chosen as the activation function since it can considerably improve gradient exploding and gradient vanishing problems [25][26][27]. The sigmoid function is expressed as The number of hidden layers and the number of neurons in each hidden layer can critically affect the quality of the model, which can be adjusted according to the training performance. In each neuron, the linear superposition of all the connected neurons in the last layer and the activation function should be performed as shown in Figure 4, where w is the weight and b is the bias. It should be noted that the weights and bias in the linear superposition are what we should train and validate by the experimental data in order to find out the correct connection of the input and output layers. Meanwhile, in this work, the sigmoid function is chosen as the activation function since it can considerably improve Energies 2021, 14,1972 5 of 13 gradient exploding and gradient vanishing problems [25][26][27]. The sigmoid function is expressed as Energies 2021, 14, x FOR PEER REVIEW 5 of 13 The fully connected neural network used in this work is shown in Figure 4, where the neurons in green represent the three input features and the neuron in red represents the output corrosion rate. For the hidden layers, a two-layer structure is selected and each layer contains 10 neurons.
When training the neural network, the mean-square error (MSE) is selected as the metric of the loss function since this work is a kind of regression analysis. The purpose of training and validation is to minimize the MSE, which is shown as the following equation: where indicates the measured data and the predicted data. Meanwhile, the rootmean-square prop (RMSProp) is chosen as the optimizer, which can speed up the training rate [28,29]. To minimize the MSE, both forward propagation and back propagation should be performed. Forward propagation is to calculate the final output value through the network, which is shown in Figure 4. Back propagation is to adjust the weights and bias to minimize the MSE between evaluated output values and the measured ones by computing the gradient of the loss function with respect to each weight according to the chain rule.

Results and Discussion
As described in Section 2, the SVM and ANN were applied to evaluate the corrosion rates of copper H65, aluminum 3003, and 20# steel in different anti-freezing solutions at various corrosion times, temperatures, and flow velocities. It should be noted that copper H65, aluminum 3003, and 20# steel were, respectively, represented by 1, 2, and 3 in the SVM and ANN models, while the anti-freezing solutions BF2354, BK3000, BL3500, HG3500, YH6830, and ZP3682 were represented by 1-6, respectively, in the SVM and ANN models. Totally, five input parameters were considered in the present work, as shown in Figure 3. The fully connected neural network used in this work is shown in Figure 4, where the neurons in green represent the three input features and the neuron in red represents the output corrosion rate. For the hidden layers, a two-layer structure is selected and each layer contains 10 neurons.
When training the neural network, the mean-square error (MSE) is selected as the metric of the loss function since this work is a kind of regression analysis. The purpose of training and validation is to minimize the MSE, which is shown as the following equation: where Y i indicates the measured data andŶ i the predicted data. Meanwhile, the rootmean-square prop (RMSProp) is chosen as the optimizer, which can speed up the training rate [28,29]. To minimize the MSE, both forward propagation and back propagation should be performed. Forward propagation is to calculate the final output value through the network, which is shown in Figure 4. Back propagation is to adjust the weights and bias to minimize the MSE between evaluated output values and the measured ones by computing the gradient of the loss function with respect to each weight according to the chain rule.

Results and Discussion
As described in Section 2, the SVM and ANN were applied to evaluate the corrosion rates of copper H65, aluminum 3003, and 20# steel in different anti-freezing solutions at various corrosion times, temperatures, and flow velocities. It should be noted that copper H65, aluminum 3003, and 20# steel were, respectively, represented by 1, 2, and 3 in the SVM and ANN models, while the anti-freezing solutions BF2354, BK3000, BL3500, HG3500, YH6830, and ZP3682 were represented by 1-6, respectively, in the SVM and ANN models. Totally, five input parameters were considered in the present work, as shown in Figure 3. The SVM-evaluated corrosion rate is shown in Figure 5 in comparison with the experimental ones, which shows an R 2 value of 0.9317. This result is reasonable but still not satisfactory. Meanwhile, to improve the reliability and accuracy of the ANN model, the k-fold cross validation was further used in the present work [30][31][32][33][34]. The main idea of k-fold cross validation is to choose different partitions of the training set and the validation set and then average the result so that the result will not be biased by any single partition. Moreover, k-fold cross validation is an effective way to solve the over-fitting problem. As shown in Figure 6, the dataset is first automatically split into k groups. Next, k-1 split groups are set to be the training dataset, and the one remaining split group is the validation dataset. Therefore, totally, k rounds of training and validation can be performed in one epoch, which critically improves the efficiency and accuracy. The value of k is often set to 5 or 10, depending on the computing resources. In the present work, k was set to 10 for achieving higher accuracy. Using the ANN model integrating the k-fold method, the MSE can be decreased much faster. The values of the MSE for the training dataset and the validation dataset along the epoch are shown in Figure 7. As can be seen in Figure 7, the MSE of the training dataset generally decreases with the increasing epoch and gets convergency. Meanwhile, the MSE of the validation dataset is critical to evaluating the predicting function of the obtained model. The MSE of the validation dataset first increases with the epoch and then decreases. After around 60,000 epoch, the MSE of the validation dataset cannot further decrease and becomes stable and convergent, demonstrating the best performance that can be achieved for the ANN model. Moreover, there is a local minimum for the validation MSE at about 5000 epoch. To break this local minimum, we used an optimizer called RMSProp, which can also adjust the training rate automatically to improve the efficiency. By using the RMSProp optimizer, this local minimum can be broken and thus the loss function can be close to the global minimum. We performed several tests for 100,000, 200,000, and 300,000 epoch, only to find that the MSE for the training dataset and the validation dataset can hardly decrease after about 60,000 epoch. Therefore, the minimum 100,000 epoch was chosen in the present work to show the result. The final MSE value for the training and validation datasets is 6.05 × 10 −7 and 5.54 × 10 −4 , respectively. The SVM-evaluated corrosion rate is shown in Figure 5 in comparison with the experimental ones, which shows an R 2 value of 0.9317. This result is reasonable but still not satisfactory. Meanwhile, to improve the reliability and accuracy of the ANN model, the k-fold cross validation was further used in the present work [30][31][32][33][34]. The main idea of kfold cross validation is to choose different partitions of the training set and the validation set and then average the result so that the result will not be biased by any single partition. Moreover, k-fold cross validation is an effective way to solve the over-fitting problem. As shown in Figure 6, the dataset is first automatically split into k groups. Next, k-1 split groups are set to be the training dataset, and the one remaining split group is the validation dataset. Therefore, totally, k rounds of training and validation can be performed in one epoch, which critically improves the efficiency and accuracy. The value of k is often set to 5 or 10, depending on the computing resources. In the present work, k was set to 10 for achieving higher accuracy. Using the ANN model integrating the k-fold method, the MSE can be decreased much faster. The values of the MSE for the training dataset and the validation dataset along the epoch are shown in Figure 7. As can be seen in Figure 7, the MSE of the training dataset generally decreases with the increasing epoch and gets convergency. Meanwhile, the MSE of the validation dataset is critical to evaluating the predicting function of the obtained model. The MSE of the validation dataset first increases with the epoch and then decreases. After around 60,000 epoch, the MSE of the validation dataset cannot further decrease and becomes stable and convergent, demonstrating the best performance that can be achieved for the ANN model. Moreover, there is a local minimum for the validation MSE at about 5000 epoch. To break this local minimum, we used an optimizer called RMSProp, which can also adjust the training rate automatically to improve the efficiency. By using the RMSProp optimizer, this local minimum can be broken and thus the loss function can be close to the global minimum. We performed several tests for 100,000, 200,000, and 300,000 epoch, only to find that the MSE for the training dataset and the validation dataset can hardly decrease after about 60,000 epoch. Therefore, the minimum 100,000 epoch was chosen in the present work to show the result. The final MSE value for the training and validation datasets is 6.05 × 10 −7 and 5.54 × 10 −4 , respectively.        Subsequently, the ANN-evaluated corrosion rates were compared to the measured ones to further validate the reliability of the presently obtained ANN model. The comparison result is shown in Figure 8, where a good agreement can be seen since R 2 is 0.9974, demonstrating better reliability and accuracy of the ANN model than the SVM model. To  Table 1. twice, i.e., before and after corrosion. According to the calculation of the corrosion rate, the relative uncertainty can be finally obtained, which is also listed in Table 1. From Table  1, it can be concluded that parameters such as temperature and corrosion time can critically influence the accuracy of the measured results. The reason is that these parameters can influence the total weight variation of the metal samples before and after corrosion. If the total weight variation is much larger than the maximum uncertainty, i.e., 0.2 mg, the relative uncertainty caused by the electronic balance is less obvious, and vice versa. For example, as shown in Table 1, when the corrosion time is longer, the corrosion is more obvious and the relative error of the measurement result is smaller, which leads to higher accuracy.    The evaluation of the measurement uncertainty was further performed in the present work. The uncertainty of the electronic balance used in the present work is 0.1 mg, and thus the maximum uncertainty should be 0.2 mg because each metal sample is weighed twice, i.e., before and after corrosion. According to the calculation of the corrosion rate, the relative uncertainty can be finally obtained, which is also listed in Table 1. From Table 1, it can be concluded that parameters such as temperature and corrosion time can critically influence the accuracy of the measured results. The reason is that these parameters can influence the total weight variation of the metal samples before and after corrosion. If the total weight variation is much larger than the maximum uncertainty, i.e., 0.2 mg, the relative uncertainty caused by the electronic balance is less obvious, and vice versa. For example, as shown in Table 1, when the corrosion time is longer, the corrosion is more obvious and the relative error of the measurement result is smaller, which leads to higher accuracy.

Conclusions
The SVM and ANN models integrating the k-fold split method were used in the present work to evaluate the corrosion rates of copper H65, aluminum 3003, and 20# steel in six anti-freezing solutions at different corrosion times, temperatures, and flow velocities. The conclusions are as follows:

•
The SVM can be used to obtain a reasonable corrosion rate, the R 2 value being 0.9317.

•
The MSE of the training dataset for the ANN decreases with the epoch and can be convergent. Meanwhile, there is a local minimum region broken by the presently used optimizer RMSProp for the MSE of the validation dataset. It can be concluded that after around 60,000 epoch, the obtained ANN model can achieve the best performance. • The good agreement between the ANN-evaluated corrosion rate and the measured ones indicates that the presently obtained ANN model is of better accuracy and reliability since the R 2 value is 0.9974. The present work can contribute to the prediction of the corrosion rates of copper H65, aluminum 3003, and 20# steel without any prior experiments, thus improving the performance and service life of the HTHP. Institutional Review Board Statement: Not applicable.

Informed Consent Statement: Not applicable.
Data Availability Statement: All data and models used during the study appear in the submitted article.