Frequency Domain Feature Extraction Investigation to Increase the Accuracy of an Intelligent Nondestructive System for Volume Fraction and Regime Determination of Gas-Water-Oil Three-Phase Flows

: In this research, a methodology consisting of an X-ray tube, one Pyrex-glass pipe, and two NaI detectors was investigated to determine the type of flow regimes and volume fractions of gas-oil-water three-phase flows. Three prevalent flow patterns—namely annular, stratified, and homogenous—in various volume percentages—10% to 80% with the step of 10%—were simulated by MCNP-X code. After simulating all the states and collecting the signals, the Fast Fourier Transform (FFT) was used to convert the data to the frequency domain. The first and second dominant frequency amplitudes were extracted to be used as the inputs of neural networks. Three Radial Basis Function Neural Networks (RBFNN) were trained for determining the type of flow regimes and predicting gas and water volume fractions. The correct detection of all flow regimes and the determination of volume percentages with a Mean Relative Error (MRE) of less than 2.02% shows that the use of frequency characteristics in determining these important parameters can be very effective. Although X-ray radiation-based two-phase flowmeters have a lot of advantages over the radioisotope-based ones, they suffer from lower measurement accuracy. One reason might be that the X-ray multi-energy spectrum recorded in the detector has been analyzed in a simple way. It is worth mentioning that the X-ray sources generate multi-energy photons despite radioisotopes that generate single energy photons, therefore data analyzing of radioisotope sources would be easier than X-ray ones. As mentioned, one of the problems researchers have encountered is the lower measurement accuracy of the X-ray, radiation-based three-phase flowmeters. The aim of the present work is to resolve this problem by improving the precision of the X-ray, radia-tion-based three-phase flowmeter using artificial neural network (ANN) and feature extraction techniques. of


Introduction
One of the most vital challenges in the oil, gas, and petrochemical industry is determining the volume percentages and diagnosing the type of flow regimes passing through the oil transmission lines. Hence, a lot of research has been done in this regard. There are many non-invasive methods to determine these parameters, such as photon attenuation methods, capacitive tomography, resistance tomography, X-rays, and so on. In recent years, much research has been done to detect these parameters using photon attenuation techniques [1][2][3][4][5][6][7][8][9][10][11][12][13][14]. The researchers in reference [1] studied three types of flow regimes with the names of stratified, homogeneous, and annular in different volume percentages using MCNP code. In this study, two radioisotope sources and three NaI detectors were used to determine the volume percentages and the type of flow regimes. An artificial neural network was designed to detect the type of flow regimes. Three separate networks were designed to determine the volume percentages of oil-water-gas three-phase flow. In another study, researchers proposed a new structure for measuring volume percentages in a stratified regime. This structure used an NaI detector next to a cesium-137 source to record the backscattered gamma radiation's energy spectrum. They also used the MLP neural network to determine volume percentages with an error of less than 6.47% [2].
In recent years, researchers have paid special attention to feature extraction from signals received from detectors. For example, Sattari et al. have researched the time domain characteristics to introduce the most appropriate ones [3]. In this study, a measurement system consisting of a cesium-137 source and two NaI detectors and a Pyrex-glass was implemented to determine the volume percentages and the type of flow regimes. After collecting the data, some features in the time domain were extracted to better interpret the data, and finally they were able to correctly identify the type of flow regimes using the MLP neural network and predict the volume percentages with high accuracy. In another study [4], researchers used time domain characteristics and the GMDH neural network to determine the volume percentages and type of flow regimes using only one detector. Roshani et al. used the dual energy method to study three-phase flows. Their detection system consisted of two 241 Am and 137 Cs sources, and two NaI detectors. They used the characteristics of recorded counts of 241 Am and 137 Cs in two detectors to train the neural network, and they were finally able to predict volume percentages with an MRE% of less than 5.68% [5]. Hanus et al. Presented several time [6] and frequency [7] domain characteristics to determine the type of flow regimes in two-phase flows, and finally identified the most effective characteristics for determining this parameter. In their next research, they tried to determine the type of flow regimes by using these characteristics and using various neural networks [8]. Hosseini et al. Used the FFT to convert recorded signals to the frequency domain and then time domain characteristics were extracted from the frequency domain signals. Using these characteristics, they were able to accurately detect all flow regimes and predict the volume percentages in two-phase flows with high accuracy [9].
Advantages such as the ability to adjust the emitted photons energy of the X-ray tube, high-intensity photons emission, the ability to turn it on and off-this advantage is very important for the health of people working with these devices-, and the ability to transport it easily and steadily. Its energy retention over time has led current researchers to use X-ray tubes instead of radioisotopes [15][16][17][18]. In [15], an X-ray densitometry system was introduced. In this study, an X-ray tube (50 kV, 1 mA) and some linear detectors were applied for two-phase flow metering. In the research [16], an X-ray tube and one NaI detector were used. The annular and stratified flow patterns were simulated. Obtained accuracy of the proposed methodology showed the ability to use X-ray tubes and ANN to determine the characteristics of multiphase flows. In [17], a structure consisting of an X-ray tube and two detectors was implemented to determine the volume percentages and type of flow regimes in three-phase flows. In this study, characteristics of recorded photon energy spectra from the two detectors and the GMDH neural network were used to determine the mentioned parameters. All flow regimes were correctly detected except one case, and volume percentages with RMSE less than 3.1 were predicted. In Reference [18], a methodology was proposed for determining the volume percentages in three-phase flows by simulating two flow regimes of stratified and annular at different volume percentages. The proposed structure consists of an X-ray tube and a NaI detector. One hundred characteristics were extracted from the received data from the detector and were considered as the input of the GMDH neural network. Since the GMDH neural network has the ability to determine effective inputs to predict the target, this network was applied as a tool for feature selection. Finally, volume percentages were predicted with an MRE% of less than 6.69%.
The purpose of this study is to use X-ray tubes, feature extraction techniques in the frequency domain, and the RBF neural network to increase the accuracy in determining critical parameters such as volume fractions and the type of flow regimes in oil-gaswater three-phase flows.

