Machine Learning Techniques Applied to Identify the Two-Phase Flow Pattern in Porous Media Based on Signal Analysis

: The development of ﬂow pattern identiﬁcation technology for gas–liquid two-phase ﬂow in porous media is of great signiﬁcance to engineering research and production. In this paper, a high accuracy identiﬁcation method for two-phase ﬂow pattern in porous media is proposed with Machine learning techniques. The gas–liquid two-phase ﬂow patterns and corresponding differential pressure signals in porous beds with particle diameters of 1.5 mm, 3 mm, and 6 mm are obtained through visual experiments. Three time domain characteristic parameters (Mean, Standard deviation, and Range) are calculated by a statistical method, while the EMD energy spectrum of the signal is obtained by empirical mode decomposition. Based on these parameters, machine learning technology, including support vector machine (SVM) and BP neural network, are employed to identify the ﬂow pattern. Four ﬂow pattern identiﬁcation models are trained based on SVM and BP neural network, with accuracies of 94.77%, 93.4%, 96.08%, and 91.5%. Furthermore, the three models with good performance are integrated by integrated learning technology. An integrated identiﬁcation model of gas–liquid two-phase ﬂow pattern in porous media with an overall accuracy of 98.04% is ﬁnally obtained.


Introduction
Two-phase flow in porous media plays a critical role in scientific and industrial processes. During a severe accident of a light water reactor (LWR), the corium may form a debris bed with a porous media structure [1]. Understanding the two-phase flow mechanism in porous media is important to developing efficient cooling technology and terminating severe accidents. In petroleum engineering applications, since the oil-water mixtures are stored in the underground cracks of porous media structures, the study of two-phase flow in porous media is conducive to the development of more efficient oil extraction technologies [2]. In addition, in agriculture engineering [3], chemical engineering [4], and other fields, two-phase flow in porous media also widely exists and has an important impact on experiments and production. Flow pattern, which has a great effect on heat and mass transfer, is the research foundation to clarify the flow and heat transfer mechanism of two-phase flow in porous media as well as improve industrial production efficiency [5]. Accurate identification of flow patterns is the premise of flow pattern research. For the needs of experiments and industrial production, it is of great significance to develop accurate and fast flow pattern identification technology for porous media.
In early research, scholars directly observe the two-phase flow patterns in transparent pipes (including pipes filled with porous media) with their eyes. They distinguish different flow patterns according to the forms of the gas-liquid phase [6,7]. Afterward, the application of high-speed cameras helps the researchers capture the subtle changes in

Description of Experiments
The experiments are carried out on a visual experimental system named DEBECO-LT (Debris Bed Coolability-Low Temperature). Figure 1 shows the diagram of the experimental system. In this paper, air and water are sent to the bottom of the test section, where they mix and flow into the porous media pipe. The wall of the experimental section is made of plexiglass, and two stainless steel wire meshes are fixed at the top and bottom to ensure that the glass balls will not move casually. Rosemont-3051 transmitters (0.04%) are fixed at the inlet and outlet of the test section to measure the differential pressure signals; the signal acquisition frequency is 400 Hz. FastcamMini Photron high-speed camera (102, 400 frame/s) is used to capture clear flow pattern photos. The previous paper describes the experimental system in more detail [27].
Appl. Sci. 2022, 12, 8575 3 of 19 porous media is constructed by using three optimal models and integrated recognition technology. Compared with the single model, the identification ability of the system has been improved. This paper provides a new idea for the development of flow pattern identification methods in porous media in the fields of the chemical industry, agriculture, petroleum, and nuclear engineering.

