Skip to main content

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.

1 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).

2 Materials and Methods

2.1 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.

Table 1 Specifications of the test engine

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.

Table 2 Fuel specifications

2.2 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]:

$$\tilde{X}^{i} = \frac{{X^{i} - X_{\text{min} } }}{{X_{\text{max} } - X_{\text{min} } }},$$

where \(X^{i}\) is the value of the feature, \(\tilde{X}^{i}\) is the scaled feature value, \(X_{\text{min} }\) and \(X_{\text{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;

$$MAE = \frac{1}{n}\sum\nolimits_{i = 1}^{n} {\left| {Y_{i} - \hat{Y}_{i} } \right|} ,$$
$$MAPE = \frac{100}{n}\sum\nolimits_{i = 1}^{n} {\left| {\frac{{Y_{i} - \hat{Y}_{i} }}{{Y_{i} }}} \right|} ,$$

where n is total number of data points in the test data set, \(Y_{i}\) is actual value of the cylinder pressure and \(\hat{Y}_{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 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.

Figure 1
figure 1

Structure of the DNN

3 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.

Figure 2
figure 2

MAPE values of DNN models which trained with different epoch and mini-batch sizes

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.

Figure 3
figure 3

Change of the (a) MAE and (b) Loss values with Epoch number

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.

Figure 4
figure 4

Experimental and predicted cylinder pressure values of 91 test data points

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.

Figure 5
figure 5

Prediction accuracy values of DNNs generated by different neuron numbers

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.

Figure 6
figure 6

Prediction accuracy values in the test data set of models with different activation functions

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 number of epochs, new tests have been made by changing the epoch numbers on this model. Figure 7 presents a graphical representation of the test MAPE values of the DNN trained with different epoch numbers. It is understood that as the number of epoch increases, the MAPE value decreases up to 500 epoch size. However, the MAPE value tends to increase at the epoch sizes larger than 500.

Figure 7
figure 7

Test MAPE values of DNN trained with different epoch numbers

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.

Figure 8
figure 8

MAPE values in the test dataset of ANN and DNN models with different number of hidden layers

4 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. (1)

    ANNs perform well in predicting the cylinder pressure. However, DNNs produce better prediction results compared to ANNs.

  2. (2)

    When the results are examined, it is seen that 99.84% prediction accuracy was obtained by the model which trained by DNNs.

  3. (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.


  1. D Lee, S Kang, J Shin. Using deep learning techniques to forecast environmental consumption level. Sustainability, 2017, 9(10): 1–17.

    Google Scholar 

  2. Y LeCun, Y Bengio, G Hinton. Deep learning. Nature, 2015, 521: 436–444.

    Article  Google Scholar 

  3. L Wei, Y Ding, R Su, et al. Prediction of human protein subcellular localization using deep learning. Journal of Parallel and Distributed Computing, 2017, 117: 212–217.

    Article  Google Scholar 

  4. A Martin, R Lara-Cabrera, F Fuentes-Hurtedo, et al. EvoDeep: A new evolutionary approach for automatic deep neural networks parametrization. Journal of Parallel and Distributed Computing, 2018, 117: 180–191.

    Article  Google Scholar 

  5. S Pang, J J Coz, Z Yu, et al. Deep learning to frame objects for visual target tracking. Engineering Applications of Artificial Intelligence, 2017, 65: 406–420.

    Article  Google Scholar 

  6. B Jan, H Farman, M Khan, et al. Deep learning in big data Analytics: A comparative study. Computers and Electrical Engineering, 2019, 75: 275–287.

    Article  Google Scholar 

  7. E O Aboagye, G J James, R Kumar. Evaluating the performance of deep neural networks for health decision making. Procedia Computer Science, 2018, 131: 866–872.

    Article  Google Scholar 

  8. Y Çay. Prediction of a gasoline engine performance with artificial neural network. Fuel, 2013, 111: 324–331.

    Article  Google Scholar 

  9. Y Çay, İ Korkmaz, A Çiçek, et al. Prediction of engine performance and exhaust emissions for gasoline and methanol using artificial neural network. Energy, 2013, 50: 177–186.

    Article  Google Scholar 

  10. V Manieniyan, G Vinodhini, R Senthilkumar, et al. Wear element analysis using neural networks of a DI diesel engine using biodiesel with exhaust gas recirculation. Energy, 2016, 114: 603–612.

    Article  Google Scholar 

  11. B Bahri, M Shahbakhti, A A Aziz. Real-time modeling of ringing in HCCI engines using artificial neural networks. Energy, 2017, 125: 509–518.

    Article  Google Scholar 

  12. R R Molkdaragh, S Jafarmadar, S Khalilaria, et al. Prediction of the performance and exhaust emissions of a compression ignition engine using a wavelet neural network with a stochastic gradient algorithm. Energy, 2018, 142: 1128–1138.

    Article  Google Scholar 

  13. H Bendu, B Deepak, S Murugan. Application of GRNN for the prediction of performance and exhaust emissions in HCCI engine using ethanol. Energy Conversion and Management, 2016, 122: 165–173.

    Article  Google Scholar 

  14. S Roy, R Banerjee, P K Bose. Performance and exhaust emissions prediction of a CRDI assisted single cylinder diesel engine coupled with EGR using artificial neural network. Applied Energy, 2014, 119: 330–340.

    Article  Google Scholar 

  15. J Rezaei, M Shahbakhti, B Bahri, et al. Performance prediction of HCCI engines with oxygenated fuels using artificial neural networks. Applied Energy, 2015, 138: 460–473.

    Article  Google Scholar 

  16. F Heister, M Froehlich. Non-lineir time series analysis of combustion pressure data for neural network training with the concept of mutual information. Proceedings of the Institution of Mechanical Engineers, D Journal of Automobile Engineering, 2001, 215(2): 299–304.

    Article  Google Scholar 

  17. C Benneth, J F Dunne, S Trimby, et al. Engine cylinder pressure reconstruction using crank kinematics and recurrently-trained neural networks. Mechanical Systems and Signal Processing, 2017, 85: 126–145.

    Article  Google Scholar 

  18. B Maass, J Deng, R Stobart. In-cylinder pressure modeling with artificial neural networks. SAE Technical Paper, 2011-01-1417, 2011,

  19. H S Sarae, H Taghavifar, S Jafarmadar. Experimental and numerical consideration of the effect of CeO2 nanoparticles on diesel engine performance and exhaust emission with the aid of artificial neural network. Applied Thermal Engineering, 2017, 113: 663–672.

    Article  Google Scholar 

  20. J M Luján, H Climent, L M García-Cuevas, et al. Volumetric efficiency modelling of internal combustion engines based on a novel adaptive learning algorithm of artificial neural networks. Applied Thermal Engineering, 2017, 123: 625–634.

    Article  Google Scholar 

  21. F Şahin. Effects of engine parameters on ionization current and modeling of excess air coefficient by artificial neural network. Applied Thermal Engineering, 2015, 90: 94–101.

    Article  Google Scholar 

  22. K Goudarzi, A Moosaei, M Gharaati. Applying artificial neural networks (ANN) to the estimation of thermal contact conductance in the exhaust valve of internal combustion engine. Applied Thermal Engineering, 2015, 87: 688–697.

    Article  Google Scholar 

  23. G S Atsalakis, K P Valavanis. Surveying stock market forecasting techniques – Part II: Soft computing methods. Expert Systems with Applications, 2009, 36: 5932–5941.

    Article  Google Scholar 

  24. S Chakravarty, P K Dash. A PSO based integrated functional link net and interval type-2 fuzzy logic system for predicting stock market indices. Applied Soft Computing, 2012, 12: 931–941.

    Article  Google Scholar 

  25. J J Wang, J Z Wang, Z G Zhang, et al. Stock index forecasting based on a hybrid model. Omega, 2012, 40: 758–766.

    Article  Google Scholar 

  26. C J Lu, J Y Wu. An efficient CMAC neural network for stock index forecasting. Expert Systems with Applications, 2011, 38: 15194–15201.

    Article  Google Scholar 

  27. F A Oliveira, C N Nobre, L E Zarate. Applying artificial neural networks to prediction of stock price and improvement of the directional prediction index – Case study of PETR4, Petrobras, Brazil. Expert Systems with Applications, 2013, 40: 7596–7606.

    Article  Google Scholar 

  28. C Tantithamthavorn, A E Hassan. An empirical comparison of model validation techniques for defect prediction models. IEEE Transactions on Software Engineering, 2017, 43: 1–18.

    Article  Google Scholar 

  29. M Malliaris, L Salchenberger. A neural network model for estimating option prices. Journal of Applied Intelligence, 1993, 3: 193–206.

    Article  Google Scholar 

  30. D Enke, S Thawornwong. The use of data mining and neural networks for forecasting stock market returns. Expert Systems with Applications, 2005, 29: 927–940.

    Article  Google Scholar 

  31. G E Peterson, S R Aylward, W E Bond, et al. Using Taguchi’s method of experimental design to control errors in layered perceptrons. IEEE Transactions on Neural Networks, 1995, 6: 949–961.

    Article  Google Scholar 

  32. H Shi, M Xu, Q Ma, et al. A whole system assessment of novel deep learning approach on short-term load forecasting. Energy Procedia, 2017, 142: 2791–2796.

    Article  Google Scholar 

  33. K G Lore, D Stoecklein, M Davies, et al. A deep learning framework for causal shape transformation. Neural Networks, 2018, 98: 305–317.

    Article  Google Scholar 

  34. Y Dai, G Wang. A deep inference learning framework for healthcare. Pattern Recognition Letters, 2020, 139: 17–25.

    Article  Google Scholar 

  35. D P Kingma, J L Ba. Adam: a method for stochastic optimization. Proceedings of 3rd International Conference on Learning Representations (ICLR), San Diego, CA, USA, May 7–9, 2015: 1–41.

Download references


The experimental data were obtained under the European Commission Marie Curie Transfer of Knowledge Scheme (FP6) pursuant to Contract MTKI-CT-4022004-509777 and was performed within a framework of a research and technological development program with the title SUSTAINABLE FUELUBE.


Not applicable.

Author information

Authors and Affiliations



HY conducted the experimental work and coordinated the writing of the article. GÇ and OT guided the artificial intelligence and deep learning calculations and evaluated the obtained results. MŞ conducted literature review and performed artificial intelligence and deep learning calculations. All authors read and approved the final manuscript.

Authors’ Information

Halit Yaşar is an associate professor at Department of Mechanical Engineering, Engineering Faculty, Sakarya University, Turkey. He received his MsC and PhD degrees from Istanbul Technical University. His research interests include internal combustion engines, energy technologies, combustion and artificial intelligence.

Gültekin Çağıl is an assistant professor at Department of Industrial Engineering, Engineering Faculty, Sakarya University, Turkey. He received his MsC and PhD degrees from Istanbul University. His research interests include statistics and artificial intelligence.

Orhan Torkul is a professor at Department of Industrial Engineering, Engineering Faculty, Sakarya University, Turkey. He received his MsC and PhD degrees from Yıldız Technical University and Cranfield Institute of Technology, England. His research interests include manufacturing planning and control, management, information systems, distance education, artificial intelligence, digital transformation and industry 4.0.

Merve Şişci is a research assistant at Department of Industrial Engineering, Engineering Faculty, Sakarya University, Turkey. She received her MsC degree from Dumlupınar University. His research interests include Information Systems and Artificial Intelligence.

Corresponding author

Correspondence to Halit Yaşar.

Ethics declarations

Competing Interests

The authors declare that they have no competing interests.

Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Yaşar, H., Çağıl, G., Torkul, O. et al. Cylinder Pressure Prediction of An HCCI Engine Using Deep Learning. Chin. J. Mech. Eng. 34, 7 (2021).

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • DOI: