Cylinder Pressure Prediction of An HCCI Engine Using Deep Learning

Engine tests are both costly and time consuming in developing a new internal combustion engine. Therefore, it is of great importance to predict engine characteristics with high accuracy using artificial intelligence. Thus, it is possible to reduce engine testing costs and speed up the engine development process. Deep Learning is an effective artificial intelligence method that shows high performance in many research areas through its ability to learn high-level hidden features in data samples. The present paper describes a method to predict the cylinder pressure of a Homogeneous Charge Compression Ignition (HCCI) engine for various excess air coefficients by using Deep Neural Network, which is one of the Deep Learning methods and is based on the Artificial Neural Network (ANN). The Deep Learning results were compared with the ANN and experimental results. The results show that the difference between experimental and the Deep Neural Network (DNN) results were less than 1%. The best results were obtained by Deep Learning method. The cylinder pressure was predicted with a maximum accuracy of 97.83% of the experimental value by using ANN. On the other hand, the accuracy value was increased up to 99.84% using DNN. These results show that the DNN method can be used effectively to predict cylinder pressures of internal combustion engines.


Introduction
Among Artificial Intelligence technologies, Deep Learning is seen as the driving force of technology generalization and development [1]. In general, Deep Learning technology is a sophisticated technology based on an increase in the number of hidden layers in a simple neural network. According to LeCun et al. [2], training neural networks with more than three hidden layers is called Deep Learning. In recent years, Deep Learning has emerged as a hot research topic in the field of Machine Learning and has achieved remarkable success in learning top hidden features in data samples [3]. Deep Neural Network which is one of Deep Learning techniques has become a powerful and extremely popular mechanism widely used to solve various complexity problems, depending on their ability to generate models that fit nonlinear complex problems [4]. The main reasons why Deep Neural Networks are so popular nowadays are lack of correctness, efficiency and flexibility [5]. Deep Learning methods are extensively applied to various fields of science and engineering such as speech recognition, computer vision, pattern recognition, image classification, and language learning methods [6,7].
There are many studies in the literature which use Artificial Intelligence in internal combustion engines. Cay [8] estimated fuel consumption, brake power and exhaust gas temperature of a SI engine by using ANN method. Cay et al. [9] predicted performance and exhaust emissions of an engine fueled with gasoline and methanol using ANN. Manieniyan et al. [10] performed wear element analysis of a DI diesel engine using biodiesel with exhaust gas recirculation using neural networks. Bahri et al. [11] investigated combustion noise, and ringing operation in a 0.3 L converted diesel engine using ANN. Rahimi et al. [12] predicted the performance and exhaust emissions of a compression ignition engine using a wavelet neural network with a stochastic gradient algorithm. Bendu et al. [13] developed an intelligent estimation tool with the Generalized Regression Neural Networks to predict the performance (brake thermal efficiency, exhaust gas temperature) and exhaust gas emissions (UHC, CO, NO, smoke) of an ethanol-fueled HCCI engine. In a study by Roy et al. [14], the availability of ANNs to estimate performance and exhaust emissions for a single-cylinder, four-stroke Common Rail Direct Injection Diesel engine is being investigated. Rezai et al. [15] developed two different ANN models, radial basis function and forward feed, in order to predict performance and emission values of a HCCI engine operating with oxygenated fuels. Heister and Froehlich [16] proposed the use of an ANN model to predict the cylinder pressure at different engine speeds, depending on the crankshaft angle. In their study, Benneth et al. [17] proposed a Repetitive Nonlinear Autoregressive Neural Network with exogenous input for restoring cylinder pressure in multi-cylinder IC motors using measured crank kinematics. They have provided fast and robust training using crankshaft speed and crankshaft acceleration as input variables. Maass et al. [18] used a NARX Neural Network to predict the cylinder pressure. The used ANN model was validated by experimental data from a diesel engine. Saraee et al. [19] investigated the effect of nanoparticle addition on specific fuel consumption and exhaust emissions of a diesel engine using ANN. Luján et al. [20] developed an adaptive learning algorithm to predict volumetric efficiency of a turbocharged diesel engine based on the increase of hidden layer weight update speed. Their results showed that the proposed adaptive learning method performs with higher learning speed, reduced computational resources and lower network complexities. Şahin [21] used ANN model to predict the in-cylinder air-fuel ratio by using data of the ionization current. The ANN model predicted the air-fuel ratio with a prediction accuracy of 0.99508. Goudarzi et al. [22] used a back propagation neural (BPN) network to estimate the heat transfer rate through the valve and its seat due the complexity of thermal contact problem between the valve and its seat.
Although there are many studies in the literature that utilize ANNs on engine performance and exhaust emission prediction, there are no studies that use DNNs. DNN models are widely used in areas such as image processing, image classification, speech recognition and text classification. For this reason, it is thought that this study will make a significant contribution to the literature. This study aims to predict the cylinder pressure of an HCCI engine with the help of DNNs. In the first step, different batch sizes, number of epochs, number of hidden layers and activation functions were tested to find the parameters that give the best estimation results of the DNN. In the second stage, DNNs with different number of hidden layers were compared with ANNs with different number of hidden layers. Comparisons were made using error measurement values of Mean Absolute Error (MAE) and Mean Absolute Percentage Error (MAPE).