Description of Experiments
The experiments are carried out on a visual experimental system named DEBECO-LT (Debris Bed Coolability-Low Temperature). Figure 1 shows the diagram of the experimental system. In this paper, air and water are sent to the bottom of the test section, where they mix and flow into the porous media pipe. The wall of the experimental section is made of plexiglass, and two stainless steel wire meshes are fixed at the top and bottom to ensure that the glass balls will not move casually. Rosemont-3051 transmitters (0.04%) are fixed at the inlet and outlet of the test section to measure the differential pressure signals; the signal acquisition frequency is 400 Hz. FastcamMini Photron high-speed camera (102, 400 frame/s) is used to capture clear flow pattern photos. The previous paper describes the experimental system in more detail [27]. The experimental pressure is equal to the local atmospheric pressure, about 0.1 MPa. The room temperature is about 10 °C. Spherical glass particles with diameters of 1.5 mm, 3 mm, and 6 mm are packed into three different porous media beds. The superficial velocity of air is 0.005-0.44 m/s and that of water is 0.59-1.17 mm/s. More details of the experimental setup can be found in Table 1. The experimental pressure is equal to the local atmospheric pressure, about 0.1 MPa. The room temperature is about 10 • C. Spherical glass particles with diameters of 1.5 mm, 3 mm, and 6 mm are packed into three different porous media beds. The superficial velocity of air is 0.005-0.44 m/s and that of water is 0.59-1.17 mm/s. More details of the experimental setup can be found in Table 1.

Feature Extraction Methodology
Feature extraction is the key to establishing the relationship between flow patterns and signals, and it is also the basis of machine learning technology to distinguish and recognize flow patterns. Appropriate feature extraction is important to developing flow pattern identification technology. In this paper, statistical methods and empirical modal analysis (EMD) technology are used to extract the time domain and time-frequency domain characteristics of the signal.

Characteristics of Time Domain
In this paper, three common statistical parameters, which are mean, variance, and range of the signal, are selected to reflect the time domain characteristics of the signal. These features can be used to analyze the time domain features of signals and as the input of machine learning classifiers containing time domain features. The calculation formulas are as follows: Mean of differential pressure signal: where x(i) refers to each point of the signal, and N indicates the number of signal points. The standard deviation of differential pressure signal: where m refers to the mean of the differential pressure signal Range of differential pressure signal:

Characteristics of Time-Frequency Domain
It is not comprehensive to extract the signal features only from the time domain. In order to extract more abundant features, this paper also introduces the empirical mode decomposition (EMD) method to extract the time-frequency domain features of the signal. EMD is a new adaptive signal time-frequency processing method proposed by N. E. Huang that is especially suitable for the analysis and processing of nonlinear and nonstationary signals. The essence of the empirical mode decomposition (EMD) method is to identify all vibration modes contained in the signal through the characteristic time scale. In this process, the characteristic time scale and the definition of IMF have certain experiences and approximations. Compared with other signal processing methods, the EMD method is intuitive, indirect, a posteriori, and adaptive. The characteristic time scale used in its decomposition is derived from the original signal.
The purpose of EMD decomposition is to obtain the eigenmode function. EMD decomposes the input signal into several eigenmode functions and a residual; the process is as follows: (1) Find all extreme points of signal I(n).
(2) Use a cubic spline curve to fit the envelope Emax(n) and Emin(n) of the upper and lower extreme points, and find the average value m 1 (n) of the upper and lower envelope and subtract it from I(n): (3) Judge whether h(n) is IMF according to preset criteria: (1) In the whole time range of the function, the number of local extreme points and zero crossing points must be equal or be at most one difference; (2) At any time point, the envelope of the local maximum (upper envelope) and the envelope of the local minimum (lower envelope) must be zero on average; (4) If not, replace I(n) with h(n) and repeat the above steps until h(n) meets the criteria; then h(n) is the IMF m (n) to be extracted; (5) Each time the IMF m (n) is obtained, it is deducted from the original signal and the above steps are repeated until the last remaining part RES M (n) of the signal is only a monotone sequence or a constant value sequence. In this way, the original signal I(n) is decomposed into the linear superposition of a series of IMF m (n) and the remaining parts: where I(n) indicates the input signal, IMF m (n) represents the eigenmode function of mth, and RES M (n) indicates the residual. The EMD energy of mth is determined by the amplitude of IMF m (n), which is defined as follows: The EMD energy spectrum is defined as follows: Level m = E m /E (8)

Support Vector Machine
Support vector machine (SVM) theory is proposed by Vapnik [28]. Generally speaking, the support vector machine is a classifier. For the two groups of marked vectors, an optimal segmentation hypersurface is given to divide the two groups of vectors into two sides so that the vector closest to the hyperplane in the two groups of vectors (the so-called support vector) is as far away from the hyperplane as possible. Figure 2 shows the schematic diagram of SVM. For a data set, data = {(x 1 , y 1 ), (x 2 , y 2 ), . . . , (x n , y n )}, where x i ∈ R n , y i ∈ {+1, −1}. It can be specifically described as the following problem of finding the conditional maximum value: The above problem involves the vector inner product mapped to a high-dimensional space, that is, the calculation of φ(x i ) T φ x j . Therefore, it is necessary to introduce kernel function K(x,z). This paper employs the Gaussian kernel function: Besides, LIBSVM tools [29] provide support for the calculation.

BP Neural Network
BP (Back Propagation) neural network is a multilayer feedforward neural network trained according to the error backpropagation algorithm, which is one of the most widely used neural network models. The process of BP neural network is mainly divided into two stages. The first stage is the forward propagation of the signal, from the input layer to the hidden layer, and finally to the output layer. The second stage is the back-propagation of error, from the output layer to the hidden layer, and finally to the input layer, adjusting the weight and offset from the hidden layer to the output layer and from the input layer to the hidden layer. Figure 3 shows the schematic diagram of a BP neural network.

Experiment Results
In this study, different flow patterns in a porous bed are recorded by changing the gas flow rate while the liquid flow rate is fixed. During this process, bubbly flow, slug flow, annular flow, and the transition flow patterns among them are observed. The photos and diagrams of typical flow patterns are shown in Figure 4. At first, the gas flow rate is lower. At this time, the gas phase is scattered between the pores of the porous media bed in the form of small bubbles. With the continuous increase in gas flow rate, the number and volume of bubbles increase, and the flow pattern begins to transition to slug flow. When the flow pattern is completely transformed into slug flow, it can be seen that the bubbles between adjacent pores are connected to form irregular gas slugs, as shown in Figure 4b. In the whole experimental section, such gas slugs can be seen everywhere. As the gas flow rate further increases, the gas slugs are connected to form larger gas slugs, and the flow pattern transitions to annular flow. For a typical annular flow, the liquid is attached to the surface of particles and pipe walls in the form of a liquid film, and the gas

Experiment Results
In this study, different flow patterns in a porous bed are recorded by changing the gas flow rate while the liquid flow rate is fixed. During this process, bubbly flow, slug flow, annular flow, and the transition flow patterns among them are observed. The photos and diagrams of typical flow patterns are shown in Figure 4. At first, the gas flow rate is lower. At this time, the gas phase is scattered between the pores of the porous media bed in the form of small bubbles. With the continuous increase in gas flow rate, the number and volume of bubbles increase, and the flow pattern begins to transition to slug flow. When the flow pattern is completely transformed into slug flow, it can be seen that the bubbles between adjacent pores are connected to form irregular gas slugs, as shown in Figure 4b. In the whole experimental section, such gas slugs can be seen everywhere. As the gas flow rate further increases, the gas slugs are connected to form larger gas slugs, and the flow pattern transitions to annular flow. For a typical annular flow, the liquid is attached to the surface of particles and pipe walls in the form of a liquid film, and the gas flows rapidly through the gap between these liquid films, as shown in Figure 4c. It is worth mentioning that in porous beds with particle diameters of 1.5 mm and 6 mm, three typical flow patterns cannot be completely observed within the current working conditions due to the limitation of pore size. Bubbly flow cannot be observed in a porous bed with a particle diameter of 1.5 mm. For a porous bed with a particle diameter of 6 mm, annular flow cannot be observed. Only in the porous bed with a particle diameter of 3 mm are bubbly flow, slug flow, and annular flow are observed at the same time.

Experiment Results
In this study, different flow patterns in a porous bed are recorded by changing the gas flow rate while the liquid flow rate is fixed. During this process, bubbly flow, slug flow, annular flow, and the transition flow patterns among them are observed. The photos and diagrams of typical flow patterns are shown in Figure 4. At first, the gas flow rate is lower. At this time, the gas phase is scattered between the pores of the porous media bed in the form of small bubbles. With the continuous increase in gas flow rate, the number and volume of bubbles increase, and the flow pattern begins to transition to slug flow. When the flow pattern is completely transformed into slug flow, it can be seen that the bubbles between adjacent pores are connected to form irregular gas slugs, as shown in Figure 4b. In the whole experimental section, such gas slugs can be seen everywhere. As the gas flow rate further increases, the gas slugs are connected to form larger gas slugs, and the flow pattern transitions to annular flow. For a typical annular flow, the liquid is attached to the surface of particles and pipe walls in the form of a liquid film, and the gas flows rapidly through the gap between these liquid films, as shown in Figure 4c. It is worth mentioning that in porous beds with particle diameters of 1.5 mm and 6 mm, three typical flow patterns cannot be completely observed within the current working conditions due to the limitation of pore size. Bubbly flow cannot be observed in a porous bed with a particle diameter of 1.5 mm. For a porous bed with a particle diameter of 6 mm, annular flow cannot be observed. Only in the porous bed with a particle diameter of 3 mm are bubbly flow, slug flow, and annular flow are observed at the same time.   Figure 5 shows the diagram of differential pressure signals of typical flow patterns in porous beds with different particle diameters. As shown in Figure 5a,b, the differential pressure signals of bubbly flow in two porous beds fluctuate around 4.5 kPa, and the fluctuation ranges are about 1 kPa. The difference in particle diameter does not lead to an obvious difference between differential pressure signals. For slug flow, it can be seen from Figure 5c-e that there is a great difference between the differential pressure signals of bubbly flow and that of slug flow. The differential pressure signals of slug flow in porous beds with particle diameters of 3 mm and 1.5 mm fluctuate up and down around 5 kPa,  Figure 5 shows the diagram of differential pressure signals of typical flow patterns in porous beds with different particle diameters. As shown in Figure 5a,b, the differential pressure signals of bubbly flow in two porous beds fluctuate around 4.5 kPa, and the fluctuation ranges are about 1 kPa. The difference in particle diameter does not lead to an obvious difference between differential pressure signals. For slug flow, it can be seen from Figure 5c-e that there is a great difference between the differential pressure signals of bubbly flow and that of slug flow. The differential pressure signals of slug flow in porous beds with particle diameters of 3 mm and 1.5 mm fluctuate up and down around 5 kPa, and the fluctuation ranges can reach about 2 kPa, which is larger than that of bubbly flow. As for the differential pressure signal of slug flow in a porous bed with a particle diameter of 6 mm, although its fluctuation range is small, which is about 1.5 kPa. The average of the signal is around 3.5 kpa at this time, which is significantly smaller than 4.5 kPa of bubbly flow and 5 kPa of slug flow in the other two porous beds. By observing differential pressure signals of annular flow in Figure 5f,g, it can be found that the average value of the differential pressure signals is increased, both greater than 5 kPa. For the porous bed with a particle diameter of 3 mm, the fluctuation range of the differential pressure signal of annular flow is smaller than that of the slug flow.
Appl. Sci. 2022, 12, 8575 9 of 19 the differential pressure signals is increased, both greater than 5 kPa. For the porous bed with a particle diameter of 3 mm, the fluctuation range of the differential pressure signal of annular flow is smaller than that of the slug flow.
In general, it can be found that there are certain differences in the features of differential pressure signals of different flow patterns, such as the mean value, dispersion degree, and so on. The features of these typical flow patterns are extracted, quantified, and classified, and then the unknown flow patterns can be classified and recognized through these features. The next section will introduce how to use time domain analysis and EMD methods to extract and quantify the characteristic parameters of differential pressure signals. In general, it can be found that there are certain differences in the features of differential pressure signals of different flow patterns, such as the mean value, dispersion degree, and so on. The features of these typical flow patterns are extracted, quantified, and classified, and then the unknown flow patterns can be classified and recognized through these features. The next section will introduce how to use time domain analysis and EMD methods to extract and quantify the characteristic parameters of differential pressure signals.

Time Domain Feature Extraction
According to Equations (1)-(3), three time domain parameters (average value, standard deviation, and range) corresponding to each group of data are obtained. The average reflects the concentration trend of the differential pressure signal, the standard deviation reflects the dispersion degree of the differential pressure signal, and the range quantifies the fluctuation range of the differential pressure signal. After sorting out the calculation results, the time domain characteristic distributions of different flow patterns in porous beds with different particle diameters are obtained, as shown in Figure 6.

Time Domain Feature Extraction
According to Equation (1)-(3), three time domain parameters (average value, standard deviation, and range) corresponding to each group of data are obtained. The average reflects the concentration trend of the differential pressure signal, the standard deviation reflects the dispersion degree of the differential pressure signal, and the range quantifies the fluctuation range of the differential pressure signal. After sorting out the calculation results, the time domain characteristic distributions of different flow patterns in porous beds with different particle diameters are obtained, as shown in Figure 6.  It can be seen from Figure 6a that there is an obvious boundary between and annular flow in a porous bed with a particle diameter of 1.5 mm. Figure in a porous bed with a particle diameter of 3 mm, a few data points of s bubble flow overlap in the time domain distribution. In Figure 6c, it can b the porous bed with a particle diameter of 6 mm, there is also an obvious tween the distribution of bubble flow and slug flow data in the time doma It can be seen from Figure 6a that there is an obvious boundary between the slug flow and annular flow in a porous bed with a particle diameter of 1.5 mm. Figure 6b shows that in a porous bed with a particle diameter of 3 mm, a few data points of slug flow and bubble flow overlap in the time domain distribution. In Figure 6c, it can be seen that in the porous bed with a particle diameter of 6 mm, there is also an obvious boundary between the distribution of bubble flow and slug flow data in the time domain. Nevertheless, it can be found from Figure 6d that when the influence of particle diameter of porous media bed is not considered, there will be a lot of overlap in the distribution of time domain characteristics of different flow patterns, which indicates that particle diameter is also one of the important parameters affecting classification, and the influence of particle diameter cannot be ignored.
In order to better analyze the distribution of time domain characteristics, the distribution range and median of time domain characteristic parameters of different flow patterns are counted, and the calculation results are shown in Table 2. It can be seen from the Table 2 that for the porous bed with a particle diameter of 1.5 mm, the average value of the differential pressure signal of the slug flow is 5.74-7.05 kPa, and that of the annular flow is greater than 8.02 kPa. Therefore, the data with the average value of the differential pressure signal falling within these ranges can be directly distinguished between the slug flow and the annular flow in the porous bed with a particle diameter of 1.5 mm. Similarly, in the porous media bed with a particle diameter of 6 mm, the average value of the differential pressure signal can also be directly used to distinguish bubbly flow and slug flow (bubbly flow is 4.11-4.76 kPa, slug flow is 3.38-3.97 kPa). However, it should be considered that the average value of differential pressure signal alone cannot distinguish all the flow patterns. Firstly, in a porous media bed with a particle diameter of 3 mm, there is a range of overlap between the characteristic parameters of different flow patterns. Secondly, for porous media beds with particle diameters of 1.5 and 6 mm, it is also difficult to distinguish data that are between two ranges (for example, the average value of differential pressure signal is within 7.05-8.02 kPa) through the judgment of researchers. This is why multiple parameters rather than a single parameter are selected to judge the flow pattern. To solve the above problems, new features (EMD energy spectrum) are introduced to provide a more judgment basis. At the same time, machine learning technology is employed to identify and classify different flow patterns from a mathematical point of view.

