Hybrid Computing Models to Predict Oil Formation Volume Factor Using Multilayer Perceptron Algorithm

Achieving important and effective reservoir parameters requires a lot of time and cost, and also achieving these devices is sometimes not possible. In this research, a dataset including 565 datapoints collected from published articles have been used. The input data for forecasting oil formation volume factor (OFVF) were solution gas oil ratio (Rs), gas specific gravity (γg), API gravity (API0) (or oil density γo), and temperature (T). Two hybrid methods multilayer perceptron (MLP) with artificial bee colony (ABC) and firefly (FF) algorithms to predict this parameter have been introduced in that study and their results have been compered after extraction. After essential investigations in this study, the results show that MLP-ABC gives the best accuracy for predicting OFVF. For MLP-ABC model OFVF prediction accuracy in terms of RMSE < 0.002573 bbl/STB and R2 = 0.998 for this test dataset. After comparing the results of the experimental equations, it was concluded that the Dokla and Osman model gives the best results and Based on Spearman’s correlation coefficient relationships all input parameters have a positive effect on OFVF prediction, which are as follows: R s > T> API> γ g and these results show that the effect of Rs is more than other input variables and the effect of γ g is the lowest.


Introduction
Accurate and valuable evaluation of PVT properties (pressure, volume and temperature) is one of the main and most obvious concerns of reservoir engineers for reservoir management and evaluation purposes. These properties include determining and obtaining properties of reservoir fluids' physical characteristics such as bubble point pressure (BPP), solution gas oil ratio an (GORs) and oil formation volume factor (OFVF), which are key development [1][2][3][4][5].
Since estimating the number of hydrocarbons in the reservoir and design is important, one of the most important tasks is to estimate the key parameters of the reservoir that can be used to achieve this importance [42,44]. For example, liquids undergo fundamental changes in temperature and pressure not only through their production path, but also during normal pressure discharge process. One of the different methods of pressure maintenance and enhance oil recovery (EOR) is injecting gas to increase the pressure of certain chemicals inside reservoir [61]. The optimal design and success of such processes require an accurate understanding of the liquid phase behaviour of the reservoir.
One of the important parameters is determining the concentration of CO2. This parameter is very important in terms of human life. In order to control this parameter, the method of CO2 storage in the subsurface as hydrate is implemented. In 2019 Hassanpouryouzband et al. predicted the solubility of CO2 and N2 in water and brine via three different state equations including, CPA-SRK72, VPT and PC-SAFT. They coupled these equations with binary Interaction Parameters (BIP). Then, they compared results with available experimental data. Acceptable proximity of predictions to experimental results confirms the reliability of the thermodynamic model [62]. A year later in 2020, Hassanpouryouzband et al.

P a g e | 18
conducted a research on H2 as a substitute for fossil fuels to reduce CO2 emissions, as well as the proper and accurate design of thermodynamic. In order to predict the thermo-physical properties of H2 mixed with CH4, N2, CO2 and a typical natural gas from the North Sea of the GERG-2008, Equation of State (EoS) and SupertRaPP models are used. In addition, a userfriendly software (H2Themobank) was made available to the public.
Due to the high importance of developing and completing oil and gas fields, one of the tasks that has been done in recent years is to use field data to calculate and predict, as well as to determine the parameters used in the oil and gas industry, for example in the following areas have been addressed: reservoirs [6]; formation damage [7], petroleum well blowouts [48], wellbore stability [8], rheology and filtration [9][10], production [11][12][13]; drilling fluid [14].
Determination of tank properties is conducted through laboratory outputs, which are very costly and time consuming. Also, these tests are not always available and there are not enough samples to determine these properties. Therefore, in order to facilitate the process of determining the characteristics of the reservoir and obtain these characteristics, researchers turned to experimental models. Using previous studies, we conclude that OFVF is a function of: solution gas oil ratio (Rs), gas specific gravity (γg), API gravity (API 0 ) (or oil density γo), and temperature (T) based on the following Eq. (1).
Previous researchers based on studies and the relationship between the parameters, presented equations in Table 1 that are shown as follows: In 1947, Standing (1947) proposed an equation for predicting OFVF using 105 data from California oil fields [15]. In 1977, Vazquez and Beggs (1977) proposed an equation for predicting OFVF using 5008 data collected from Worldwide, but in this equation, have a boundary (API=30) and this equation divided two section [16]. In 1980, Glaso (1980) proposed an equation for predicting OFVF using 41 data collected from the North Sea [17]. In 1988, Al-Marhoun (1988) proposed an equation for predicting OFVF using 160 data collected from the Middle East [18]. In 1992, Dokla and Osman (1992) presented an equation for predicting OFVF using 51 data collected from the UAE [19]. In 1993, Petrosky and Farshad (1993) proposed an equation for predicting OFVF using 90 data collected from the Gulf of Mexico [20]. The empirical relationships of BPP and OFVF, along with data and equations for prior researchers are respectively listed in Table 1. In the experimental correlations, the performance accuracy was very low and unacceptable. Therefore, researchers have started using artificial intelligence in recent years [20][21][22][23] for example; Analysis of crude-oil desalting system [51], velocity prediction in sewer pipes [64]; bed load sediment transport estimation in a clean pipe [65]; monthly inflow prediction [66]; predicting sediment transport in clean pipes [67] and estimate velocity at limit of deposition in storm sewers [68]. In this regard, many researchers using artificial intelligence were able to predict the value of OFVF, some of which we report: A large number of researchers including Gharbi and Elsharkawy (1997) [24], Gharbi [38] were used GA algorithm.
Many researchers using ANN, ANFIS, RBF, SVM, SVR, GA, GSA and LSSVM algorithms to predict OFVF have been able to provide models that work better than the experimental correlations. In this paper, we intend to combine MLP-ABC and MLP-FF methods to construct a vigorous model for determining OFVF as a function of input data. Furthermore, the introduction of these recombination algorithms in the field of data forecasting is important for being implemented in crude oil data worldwide.
Methodology Work Flow Figure 1 shows a workflow diagram that shows all steps in a quick scan to construct a model to determine OFVF. These steps are as follows: data collection, describing of the variables, and data normalization. Through data normalization process all data variables were normalized to range between +1 and -1 by applying Eq. (2). Where; = the value of attribute l for data records I; = the minimum value of the attribute l among all the data records in the dataset; and, = the maximum value of the attribute l among all the data records in the dataset. Then we verify the data after normalization and then divide it into two parts: training and testing. At this time, we used 70% of the data for train and 30% of the data for test. Finally, the set of calculated outputs of each method is compared with experimental models using computational error and then the best result is obtained.

Machine Learning Algorithm
Today, artificial intelligence is rooted in various industries and sciences. It has found a wide variety of applications in various fields. The oil and gas industry, which has long been the focus of the whole world, and the reason is that the extracted oil and gas has changed the world. Many people did a lot of work to optimize and find important and key parameters in the oil and gas industry, for example in the following areas have been addressed: prediction flow rate of orifice & choke flow [22-23; 39-40, 44]; prediction of casing collapse based on shear modulus & geomechanical approach [41,43]; prediction of bubble point pressure [42].

Multilayer Perceptron (MLP) Algorithm
One of the best up-to-date tools in the world is to create complex nonlinear relationships between sets and create a black box, artificial neural network [45; 49-50]. This ANN algorithm covers a wide range of methods used in various industries. Important factors in choosing ANN type are selecting attributes (i.e., input variables to be considered), network architecture (number of layers and nodes), transferring functions between layers, and selecting training algorithm to optimize their prediction performance [46]. One of the most widely used neural networks is the multilayer perceptron (MLP), which is a versatile and flexible neural network that is suitable for all data sets (large and small) [47]. This network was used to predict OFVF. One of the methods that teaches MLP and causes data aggregation is the Levenberg-Marquardt (LM) algorithm. Using the Levenberg-Marquardt (LM) algorithm, which is implemented in MLP, in conjunction with two optimization algorithms named artificial bee colony (ABC) and Firefly algorithm (FF), two recombinant algorithms can be created. Figure 2 shows the structure of MLP.

Firefly (FF) Algorithm
Fireflies are a species of beetles that emit of themselves a green or yellow light. The fireflies have a great tendency to move toward, which makes them brighter than they were. The factors affecting receiving light from a source are the distance between the fireflies, the ability of ambient in light absorption, the type of light source, and the amount of emitting light from the emitting source.
Firefly algorithm (FF) is an optimization method striving to find the optimal solution for the problem by simulating the fireflies' behavior. The flow diagram for FF algorithm is displayed in Figure 3. The procedure of optimization method is described in the following [51][52]. The first stage is setting the value for initial parameters in order to the FF algorithm to start. Required parameters for this algorithm are: number of fireflies (n), the number of repetitions (t), random vector coefficient (α), light absorption coefficient (γ), upper line (max) and lower line (min).
After this stage, a population of n numbers of fireflies is created with random values. The brightness of a firefly is considered as its fitness amount [68]. The brightness amount is determined based on the problem type that is going to be optimized and the selected fitness function for that problem. The charm between each two fireflies can be determined using Eq. (3). This equation displays that how charm is the j firefly for the I firefly [68].
Where γ is the amount of ambient light absorption, the variable is the light source that can received one of the three values 0, 1, and 2, and is the Euclidean distance that can be determined using Eq. (4).
After computation of the distance between fireflies and determination of charm between fireflies' pairs, if a firefly sees that the other firefly in their pair is brighter than itself, then it will move towards that brighter firefly [68]. The movement of dimmer firefly toward the brighter firefly is calculated using Eq. (5).
Where the variable α is the random vector coefficient and takes a constant value, ε takes a small value, and x represents the new position of the firefly i.
All the fireflies in the population move towards the best firefly, while the best firefly moves randomly. The random movement of the best firefly can be obtained using Eq. (6).

Artificial Bee Colony (ABC) Algorithm
Artificial bee colony algorithm (ABC) is a simulation of the bee groups' behavior in searching for food. Bees are divided into three categories: i) worker bees which go toward the pre-determined food sources ii) pioneer bees which perform a random search for a food source iii) search bees which stay in the dance area to make a decision on the selection of a source food [53][54][55]. Figure 4 displays the flowchart of ABC algorithm.
Working with this algorithm, we initially specify the number of initial populations of the worker and pioneer bees as well as the main parameters including cost function, trial index, and problem range and allowable limit for the index trial. At this stage, the pioneer bees start searching randomly and achieve the proper sources. The pioneer bees should not go beyond the specified range. The specified range can be obtained using Eq. (7), as follows: Where in Eq. (7), is the ith response in jth dimension, r represents a random number from o to 1, and and are the lower the upper limits, respectively.
In this part, more bees are allocated to the sources with higher suability and eliminate few percent of the sources with lower suitability.
After, the cost function is calculated, and then, based on calculated cost function, the sources' performance is calculated (Eq. (8)).
Then, the employed bees move toward the sources found by the pioneer bees. The more efficient the sources, the more bees are allocated to them. The movement of bees is obtained by Eq. (9).
Where, represents the position of bee, represents the random selection of an employed bee, is the t bee, is the response dimension, and is a random number selected between 1 and -1.
The sending of employed bees is performed using following methods: 1. Sending more specified bees to better sources and sending specified number of bees to normal sources. 2. Sending bees according to Roulette cycle (on the basis of the performance probability of each source) using Eq. (10).
Where, is the probability of the source's selection and ( ) is the suitability value of the source.
Abandoned sources are defined as the sources wasting the computational power, which makes efforts to convince them not to work. To determine the abandoned source, the trial index must be checked for each source. If the trial index is greater or equal to admissible limit and that source is not the best problem's solution, the source is considered as an abandoned source. Indeed, to implement that, a counter need to be set, the value of which increases with each visit to that source, and if the number of visits to that source becomes greater than the specified limit and there is no improvement, then the source will be announce as an abandoned source, and it will no longer considered as a suitable source.
For search a new source instead of abandoned source should be: The sources having been abandoned must be replaced by new sources In fact, the pioneer bees, using Eq. (11), find another initial response once again.
If the number of iterations meets a certain level or reaches a certain value of cost function, the algorithm ends.

FF-MLP Hybrid Algorithm
The neural network has always been widely used as a problem-solving tool. In this study, we used a combination of MLP with optimization methods to better compare the results [56]. We did this combination with the same two methods FF and ABC that were used in sections before to make a logical comparison of the results. Figure 5 shows the flowchart of the FF-MLP method. P a g e | 22 In this method, we must first normalize the data. In this section, we used exactly the same two sets of training and testing datapoints. In this combined method, in principle, the network training operation is performed by FF, and in fact, the weights and bias of the perceptron's in each layer are obtained by the FF optimization method. As shown in the flowchart, the MLP network has been used as a cost function for the FF algorithm. What is the error of new weights and biases?
After the optimal weights are obtained, we create the network with those weights and this time we give the test data to it to find out how the network has been trained and what is the amount of error.
The interaction between the network and the FF algorithm is such that we consider all the weights of the layers as well as the bias as a presenter or vector, and the FF algorithm creates its population according to the length of this presentation. In fact, each member of the population is a presentation of the length of all weights and bias. The weights of each layer are in the form of a matrix. For example, if the first layer it has 4 inputs and 8 perceptron's, so a 4x8 matrix represents the weights of the first layer and an 8x1 vector represents the first layer bias. The next layers are the same. Table 2 presents the parameters related to the implementation of this method.

