Cavitation Damage Prediction of Stainless Steels Using an Artiﬁcial Neural Network Approach

: Cavitation damage has not been well predicted because of its complex relationship of many mechanical and microstructural factors. An artiﬁcial neural network approach of the back-propagation network was used to predict cavitation damage of stainless steels, 316L and 420, in terms of the signiﬁcant inﬂuence of cavitation time, roughness, and residual stress on cavitation damage. Mean depth of erosion was used to quantitatively describe cavitation damage of 316L and 420. Prediction accuracy was improved by analyzing the e ﬀ ects of the number and type of input nodes, the number of nodes in the hidden layer, and di ﬀ erent activation functions on prediction accuracy. The best performance was in the model with the input nodes of cavitation time and roughness, eleven nodes in the hidden layer, and the activation function of logsig.


Introduction
Cavitation erosion (CE) is a kind of damage where cavitation bubbles that form in the liquid collapse near the solid boundary, which results in erosion from micro jets and shock waves [1][2][3]. It often leads to severe equipment damage of hydraulic machinery such as pumps, turbines, valves, pipes, vessels, and so on [1,4]. Cavitation damage has been modeled previously [1,5,6]. Szkodo [7] introduced an evaluation of cavitation damage, where they compared CE curves with a Weibull distribution, considering the influence of plastic deformation and the stress intensity factor, and they gave a mathematical model. Shuji et al. [8,9] analyzed characterization of the erosion process. They assumed the damage as pits and then formulated cavitation erosion depth; however, the quantitative accuracy and verification of their formulations were not shown. It has been found that cavitation erosion behavior was related to microstructure and mechanical properties of materials [10][11][12][13][14]. Multiple mechanical parameters affect CE, such as yield strength, ultimate strength, hardness, toughness, fracture toughness, and work-hardening capacity, and are considered to be correlated with cavitation erosion behavior [13][14][15][16]. There are arguments, especially about the effect of hardness on CE [15,17]. CE is viewed as a fatigue process [18,19]. Residual stress and roughness, which influence the fatigue behavior of materials [20][21][22], may affect the cavitation erosion behavior of materials. It can be seen that the evolution of cavitation damage is nonlinear and complex; it is difficult to build accurate equations

Experimental Program
The cavitation erosion test was conducted by using a modified ultrasonic fatigue apparatus according to ASTM G32-03 [31]. Cavitation bubbles were produced under a vibrating tip. The frequency of vibration was 20 ± 0.2 kHz. The peak-to-peak amplitude was 50 ± 0.6 µm. The vibrating tip was made of Ti-6Al-4V. The vibrating tip was immersed about 4 mm in tap water. The test was performed in running water with a stationary specimen method, as the stationary specimen method was convenient for characterizing eroded specimens. The standoff distance between specimen and tip was 0.5 mm. The specimen was placed under the vibrating tip. The vibrating tip introduced cavitation bubbles, the cavitation bubbles collapsed close to the specimens, and then specimens were eroded by the cavitation bubbles. The schematic image of the machine is shown in Figure 1. The temperature around the stationary specimen was kept at 25 ± 3 • C. As-received 420 and 316L were chosen as tested materials, their chemical compositions and mechanical properties are listed in Tables 1 and 2, respectively. Specimens (20 mm × 20 mm × 10 mm) were made using wire electrical discharge machining. Specimens were ground and polished before they were taken to the cavitation erosion test. After the test, specimens were cleaned and dried by hot air, then the mass loss of the materials was weighed by an electronic balance with an accuracy of 0.1 mg. The eroded surfaces of specimens after different cavitation times are shown in Figure 2. For characterization, residual stress measurements were conducted on the eroded surface via X-ray diffraction. Three points were tested at different distances from the erosion center (0, 2, and 4 mm), then the average values and errors were calculated. Roughness was measured by a roughness measuring instrument. The microhardness test was carried out on a cross-section of the eroded specimen using a Vickers microhardness tester under loads of 100 gf and 200 gf for 316L and 420, respectively, with a dwell time of 15 s. The tested points were about 100 µm from the eroded surface.
Metals 2019, 9, x FOR PEER REVIEW 3 of 11 specimens after different cavitation times are shown in Figure 2. For characterization, residual stress measurements were conducted on the eroded surface via X-ray diffraction. Three points were tested at different distances from the erosion center (0, 2, and 4 mm), then the average values and errors were calculated. Roughness was measured by a roughness measuring instrument. The microhardness test was carried out on a cross-section of the eroded specimen using a Vickers microhardness tester under loads of 100 gf and 200 gf for 316L and 420, respectively, with a dwell time of 15 s. The tested points were about 100 μm from the eroded surface.       In order to quantitatively study the relationship between cavitation damage and the parameters of cavitation time, roughness, residual stress, and microhardness, the mean depth of erosion (MDE) was used to describe cavitation damage, and it was calculated by using the following equation: where Δm is the mass loss (mg), ρ is the density of the materials (mg/mm 3 ), and A is the area of eroded surface (mm 2 ).

