1. Introduction
As important energy conversion and fluid transportation equipment, centrifugal pumps are widely used in the petrochemical, coal chemical, and oil and gas extraction fields [
1]. In practical engineering applications, gas–liquid two-phase flow is frequently encountered, reducing the performance of the pump [
2,
3]. The increase of inlet gas volume not only affects the pressure increment and efficiency of a centrifugal pump, but also produces surging and even gas locking of the pump, which will endanger the stability of flow system and reduce the service life of the pump [
4,
5]. Therefore, the prediction of pump performance under the gas–liquid two-phase flow condition is of great significance. Studies show that pump performance is closely related to the flow pattern in the pump [
6]. Thus, the correct identification of the flow pattern in the pump is essential for developing prediction models to analyze the flow characteristics and performance of the pump.
Currently, two methods are available for the identification of two-phase flow patterns. The first one is the direct measurement method, which determines the flow pattern from the flow image. Visual inspection, high speed photography [
6,
7,
8,
9,
10] and tomographic imaging are several typical methods used [
11,
12]. He et al. [
6,
10] investigated the flow pattern in the impeller of a centrifugal pump using high-speed camera technology and obtained four different flow patterns. The effects of the inlet gas volume fraction (IGVF), liquid flow rate and rotational speed on the distribution of the gas–liquid phase in the impeller was analyzed, as were the pump pressure increment and efficiency. Verde et al. [
8] observed four typical flow patterns using the high-speed camera technique and determined that the centrifugal pump performance variation is related to the gas–liquid two-phase flow characteristics in the pump. In addition, they obtained a flow pattern versus pump performance graph under different operating conditions. Schäfer et al. [
11] obtained distribution images of high gas content in the impeller by the gamma-ray scanning technique, and determined the effect of inlet flow conditions on the performance of centrifugal pumps.
The second type is the indirect measurement method, which works by measuring the fluctuating signals reflecting the flow characteristics and then processing them for analysis. Pressure, differential pressure, gas volume fraction and void fraction are several parameters that are frequently employed. Unfortunately, the indirect method is mainly applied for identification of the flow patterns in pipes and channels [
13,
14,
15,
16,
17,
18], while few studies have been reported concerning centrifugal pumps. Li et al. [
14] identified flow patterns through the pressure characteristics of each branch of the riser and the probability density function (PDF) of the differential pressure. Yin et al. [
16] carried out a multi-scale marginal spectral entropy analysis on the differential pressure signal, which can distinguish the four flow regimes in the beam channel, macroscopically. Du et al. [
18] analyzed the wave signals measured in the vertical pipeline by using the adaptive optimal kernel time-frequency algorithm (AOK TFR), and distinguished different flow patterns and their complex dynamic behaviors. Sun et al. [
19] also identified gas–liquid two-phase flow patterns after analyzing the differential pressure signal in the horizontal Venturi based on the time-frequency signal processing method of the adaptive optimal kernel (AOK). Euh et al. [
20] carried out a wavelet analysis on the void fraction signal measured in the vertical channel and obtained the identification criteria of different flow patterns by calculating the effective local wavelet energy and scale in the time-frequency diagram.
In recent years, machine learning has shown excellent characteristics in solving complex problems in engineering applications and scientific fields, which provides a new idea for flow pattern recognition of centrifugal pump under gas–liquid two-phase conditions [
21,
22]. As an important method to realize machine learning tasks, artificial neural networks mainly include algorithms such as Back Propagation (BP), Multilayer Perceptron (MLP), Radial Basis Function (RBF), Probabilistic Neural Network (PNN) and Convolutional Neural Network (CNN). Many studies have been published on two-phase flow pattern identification based on artificial neural networks for their good classification ability [
23,
24,
25,
26]. Lin et al. [
23] constructed a 5-layer BP neural network using the superficial velocities of water and air and the channel inclination angle as inputs. They identified six flow patterns in channels with different inclination angles and found that the results matched the Barnea unified model well. Xu et al. [
24] realized the flow pattern recognition of long-distance riser system based on BP neural network by extracting the pressure signal feature and reducing the dimension of the principal component analysis (PCA). The influence of the pressure signal and signal length at different positions on the recognition rate were also analyzed. They found that a higher recognition rate can be obtained when the differential pressure is used as the input. Rosa et al. [
26] investigated the flow pattern in a vertical channel based on the void fraction and the relevant probability density function. They also compared the identification results of flow patterns using the MLP, RBF and PNN algorithm models. Abbagoni et al. [
27] classified different flow patterns of gas–liquid two-phase flow by ultrasonic signal and artificial neural network, and compared the recognition rate of models under different feature extraction methods. Ghosh et al. [
28] used the statistical parameter training model of a probe signal and three different artificial neural network models to identify counter-current gas–liquid two-phase flow.
The present work aims to develop a prediction model based on an artificial neural network to identify the flow pattern in the impeller of the centrifugal pump. First, experiments were conducted on the gas–liquid two-phase flow pattern of the centrifugal pump. The influence of the inlet gas volume fraction, the rotational speed and the liquid flow rate on the flow pattern in the impeller were obtained, and thus the basic database was established. Then, the SMOTE algorithm was used to over sample a few samples and the suitable network hyperparameters were selected by keeping the number of sample classes balanced, after which an artificial neural network-based flow pattern identification model for centrifugal pumps was constructed. Finally, the identification results of four flow patterns were analyzed and evaluated.
3. Model Building and Training
A multi-layer BP artificial network model was used to classify and predict the gas–liquid two-phase flow pattern of the centrifugal pump. As a multilayer feedforward network with error back propagation, a BP neural network possesses strong nonlinear mapping approximation ability. It is one of the most widely used neural networks at present. It consists of the input layer, the hidden layer and the output layer, whose output results are propagated forward and whose errors are back-propagated.
Figure 4 shows the network structure employed in this study. The inputs are the inlet gas volume fraction (IGVF), the liquid phase volume flow rate (
QL), the pump rotational speed (
N) and the pressure increment (Δ
P). The output is the probability value corresponding to four flow patterns, which are denoted as 0, 1, 2 and 3, respectively.
3.1. SMOTE Oversampling
The sample numbers of the four flow patterns are shown in
Table 4. The BF only appeared when the IGVF was extremely low. Because of the limitation of the experimental system, only 9 samples of BF patterns and 37 samples of ABF patterns were available in this study. The imbalance rate of the BF pattern and the ABF pattern to the SF pattern was 10 and 2.4, respectively. Under this situation, the model will pay more attention to the SF pattern, which will degrade into the classification performance of BF pattern and ABF pattern. Thus, the imbalance rate problem should be resolved to achieve good recognition accuracy.
The SMOTE algorithm can be employed to resolve the imbalance rate problem of the experimental data and enhance the data. The algorithm is an oversampling technique to synthesize new samples after analyzing the samples with a small number. Compared with the random oversampling technique which is easy to make the model be over fit, the SMOTE algorithm samples the feature space, so its accuracy is higher than that of the traditional sampling method [
29,
30]. The algorithm is shown as follows:
(1) For sample
a with low proportion in the category, the Euclidean distance
s to sample
b in the category is calculated by Equation (1):
(2) Taking point a as the center, k adjacent samples are selected according to Euclidean distance s to obtain their k proximity.
(3) A sample point
c is randomly selected from the nearest neighbors of
k, and its linear interpolation
d to the original sample point
a are calculated according to Equation (2).
d is a minority sample point similar to
a;
where
δ is a random number between 0 and 1.
(4) Set the sampling scale and repeat the above interpolation process. Then the synthesized samples are added to the original data set.
3.2. Selection of Network Super Parameters
The structure of a neural network has an important influence on the prediction results. A series of hyperparameters, such as the number of neurons in the hidden layer, the activation function, etc., need to be determined to build the network model.
3.2.1. Selection of Number of Hidden Layers
When the number of hidden layers is one, various functions containing continuous mappings from one finite space to another finite space can be fitted; when a number of hidden layers are double-layer, various precision decision boundaries can be represented with appropriate activation functions, and smooth mappings of various precision can be fitted. In order to make the network model effectively learn the flow characteristics of gas–liquid two-phase flow and accurately predict various flow patterns under different working conditions, a double-layer hidden layer was selected for flow pattern identification in this paper.
3.2.2. Number Selection of Hidden Layer Neurons
Generally, there is no general solution to determine the number of nodes. If the number of hidden layer nodes is too small, the network may not be trained at all or the network performance will be very poor; if the number of hidden layer nodes is too large, the system error of the network can be reduced. However, the network training time will be much longer on the one hand, and on the other hand, the training may fall into local minima and cannot achieve the optimal point, which is also the essential reason for over fitting during training. If a small network with few nodes is selected, the loss value is extremely high, even though the network is easy to converge to local minima. While a large, multi-node network is selected, the loss value is small and more local minima can be found. In the present study, 512 neurons were ultimately selected for network training.
3.2.3. Selection of Activation Function
For the hidden layer, the Relu activation function was selected, as it can overcome the gradient disappearance problem and greatly reduce the training time of the network [
23]. For the output layer, the softmax activation function [
31,
32] is chosen to output the probability values predicted by the network for the four flow patterns. The sum of the four probability values equals one, and the flow pattern corresponding to the maximum probability value is the flow pattern predicted by the network.
3.2.4. Learning Rate
When the gradient decreases, it is necessary to specify a learning rate as a control factor for the weight update step, for which learning rates of 0.01, 0.001 and 0.0001 are often used. In this study, the exponential attenuation of learning rate is adopted. A large learning rate was used in the early training stage to make the network converge quickly. The learning rate was gradually reduced with the increase of the number of iterations, so as to better make the network converge to the optimal solution.
3.2.5. Iteration Number
Too few iterations will make the network under fit, and too many iterations will make the network over fit. The number of iterations suitable for the network model should be reasonably selected. The Early Stopping method was used here to calculate the correct rate on the training set after each iteration. When the number of iterations exceeds a certain range, the accuracy of the model remains unchanged or its improvement becomes too small. We worked to avoid over fitting and to improve the generalization ability of the network.
3.2.6. Regularization Parameter
In the training process of the network, L2 regularization was added to the Early Stopping method to avoid the over-fitting of the network. L2 regularization controls the complexity of the model by adding a penalty term to the original loss function to penalize a model with high complexity [
33], as shown in Equation (3):
where
L is the training error, i.e., the loss function,
is the training error after regularization,
λ is an adjustable regularization parameter used to control the strength of regularization and
is the sum of the squares of weights, which needs to meet Equation (4).
where
C is the upper limit of the sum of the squares of the weights, that is, the sum of the squares of weights of the network cannot exceed parameter
C. Thus, after adding L2 regularization, the goal of the network is to minimize the training error
within this constraint.
3.3. Model Building Process and Steps
The model training flow chart with SMOTE oversampling is shown in
Figure 5. The specific construction and training process of the model is as follows:
Step 1: determination of input and output parameters. In order to make the network model better classify and predict the four flow patterns of gas–liquid two-phase flow, the inlet gas volume fraction (IGVF), the pressure increment (ΔP), the rotational speed (N) and the liquid phase flow (QL) were selected as inputs. The flow patterns divided according to observations by the high-speed camera are used as the outputs, which was taken as the original data set.
Step 2: dividing the training set and test set. A total of 218 sample points were obtained from the experiment. In order to obtain a reasonable network model, the data set needs to be divided into training and test sets. In the present work, 80% of the experimental data (174 samples) were are selected as the training set, and the remaining 20% (44 samples) constituted the test set.
Step 3: SMOTE oversampling. Since imbalance in the distribution of the four flow patterns can lead to a significant reduction in the classification performance of the model, the oversampling of the samples with a small number in the training set is required after dividing the training and test sets.
Table 5 shows the number of samples in the training set of each flow pattern before and after the data were enhanced by SMOTE.
Step 4: data preprocessing. Before the data is input to the network for training, the input and output parameters need to be feature extracted and normalized. For the output parameters, the labels 0, 1, 2 and 3 are used to represent the BF, ABF, GPF and SF patterns, respectively. For the input parameters, the Zero-mean normalization (Z-score standardization) is required. Four input quantities, including inlet gas volume fraction (IGVF), liquid phase flow
QL, pump rotational speed
N and pressure increment Δ
P were standardized, respectively. The mean value and the standard deviation were 0 and 1, respectively, after processing. The standardized equation is shown in Equation (5):
where
xij is the
jth original value of input feature
i,
is the mean value of characteristic
i,
is the standard deviation of characteristic
i. After standardization, if the original value of the data is greater than its mean value, positive standardized data will be obtained. Otherwise, negative standardized data will be obtained.
Some sample points after data preprocessing are shown in
Table 6.
Step 5: neural network training. The number of network layers adopts a four-layer network structure, that is, the neural network includes an input layer, an output layer and two hidden layers. The number of nodes in each layer was 4, 512, 512 and 4, respectively.
Step 6: deviation calculation. Cross-entropy loss was used to test the deviation between the predicted value of the model and the real value. It is defined by Equation (6):
where
M is the number of samples in the training set,
Li is the error of the
ith training sample,
m is the number of categories,
m = 4;
pit represents the probability that the
ith sample is predicted as category
t,
yit is a symbolic function, if the true category of sample
i is
t, it equals 1, otherwise it is 0
Step 7: model verification. The untrained test data sets were are used to evaluate the performance of the network model.
3.4. Network Iteration Curve
Accuracy was selected as the evaluation function of the network, as shown in
Figure 6a. With the increase of the iteration numbers (epoch), the accuracy shows an upward trend and finally tends to stabilize. When the accuracy barely increases with iterations, the network training comes to an end. The accuracy of the network model on the present training set was 0.95.
Figure 6b shows the iterative curve of the cross-entropy loss function. With the increase of the iteration numbers, the loss value of the network continues to decline and finally tends to stabilize.
4. Discussion
4.1. Comparison of Recognition Rate
In order to evaluate the effects of the SMOTE oversampling on the network performance, the classification performance before and after data enhancement was compared on each sample set, and in particular on the performance on the test set.
Table 7 shows comparisons of the identification results of four flow patterns between the original data set and the enhanced data set. It can be seen that the training data of the BF that the ABF and the GPF increased from 6, 30 and 66 to 72 after data enhancement by SMOTE, which was equal to the increase to the SF pattern. The model failed to recognize the BF pattern in the original data set, including the training set and the test set. When the model was trained by the enhanced data, we found that no misjudged data in the training set for the BF pattern and only one misjudged datum in the test set. The identification rate of the BF pattern in the test set was 66.67%. For the ABF pattern, the identification rate in the test data also increased from 71.43% to 100%. In addition, the identification rate in the test data of the GPF pattern was also slightly raised from 82.36% to 88.24%. The model performed best for the SF pattern among the four flow patterns. It is concluded that the SMOTE oversampling technique is beneficial to predict datasets with large imbalance rates. The generalization and robustness of the model based on the artificial neural network can be improved significantly when combined with the SMOTE technique.
As shown in
Figure 7, the confusion matrix plot based on the classification results of the model on the test set for the four flow patterns also displayed the identification rate. The horizontal and vertical coordinates in the figure are the predicted and actual flow patterns, respectively. The color in the legend denotes the identification rate. The results demonstrated that the prediction performance of the model was improved when it was trained by the enhanced data.
Note that part of the GPF samples were still misjudged as the ABF and the SF, no matter whether or not the training data was enhanced by the SMOTE oversampling technique. This was mainly due to the GPF pattern being the transition flow pattern between the ABF pattern and the SF pattern. GPF shows strong unstable characteristics, at which the surging phenomenon of the pump tends to occur [
34]. It is suggested that more characteristic signals are required to further improve the prediction performance of the model on the GPF pattern.
4.2. Receiver Operating Characteristic (ROC) Analysis
In order to further evaluate the classification performance of the model for each flow pattern, a Receiver Operating Characteristic curve (ROC curve) is introduced for analysis. The ROC curve is drawn based on the results of different judgment criteria, such as normal, roughly normal, suspicious, roughly abnormal and abnormal. The horizontal and vertical coordinate are the true positive rate (sensitivity) and the false positive rate (specificity), respectively. In the ROC curve, the closer the curve is to the upper left corner and the larger the Area Under the Curve (AUC, the minimum value is 0.5), the better the classification performance of the model.
Figure 8 shows the ROC curve of the model on the test set before and after data enhancement. For the BF pattern (class 0), the AUC was 0.5 before the data were enhanced using the SMOTE (
Figure 8a), which means that the authenticity of BF classification by the model was 0; while the AUC increased to 0.83 after data enhancement (
Figure 8b), which shows a significant improvement in the classification performance of the model. Meanwhile, the ROC curves of the other three flow patterns also shifted to the upper left corner after data enhancement and the AUC was much higher than before data enhancement.
In addition, the macro-average ROC curve was also employed to evaluate the overall classification performance of the model. The AUC of the macro-average ROC curve before and after data enhancement was 0.79 and 0.93, respectively. The ROC curve after SMOTE algorithm processing was much closer to the upper left corner, which indicates that the overall classification performance of the model improved significantly.
4.3. Model Evaluation
In addition to the identification rate P0, another three idices, i.e., Kappa coefficient, Macro-F1 and Micro-F1, were introduced to further evaluate the model performance.
The Kappa coefficient is used in statistics to assess consistency, which is defined by Equation (7):
where
P0 and
Pe are calculated by Equations (8) and (9)
where
TPi,
FPi and
FNi are the number of True Positives, False Positives, and False Negatives in category
i, respectively,
m is the number of categories,
m = 4,
Z is the total number of samples.
The F1-score is a measure of accuracy in a dichotomous classification problem, and is used to measure the accuracy of uneven distribution data. It takes into account both the precision (
p) and recall (
r) of the classification model. In multi-classification problems, there are two ways to calculate the F1-score of a model, which are Macro-F1 and Micro-F1. In the uneven distribution sample set, for an F1 value, Macro-F1 focuses on the category with the fewest samples, while Micro-F1 focuses more on the category with the most samples. They are calculated by Equations (10)–(15):
Table 8 shows the evaluation index of the model on the training set, test set and total data set before and after data enhancement. It is can be seen that, before data enhancement, the identification rate
P0 of the model on the training set was 91.95%, but it was only 81.82% on the test set, which means that the generalization of the model is poor. After data enhancement, the identification rate of the model was higher than 93% for all three sample sets. The generalization of the model was significantly improved. In addition, the Kappa coefficient, Macro-F1 and the Micro-F1 were higher than 0.9 after data enhancement, which also shows the good classification performance of the model.
For the model performance on the test set before data enhancement, the Macro-F1 and the Micro-F1 were 0.6 and 0.82 respectively, indicating that the model performed poorly in the category with few samples (BF pattern) for classification. After data enhancement, the Macro-F1 and the Micro-F1 increased to 0.9 and 0.93, respectively, which demonstrates that the model could accurately identify all types of flow pattern samples. The classification performance of the model was significantly improved.
5. Conclusions
In this paper, the flow characteristics of centrifugal pump under gas–liquid two-phase conditions were experimentally investigated and the corresponding flow pattern map was obtained. The two-phase flow pattern identification model of a centrifugal pump based on the SMOTE algorithm and a multilayer BP artificial neural network was constructed by determining the network hyperparameters, such as the number of layers and neurons, the iteration number and the learning rate. The classification performance of the model was also analyzed and evaluated.
Four typical flow patterns, i.e., Bubble Flow, Agglomerated Bubble Flow, Gas Pocket Flow and Segregated Flow, in the impeller of centrifugal pump were observed with the increase of the inlet gas volume fraction. The transformation of the flow pattern in the impeller was delayed and the gas carrying capability of the pump was improved by increasing the liquid phase flow and the pump rotational speed. The uneven distribution problem of samples on the training set was solved by data enhancement using the SMOTE algorithm. The overfitting of the model to the samples with a small number was avoided, which reduced data misclassification in the test set and significantly improved the identification rate of the four flow patterns, especially the Bubble Flow pattern.
A discrete flow pattern such as the Segregated Flow can be well identified because it has obvious, characteristic features. However, for the flow data in the transition region of two flow patterns, the input parameters used in the present study were inadequate to characterize their features. Therefore, more information (e.g., the probability density function (PDF) and power spectral density (PSD) of the differential pressure signals) to reflect the characteristics of the flow patterns in the transition region are required for further investigation.