Prediction of In-Flight Particle Properties and Mechanical Performances of HVOF-Sprayed NiCr–Cr3C2 Coatings Based on a Hierarchical Neural Network

High-velocity oxygen fuel (HVOF) spraying is a promising technique for depositing protective coatings. The performances of HVOF-sprayed coatings are affected by in-flight particle properties, such as temperature and velocity, that are controlled by the spraying parameters. However, obtaining the desired coatings through experimental methods alone is challenging, owing to the complex physical and chemical processes involved in the HVOF approach. Compared with traditional experimental methods, a novel method for optimizing and predicting coating performance is presented herein; this method involves combining machine learning techniques with thermal spray technology. Herein, we firstly introduce physics-informed neural networks (PINNs) and convolutional neural networks (CNNs) to address the overfitting problem in small-sample algorithms and then apply the algorithms to HVOF processes and HVOF-sprayed coatings. We proposed the PINN and CNN hierarchical neural network to establish prediction models for the in-flight particle properties and performances of NiCr–Cr3C2 coatings (e.g., porosity, microhardness, and wear rate). Additionally, a random forest model is used to evaluate the relative importance of the effect of the spraying parameters on the properties of in-flight particles and coating performance. We find that the particle temperature and velocity as well as the coating performances (porosity, wear resistance, and microhardness) can be predicted with up to 99% accuracy and that the spraying distance and velocity of in-flight particles exert the most substantial effects on the in-flight particle properties and coating performance, respectively. This study can serve as a theoretical reference for the development of intelligent HVOF systems in the future.