Significant Parameters of Cavitation Damage
The relationship between cavitation damage (mean depth of erosion) and cavitation time for 316L and 420 is presented in Figure 3a. In general, the cavitation damage of 316L and 420 increased with cavitation time. The cavitation damage evolution of 316L was similar to that of 420. The relationship between cavitation damage and average roughness of the eroded surface of 316L and 420 is presented in Figure 3b. Roughness increased with cavitation time because cavitation damage became increasingly serious; this was also found locally in other cavitation erosion processes [32][33][34][35]. On the whole, cavitation damage was proportional to roughness. The evolution rate of cavitation damage of 420 with roughness was faster than that of 316L. The relationship between cavitation damage and hardness of 316L and 420 is shown in Figure 3c. Because of the non-monotonic relationship between hardness and cavitation damage, especially for 316L, cavitation damage was not directly connected to hardness. The relationship between cavitation damage and residual stress is displayed in Figure 3d. It can be found that the residual stress of 316L was lower than that of 420 during CE. Meanwhile, cavitation damage of 316L and 420 increased overall with residual stress. In order to quantitatively study the relationship between cavitation damage and the parameters of cavitation time, roughness, residual stress, and microhardness, the mean depth of erosion (MDE) was used to describe cavitation damage, and it was calculated by using the following equation: where ∆m is the mass loss (mg), ρ is the density of the materials (mg/mm 3 ), and A is the area of eroded surface (mm 2 ).

Significant Parameters of Cavitation Damage
The relationship between cavitation damage (mean depth of erosion) and cavitation time for 316L and 420 is presented in Figure 3a. In general, the cavitation damage of 316L and 420 increased with cavitation time. The cavitation damage evolution of 316L was similar to that of 420. The relationship between cavitation damage and average roughness of the eroded surface of 316L and 420 is presented in Figure 3b. Roughness increased with cavitation time because cavitation damage became increasingly serious; this was also found locally in other cavitation erosion processes [32][33][34][35]. On the whole, cavitation damage was proportional to roughness. The evolution rate of cavitation damage of 420 with roughness was faster than that of 316L. The relationship between cavitation damage and hardness of 316L and 420 is shown in Figure 3c. Because of the non-monotonic relationship between hardness and cavitation damage, especially for 316L, cavitation damage was not directly connected to hardness. The relationship between cavitation damage and residual stress is displayed in Figure 3d. It can be found that the residual stress of 316L was lower than that of 420 during CE. Meanwhile, cavitation damage of 316L and 420 increased overall with residual stress. Metals 2019, 9, x FOR PEER REVIEW 5 of 11

