CHEMICAL ENGINEERING TRANSACTIONS  
 

VOL. 52, 2016 

A publication of 

 

The Italian Association 
of Chemical Engineering 
Online at www.aidic.it/cet 

Guest Editors: Petar Sabev Varbanov, Peng-Yen Liew, Jun-Yow Yong, Jiří Jaromír Klemeš, Hon Loong Lam 
Copyright © 2016, AIDIC Servizi S.r.l., 

ISBN 978-88-95608-42-6; ISSN 2283-9216 
 

Modelling and Optimisation of a Crude Oil Hydrotreating 

Process Using Neural Networks 

Wissam A.S. Muhsin*, Jie Zhang, Jonathan Lee 

School of Chemical Engineering and Advanced Materials, Newcastle University, Newcastle upon Tyne NE1 7RU, UK 

w.a.muhsin2@newcastle.ac.uk 

This paper presents a study on the data-driven modelling and optimisation of a crude oil hydrotreating process 

using bootstrap aggregated neural networks. Hydrotreating (HDT) is a chemical process that can be widely 

used in crude oil refineries to remove undesirable impurities like sulphur, nitrogen, oxygen, metal and aromatic 

compounds. In order to enhance the operation efficiency of HDT process for crude oil refining, process 

optimisation should be carried out. To overcome the difficulties in building detailed mechanistic models, 

Bootstrap aggregated neural network models are developed from process operation data. In this paper, a 

crude oil HDT process simulated using Aspen HYSYS is used as a case study. It is shown that bootstrap 

aggregated neural network gives more accurate and reliable predictions than single neural networks. The 

neural network model based optimisation results are validated on HYSYS simulation and are shown to be 

effective.  

1. Introduction 

The crude oil industry started with the drilling of the first oil well in 1859, then two years later the first refinery 

was opened in order to produce kerosene from crude oil, meaning the oil industry is about 157 years old. 

Since then, crude oil refining equipment has been developed by scientists and oil experts. Crude oil is a 

complex mixture of hydrocarbons (liquids and gases) which contain many different hydrocarbon compounds 

with varied appearances and compositions because each oil field has unique specifications of hydrocarbons 

(Hamadi, 2006). 

Modern refining operations are very complex. There are many operating units in refineries which include crude 

distillation units (CDU), catalytic reforming processes, hydrotreating units (HDT), isomerisation units (Isom), 

kerosene hydrotreating units (KHT), liquefied petroleum gases units (LPG), fluid catalytic cracking (FCC), 

vacuum distillation units (VDU), hydrocracking units (HCK), alkylation units, coker units and others (Gary and 

Handwerk, 1994). The typical products that are produced in a petroleum refinery are gasoline, kerosene, jet 

fuels, gasoil, diesel, etc. (Gary and Kaiser, 2007).The oil refinery’s aim is to convert crude oil into 

transportation fuels more economically. 

Most refineries continuously try to improve and upgrade existing operating units or use a new technology in 

order to meet the environmental regulations concerning the quality and specification of oil products. Changes 

in operation units are made in response to regulation changes which affect modern refineries (Babich and 

Moulijn, 2003). Hydrotreating (HDT) is a special process that can be utilised in petroleum refineries to reduce 

inorganic impurities like sulphur, nitrogen, and oxygen compounds. Using hydrogen in crude oil processes is 

one of the most important advances in refining technology in the twentieth century (Speight, 2014). HDT was 

used first in the 1950s in America, and later in Europe and beyond (Chaudhuri et al., 1995). HDT of crude oil 

is a new process with challenges that have not been extensively taken into account in the literature, as the 

conventional process of HDT is conducted for each oil product individually and not for the whole crude oil 

(Jarullah et al., 2011). Additionally, different process variables should be considered in the HDT process such 

as charge, pressure, temperature, liquid hourly space velocity (LHSV), and hydrogen to hydrocarbon (H2/HC) 

ratio. Furthermore, the hydrotreating of crude oil is conducted in a fixed bed reactor under severe operating 

conditions, for example high reaction temperature and pressure (Nawaf et al., 2015). 

                                

 
 

 

 
   

                                                  
DOI: 10.3303/CET1652036 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Please cite this article as: Muhsin W. A. S., Zhang J., Lee J., 2016, Modelling and optimisation of a crude oil hydrotreating process using 
neural networks, Chemical Engineering Transactions, 52, 211-216  DOI:10.3303/CET1652036   

211



Recently, computer and information technology have become increasingly significant in crude oil refineries 

and industrial processes with the improvement of simulation, modelling, optimisation, and control systems. In 

this work, a crude oil hydrotreating process was simulated utilising Aspen HYSYS (Version 8.8) to produce 

simulated HDT process operation data. Bootstrap aggregated neural networks (Zhang et al., 1997) were used 

to build up an accurate and robust data-driven model for the crude oil hydrotreating process. Process 

optimization plays a significant role in industrial decision making and is one of the main tools that can be used 

for obtaining the best plant design, maximising profitability of a plant and minimising its environmental impacts 

(Khalfalla, 2009). The target of process optimization is to reduce cost, increase process profits, and process 

efficiency (Binder et al., 2001). 

This paper focuses on modelling and optimisation of a crude oil hydrotreating process using neural network 

based data-driven models. It is organised in the following way: Section 2 gives the process simulation of crude 

oil hydrotreating using Aspen HYSYS. Section 3 presents data-driven modelling using bootstrap aggregated 

neural networks. Section 4 presents optimisation of the HDT process based on bootstrap aggregated neural 

network model. Finally, the last section includes the conclusions. 

2. Process simulation using Aspen HYSYS 

Aspen HYSYS is a process simulation environment for many processing industries. Good examples of these 

are oil and gas production, petroleum refining, air separation industries, and gas processing (Limsukhon, 

2002). For this reason, Aspen HYSYS is a significant tool in AspenTech, Aspen ONETM Process Engineering 

applications (Bilal et al., 2013). In this paper, a crude oil hydrotreating process was simulated using Aspen 

HYSYS version 8.8.  

Figure 1 illustrates a simple process flow diagram of crude oil hydrotreating. Initially, crude oil is pumped to the 

process and mixed with hydrogen gas, and then the mixture is sent to the heat exchanger to preheat the 

charge. After that, the warm feed is passed to the furnace to acquire the required reaction temperature, and 

then fed to the reactor where chemical reactions take place. Next, the reactor effluent is employed to preheat 

the feedstock and further cooled by the cooler. Following this, the product is sent to the high pressure 

separator (HPS) to remove free gases from the liquid product. The gases are compressed via a reciprocating 

compressor, and the liquid product is passed to the low pressure separator to remove gases which cannot be 

removed from the HPS. The hydrotreated crude oil is fed to the conventional process (a crude distillation unit) 

and the off gas is separated from the final product.  

 

Figure 1: Simple schematic diagram of the crude oil hydrotreating technology 

3. Modelling a crude oil hydrotreating process using aggregated neural networks 

3.1 Bootstrap aggregated neural networks 

Bootstrap aggregated neural network is utilised in this work to develop an accurate and robust model for crude 

oil hydrotreating process. A number of previous studies have shown the effects of bootstrap aggregated 

neural networks. For instance, two different models for forecasting airplane passengers were aggregated and 

found to have improved model prediction accuracy (Bates and Granger, 1969). Figure 2 shows a bootstrap 

aggregated neural network, where various neural network models are built to model the relationship between 

model inputs and outputs and are then aggregated (Zhou et al., 2012). The individual networks are learned 

through using different training data and from different initial weights. The output of the bootstrap neural 

network is a weighted combination of the individual neural outputs, illustrated in the equation below (Zhang et 

al., 1998): 

212



𝑓(𝑋) = ∑ 𝑤𝑖 𝑓𝑖  (𝑋)
𝑛

𝑖=1
  (1) 

where 𝑓(𝑋) is the bootstrap aggregated neural network predictor, 𝑓𝑖 (𝑋) is the ith network predictor,  𝑤𝑖  is the 

weight for aggregating the ith neural network, 𝑛 is the number of neural networks, and 𝑋 is a vector of network 

inputs. 

 

Figure 2: A bootstrap aggregated neural network (Ahmad and Zhang, 2003) 

3.2 Single neural network model 
A single neural network model was developed first for the purpose of comparison. The network inputs are 

crude oil flow rate, hydrogen molar flow rate, reactor temperature and pressure. The network outputs are 

sulphur and nitrogen removal. 150 data samples were produced from the HYSYS simulation of a crude oil 

hydrotreating process to build a neural network model. These data (150 samples) are divided into three 

groups: training data (78 samples), testing data (41 samples), and unseen validation data (31 samples). The 

neural networks were trained by employing the Levenberg-Marquardt training method with early stopping in 

order to avoid over-fitting in the neural network. The number of hidden neurons was determined by trying a 

range of hidden neurons and examining their sum of squared errors (SSE) on the testing data. Figure 3 shows 

the SSE values (scaled, dimensionless) of single neural networks for sulphur removal with different number of 

hidden neurons on the training, testing, and validation data. It can be seen that using 30 hidden neurons gives 

the least SSE on the testing data. Thus 30 hidden neurons were used. Figure 4 shows the model prediction 

performance (scaled, dimensionless) on the training, testing, and unseen validation data. The main finding 

from this figure is that there are some quite large errors on the unseen validation data though model errors on 

training and testing data appear to be small. This reveals that a single neural network model is not reliable, 

and therefore a bootstrap aggregated neural network should be considered. 

 

 

Figure 3: SSE of single neural networks with different number of hidden neurons 

 

 

(a) (b) 

Figure 4: Neural network model performance on training and testing data (a) and unseen validation data (b). 

0

2

4

6

4 8 12 16 20 24 28

S
S

E

Number of Hidden Neurons

Training data

Testing data

Validation data

0 10 20 30 40 50 60 70 80
-2

-1

0

1

2
Training data: -:y;  ..:yp

0 5 10 15 20 25 30 35 40 45
-4

-2

0

2
Testing data: -:y;  ..:yp

Samples

 

 

y yp

0 5 10 15 20 25 30 35
-3

-2

-1

0

1

Samples

Output & Prediction Data -yv, ---yvp1

 

 

yv yvp1

213



3.3 Bootstrap aggregated neural network model 
The bootstrap aggregated neural network contains 30 single neural networks. The training data for every 

neural network was acquired via bootstrap re-sampling with replacement of the original training data. Figure 

4(a) demonstrates the mean squared error (MSE) of the single neural networks for the estimation of sulphur 

removal on the training, testing and validation data. It can be seen from Figure 4(a) that the single neural 

network models produce different performances. The 4th, 16th and 27th networks give the same performance 

(MSE = 0.0418) on the training and testing data. However, their performance is extremely different on the 

unseen validation data. It can be deduced that the individual neural network models are not reliable. 

  
(a) (b) 

Figure 4: MSE of sulphur removal: (a) Individual neural networks, (b) Bootstrap aggregated neural networks 

Figure 4(b) shows the performance of bootstrap aggregated neural network models with different number of 

networks to be aggregated. From Figure 4(b), it can be seen that the MSE declined gradually with the number 

of networks and then levelled off. The MSE values of aggregated neural network models on the training, 

testing and unseen validation data are quite consistent. Comparing the results in Figure 4, it can be concluded 

that the bootstrap aggregated neural network models are more accurate and reliable than the individual neural 

network models. Figure 5 shows the 95 % model prediction confidence intervals for the bootstrap aggregated 

neural network models of sulphur removal on the unseen validation data. When the confidence intervals are 

tight, the reliability of the corresponding predictions will be high. 

 

 

Figure 5 Prediction of sulphur removal from bootstrap aggregated neural network with confidence intervals 

4. Optimisation of HDT process using bootstrap aggregated neural network model 

Optimisation of the crude oil hydrotreating unit is carried out using the developed bootstrap aggregated neural 

network model. The aim of the process optimisation is to maximise sulphur removal in the liquid at the end of 

reactor effluent subject to process constraints which can be presented as follows: 

 

214



 330 °C ≤ reactor inlet temperature ≤ 380 °C 

 70 bar ≤ reactor pressure ≤ 110 bar 

 40 m3/h ≤ feed flow rate ≤ 90 m3/h 

 300 kmol/h ≤ H2 molar flow ≤ 1,000 kmol/h 

 

The optimisation problem solved in this paper is described as follows: 

min J = - α1S - α2F + α3P (2) 

where J is the objective function, S is the bootstrap aggregated neural networks output (i.e. the estimated 

sulphur removal at the end of reactor effluent), F is the feed flow rate, P is the reactor pressure, α1, α2, and α3 

are weighting factors which are selected based on the relative importance of the corresponding terms and 

their magnitudes. Large weighting factor was given to the first term in order to maximise the sulphur recovery. 

The second term intends to increase the feedstock to maintain high productions. Furthermore, the lowest 

weighting factor was applied for the third term which aims to decrease the reactor pressure due to the fact that 

high pressure is not appropriate, as hydrogen partial pressure will not rise because of the physical limitations 

of high pressure (Jimenez et al., 2005). The sequential quadratic programing (SQP) method implemented via 

the function “fmincon” in the MATLAB Optimisation Toolbox was used. Table 1 shows the optimisation results 

using bootstrap aggregated neural networks and HYSYS validation under various weighting parameters. It can 

be seen from Table 1 that when relatively large weighting is applied to the feed flow rate (runs 1 and 3), the 

product throughput is high with the sacrifice of sulphur removal. When small weighting is applied to the feed 

flow rate (run 5), the sulphur removal is the highest but the production throughput is reduced significantly. 

Thus, there is trade-off between sulphur removal and production rate. The weightings selected will be 

determined by the particular plant operation objectives.  

Table 1 Process performance at optimum operating conditions using neural networks and HYSYS validation 

R
u
n

 

Crude 

Oil 

(m3/h) 

H2Flow 

(kgmole

/ h) 

P 

(bar) 

T 

( oC) 

a1 

 

a2 

 
a3 S Re 

wt.% 

J 

 

S Re 

wt.% 

(HYS) 

J 

(HYS) 

1 79.41 1,000 110 380 1 0.1 0.01 83.64 -90.48 84.68 -91.52 

2 68.69 1,000 110 380 1 0.01 0.001 87.71 -88.29 89.79 -90.37 

3 73.68 1,000 97.0 380 1 0.09 0.06 82.30 -83.11 83.02 -83.83 

4 62.86 883.9 76.61 380 1 0.09 0.07 78.90 -79.19 77.48 -77.77 

5 40.00 1,000 110 380 1 0.005 0.0005 95.89 -96.03 99.21 -99.35 

6 41.31 1,000 110 380 1 0.006 0.0006 95.61 -95.79 99.01 -99.19 

7 48.89 1,000 110 380 1 0.007 0.0007 93.83 -94.09 97.38 -97.64 

8 55.89 1,000 110 380 1 0.008 0.0008 91.94 -92.30 95.14 -95.50 

9 59.25 1,000 110 380 1 0.0085 0.00085 90.94 -91.35 93.87 -94.28 

10 62.53 1,000 110 380 1 0.009 0.0009 89.91 -90.37 92.52 -92.98 

5. Conclusions 

Modelling and optimisation of a HDT process for crude oil using bootstrap aggregated neural networks is 

presented in this study. HYSYS simulated process operation data are considered as representing the real 

plant data and are used in building neural network models. Bootstrap aggregated neural network models are 

developed to predict sulphur removal and are shown to give more accurate and reliable predictions than single 

neural network models. Another advantage to using bootstrap aggregated neural networks is that the model 

prediction confidence intervals can also be obtained. The developed model is then used in used to find the 

optimal operating conditions of HDT process. The obtained optimisation results are validated on HYSYS 

simulation and are demonstrated to be efficient.  

References 

Ahmad Z., Zhang J., 2003, Improving data based nonlinear process modelling through Bayesian combination 

of multiple neural networks, Proceedings of the International Joint Conference on Neural Networks 2003, 

1-4, 2472-2477. 

Babich I.V., Moulijn J.A., 2003, Science and technology of novel processes for deep desulfurization of oil 

refinery streams: a review, Fuel, 82(6), 607-631. 

215



Bates J.M., Granger C.W.J., 1969, COMBINATION OF FORECASTS, Operational Research Quarterly, 20(4), 

451-468. 

Bilal S., Mujahid A.U., Kasim S., Nuhu M., Mohammed A., Abubakar H.M., Yahaya U.B., Habib A., Abubakar 

B., Aminu Y.Z., 2013, Simulation of Hydrodesulphurization (HDS) Unit of Kaduna Refining and 

Petrochemical Company Limited, Chemical and Process Engineering Research, 13, 29-35. 

Binder T., Blank L., Bock H.G., Bulirsch R., Dahmen W., Diehl M., Kronseder T., Marquardt W., Schlöder J., 

von Stryk O., 2001, Introduction to Model Based Optimization of Chemical Processes on Moving Horizons, 

in Grötschel M., Krumke S., Rambau J. (eds.) Online Optimization of Large Scale Systems. Springer Berlin 

Heidelberg, 295-339. 

Chaudhuri U.R., Chaudhuri U.R., Datta S., Sanyal S.K., 1995, MILD HYDROCRACKING - A STATE-OF-THE-

ART, Fuel Science & Technology International, 13(9), 1199-1213. 

Gary J.H., Handwerk G.E., 1994 Petroleum refining : technology and economics. 3rd edn. New York: M. 

Dekker. 

Gary J.H., Kaiser M.J., 2007, Petroleum refining : technology and economics. 5th edn. Boca Raton: Taylor & 

Francis. 

Hamadi A.S., 2006, Petroleum Refining, 5-9 Agust 2006, Dohuk, Iraq. 

Jarullah A.T., Mujtaba I.M., Wood A.S., 2011, Kinetic parameter estimation and simulation of trickle-bed 

reactor for hydrodesulfurization of crude oil, Chemical Engineering Science, 66(5), 859-871. 

Jimenez F., Nunez M., Kafarov V., 2005, Study and modeling of simultaneous hydrodesulfurization, 

hydrodenitrogenation and hydrodearomatization on vacuum gas oil hydrotreatment, in Puigjaner L., 

Espuna A. (eds.) European Symposium on Computer-Aided Process Engineering-15, 20A and 20B. 619-

624. 

Khalfalla H.A., 2009, Modelling and optimisation of oxidative desulphurization process for model sulphur 

compounds and heavy gas oil. Determination of rate of reaction and partition coefficient via pilot plant 

experiment; modelling of oxidation and solvent extraction processes; heat integration of oxidation process; 

economic evaluation of the total process. Ph.D. thesis. University of Bradford (United Kingdom). 

Limsukhon M., 2002, Applications of Pinch Technology (Heat exchanger networks and process heat 

integration). Chulalongkorn University. 

Nawaf A.T., Gheni S.A., Jarullah A.T., Mujtaba I.M., 2015, Optimal Design of a Trickle Bed Reactor for Light 

Fuel Oxidative Desulfurization Based on Experiments and Modeling, Energy & Fuels, 29(5), 3366-3376. 

Speight J.G., 2014, The chemistry and technology of petroleum. Fifth edition. edn. 

Zhang J., Martin E.B., Morris A.J., Kiparissides C., 1997, Prediction of polymer quality in batch polymerisation 

reactors using neural networks, Proceedings of the 1997 American Control Conference, 1-6, 1370-1374. 

Zhang J., Morris A.J., Martin E.B., Kiparissides C., 1998, Prediction of polymer quality in batch polymerisation 

reactors using robust neural networks, Chemical Engineering Journal, 69(2), 135-143. 

Zhou C., Liu Q., Huang D., Zhang J., 2012, Inferential estimation of kerosene dry point in refineries with 

varying crudes, Journal of Process Control, 22(6), 1122-1126. 

 

 

216