ABC-MLP hybrid algorithm
This method is the same as the previous method, only ABC is used instead of FF. Use of this optimization method is only for comparison of the methods. Figure  6 shows the flowchart method. Table 3 presents the parameters related to the implementation of this method.

Data Collection & Data Analysis
The data used in this study to determine an optimal model for OFVF from Moghadam et al. (2011b) [57], Omar and Todd (1993) [58], Dokla and Osman (1992) [19], Al-Marhoun (1998) [18], Ghorbani et al. (2020a) [42], Gharbi & Elsharkawy (1997) [24], Mahmood and Al-Marhoun (1996) [59] and Ganji et al. (2014) [60] which is a mixture of data samples from different parts of the World. Table 3 summarizes the statistical distributions of these four data variables for the 565 data records compiled. The parameters that affect the determination of OFVF are: T, Rs, γg and API, which are interpreted in detail for data related to samples collected from worldwide. In order to describe the input data, the contour plot diagram (Figure 3) is used. The description of this diagram is as follows: In the Figure 7 for the T parameter, about 70% of the data are related to T < 200 F0 and the remaining 30% are related to T > 200 F0. For T <100 F0 (OFVF < 1.3 bbl/STB), the T data contains about 17% of the data and> 300 F0 (2 < OFVF < 2.7 bbl/STB) about 5% of the data. For the Rs parameter, approximately 45% of the data are related to Rs <400 Scf / STB and the remaining 14% are related to Rs > 1200Scf / STB.
For the γg parameter, approximately 70% of the data is related to γg <1.5 and 26% of the data is related to γg> 1.5. of these, 35% of the data are related to 0.5 < γg <1. For the API parameter, approximately 80% of the data is related to 30 <API <40 and of these, 17% of the data is related to 20 <API <30 (OFVF < 1.2 bbl/STB). Histogram plots (Figure 8) confirm the positively skewed character of the Swir and K distributions.
Standard Deviation (SD): Mean Square Error (MSE): Where; n = number of data records; = measured dependent variable value for the ith data record; and, = predicted dependent variable value for the ith data record.
Coefficient of Determination (R2): Table 5 and Figure 9 reveal that all two-hybrid machine-learning-optimizer models evaluated, MLP-FF, MLP-ABC and plus empirical equation, deliver accurate and credible OFVF prediction for test data.
The MLP-ABC model is the least accurate, whereas the models by providing OFVF prediction accuracy in terms of RMSE < 0.002573 bbl/STB and R2 = 0.998 for this test dataset.   Using Pearson's correlation coefficient, which is in the range -1 (perfect negative correlation) or +1 (perfect positive correlation) with a zero-value indicating a total lack of correlation, the sensitivity of each parameter to the OFVF showed. Spearman's correlation coefficient (ρ) is calculated for ranked data using Eq. (20). Where; Vi = the value of data record i for input variable V; = the average value of the input variable V; Zi = the value of data record i for input variable Z; = the average of the input variable Z; and, n = the number of data points in the population.  As shown in the figure, based on 565 available data from around the world and input variables from this data, all input parameters have a positive effect on OFVF prediction, which are as follows: Rs> T> API> γg and these results show that the effect of Rs is more than other input variables and the effect of γg is the lowest.

Conclusion
In this research, 565 data collected from worldwide have been used. The input data for forecasting OFVF, solution gas oil ratio (Rs), gas specific gravity (γg), API gravity (API0) (or oil density γo), and temperature (T). These input variables are very important for predicting OFVF because these variables are routinely taken in the oil industry and through this data can be an important parameter that is important for the development of oil and gas reservoirs. Calculated without spending time and money. P a g e | 26 In this paper, the combination of MLP method, which is a network of artificial intelligence, with ABC and FF optimization methods has been used, which are the new combination methods for predicting OFVF.
For MLP-ABC model OFVF prediction accuracy in terms of RMSE < 0.002573 bbl/STB and R2 = 0.998 for this test dataset. After comparing the results of the experimental equations, it was concluded that the Dokla and Osman model gives the best results.
Based on Spearman's correlation coefficient relationships all input parameters have a positive effect on OFVF prediction, which are as follows: Rs> T> API> γg and these results show that the effect of Rs is more than other input variables and the effect of γg is the lowest.