Back-Propagation Neural Network
ANN is an algorithmic, mathematical model for distributed, parallel information processing. It adjusts connections between a large number of internal nodes, according to the complexity of the system, to achieve the purpose of processing information. ANN has the ability of self-learning and self-adaptation. Back-propagation (BP) neural network is a kind of supervised feed-forward neural network. The processing units in the BP neural network include input layer, output layer, and several hidden layers. Units in the hidden layer are used to compute the weights between pattern, the error between generated output, and the targeted output is fed backward to modify its weight [24]. BP is widely applied because it is able to deal with complex, nonlinear mapping. It is particularly suitable for solving complex problems with internal mechanisms. Therefore, BP was adopted in this paper.
BP requires that the activation function used by the artificial nodes be differentiable, thus, logsig and tansig were utilized as the activation functions in the hidden layer. The activation function of purelin was used by default in the output layer. Although the result of the Levenberg-Marquardt training approach may be trapped in the local optima [23], needing larger storage space than other training algorithms, application of the Levenberg-Marquardt training approach in BP usually gets better results than other training algorithms, and its convergence rate is fast; thus, it is often applied.

Damage Prediction Using ANN
Parameters that influenced cavitation damage were used as the network input nodes, and the mean depth of erosion was used as the output. Besides the input and output layers, the hidden layer was included in BP. Generally, one or more layers could be utilized as hidden layers in the BP neural network. As there were not many input and output nodes, and one hidden layer was used in many applications with a desired accuracy [36], one hidden layer was adopted in this work. The number of hidden nodes could be estimated by Kolmogorov's theorem [37],

Back-Propagation Neural Network
ANN is an algorithmic, mathematical model for distributed, parallel information processing. It adjusts connections between a large number of internal nodes, according to the complexity of the system, to achieve the purpose of processing information. ANN has the ability of self-learning and self-adaptation. Back-propagation (BP) neural network is a kind of supervised feed-forward neural network. The processing units in the BP neural network include input layer, output layer, and several hidden layers. Units in the hidden layer are used to compute the weights between pattern, the error between generated output, and the targeted output is fed backward to modify its weight [24]. BP is widely applied because it is able to deal with complex, nonlinear mapping. It is particularly suitable for solving complex problems with internal mechanisms. Therefore, BP was adopted in this paper.
BP requires that the activation function used by the artificial nodes be differentiable, thus, logsig and tansig were utilized as the activation functions in the hidden layer. The activation function of purelin was used by default in the output layer. Although the result of the Levenberg-Marquardt training approach may be trapped in the local optima [23], needing larger storage space than other training algorithms, application of the Levenberg-Marquardt training approach in BP usually gets better results than other training algorithms, and its convergence rate is fast; thus, it is often applied.