Experimental Setup and Procedure
In this study, the experiment were performed on a single-cylinder Ricardo Hydra research engine. The engine specifications are given in Table 1.
The fuel was injected into the inlet port at compression TDC (Top Dead Centre) and targeted onto the back of the closed inlet valves. This timing was designed to allow the maximum possible time for fuel to evaporate and mix before induction into the cylinder. The intake could be pressurized using an electrically driven compressor and the intake air could be heated. The excess air coefficient was measured by a Horiba MEXA 1500 exhaust gas analyzer. Cylinder pressure was measured with a Kistler 6125 piezoelectric pressure transducer located in the side of the pent-roof cylinder head.
Engine tests were performed with unleaded gasoline fuel. The fuel specifications are presented in Table 2. The excess air coefficient was set to fixed values of 3.0, 3.75, 4.25 and 4.75 by adjusting the amount of injected fuel.  During the experiments, intake air temperature, intake air pressure and engine speed held constant at 80 °C, 2.0 bar (abs) and 1200 r/min respectively. Lubricant and coolant temperatures were both held at a constant temperature of 90 °C. An average pressure signal based on 100 cycles was obtained and stored by the AVL system for each condition once combustion had stabilized.

Deep Learning model
In the study, 4803 pieces of data were used. Crank angle and air excess coefficient values are used as input variables and cylinder pressure values are used as output variables. 66.6% of the data set is divided into training and 33.3% is divided into test data set. To track the loss of validation during training, 321 data points corresponding to 10% of the training data set were selected as validation data sets and used to reduce errors. In most cases, input data has a wide range of values that reduces the effectiveness of training procedures. Data normalization method can be used to overcome this situation [23]. Before the network was trained, the input and output variables of training and test data were scaled between 0 and +1 with the help of min-max normalization given in Eq. (1) [24]: where X i is the value of the feature, X i is the scaled feature value, X min and X max are the minimum and maximum value of the dataset, respectively.
In this study, MAE and MAPE were used as the performance criteria. The equations for these criteria are given below; where n is total number of data points in the test data set, Y i is actual value of the cylinder pressure and Ŷ i is the predicted value of the cylinder pressure. The low MAE and MAPE values indicate that the predicted values agree with the actual data [25][26][27]. In addition to these error measures, the 1-MAPE value was used in this study to show the accuracy of predictions of the models in percentage terms.
Forecast models can provide a high unrealistic forecasting performance when reapplied to the same sample they are trained [28]. Malliaris and Salchenberger [29] indicate that validation techniques are needed to identify (1) the appropriate number of hidden layer nodes during the modeling of the neural network, so that under-fitting (very few neurons) and over-fitting (too many neurons) problems can be avoided. One of the approaches that can be used to avoid over-fitting is the k-fold-cross-validation technique [30,31]. In this study, in addition to statistical performance measures, a 3-fold-cross-validation technique has been applied to improve the generalization ability of DNNs.
The DNN Model is formed as an input layer, four hidden layers and an output layer. The general structure of the network and the number of neurons in each layer are given in Figure 1. Analyzes were performed using the Keras Library in the Spyder development environment. As an activation function, sigmoid function, hyperbolic tangent function (tanh) and rectified linear unit (ReLU) activation functions are used in generally [32]. In this paper, The ReLU activation function is used in each of the layers. When the ReLU activation function is used in the layers, convergence is accelerated and the parameters are learned faster than typical logistic sigmoid and tanh activation functions [33]. When the performance of the fitting function is measured, different loss functions such as mean square error loss function, logistic loss function, hinge loss function and cross entropy loss function can be used [34]. In this study, mean squared error loss function is used as loss function. The batch sizes can be given up to the size of training data set. While the Adam optimization method [35] was used as the optimization function, the learning rate was taken as 0.001.

Results and Discussion
It is a known fact that parameters influence Neural Network performance. To find the best parameters, the number of epoch was changed to 500 and 1000 in each application, while the batch size was changed to be 2, 4, 8, 16, 32, 64, 128, 256, 512, and 1024. When the comparison results are analyzed in Figure 2, it is seen that the DNN created by using 500 epoch number and 64 batch size parameter gives the best performance with 0.159571 MAPE value.
The graphs in Figure 3 were obtained from Spyder software. The figures illustrate the optimal neural network training and validation processes. In these figures, the horizontal axis denote the training and validation epoch. In Figure 3a, the vertical axis is the MAE value, while the vertical axis in Figure 3b denotes loss value. As can be seen from the figures, as the number of epoch increases training and validation errors and lost values tend to decrease in parallel. A slow decline is seen first, while a slow decline in epoch numbers is seen. This means that the network does not memorize. As mentioned previously, there are 1601 data points in the test dataset. However, in order to clearly see the difference between the predicted and experimental data, the points of the crank angle range realized by the side are shown in Figure 4. As can be seen from the figure, the experimental and predicted cylinder pressure values coincide except a few points. This indicates that the prediction performance of the model is very good.
In order to investigate the effect of the neuron number of on the prediction performance, the neurons number in each layer was decreased and a new model with 4 hidden layers was created. In the first model (DNN1), the number of neurons in the hidden layers are 100, 150, 120 and 120, respectively, while the number of neurons in the second model (DNN2) are 10, 15, 12 and 12. The prediction accuracy values of the two models are given in Figure 5. Although they have different estimating performance, both models show a prediction accuracy over 99%. As can be seen from these results, the DNN1 model was not affected by the overfitting situation which could be caused by the use of excess neuron number.
In order to investigate the effect of activation functions on prediction performance, the results obtained with hyperbolic tangent, log sigmoid, and ReLU activation function were compared. Figure 6 shows the prediction accuracy values of the models trained with different activation functions. As can be seen from the figure, the best predictor was the ReLU activation function with 99.84% prediction accuracy value.
The results of the study on dataset shows that the 4 hidden layer DNN with 500 epoch number and 64 batch size parameters using the ReLU activation function in each layer and using 100, 150, 120, 120 neuron numbers in layers gives the best performance. To understand that the network whether memorize or not because of the high  In order to understand effects of hidden layer number on training of network and whether DNNs are superior to ANNs in prediction performance or not, performances of DNN models which were built with optimal parameters were compared with ANN models. DNN1 and DNN2 which two models of DNNs have 4 hidden layers and 5 hidden layers respectively. ANN1, ANN2 and ANN3 that are models of ANNs have 1 hidden layer, 2 hidden layers and 3 hidden layers respectively. ReLU activation function was used in each layer.
The MAPE values in the test dataset of ANN and DNN models with different numbers of hidden layers are shown in Figure 8. As can be seen from the figure, as the number of hidden layers increases to a certain extent, the prediction performance of the models increases. The DNN with 4 hidden layers gives better prediction result with MAPE value of 0.159. However, when the number of hidden layers is increased to 5, the prediction performance decreases.

Conclusions
In this article, cylinder pressure of an HCCI engine was predicted by using DNN and the results were compared with the results of three different ANN models. Conclusions obtained from this study are summarized as follows.
(1) ANNs perform well in predicting the cylinder pressure. However, DNNs produce better prediction results compared to ANNs. (2) When the results are examined, it is seen that 99.84% prediction accuracy was obtained by the model which trained by DNNs. (3) DNN methods, which give very close results to the experimental values, can be used to determine the cylinder pressure of an HCCI engine at different operating conditions. Thus, the number of experiment, which require long time and high cost, can be significantly reduced.