Introduction
High-velocity oxygen fuel (HVOF) spraying is a high-energy thermal spraying process for depositing protective coatings with anticorrosion, anti-erosion, and anti-wear properties [1][2][3].In the HVOF technique, a mixture of fluid/gaseous fuel and oxygen is ejected through a Laval nozzle at supersonic speeds into a combustion chamber [4].At extremely high temperatures and pressures, the resultant gas heats and accelerates the feeding powder to form the final coating on the substrate [5].The in-flight particle properties (temperature and velocity) critically affect the performances of HVOF-sprayed coatings [6,7] and depend on the parameters of the HVOF process, including the standoff distance, oxygen flow, and fuel flow [8].However, owing to the complex physical and chemical phenomena involved in the HVOF technique, designing spraying parameters that optimize the coating performances is challenging.HVOF-sprayed coatings have been predicted and optimized through various approaches, such as experimental design, numerical simulation, and machine learning (ML) [9][10][11][12][13].
Recently, statistical optimization methods, including the Taguchi method and numerical simulations, have been widely employed to establish polynomial regression equations and clarify the influence of the process parameters on the coating properties.For example, Nguyen et al. [14] used the Taguchi method to investigate the optimal process parameters of HVOF-sprayed WC-16Co coatings.However, as the performance of coatings is affected by multiple sets of HVOF process parameters, these methods do not make accurate predictions of the coating performance based on experimental designs, thereby substantially limiting their applicability.Nevertheless, the entire HVOF process, including the variation patterns of flame pressure, temperature, velocity, Mach number, combustion composition, temperature, velocity, and motion trajectory of WC-12Co particles, has been analyzed using numerical models [15].However, it should be mentioned that in metal-ceramic composites, as one of the most studied HVOF-sprayed coatings, such as NiCr-Cr 3 C 2 and WC-Co, carbide (WC and Cr 3 C 2 ) powders are susceptible to different degrees of decomposition reaction under various HVOF spraying parameters [16].There is no doubt that the change in composition of in-flight particles will significantly affect the deposition behavior of each particles, influencing the temperature and velocity of in-flight particles.As such, the complex evolution procedures (e.g., phase transformation, dissolution, and evaporation of some elements or compositions) make it very difficult to model the real behaviors of the particles via numerical simulations.Consequently, neither the Taguchi method nor the numerical simulation-based modeling technique can accurately predict the spraying parameters and coating performance.
Machine learning (ML) techniques can overcome the abovementioned technical difficulties of the Taguchi and numerical modeling methods [17].Artificial neural networks (ANNs) with flexible structures and powerful learning ability are most commonly proposed for the prediction and optimization of thermal spraying processes.In 2004, ANN implementation in the thermal spray process was pioneered by the LERMPS laboratory [18].They modeled the plasma spraying technique using an ANN and then analyzed and predicted the coating characteristics, including the percentage of unmelted particles, porosity, and phase composition [18][19][20][21].Choudhury also trained an ANN model for predicting the inflight particle characteristics of an atmospheric plasma spraying process [22].Moreover, he investigated the relation between these characteristics and the properties of plasma-sprayed 8YSZ electrolyte coatings [23].Recently, researchers have explored ML algorithms and neural networks that predict the performance of TiO 2 coatings deposited using a novel plasma spraying technique called suspension plasma spraying [24].However, research on neural network-based predictions of the HVOF spraying process and HVOF-sprayed coatings is limited compared to that on neural network-based predictions of plasma spraying [13,25].
As mentioned earlier, researchers have predicted the particle or coating properties in case of the plasma spraying process, but studies on the relationships among the HVOF process parameters, intermediate variables (i.e., temperature and velocity of the in-flight particles), and coating properties are limited.Moreover, most prediction models for both HVOF and plasma spraying in-flight particle characteristics are based on ANNs [13,[18][19][20][21], which tend to be overfitted when the input data are limited.
Convolutional neural networks (CNNs) can automatically mine the potential pattern features, which is potentially less time consuming than accumulating experience and professional knowledge [17].Unlike ANNs, CNNs employ a weight-sharing feature that reduces the number of trainable network parameters, enhancing the generalization of the model and avoiding or weakening overfitting [26].Moreover, a CNN model is a powerful tool for pattern recognition in various computational materials problems characterized by local interactions [27].Using a CNN-based approach, Zhang et al. [28] attempted to improve predictions of the material removal rate in chemical mechanical polishing.Lu et al. [29] developed a CNN model that rapidly and accurately predicts the amorphous formation ability of various amorphous alloys; they reported a prediction accuracy of 0.71693, more than 19% higher than those of 13 standards.CNN-based studies are currently few and limited to air-plasma spraying and air plasma-sprayed coatings.The relation between in-flight particles and the spraying parameters has been implicitly established and analyzed in a previous study [17].Thus, developing CNN models of the HVOF process and HVOF-sprayed coatings is desired and should be attempted.
However, the ANN and CNN models are based on blackbox algorithms which obscure their interpretability [30], i.e., ANNs and CNNs generate their prediction and relation results without considering the basic physical models of the HVOF process.The physicsinformed neural network (PINN) is a hybrid physical-statistical ML method that embeds automatic differentiation and partial differential equations into the loss function of neural networks [31].Moreover, the PINN combines physical models with neural network regression to compensate for the poor transferability of traditional ML techniques, such as ANN and CNN, to unknown structures.In thermal fluid studies, the PINN has been used to solve momentum and energy transport governing equations [32] and to accurately predict the velocity and temperature of particles [33,34].In addition to thermal fluid problems, PINNs have been applied to various material applications.Zhang [35] found that among various deep neural networks and traditional ML models, the PINN most accurately predicts the creep-fatigue life of 316L stainless steel.To the best of our knowledge, a PINN model has never been applied to thermal spraying, which is characterized by complex flow fields and thermal fields during deposition.
This study attempts to optimize HVOF-sprayed NiCr-Cr 3 C 2 coatings and predict their in-flight particle properties based on the HVOF process parameters and the properties of the NiCr-Cr 3 C 2 coatings.The HVOF process and HVOF-sprayed coatings are analyzed using a PINN-CNN hierarchical neural network that synergistically combines the advantages of the PINN and CNN.The primary objective is to propose a layered learning model that utilizes the PINN to construct the first layer for predicting the HVOF in-flight particle properties, which is followed by that of a second layer using a CNN for prediction of coating properties.The framework is illustrated in Figure 1.The relative importance of the spraying parameters with respect to the properties of in-flight particles and coating performance are then evaluated using a random forest (RF) model.Results indicated that spraying distance and in-flight particle velocity most considerably affect the in-flight particle properties and coating performance, respectively.Furthermore, compared with experimental data, the temperature and velocity of in-flight particles as well as the coating properties (cross-sectional porosity, wear resistance, and microhardness) are predicted with up to 99% accuracy.

HVOF Spray Process Parameters
The raw material used herein is a commercially available NiCr-Cr3C2 powder (METCO 81 VF-NS: Oerlikon Metco AG, Wohlen, Switzerland) with particle size ranging

HVOF Spray Process Parameters
The raw material used herein is a commercially available NiCr-Cr 3 C 2 powder (METCO 81 VF-NS: Oerlikon Metco AG, Wohlen, Switzerland) with particle size ranging from 5 µm to 45 µm.HVOF spraying experiments were conducted using an in-house fabricated Diamond Jet spraying system.The gun was guided by a six-axis industrial robot (IRB2600-20: ABB, VÄSTERÅS, Sweden); a sandblasted 316L stainless steel plate (Ø 25 mm × 10 mm) was used as the substrate.During the experiments, three process parameters, namely the oxygen flow rate (Q(O 2 )), fuel flow rate (Q(CH 4 )), and standoff distance (SOD), were varied.In addition, in-flight particles were characterized during HVOF spraying using a commercial diagnostic system, AccuraSpray G3 (Tecnar, St-Bruno, PQ, Canada).The specific spraying process parameters are listed in Table 1.

Coating Microstructure Characterization
The porosity of the coating was determined through analyzing its cross-sectional microstructure via optical microscope (Nikon, Japan).Over 10 consecutive images were captured, and the average value was calculated using ImageJ imaging software (version: 1.8.0_112).The microhardness of the coatings was evaluated using a Vickers microhardness tester (Leiz-Wetzlar, Germany) with a load of 300 gf and a dwell time of 25 s on a cross-section of the coating.Twenty random indentations were made, and an average microhardness value was obtained for each coating.Wear rates were determined through performing dry sliding wear tests using a CSEM tribometer (Neuchatel, Switzerland) at an atmospheric temperature of 15-20 • C and a humidity of 40-50%.The paired material used comprised Al 2 O 3 balls (diameter = 6 mm) with a load of 5 N, a rotation radius of 7 mm, a linear rotation speed of 10 mm/s, and a sliding distance of 500 m.The cross-sectional profile of the wear track was measured using a profilometer (Altisurf 500, Thonon-les-Bains, France), and 10 contour measurements were performed to obtain the average wear rate.The wear rate is denoted by K as expressed in Equation (1).
Here, ∆V denotes the volume loss of the material, S denotes the sliding distance, and F N denotes the applied normal load.
For the above characterization and performance tests, all specimens were prepared via grinding using P220 SiC paper (Struers, Champigny-sur-Marne, France) and MD-Largo disks (Struers, Champigny-sur-Marne, France), followed by polishing with a 3-µm diamond suspension and a 0.04-µm nondrying colloidal silica suspension.

Feature Selection Based on the Random Forest (RF) Model
The HVOF spraying process involves numerous feature variables.To avoid compromising prediction accuracy, we applied the RF feature selection algorithm to identify essential features for prediction.The final classification outcome was determined through a voting process among the base classifiers.Integrating multiple decision trees in the RF model renders it more stable than a standalone decision tree model, particularly in classifying complex feature variables and unbalanced categories.This property results in more accurate predictions and reduces the likelihood of overfitting (Figure 2).

Feature Selection Based on the Random Forest (RF) Model
The HVOF spraying process involves numerous feature variables.To avoid compromising prediction accuracy, we applied the RF feature selection algorithm to identify essential features for prediction.The final classification outcome was determined through a voting process among the base classifiers.Integrating multiple decision trees in the RF model renders it more stable than a standalone decision tree model, particularly in classifying complex feature variables and unbalanced categories.This property results in more accurate predictions and reduces the likelihood of overfitting (Figure 2).In the RF model, noisy but important features can substantially affect classification accuracy.Therefore, we used feature importance as a criterion for selecting the features of the RF algorithm.The feature importance metric  for feature  is given by Equation (2): where B denotes the number of training samples,  denotes the number of correct classifications counted by the decision tree for the out-of-bag data, and  denotes the In the RF model, noisy but important features can substantially affect classification accuracy.Therefore, we used feature importance as a criterion for selecting the features of the RF algorithm.The feature importance metric D j for feature X j is given by Equation (2): where B denotes the number of training samples, R oob b denotes the number of correct classifications counted by the decision tree for the out-of-bag data, and R oob bj denotes the number of correct classifications counted when the decision tree classifies the out-of-bag data after perturbation.

Data Collection and Preprocessing
The dataset utilized in the experiments comprise 320 data points from 40 sets of spraying experiments and corresponding characterizations and performance tests on HVOFsprayed NiCr-Cr 3 C 2 coatings.The experiments include monitoring in-flight particles (temperature and velocity) and coating characterization tests (e.g., porosity, wear resistance, and microhardness).The spraying parameters, characteristics of the in-flight particles, and coating performances are summarized in Table 2. Additionally, all these HVOFsprayed NiCr-Cr 3 C 2 coatings exhibited typical lamellar structure.Taking the No. 5 and No. 35 samples as examples, different NiCr/Cr 3 C 2 ratio and lamellar structures with porosity were observed in Figure 3, where the NiCr matrix is light gray and Cr 3 C 2 is in dark gray.The PINN considers the standoff distance (SOD), oxygen flow rate (Q(O 2 )), and fuel flow rate (Q(CH 4 )) as inputs and particle in-flight velocity and temperature as outputs.The PINN outperforms current ML approaches used in thermal spraying through incorporating physical information regarding the system.In addition, it reduces the dataset required to uncover complex prediction-response relations, shortens training time, and rationalizes the mechanism of the spraying process.Therefore, we used the PINN as the first layer of the layered neural network model to predict particle in-flight velocity and temperature through inputting standoff distance (SOD), oxygen flow rate (Q(O2)), and fuel flow rate (Q(CH4)).In the second layer of the neural network model, we used a CNN with in-flight particle velocity (V) and temperature (T) as inputs and microhardness, porosity, and wear rate of coatings as final outputs.Before training the model, we normalized it according to Equation (3) through setting the variable input range between one and two to prevent computational errors resulting from different parameter magnitudes.To prevent overfitting, we randomly divided the data into the training and validation sets, with proportions of 80% and 20%, respectively.In the second layer of the neural network model, we used a CNN with in-flight particle velocity (V) and temperature (T) as inputs and microhardness, porosity, and wear rate of coatings as final outputs.Before training the model, we normalized it according to Equation (3) through setting the variable input range between one and two to prevent computational errors resulting from different parameter magnitudes.To prevent overfitting, we randomly divided the data into the training and validation sets, with proportions of 80% and 20%, respectively.
Here, X NORM denotes the normalized value, X denotes the experimental value, X MAX denotes the maximum experimental value, and X MI N denotes the minimum experimental value.Specific representation of the data in the model is shown in Figure 4.In the second layer of the neural network model, we used a CNN with in-flight particle velocity (V) and temperature (T) as inputs and microhardness, porosity, and wear rate of coatings as final outputs.Before training the model, we normalized it according to Equation (3) through setting the variable input range between one and two to prevent computational errors resulting from different parameter magnitudes.To prevent overfitting, we randomly divided the data into the training and validation sets, with proportions of 80% and 20%, respectively.
Here,  denotes the normalized value,  denotes the experimental value,  denotes the maximum experimental value, and  denotes the minimum experimental value.Specific representation of the data in the model is shown in Figure 4.

PINN Model: First-Layer Building, Training, and Validation
The layered machine model was implemented in PyTorch, a deep learning framework based on Torch, and developed using Python.The first layer of the model employs a PINN with transfer functions, including functions from the input layer to the first hidden layer, between hidden layers, and from the second hidden layer to the output layer set to tansig, logsig, and purelin, respectively.In addition, proportional conjugate gradient backpropagation (trainscg) was selected as the training function.
As there were three input variables and two target variables in the dataset, the number of neurons in the input layer was set to three and the number of neurons in the output layer was set to two.However, no general rule exists for determining the exact number of neurons in the hidden layer.Typically, the fewer the hidden layers and number of neurons in the hidden layers, the more lightweight the model.Therefore, in this study, a neural network model with two hidden layers was selected and the number of neurons in each hidden layer was set to 10 after simulation and comparison based on the prediction results.

PINN Model: First-Layer Building, Training, and Validation
The layered machine model was implemented in PyTorch, a deep learning framework based on Torch, and developed using Python.The first layer of the model employs a PINN with transfer functions, including functions from the input layer to the first hidden layer, between hidden layers, and from the second hidden layer to the output layer set to tansig, logsig, and purelin, respectively.In addition, proportional conjugate gradient backpropagation (trainscg) was selected as the training function.
As there were three input variables and two target variables in the dataset, the number of neurons in the input layer was set to three and the number of neurons in the output layer was set to two.However, no general rule exists for determining the exact number of neurons in the hidden layer.Typically, the fewer the hidden layers and number of neurons in the hidden layers, the more lightweight the model.Therefore, in this study, a neural network model with two hidden layers was selected and the number of neurons in each hidden layer was set to 10 after simulation and comparison based on the prediction results.Figure 5   Herein, the neural network model is trained using the backpropagation method, a commonly used algorithm for learning multilayer networks.The training is supervised, and the inputs are forwarded through a transfer function to calculate the error between the model output and actual experimental data.This error, denoted as mse_1, is optimized Herein, the neural network model is trained using the backpropagation method, a commonly used algorithm for learning multilayer networks.The training is supervised, and the inputs are forwarded through a transfer function to calculate the error between the model output and actual experimental data.This error, denoted as mse_1, is optimized during training to improve network performance.Additionally, physical formulas are embedded, such as those for particle velocity and temperature, using Lagrangian methods.The loss functions for v p and T p in Equations ( 4) and ( 5) are associated with an error of mse_2.To minimize the errors, mse_1 and mse_2 are backpropagated to adjust the network weights and bias values.Two metrics were used to evaluate the CNN results in this study: the mean absolute error (MAE) of Equation ( 6) and the decidability factor (R 2 ) of Equation (7).Smaller MAE values and a larger R 2 indicate a better model fit and higher prediction accuracy, respectively.
In Equation ( 4), v p denotes the velocity of the particle flight, m p denotes the mass of the particle, v g denotes the gas velocity, C D denotes the drag coefficient, A p denotes the particle cross-sectional area, ρ g denotes the gas density, and x denotes the axial position.In Equation ( 5), T p denotes the particle temperature, A p denotes the particle surface area, C P p denotes the particle heat capacity, T g denotes the gas temperature, and h denotes the heat transfer coefficient.
Here, y i denotes the true value, ŷi denotes the predicted value (i = 1, 2, . .., n), and n denotes the number of samples.
Here, t i denotes the experimental results, a i denotes the predicted result, = t i denotes the mean of the experimental results, and N denotes the number of datasets.

CNN Model: Building, Training, and Validation of the Second Layer
In this work, we use a CNN to construct the second layer of our model.We evaluate and compare the predictive performance of the CNN model using the same evaluation metrics as the PINN.The CNN mainly comprises a convolutional layer, pooling layer, and fully connected layer (Figure 6).
Materials 2023, 16, x FOR PEER REVIEW 9 of 18 the particle cross-sectional area,  denotes the gas density, and  denotes the axial position.In Equation ( 5),  denotes the particle temperature,  denotes the particle surface area,  denotes the particle heat capacity,  denotes the gas temperature, and ℎ denotes the heat transfer coefficient.
Here,  denotes the true value,  denotes the predicted value (i = 1, 2, ..., n), and n denotes the number of samples.
Here,  denotes the experimental results,  denotes the predicted result, ̿ denotes the mean of the experimental results, and  denotes the number of datasets.

CNN Model: Building, Training, and Validation of the Second Layer
In this work, we use a CNN to construct the second layer of our model.We evaluate and compare the predictive performance of the CNN model using the same evaluation metrics as the PINN.The CNN mainly comprises a convolutional layer, pooling layer, and fully connected layer (Figure 6).Herein, we propose a novel architecture wherein the input layer is the predicted particle flight speed and temperature obtained from the PINN model.The convolutional layer performs layer-by-layer feature extraction of the input signal, and the obtained features are then mapped to the output layer using the fully connected layer.The output layer predicts the microhardness, porosity, and wear rate of the coating.The convolutional layer is the central component of the CNN and calculates feature values from the input data.The specific calculation is expressed in Equation (8).
Here, f denotes the input signal guide, ω denotes the convolution kernel, n denotes the total number of signals, and q denotes the size of the convolution kernel.
The primary function of the pooling layer is to decrease the dimensionality of the data, reduce computation, and prevent overfitting while enhancing the robustness of the system.Because the dataset is small, the network comprises only two convolutional layers and lacks a pooling layer.
The fully connected layer is a shallow perceptron that establishes complete connections between the output layer and the data acquired after multiple convolution and pooling operations.Finally, the Softmax activation function classifies the results obtained in the output layer, computed as shown in Equation (9): . . .
where k denotes a particular classification, θ T 1 x (i) denotes the value of that classification, p y (i) = k x (i) , θ denotes the probability of the kth category, and θ denotes the weight.
The CNN model is optimized using Adam's optimizer, with a learning rate set at 0.00001.The ReLU function is selected as the activation function for both convolutional layers, while the categorical cross-entropy function is selected as the loss function.The training process for the CNN is illustrated in Figure 7.To meet the accuracy requirements, the training process is divided into two parts: forward and backward propagation.During forward propagation, the network is constructed and the weights and errors are initialized.Subsequently, the input data are convolved into the fully connected layer and classified.The gradient descent method is applied in backward propagation, and the error is fed back to the convolutional layer based on the loss function through adjusting the network parameters and repeating the aforementioned steps.The fully connected layer is a shallow perceptron that establishes complete connections between the output layer and the data acquired after multiple convolution and pooling operations.Finally, the Softmax activation function classifies the results obtained in the output layer, computed as shown in Equation ( 9 where  denotes a particular classification,   ( ) denotes the value of that classification,   ( ) =   ( ) ,  denotes the probability of the  th category, and  denotes the weight.
The CNN model is optimized using Adam's optimizer, with a learning rate set at 0.00001.The ReLU function is selected as the activation function for both convolutional layers, while the categorical cross-entropy function is selected as the loss function.The training process for the CNN is illustrated in Figure 7.To meet the accuracy requirements, the training process is divided into two parts: forward and backward propagation.During forward propagation, the network is constructed and the weights and errors are initialized.Subsequently, the input data are convolved into the fully connected layer and classified.The gradient descent method is applied in backward propagation, and the error is fed back to the convolutional layer based on the loss function through adjusting the network parameters and repeating the aforementioned steps.

Analysis of RF Feature Selection Results
To select key features for accurate prediction results in further steps, we constructed an RF model herein.This model was used to compute the percentages of feature im-

Analysis of RF Feature Selection Results
To select key features for accurate prediction results in further steps, we constructed an RF model herein.This model was used to compute the percentages of feature importance for velocity and temperature in the PINN model and for porosity, microhardness, and wear rate in the CNN model.The RF evaluation determined the contribution of each input variable to each output variable of the PINN and CNN models in further steps.As shown in Figure 8, the feature names were displayed on the horizontal axis, while their corresponding importance was marked on the vertical axis.
Materials 2023, 16, x FOR PEER REVIEW portance for velocity and temperature in the PINN model and for porosity, mi ness, and wear rate in the CNN model.The RF evaluation determined the contrib each input variable to each output variable of the PINN and CNN models in furth As shown in Figure 8, the feature names were displayed on the horizontal axis, wh corresponding importance was marked on the vertical axis.Figure 8a illustrates the RF analysis of the PINN model layer, revealing th Q(O2), and Q(CH4) are important features affecting the velocity of in-flight particl SOD, Q(CH4), and Q(O2) are features that affect the temperature of these partic results demonstrate that SOD exerts the greatest effect on the characteristics of particles, making 95% and 87% contribution to the velocity and temperature, resp However, the effects of Q(O2) and Q(CH4) on temperature and velocity are limite is consistent with the Irregular trend of velocity variation with CH4 flow.Figur plays the results of the RF evaluation of the CNN model, indicating that the veloc flight particles exerts a greater effect on the microhardness and wear rate of the making 72% and 69% contributions to these parameters, respectively; the velocity important than the temperature characteristics.However, with regard to the coa rosity, the temperature of in-flight particles (55%) is more important than their (45%).It indicated that the porosity of HVOF-sprayed coatings is relatively more to the melting degree of in-flight particles.Additionally, as shown in Figure 8a, si the velocity and temperature of in-flight particles are obviously determined by s distances, the optimization of spraying distance is an efficient way for controlling rosities of coatings.Therefore, based on the RF model calculation results, adjus velocity range is an effective measure for adjusting the microhardness and wea HVOF-sprayed NiCr-Cr3C2 coatings.Furthermore, tuning the temperature of im particles is more useful to control the porosity of the NiCr-Cr3C2 coatings.

Analysis of the PINN Training Results
After training the PINN model, we plotted loss function values for the traini a function of the epochs (Figure 9).After several rounds of trial and error and pa adjustments, the training loss values of the PINN network model remained con at <0.01 and attained a steady state.Figure 10 displays the fit of the PINN mod zontal coordinates, vertical coordinates, and the solid line represent the experime ues, predicted values, and ideal fit results, respectively.The closer the dispersio are to the solid line, the more accurate is the prediction.As shown in Figure 1 predicted values of the PINN model training for the temperature and velocity o Figure 8a illustrates the RF analysis of the PINN model layer, revealing that SOD, Q(O 2 ), and Q(CH 4 ) are important features affecting the velocity of in-flight particles, while SOD, Q(CH 4 ), and Q(O 2 ) are features that affect the temperature of these particles.The results demonstrate that SOD exerts the greatest effect on the characteristics of in-flight particles, making 95% and 87% contribution to the velocity and temperature, respectively.However, the effects of Q(O 2 ) and Q(CH 4 ) on temperature and velocity are limited, which is consistent with the Irregular trend of velocity variation with CH 4 flow.Figure 8b displays the results of the RF evaluation of the CNN model, indicating that the velocity of in-flight particles exerts a greater effect on the microhardness and wear rate of the coating, making 72% and 69% contributions to these parameters, respectively; the velocity is more important than the temperature characteristics.However, with regard to the coating porosity, the temperature of in-flight particles (55%) is more important than their velocity (45%).It indicated that the porosity of HVOF-sprayed coatings is relatively more sensitive to the melting degree of in-flight particles.Additionally, as shown in Figure 8a, since both the velocity and temperature of in-flight particles are obviously determined by spraying distances, the optimization of spraying distance is an efficient way for controlling the porosities of coatings.Therefore, based on the RF model calculation results, adjusting the velocity range is an effective measure for adjusting the microhardness and wear rate of HVOF-sprayed NiCr-Cr 3 C 2 coatings.Furthermore, tuning the temperature of impinging particles is more useful to control the porosity of the NiCr-Cr 3 C 2 coatings.

Analysis of the PINN Training Results
After training the PINN model, we plotted loss function values for the training set as a function of the epochs (Figure 9).After several rounds of trial and error and parameter adjustments, the training loss values of the PINN network model remained consistently at <0.01 and attained a steady state.Figure 10   The mean absolute error (MAE) distribution between the experimental v the predicted values of the PINN model is shown in Figure 11.It was calcula Equation (6). Figure 11a,b display the MAE distribution of in-flight particle ve the training and validation sets, which were distributed from 0.00033 to 0.0519 MAE of 0.01346.Figure 11c,d show the MAE distribution of the in-flight particl ature, which ranged from 0.00026 to 0.02241 with an MAE of 0.00966.The veloc bution of in-flight particles was larger and more dispersed than the temperature tion, indicating that the PINN model was more accurate in predicting temperatu to the uniform preheating of in-flight particles during the testing process, whic more accurate temperature estimation.For in-flight particle velocity values, t predicted instantaneous velocity during a short period before the in-flight and was normal (i.e., within the range of acceptability).The mean absolute error (MAE) distribution between the experimental values and the predicted values of the PINN model is shown in Figure 11.It was calculated using Equation (6). Figure 11a,b display the MAE distribution of in-flight particle velocity for the training and validation sets, which were distributed from 0.00033 to 0.05190 with an MAE of 0.01346.Figure 11c,d show the MAE distribution of the in-flight particle temperature, which ranged from 0.00026 to 0.02241 with an MAE of 0.00966.The velocity distribution of in-flight particles was larger and more dispersed than the temperature distribution, indicating that the PINN model was more accurate in predicting temperature owing to the uniform preheating of in-flight particles during the testing process, which led to a more accurate temperature estimation.For in-flight particle velocity values, the model predicted instantaneous velocity during a short period before the in-flight and the MAE was normal (i.e., within the range of acceptability).The mean absolute error (MAE) distribution between the experimental values and the predicted values of the PINN model is shown in Figure 11.It was calculated using Equation (6). Figure 11a,b display the MAE distribution of in-flight particle velocity for the training and validation sets, which were distributed from 0.00033 to 0.05190 with an MAE of 0.01346.Figure 11c,d show the MAE distribution of the in-flight particle temperature, which ranged from 0.00026 to 0.02241 with an MAE of 0.00966.The velocity distribution of in-flight particles was larger and more dispersed than the temperature distribution, indicating that the PINN model was more accurate in predicting temperature owing to the uniform preheating of in-flight particles during the testing process, which led to a more accurate temperature estimation.For in-flight particle velocity values, the model predicted instantaneous velocity during a short period before the in-flight and the MAE was normal (i.e., within the range of acceptability).To verify the reliability of the PINN model, a randomly selected test set, unrela the training and optimization of the PINN model, was used to validate the predict locity and temperature performance.Figure 11 shows that the maximum MAEs velocity and temperature of in-flight particles in the test set were 0.03962 and 0. respectively, while the minimum MAEs of the velocity and temperature of in-flight cles in the test set were 0.00142 and 0.00026, respectively.In other words, it revea the prediction accuracy of temperature and velocity of in-flight particles are 96.8999.47%, respectively.Comparing with in-flight particle predictions based on trad machine learning models from different thermal spraying routes, including plasma ing (with 82% and 97% prediction accuracies for mean particle temperature and ve [36], cold spraying (with 96.45% predication accuracy for particle velocity) [37 HVOF (with 99.24% and 99.57% prediction accuracies for mean particle temperatu velocity) [13], the novel hybrid PINN-CNN model exhibited generally more accura dictions.In addition, results indicated that the predicted and actual values of the were consistent, which demonstrates that the PINN model was trained and met th diction requirements for the temperature and velocity of in-flight particles in the spray process.The model establishes a physical relation to describe the associati tween HVOF spray process parameters and particle flight characteristics.

Analysis of the CNN Training Results
After training the CNN network (Figure 12a-c  To verify the reliability of the PINN model, a randomly selected test set, unrelated to the training and optimization of the PINN model, was used to validate the predicted velocity and temperature performance.Figure 11 shows that the maximum MAEs of the velocity and temperature of in-flight particles in the test set were 0.03962 and 0.01824, respectively, while the minimum MAEs of the velocity and temperature of in-flight particles in the test set were 0.00142 and 0.00026, respectively.In other words, it reveals that the prediction accuracy of temperature and velocity of in-flight particles are 96.89% and 99.47%, respectively.Comparing with in-flight particle predictions based on traditional machine learning models from different thermal spraying routes, including plasma spraying (with 82% and 97% prediction accuracies for mean particle temperature and velocity) [36], cold spraying (with 96.45% predication accuracy for particle velocity) [37], and HVOF (with 99.24% and 99.57% prediction accuracies for mean particle temperature and velocity) [13], the novel hybrid PINN-CNN model exhibited generally more accurate predictions.In addition, results indicated that the predicted and actual values of the model were consistent, which demonstrates that the PINN model was trained and met the prediction requirements for the temperature and velocity of in-flight particles in the HVOF spray process.The model establishes a physical relation to describe the association between HVOF spray process parameters and particle flight characteristics.

Analysis of the CNN Training Results
After training the CNN network (Figure 12a-c 14c,d).Furthermore, the MAEs of the coating wear rate were mostly distributed between 0.000004 and 0.03318, with an average of 0.01078 (Figure 14e,f).The MAE results indicate that the error distribution of the coating wear rate is wider and more dispersed than the distribution of coating microhardness or porosity.This implies that the CNN model accurately predicts the porosity and microhardness of the coating.This is because porosity is a parameter directly obtained after spraying and less influenced by other parameters.Therefore, direct prediction based on particle velocity and temperature provides high accuracy of up to 99%.Furthermore, in case of coating microhardness, the error bars are larger, the CNN data exhibit fluctuations, and the test data are affected by specimen size, the degree of particle flattening, and residual stress.The accuracy of data predicted directly on the basis of particle velocity and temperature is lower than that predicted on the basis of porosity.The coating wear rate is influenced by the porosity, microhardness, and roughness of the sample and exhibits a substantial relation with the surface condition of the specimen post treatment.Therefore, it is understandably influenced by the crossover of parameters, and the prediction accuracy of the model is low.To evaluate the effectiveness of the CNN model, we randomly split the dataset into training and validation sets.The experimental results show that the R 2 values of the model reached 0.99971, 0.99741, and 0.99968 for the porosity, microhardness, and wear rate, respectively (as shown in Figure 13a-c).These results confirm that the fitting of the model is good.However, the R 2 values of the CNN model were smaller than those of the PINN model.This difference can be attributed to the ability of the PINN to embed the physical relation equation, which enhances the prediction accuracy and fit of the model.The accuracy of the CNN model was evaluated using MAE (Figure 14a-f).After model training, we reversely normalized the true and predicted values in the training and validation sets.Figure 14 compares the MAEs between experimental values and the predicted values of the CNN model.As shown in Figure 14a,b, the MAEs for the porosity of the coating in the training and validation sets ranged from 0.000002 to 0.03877, with an average of 0.00218.The coating microhardness exhibited maximum and minimum MAEs of 0.04864 and 0.00043, respectively, between true and predicted values, with an average of 0.00513 (Figure 14c,d).Furthermore, the MAEs of the coating wear rate were mostly distributed between 0.000004 and 0.03318, with an average of 0.01078 (Figure 14e,f).The MAE results indicate that the error distribution of the coating wear rate is wider and more dispersed than the distribution of coating microhardness or porosity.This implies that the CNN model accurately predicts the porosity and microhardness of the coating.This is because porosity is a parameter directly obtained after spraying and less influenced by other parameters.Therefore, direct prediction based on particle velocity and temperature provides high accuracy of up to 99%.Furthermore, in case of coating microhardness, the error bars are larger, the CNN data exhibit fluctuations, and the test data are affected by specimen size, the degree of particle flattening, and residual stress.The accuracy of data predicted directly on the basis of particle velocity and temperature is lower than that predicted on the basis of porosity.The coating wear rate is influenced by the porosity, microhardness, and roughness of the sample and exhibits a substantial relation with the surface condition of the specimen post treatment.Therefore, it is understandably influenced by the crossover of parameters, and the prediction accuracy of the model is low.To evaluate the effectiveness of the CNN model, we randomly split the dataset training and validation sets.The experimental results show that the R 2 values of the mo reached 0.99971, 0.99741, and 0.99968 for the porosity, microhardness, and wear rate spectively (as shown in Figure 13a-c).These results confirm that the fitting of the mo is good.However, the R 2 values of the CNN model were smaller than those of the PI model.This difference can be attributed to the ability of the PINN to embed the phys relation equation, which enhances the prediction accuracy and fit of the model.The ac racy of the CNN model was evaluated using MAE (Figure 14a-f).After model train we reversely normalized the true and predicted values in the training and validation s Figure 14 compares the MAEs between experimental values and the predicted value the CNN model.As shown in Figure 14a,b, the MAEs for the porosity of the coating in training and validation sets ranged from 0.000002 to 0.03877, with an average of 0.00 The coating microhardness exhibited maximum and minimum MAEs of 0.04864 0.00043, respectively, between true and predicted values, with an average of 0.00513 ( ure 14c,d).Furthermore, the MAEs of the coating wear rate were mostly distributed tween 0.000004 and 0.03318, with an average of 0.01078 (Figure 14e,f).The MAE res indicate that the error distribution of the coating wear rate is wider and more disper than the distribution of coating microhardness or porosity.This implies that the C model accurately predicts the porosity and microhardness of the coating.This is beca porosity is a parameter directly obtained after spraying and less influenced by other rameters.Therefore, direct prediction based on particle velocity and temperature provi high accuracy of up to 99%.Furthermore, in case of coating microhardness, the error b are larger, the CNN data exhibit fluctuations, and the test data are affected by specim size, the degree of particle flattening, and residual stress.The accuracy of data predic directly on the basis of particle velocity and temperature is lower than that predicted the basis of porosity.The coating wear rate is influenced by the porosity, microhardn and roughness of the sample and exhibits a substantial relation with the surface condi of the specimen post treatment.Therefore, it is understandably influenced by the cro ver of parameters, and the prediction accuracy of the model is low.Figure 14 demonstrates the reliability of the CNN model through evaluating its prediction performance on the test set.The porosity, microhardness, and wear rate have maximum MAEs of 0.00063, 0.01009, and 0.03318, respectively.The minimum MAEs for porosity, microhardness, and wear rate are 0.00029, 0.00146, and 0.00052, respectively.These results indicated that the predication accuracy for coatings' porosity, microhardness and wear rate are 99.97%,99.74%, and 99.97%, respectively.As a comparison, based on the Generative Adversarial Network (GAN) model, the prediction accuracy for coating characteristics via suspension plasma spraying is only 80% [24].Consequently, the hybrid PINN-CNN model also possess advantages with excellent prediction accuracy for coating performances.

Conclusions
Herein, a new hierarchical neural network model based on the PINN and CNN has been proposed to simulate the relation between HVOF spray process parameters, in-flight particle characteristics, and NiCr-Cr 3 C 2 coating properties.It should be mentioned that the development of the novel hybrid PINN-CNN model could be beneficial for reducing the overfitting problem from the conventional ANN model, as well as compensating for the poor transferability of traditional machine learning techniques due to the usage of PINN model.The main contributions of the proposed approach can be summarized as follows: First, an RF model was developed for feature selection to assess the importance of each feature.Results demonstrate that SOD exerts the greatest effect on the velocity and temperature of in-flight particles and that the velocity of in-flight particles affects the microhardness and wear rate of the coating; the temperature of in-flight particles is more important for the porosity of the coating than their velocity.Second, this study proposes a novel approach: the prediction of HVOF-sprayed coatings based on the hybrid PINN-CNN model.The PINN model can predict the velocity and temperature of in-flight particles via training and optimization, with MAEs of 0.01346 and 0.00966, respectively.Third, the CNN model considers the velocity and temperature of in-flight particles predicted by the PINN as the input and predicts the porosity, microhardness, and wear rate.The MAEs of the CNN model are 0.00218, 0.00513, and 0.01078 for the porosity, microhardness, and wear rate, respectively, which achieve good prediction accuracy and less overfitting.The hybrid PINN-CINN model prediction errors are 1% overall, and the R 2 is >96%, which possessed comparable or even better prediction accuracies for both in-flight particle characteristics and coating performances compared to traditional ML models.Moreover, the development of the novel hybrid PINN-CNN model is beneficial for reducing the overfitting problem from the conventional ANN model, as well as compensating for the poor transferability of traditional machine learning techniques due to the usage of the PINN model.All in all, the hierarchical neural network model is not only capable of effectively realizing the prediction of in-flight particle behavior and coating performances as well as its influencing factors, but also providing a theoretical basis for preparing and optimizing high-performance HVOF-sprayed coatings.

Materials 2023 , 18 Figure 1 .
Figure 1.The framework of this work.

Figure 1 .
Figure 1.The framework of this work.

Figure 2 .
Figure 2. The random forest model structure.

Figure 2 .
Figure 2. The random forest model structure.

Figure 4 .
Figure 4. Specific representation of data in the model.Figure 4. Specific representation of data in the model.

Figure 4 .
Figure 4. Specific representation of data in the model.Figure 4. Specific representation of data in the model.

Figure 5
depicts the PINN model architecture diagram.Materials 2023, 16, x FOR PEER REVIEW 8 of 18 depicts the PINN model architecture diagram.

Figure 6 .Figure 6 .
Figure 6.The basic architecture of a CNN.Herein, we propose a novel architecture wherein the input layer is the predicted particle flight speed and temperature obtained from the PINN model.The convolutional layer performs layer-by-layer feature extraction of the input signal, and the obtained features are then mapped to the output layer using the fully connected layer.The output Figure 6.The basic architecture of a CNN.

Figure 7 .
Figure 7.The progress of CNN training.

Figure 7 .
Figure 7.The progress of CNN training.

Figure 8 .
Figure 8.(a) The contribution rate of input variables on the velocity and temperature o particles.(b) The contribution rate of input variables on the coating porosity, microhard wear rate.

Figure 8 .
Figure 8.(a) The contribution rate of input variables on the velocity and temperature of in-flight particles.(b) The contribution rate of input variables on the coating porosity, microhardness, and wear rate.
displays the fit of the PINN model.Horizontal coordinates, vertical coordinates, and the solid line represent the experimental values, predicted values, and ideal fit results, respectively.The closer the dispersion points are to the solid line, the more accurate is the prediction.As shown in Figure 10a,b, the predicted values of the PINN model training for the temperature and velocity of the in-flight particles are highly similar to the actual values, and the R 2 values of the model reach 0.99473 and 0.96888, respectively.These results indicate that the PINN model satisfies the training requirements and can be used to predict the velocity and temperature of the in-flight particles.als 2023, 16, x FOR PEER REVIEW flight particles are highly similar to the actual values, and the R 2 values of the mo 0.99473 and 0.96888, respectively.These results indicate that the PINN model sa training requirements and can be used to predict the velocity and temperature flight particles.

Figure 9 .Figure 10 .
Figure 9.The loss values of PINN training process for predicting velocity (a) and temper

Figure 9 .
Figure 9.The loss values of PINN training process for predicting velocity (a) and temperature (b).
flight particles are highly similar to the actual values, and the R 2 values of the model reach 0.99473 and 0.96888, respectively.These results indicate that the PINN model satisfies the training requirements and can be used to predict the velocity and temperature of the inflight particles.

Figure 9 .
Figure 9.The loss values of PINN training process for predicting velocity (a) and temperature (b).

Figure 10 .
Figure 10.Predicted R 2 values for velocity (a) and temperature (b) models.

Figure 10 .
Figure 10.Predicted R 2 values for velocity (a) and temperature (b) models.

Figure 11 .
Figure 11.Mean absolute error distribution of the velocity (a,b) and temperature (c,d) experi values and the predicted values from the PINN model.
), we plotted the loss function of the training set for each training cycle.The results indicated a gradual decrease training error with increasing training times; the average training error stabilized proximately 0.05 after 20,000 training cycles.

Figure 11 .
Figure 11.Mean absolute error distribution of the velocity (a,b) and temperature (c,d) experimental values and the predicted values from the PINN model.
), we plotted the loss function values of the training set for each training cycle.The results indicated a gradual decrease in the training error with increasing training times; the average training error stabilized at approximately 0.05 after 20,000 training cycles.

Figure 12 .
Figure 12.The loss values of CNN training process for predicting porosity (a), microhardness (b), and wear rate (c).To evaluate the effectiveness of the CNN model, we randomly split the dataset into training and validation sets.The experimental results show that the R 2 values of the model reached 0.99971, 0.99741, and 0.99968 for the porosity, microhardness, and wear rate, respectively (as shown in Figure13a-c).These results confirm that the fitting of the model is good.However, the R 2 values of the CNN model were smaller than those of the PINN model.This difference can be attributed to the ability of the PINN to embed the physical relation equation, which enhances the prediction accuracy and fit of the model.The accuracy of the CNN model was evaluated using MAE (Figure14a-f).After model training, we reversely normalized the true and predicted values in the training and validation sets.Figure14compares the MAEs between experimental values and the predicted values of the CNN model.As shown in Figure14a,b, the MAEs for the porosity of the coating in the training and validation sets ranged from 0.000002 to 0.03877, with an average of 0.00218.The coating microhardness exhibited maximum and minimum MAEs of 0.04864 and 0.00043, respectively, between true and predicted values, with an average of 0.00513 (Figure14c,d).Furthermore, the MAEs of the coating wear rate were mostly distributed between 0.000004 and 0.03318, with an average of 0.01078 (Figure14e,f).The MAE results indicate that the error distribution of the coating wear rate is wider and more dispersed than the distribution of coating microhardness or porosity.This implies that the CNN model accurately predicts the porosity and microhardness of the coating.This is because porosity is a parameter directly obtained after spraying and less influenced by other parameters.Therefore, direct prediction based on particle velocity and temperature provides high accuracy of up to 99%.Furthermore, in case of coating microhardness, the error bars are larger, the CNN data exhibit fluctuations, and the test data are affected by specimen size, the degree of particle flattening, and residual stress.The accuracy of data predicted directly on the basis of particle velocity and temperature is lower than that predicted on the basis of porosity.The coating wear rate is influenced by the porosity, microhardness, and roughness of the sample and exhibits a substantial relation with the surface condition of the specimen post treatment.Therefore, it is understandably influenced by the crossover of parameters, and the prediction accuracy of the model is low.
Figure 14 compares the MAEs between experimental values and the predicted values of the CNN model.As shown in Figure 14a,b, the MAEs for the porosity of the coating in the training and validation sets ranged from 0.000002 to 0.03877, with an average of 0.00218.The coating microhardness exhibited maximum and minimum MAEs of 0.04864 and 0.00043, respectively, between true and predicted values, with an average of 0.00513 (Figure

Figure 12 .
Figure 12.The loss values of CNN training process for predicting porosity (a), microhardness (b), and wear rate (c).

Materials 2023 ,Figure 12 .
Figure 12.The loss values of CNN training process for predicting porosity (a), microhardness and wear rate (c).

Figure 14 .
Figure 14.Mean absolute error distribution of the porosity (a,b) , microhardness (c,d), and wea (e,f) experimental values and the predicted values from the CNN model.

Figure 14
Figure 14  demonstrates the reliability of the CNN model through evaluating its diction performance on the test set.The porosity, microhardness, and wear rate have imum MAEs of 0.00063, 0.01009, and 0.03318, respectively.The minimum MAEs fo rosity, microhardness, and wear rate are 0.00029, 0.00146, and 0.00052, respectively.T results indicated that the predication accuracy for coatings' porosity, microhardness wear rate are 99.97%,99.74%, and 99.97%, respectively.As a comparison, based on

Figure 14 .
Figure 14.Mean absolute error distribution of the porosity (a,b), microhardness (c,d), and wear rate (e,f) experimental values and the predicted values from the CNN model.

Table 1 .
Spraying parameters for NiCr-Cr 3 C 2 coatings in the HVOF process.

Table 2 .
Spraying parameters, characteristics of in-flight particles, and coating performances.