Radiation-Based System
In this research, a detection system consisting of an X-ray tube, a Pyrex-glass pipe, and two NaI detectors with dimensions of 2.54 mm × 2.54 mm was simulated using the MCNP-X code. In this system, detectors were placed at a distance of 20 cm from the source, one of them was directly related to the source, and the other was at an angle of 15° to the source. A Pyrex-glass has been used to simulate flow regimes at different volume percentages. The structure of the designed system is shown in Figure 1. The three common flow regimes, shown in Figure 2, were simulated in volume percentages from 10% to 80% with a step of 10%. Thirty-six various volume fractions were simulated for each flow pattern, which includes a total of 108 simulations.  In this study, a typical industrial X-ray tube was used. The electron source and a tungsten/rubidium target were mounted in X-ray tubes as the cathode and anode, respectively. Complete X-ray tube simulation through MCNPX code, wherein a released electron from the cathode reacts to the anode and produces X-ray radiation, is time-demanding. Because the computation of photon tracking in MCNPX code is less than the electron, in this scrutiny, a source of photon inserted in an X-ray tube's shield was regarded for a cathode-anode assembly. TASMIC, a free package presented by Hernandez et al. [19], was applied. It is mentioned that various investigations have been conducted on X-ray spectra production via both theoretical and MCNP methods. Utilizing MCNPX code, Hernandez et al. produced an X-ray spectrum for diverse voltages of the tube. To define source energy, the achieved X-ray spectrum using the TASMIC package for 150 kV as tube voltage was embedded into the input of MCNPX file by SI and SP choices in the SDEF card. The aforementioned source of the photon was inserted in a cylinder serving as an X-ray tube shield. On the shield surface, a section (the entitled output window) was left open for the releasing of the congenial produced X-ray photons. For filtration of low energy photons in this scrutiny, an aluminum filter with a thickness of 2.5 mm was placed against the output window of the X-ray tube.

Frequency Domain Feature Extraction
Feature extraction is performed from the measured raw data and provides a derivative amount of data that aims to reduce the size, eliminate useless data, facilitate the training process, and generalize the data. It also improves the interpretation of the data. When the available data is too large for processing, feature extraction methods are utilized to decrease the dimensions while preserving the properties of the data. When the amount of data available is large, not only is data analysis very difficult, but the designed detection system may be incompatible with the data set, and the detection system may be generalized to a limited set of data. There are various methods for feature extraction, such as feature extraction in the time, frequency, and time-frequency domain, and some innovative techniques that can be used (in proportion to raw data) to reduce the dimensions of the data. In this research, feature extraction in the frequency domain has been used, such that the FTT (Equation (1) [20]) was used to convert the received signals into the frequency domain. Then, the first and second dominant frequencies of the signals were extracted. As mentioned, two detectors have been used in this study and two characteristics have been extracted from each detector. Therefore, four characteristics were implemented for training the neural networks.
where Y(k) = FFT(X) and = ∕ is one of n roots of unity. Figure 3 shows the received and converted signals into the frequency domain for all three mentioned flow regimes.