Damage Prediction Using ANN
Parameters that influenced cavitation damage were used as the network input nodes, and the mean depth of erosion was used as the output. Besides the input and output layers, the hidden layer was included in BP. Generally, one or more layers could be utilized as hidden layers in the BP neural network. As there were not many input and output nodes, and one hidden layer was used in many applications with a desired accuracy [36], one hidden layer was adopted in this work. The number of hidden nodes could be estimated by Kolmogorov's theorem [37], where N i is the number of input nodes, and N h is the number of hidden nodes. Then, the number of layers and the number of the nodes of each layer were confirmed. As surface roughness and residual stress were related to cavitation damage, cavitation time affected the damage as well. Therefore, cavitation time, roughness, and residual stress could be used as input nodes, namely, the largest of the number of input nodes N i could be set as 3, and N h could be set as 7 according to the Equation (2). The mean depth of erosion represented the output node, namely, there was one output in the network, as is shown in Figure 4. The linear interpolation method was used to obtain enough instances from the tested data. There were 48 sets of data for inputs and outputs. Among those data, 42 groups of instances were selected randomly to model the network, 26 (about 60%) instances were used for training, 8 (about 20%) for validation, and the other 8 for testing the network. Besides, the remaining six instances were used to test the network model. The ANN architecture of three input nodes is shown in Figure 4.
where Ni is the number of input nodes, and Nh is the number of hidden nodes. Then, the number of layers and the number of the nodes of each layer were confirmed. As surface roughness and residual stress were related to cavitation damage, cavitation time affected the damage as well. Therefore, cavitation time, roughness, and residual stress could be used as input nodes, namely, the largest of the number of input nodes Ni could be set as 3, and Nh could be set as 7 according to the Equation (2). The mean depth of erosion represented the output node, namely, there was one output in the network, as is shown in Figure 4. The linear interpolation method was used to obtain enough instances from the tested data. There were 48 sets of data for inputs and outputs. Among those data, 42 groups of instances were selected randomly to model the network, 26 (about 60%) instances were used for training, 8 (about 20%) for validation, and the other 8 for testing the network. Besides, the remaining six instances were used to test the network model. The ANN architecture of three input nodes is shown in Figure 4. Initial data of the connection weight coefficients of the layers were given by random numbers. Training was terminated when the average squared error between the network output and the target output was less than 0.00001. The maximum number of epochs was set as 500, and the learning rate was set as 0.05. The algorithm was written in MATLAB. The Neural Network toolbox was utilized to define, train, and simulate the network model. The built network model was repeated 50 times to check prediction accuracy and capability. To determine the performance of the network model, three different criteria were used: the relative absolute mean error (RAME), the root mean square error (RMSE), and the coefficient of determination (R 2 ) [29,38]. The equations of these criteria are as follows: where ypi is the predicted value, yi is the target value, and n is the number of instances. As the mean depth of erosion in the initial stage was zero, thus, the predicted value was used as the denominator of RAME. Initial data of the connection weight coefficients of the layers were given by random numbers. Training was terminated when the average squared error between the network output and the target output was less than 0.00001. The maximum number of epochs was set as 500, and the learning rate was set as 0.05. The algorithm was written in MATLAB. The Neural Network toolbox was utilized to define, train, and simulate the network model. The built network model was repeated 50 times to check prediction accuracy and capability. To determine the performance of the network model, three different criteria were used: the relative absolute mean error (RAME), the root mean square error (RMSE), and the coefficient of determination (R 2 ) [29,38]. The equations of these criteria are as follows:

Results and Discussion
where y pi is the predicted value, y i is the target value, and n is the number of instances. As the mean depth of erosion in the initial stage was zero, thus, the predicted value was used as the denominator of RAME.

Results and Discussion
As is shown in Figure 3, cavitation time and roughness were proportional to cavitation damage. Cavitation damage could be expressed by the mean depth of erosion according to Equation (1), as residual stress was considered an important factor for cavitation erosion behavior, and it had the tendency to increase with the cavitation damage; therefore, cavitation time, roughness, and residual stress were used as input nodes for cavitation damage prediction using ANN. To evaluate and improve the prediction accuracy of the ANN model, the effect of the number and type of input nodes, the number of nodes in the hidden layer, and different activation functions on prediction were analyzed. RAME, RMSE, and R 2 were considered the evaluation criteria. Figure 5 presents the effect of type and the number of input nodes on cavitation damage prediction for 420 and 316L. The number of nodes in the hidden layer of all models was seven in Figure 5. It seemed that the number of input nodes did not affect prediction results. But for the type of input nodes, it was apparent that the worst performance was in the model with the residual stress input node. This was probably because the value of residual stress was not accurate, as the measurement of residual stress was affected by the roughness of the eroded surface. Relatively good performances were achieved by the model with cavitation time and roughness (T&R) input nodes and the model with the input node of cavitation time (T). To analyze the best performance of models with different input nodes, RAME, RMSE, and R 2 values for models with T&R and T are shown in Table 3. Regardless of the similar criteria results, RAME, R 2 of the model with 420, and R 2 of the model with 316L showed that the best performance was achieved by the model with the input nodes of cavitation time and roughness (T&R), as the prediction model using the input nodes of T&R had smaller RMSE values. As is shown in Figure 3, cavitation time and roughness were proportional to cavitation damage. Cavitation damage could be expressed by the mean depth of erosion according to Equation (1), as residual stress was considered an important factor for cavitation erosion behavior, and it had the tendency to increase with the cavitation damage; therefore, cavitation time, roughness, and residual stress were used as input nodes for cavitation damage prediction using ANN. To evaluate and improve the prediction accuracy of the ANN model, the effect of the number and type of input nodes, the number of nodes in the hidden layer, and different activation functions on prediction were analyzed. RAME, RMSE, and R 2 were considered the evaluation criteria. Figure 5 presents the effect of type and the number of input nodes on cavitation damage prediction for 420 and 316L. The number of nodes in the hidden layer of all models was seven in Figure 5. It seemed that the number of input nodes did not affect prediction results. But for the type of input nodes, it was apparent that the worst performance was in the model with the residual stress input node. This was probably because the value of residual stress was not accurate, as the measurement of residual stress was affected by the roughness of the eroded surface. Relatively good performances were achieved by the model with cavitation time and roughness (T&R) input nodes and the model with the input node of cavitation time (T). To analyze the best performance of models with different input nodes, RAME, RMSE, and R 2 values for models with T&R and T are shown in Table 3. Regardless of the similar criteria results, RAME, R 2 of the model with 420, and R 2 of the model with 316L showed that the best performance was achieved by the model with the input nodes of cavitation time and roughness (T&R), as the prediction model using the input nodes of T&R had smaller RMSE values.  Table 3. RAME, RMSE, and R 2 for the models with input nodes of T&R and the models with input node of T in Figure 3.