Time-Frequency Feature Extraction
EMD has been briefly introduced in Section 3.1.2. In this section, the differential pressure signals of different flow patterns are decomposed to obtain the IMF components of the signal; the decomposition results are shown in Figure 7.
Appl. Sci. 2022, 12, 8575 13 of 19 distributed at levels four, five, and six, especially at level four. As can be seen in Table 5, the difference in EMD energy at level seven between different conditions is large. For example, for the slug flow in the porous bed with particle diameters of 3 mm and 6 mm, the energy proportion may reach more than 40%, while for other conditions, the energy proportion of this level is much lower.   As can be seen in Figure 7, most of the IMF3 of slug flow is close to zero, which is obviously different from that of bubbly flow and annular flow. Similarly, the IMF4 of bubbly flow is also very different from that of slug flow and annular flow, not only in forms but also in amplitude. Moreover, for IMF6, IMF7, there are also differences in the amplitudes of modal functions of different flow patterns. Therefore, using Equations (6) and (7), the EMD energy spectra of different signals are defined and calculated, and the corresponding distribution ranges are obtained. Due to the adaptability of the EMD method, the decomposition levels of different signals are different. Considering that the amplitudes of IMF8 and IMF9 of most signals are very low (energy is very low), in order to unify the results, only the energy of level one-level seven is retained. The calculation results are shown in Tables 3-5. It can be seen from Table 3 that the energy proportion of EMD at levels 1-3 is not high, especially from the median point of view; only the bubbly flow in a porous bed with a particle diameter of 6 mm accounts for more than 10% of the energy at level one. It can be seen from Table 4 that the EMD energy of the signal is mainly distributed at levels four, five, and six, especially at level four. As can be seen in Table 5, the difference in EMD energy at level seven between different conditions is large. For example, for the slug flow in the porous bed with particle diameters of 3 mm and 6 mm, the energy proportion may reach more than 40%, while for other conditions, the energy proportion of this level is much lower.
In general, by processing the signal with the EMD method and calculating the corresponding EMD energy spectrum, new parameters that are different from time domain characteristic parameters can be obtained. These new parameters will show different characteristics with different flow patterns, which can be used for the identification of flow patterns. They also provide richer feature vectors as support for the next machine learning classification.

Machine Learning Identification
In Section 4.2, the time domain characteristics and EMD energy spectrum of differential pressure signals are calculated. After analyzing these characteristics, it can be found that it is difficult to classify and identify all working conditions with a single parameter, and there is often overlap between parameters. The complex characteristics make it difficult for researchers to accurately identify flow patterns through subjective judgment. The development of machine learning technology, especially support vector machine (SVM) technology and neural network technology, provides new ideas and tools for solving these problems. Through SVM technology and neural network technology, the recognition model can be trained by using multi-dimensional feature vectors based on certain mathematical rules. Compared with manual recognition, these mathematical models can quickly and accurately judge the flow pattern according to the input feature vector, which greatly reduces the impact of subjectivity on the results and improves the recognition efficiency. Therefore, this section uses SVM technology and neural network technology to train multiple SVM/neural network identification models with different features and compares the identification ability of these models to evaluate the performance of the two technologies in porous media flow pattern identification.
Samples should be prepared before training. A total of 341 sets of typical flow pattern data are obtained in this experiment, including bubbly flow, slug flow, and annular flow. One part of the data is used as the training set to train the model, and the other part of the data is used as the test set to test the identification ability of the model. The details are shown in Table 6. The vector including time domain features and EMD energy spectrum is constructed. Considering the important influence of particle diameter on the characteristics, the particle diameter is also included in the vector. The dimension n of the vector should not be too large, which is limited by the number of training sets. In this paper, n < 8 (2 n < 188). Therefore, the final vector is composed of three time domain characteristic parameters, three levels of EMD energy ratio, and one particle diameter. From large to small, two kinds of vectors are constructed, which will lead to two different SVM models. One vector includes four, five, and six levels and the other one includes one, two, and seven levels. Examples of vectors are shown in Table 7. The SVM models are trained with the prepared vectors. In this paper, the k-CV method [30] combined with the grid search method is used to obtain two key parameters (the penalty factor C and the kernel function parameter g), which are important to ensure the accuracy of SVM models. Table 8 shows the identification results of the two SVM models.
In general, the identification ability of the SVM-1 model is better than that of the SVM-2 model. The identification ability of slug flow and annular flow of SVM-1 model is better than that of the SVM-2 model. However, its bubbly flow identification ability is worse than that of the SVM-2 model, but this gap is not very obvious.
In addition to the SVM model, the neural network flow pattern identification model is also trained based on BP neural network technology. In this paper, BP neural network includes one input layer (7 neurons, corresponding to seven features of a vector), one intermediate layer (12 neurons), and one output layer (3 neurons, corresponding to labels of three flow patterns). The same training set and test set as SVM models are selected, which can help evaluate the identification ability of the two methods. The training results are shown in Table 9. As shown in Table 9, the identification ability of different BP network models varies greatly. The BP-1 model has the best identification ability, which is not only better than the BP-2 model but also better than SVM-1 and SVM-2 models. The identification ability of the BP-2 model is the worst of the four models. Moreover, the models containing one, two, and seven levels of EMD energy perform worse than the models containing four, five, and six levels of EMD energy.
Next, consider further improving the identification ability of flow patterns. The idea of bagging technology in integrated learning technology is introduced. That is, train multiple models at the same time, let these models vote on the results, and determine the final results according to the voting results. In this study, four models are trained. If all the models participate in the voting, there may be a tie vote. Due to the poor performance of BP-2, its results may mislead the correct results. Therefore, SVM-1, SVM-2, and BP-1 were selected to form an integrated model. The identification process is shown in Figure 8, moreover, considering the special situation (bubble flow: annular flow: slug flow, 1:1:1). Since the BP-1 model performed best among the three models, it is considered that the final result of BP-1 model will prevail when the conflict occurs. Table 10 shows the identification results of an integrated model. It can be seen that the integrated model further improves identification ability based on the original models. The test data of bubbly flow and annular flow have been correctly identified, and only two groups of slug flow data have not been correctly identified. moreover, considering the special situation (bubble flow: annular flow: slug flow, 1:1:1).
Since the BP-1 model performed best among the three models, it is considered that the final result of BP-1 model will prevail when the conflict occurs. Table 10 shows the identification results of an integrated model. It can be seen that the integrated model further improves identification ability based on the original models. The test data of bubbly flow and annular flow have been correctly identified, and only two groups of slug flow data have not been correctly identified. Figure 8. Diagram of integrated model. Figure 8. Diagram of integrated model.