RBF Neural Network
In the last few years, various computational techniques have been utilized for various applications in the engineering research area . RBF Neural Network is one of the most widely used neural networks that applies radial basis functions as an activation function. This network is used in many applications, such as function approximation, time series prediction, classification, and system control [81,82]. This neural network is a feed-forward neural network, which consists of three layers called the input layer, the hidden layer, with a nonlinear activation function, and the output layer, with linear function [83]. The output of the ith hidden neuron is obtained by the following equation [83]: where k is the neurons number in the hidden layer, is the width of the receptive field in the input space from unit i, k is a strictly positive radially symmetric function (kernel) with a unique maximum at its center ( ), which drops off promptly to zero away from the center. This means that is a significant value when the distance of ‖ − ‖ is less than the width of [84]. By considering the input vector of X, the output of the nth neuron of the output layer is obtained by [84]: where is the weighting factor.
which H and Y are the outcome of radial basis functions and desired output, respectively [84]. The available data are divided into two categories: training and testing data. The use of test data in the network training process reassures us to avoid under-fitting and over-fitting problems.

Results and Discussion
In this study, three RBF neural networks have been designed to determine the type of flow regimes and detect volume percentages. The inputs of these networks are the first and second dominant frequencies of the recorded signals of both detectors. The ratio of data sharing as training data and test data is 70% to 30%, respectively. The designed classifier network has four input neurons, 35 hidden neurons, and one output neuron. The configuration of the classifier network is shown in Table 1. The output of this network are the numbers 1, 2, and 3, which are related to the annular, homogeneous, and stratified regimes, respectively. It should be noted that several thresholds are considered for the output of this network, so that the outputs between 0.5 and 1.5 are in the annular class, the outputs between 1.5 and 2.5 are in the homogeneous class, and the outputs between 2.5 and 3.5 are in the stratified class. Figure 4 shows the network structure of the classifier network, which is responsible for classifying flow regimes. Figure 5 illustrates the performance of this network for training and testing data using a confusion matrix, which represents 100% accuracy.    Two predictor neural networks are designed to determine the volume percentages of the gas phase and the water phase. It is necessary to say that, because the volume of the pipe is constant, by determining the volume percentage of the two phases, the volume percentage of the third phase is easily obtained. In this research, to show the performance of designed networks, a fit diagram (in which both network outputs and targets are plotted on a diagram), an error diagram, error histogram diagram, and a regression diagram have been illustrated. The structures of the neural networks used to estimate the volume percentage of the gas and water phases and the performance of these networks are shown in Figures 6-9, respectively. The configuration of the gas and water volume fraction predictor network is shown in Table 2.  (a) (b) Figure 8. The fit diagram, the error histogram diagram, the error diagram, and the regression diagram to show the performance of the gas phase volume fraction predictor network for (a) train data (b) test data.
(a) (b) Figure 9. The fit diagram, the error histogram diagram, the error diagram, and the regression diagram to show the performance of the water phase volume fraction predictor network for (a) train data (b) test data.
In fact, for the purpose of obtaining the optimal RBF model, several structures have been constructed and tested. The number of neurons was increased one by one from 1 neuron until the obtained error became almost constant. Until 35 neurons for classifier network, 45 neurons for gas volume fraction predictor network, and 58 neurons for water volume fraction predictor network, the errors changed meaningfully; however, after that, the error change was negligible. This behavior has been shown in Figures 10-12, which are performance graphs. In other words, selecting more neurons not only improves the performance of the neural network, but also increases the complexity of the designed networks.  To illustrate the performance of the designed networks, two error criteria, root mean square error (RMSE) and mean relative error (MRE), are calculated as follows and tabulated in Table 3: A comparison between current research and previous studies is shown in Table 4. As is clear from the table, the use of frequency characteristics and RBF neural network is very effective in increasing the accuracy in determining the parameters of volume percentages and the type of flow regimes. It should be noted that the available data are often affected by uncertainty or imprecision, therefore it would be interesting to design non-destructive systems based on fuzzy logic approaches [85][86][87]. This subject could be used in future research in this area.

Conclusions
In this study, the application of characteristics of the signal in the frequency domain as well as the RBF neural network to determine the type of flow regimes and volume percentages in three-phase flows have been investigated. The structure of the detection system, which consists of an X-ray tube, a Pyrex-glass, and two NaI detectors, was implemented using the MCNP-X code. From each received signal, two characteristics named amplitude of the first and second dominant frequency were extracted and used as neural network inputs for network training. As a result, three networks were implemented to diagnose the type of flow patterns and determine the gas and water phase volume percentages. Reducing the error in determining the mentioned parameters due to the use of frequency characteristics and the RBF network is a great achievement of this research.

Conflicts of Interest:
The authors declare no conflict of interest.