The Effects of the Number of Nodes in the Hidden Layers on Prediction
It has been suggested that the number of nodes in the hidden layer influences the results of the ANN model, and that usually the more nodes there are in the hidden layer the better the ANN performance [39]. RAME, RMSE, and R 2 for different numbers of nodes in the hidden layer and Figure 5. Relative absolute mean error (RAME), root mean square error (RMSE), and R 2 for models with different numbers and types of input nodes and different stainless steels (a) 420 and (b) 316L. Table 3. RAME, RMSE, and R 2 for the models with input nodes of T&R and the models with input node of T in Figure 3.

The Effects of the Number of Nodes in the Hidden Layers on Prediction
It has been suggested that the number of nodes in the hidden layer influences the results of the ANN model, and that usually the more nodes there are in the hidden layer the better the ANN performance [39]. RAME, RMSE, and R 2 for different numbers of nodes in the hidden layer and different numbers and types of input nodes are presented in Figure 6. For one input node, the input node of residual stress (S) was not analyzed for its worst performance, shown in Figure 5. In Figure 6a,b it was interesting to find that on the whole, for models with input node, cavitation time (T), and roughness (R), the performances of these two models became increasingly worse with the increase of node number in the hidden layer. The best performance was achieved by the model with the input node of cavitation time (T) and seven nodes in the hidden layer, as shown in Figure 6a,b. For models with three and two input nodes, results of their criteria were irregular, as displayed in Figure 6c,d. But it could be seen that the best performance was achieved by the model with the input nodes of cavitation time and roughness (T&R) and eleven nodes in the hidden layer, and that the best performance of models with three input nodes (cavitation time, roughness, and residual stress (T&R&S)) was in the model with three nodes in the hidden layer, as shown in Figure 6e,f. different numbers and types of input nodes are presented in Figure 6. For one input node, the input node of residual stress (S) was not analyzed for its worst performance, shown in Figure 5. In Figure  6a,b it was interesting to find that on the whole, for models with input node, cavitation time (T), and roughness (R), the performances of these two models became increasingly worse with the increase of node number in the hidden layer. The best performance was achieved by the model with the input node of cavitation time (T) and seven nodes in the hidden layer, as shown in Figure 6a,b. For models with three and two input nodes, results of their criteria were irregular, as displayed in Figure 6c,d.
But it could be seen that the best performance was achieved by the model with the input nodes of cavitation time and roughness (T&R) and eleven nodes in the hidden layer, and that the best performance of models with three input nodes (cavitation time, roughness, and residual stress (T&R&S)) was in the model with three nodes in the hidden layer, as shown in Figure 6e,f. Figure 6. RAME, RMSE, and R 2 for models with different numbers of nodes in the hidden layer: (a,b) one input node, (c,d) two input nodes, and (e,f) three input nodes.