Conclusions
In this paper, a method based on feature extraction and machine learning is proposed to identify the two-phase flow patterns in porous media, which provides a new idea for the development of flow pattern identification methods in porous media in the fields of the chemical industry, agriculture, petroleum, and nuclear engineering. The differential pressure signals of two phase flow in the porous media packed with particles are collected through visual experiments. The time domain characteristic parameters and EMD energy spectrum are extracted. After that, a variety of flow pattern identification models based on machine learning technology are trained. An integrated flow pattern identification model with high accuracy is finally obtained based on integrated identification technology. The main conclusions are as follows: (1) There are differences between the average values of differential pressure signals of different flow patterns. For a porous bed with a particle diameter of 1.5 mm, the boundary between slug flow and annular flow is 8 kPa. For a porous bed with a particle diameter of 3 mm, the distribution range of average differential pressure of different flow patterns overlaps. For a porous bed with a particle diameter of 6 mm, the boundary between bubbly flow and slug flow is 4 kPa. For other parameters, the overlapping area between different flow patterns is larger, and it is difficult to distinguish the flow patterns only by manual identification. It is necessary to introduce machine learning technology. (2) The BP-1 model based on BP neural network technology has the best identification ability among single models, with an accuracy of 96.08%. However, another BP-2 model based on different levels of EMD energy has the worst identification ability. Its accuracy is only 91.5%. The identification ability of the two models SVM-1 and SVM-2 trained by SVM technology is close, since the accuracies of them are 94.77%, and 93.4%, respectively. In this study, the two neural network models have the highest and lowest recognition accuracy. Although the SVM model is lower than the optimal neural network model in recognition accuracy, the recognition ability of the two models is closer. SVM technology is more stable than BP neural network technology. (3) By integrating several high-quality models, the integrated model can further improve the ability of flow pattern identification on the basis of the original models. The identification accuracy increased from 94.77% to 98.04%. This behavior will increase the total calculation time because it takes time to train each model. The total time is approximately equal to the sum of the time needed to train the three models, respectively. Users can consider comprehensively according to the requirements for accuracy and timeliness. Moreover, poor quality models will reduce the identification ability of integrated models. Funding: This research received no external funding.