The Effects of Activation Functions on Prediction
From the above analysis it was seen that for the models with three input nodes (cavitation time, roughness, and residual stress (T&R&S)), the best performance was in the model with three nodes in the hidden layer (T&R&S-3); for the models with two input nodes, the best performance was achieved in the model with the input nodes of cavitation time and roughness and eleven nodes in the hidden layer (T&R-11); and for the models with one input node, the best performance was obtained by the model with the input node of cavitation time and seven nodes in the hidden layer (T-7). To further improve the accuracy of prediction, the effect of different activation functions on the prediction is shown in Figure 7. It was drawn that the activation function of logsig could slightly improve the accuracy of prediction. The best performance was in the model with the input nodes of cavitation time and roughness, eleven nodes in the hidden layer, and the activation function of logsig (T&R-11-logsig)-the criteria results of this model, RAME, RMSE, and R 2 were about 0.17, 0.13, and 0.999, respectively. Metals 2019, 9, x FOR PEER REVIEW 9 of 11 From the above analysis it was seen that for the models with three input nodes (cavitation time, roughness, and residual stress (T&R&S)), the best performance was in the model with three nodes in the hidden layer (T&R&S-3); for the models with two input nodes, the best performance was achieved in the model with the input nodes of cavitation time and roughness and eleven nodes in the hidden layer (T&R-11); and for the models with one input node, the best performance was obtained by the model with the input node of cavitation time and seven nodes in the hidden layer (T-7). To further improve the accuracy of prediction, the effect of different activation functions on the prediction is shown in Figure 7. It was drawn that the activation function of logsig could slightly improve the accuracy of prediction. The best performance was in the model with the input nodes of cavitation time and roughness, eleven nodes in the hidden layer, and the activation function of logsig (T&R-11-logsig)-the criteria results of this model, RAME, RMSE, and R 2 were about 0.17, 0.13, and 0.999, respectively.

Conclusions
In this paper, it can be found that there are relationships between cavitation damage and the parameters including cavitation time, roughness, and residual stress. ANN modeling of cavitation damage of 420 and 316L is investigated based on this relationship, and the following conclusions can be drawn: (1) A prediction approach using the artificial neural network for the cavitation damage is proposed. (2) From the analysis of the relationship between cavitation damage and microhardness, microhardness seems not to be related to cavitation damage. (3) From analysis of the relationship between cavitation damage, residual stress, and the ANN model, residual stress seems not to be related to cavitation damage. (4) Cavitation damage is affected by cavitation time and roughness. The increase of cavitation time or the increase of roughness during the cavitation erosion process increases cavitation damage. (5) The model using BP method with input nodes of cavitation time and roughness, eleven nodes in the hidden layer, and the activation function of logsig has a good performance of forecasting cavitation damage.

Conclusions
In this paper, it can be found that there are relationships between cavitation damage and the parameters including cavitation time, roughness, and residual stress. ANN modeling of cavitation damage of 420 and 316L is investigated based on this relationship, and the following conclusions can be drawn: (1) A prediction approach using the artificial neural network for the cavitation damage is proposed.
(2) From the analysis of the relationship between cavitation damage and microhardness, microhardness seems not to be related to cavitation damage. (3) From analysis of the relationship between cavitation damage, residual stress, and the ANN model, residual stress seems not to be related to cavitation damage. (4) Cavitation damage is affected by cavitation time and roughness. The increase of cavitation time or the increase of roughness during the cavitation erosion process increases cavitation damage. (5) The model using BP method with input nodes of cavitation time and roughness, eleven nodes in the hidden layer, and the activation function of logsig has a good performance of forecasting cavitation damage.
Funding: This work is funded by the National Key Research and Development Program of China, grant number: 2016YFF0203301.