Intelligent Microfluidics Research on Relative Permeability Measurement and Prediction of Two-Phase Flow in Micropores

Relative permeability is a key index in resource exploitation, energy development, environmental monitoring, and other fields. However, the current determination methods of relative permeability are inefficient and invisible without considering wetting order and pore structure characteristics either. In this study, microfluidic experiments were designed for figuring out key factors impacting on the two-phase relative permeability. The optimized intelligent image recognition was established for saturation extraction. The deep learning was conducted for the prediction of two-phase permeability based on the inputs from microfluidic experiments and image recognition and optimized. Results revealed that phase saturation, wetting order, and pore topology were the key factors influencing the two-phase relative permeability, with the importance of 38.22%, 34.84%, and 26.94%, respectively. The deep learning-based relative permeability model performed well, with MSE < 0:05 and operational efficiency of 3ms/epoch. Aiming at relative permeability model optimization, on the one hand, the dividing ratio of training set and testing set for flooding phase relative permeability prediction achieved the highest prediction accuracy at 7 : 3, while that for displaced phase was 6 : 4. On the other hand, tanh() activation function performed 40% more accurate than the sigmoid() activation function.


Introduction
The relative permeability is a crucial parameter reflecting reservoir rock allocation properties and an indispensable index revealing the characteristics of fluid flow and distribution [1,2]. Moreover, relative permeability is a key index in resource exploitation, energy development, environmental monitoring, and other fields [3,4]. The greater the relative permeability of certain fluid in a particular reservoir means that the weaker the reservoir resistance to the fluid, the stronger the mobility of fluid in pores and the more clear the distribution in the reservoir. For instance, in groundwater resource mining and storage, water relative permeability is applied to guide the location of mining sites and to evaluate the risk of groundwater leakage in the reservoir. In oil and gas reservoir development, the relative permeability of crude oil or natural gas is adopted to evaluate the significance and benefits of the reservoir water injection development. In soil environmental monitoring, relative permeability is a key indicator to determine the characteristics of sewage diffusion and transport. The construction of a relative permeability model with high efficiency, high accuracy, high robustness, and extensive applicable scenarios is of great significance to effectively evaluate resource mining efficiency, improve energy recovery, and optimize environmental monitoring and testing [5][6][7][8].
The construction of relative permeability models is based on data feedback from adequate relative permeability experiments. However, the current relative permeability determination experiments are still based on the steady-state multiphase core displacement, which has some shortcomings [9][10][11]. First, a single core cannot reflect the pore characteristics of the entire reservoir, while equivalent conditional experiments on multiple cores imply significant consumption of time and cost. In addition, the experiments will change the core wetting history or even destroy the internal pore structure of the core, which is not beneficial for improving the experimental accuracy by weakening the stochastic error through multiple experiments. Finally, the experiments require the experimenter to keep recording the flow of each phase fluid and indirectly obtain the saturation at each time, which limits the experimenter resulting in low experimental efficiency [12][13][14][15].
Besides, extensive experiments have shown that relative permeability is a function of saturation. Nevertheless, the factors such as wetting order and pore structure characteristics also have negligible effect on relative permeability. Most of the relative permeability models proposed by academia lack the consideration of wetting order and pore structure characteristics. This is largely due to the invisibility of internal flow during conventional steady-state core displacement experiments, leading to the wetting order and the pore structure features' unattainability. In addition, the introduction of wetting order and pore structure characteristics based on the phase saturation will significantly increase the nonlinearity and model complexity of the relative permeability model, which increases the difficulty to build a reliable relative permeability model [16][17][18][19].
The nonsteady two-phase microfluidic experiments are characterized by whole-process visualization, automated parameter recording, and the experimental setup closer to the two-phase displacement flow in engineering practice. It is a reliable substitution experiment to obtain the basic data of constructing the relative permeability model. During the microfluidic experiments, the electron ocular records the saturation over time, producing a large number of image data [20][21][22][23]. According to the microfluidic experiments, general cognition of impacts from various parameters on relative permeability could be obtained, while the quantitative contribution of each parameter could be clarified basing on the Sobol sensitivity analysis model. Furthermore, by introducing the image recognition algorithm, the intelligent identification, storage and analysis of saturation, wetting order, and pore structure characteristics could be achieved with less time cost comparing to conventional methods [24][25][26][27]. Finally, based on the saturation, wetting order, and pore structure data, relative permeability intelligent models are constructed by adopting deep learning algorithm, especially the deep neural network (DNN) [28,29].
In this study, microfluidic experiments were designed for figuring out key factors impacting on the two-phase relative permeability. The optimized intelligent image recognition was established for saturation extraction. The deep learning was conducted for the prediction of two-phase permeability based on the inputs from microfluidic experiments and image recognition. The microfluidic experiments and deep learning model introduced in this study are of great significance for efficient and reliable research on resource exploitation, energy development, and environmental monitoring.

Methodology
The research route for intelligent model-based image recognition and permeability prediction of two-phase flow in micropores is shown in Figure 1. First, experimental images were obtained by the designed microfluidic two-phase flow experiments. Subsequently, the image data was preprocessed via applying the image enhancement algorithm specifically the global equalization. Secondly, the preprocessed image data was input into the convolution neural network (CNN); then, the water and oil saturation in the images was extracted and identified. Output from the CNN, the oil and water saturation together with the wetting order and pore diversity obtained from the microfluidic two-phase flow experiments was input to the deep neural network (DNN) model. Finally, the intelligent prediction model of relative permeability based on the DNN was established and optimized [30][31][32][33][34].

Physical Equations.
In this study, the two-phase flow in micropores specified as the process of oil flooding by water was investigated. The flowing process could be described as the Darcy porous flow [31,35]. According to the Darcy law, the relationship between the permeability and the pressure and flow, as shown in the following equation [31,36,37]: where Q is flow rate, m 3 /s; K is the permeability of the porous media, m 2 ; A is the outlet area, m 2 ; μ is the viscosity of liquid, Pa·s; and ▽P is the pressure gradient, Pa/m. Accordingly, the permeability is defined as the format as shown in the following equation: where u is the liquid velocity, m/s. Furthermore, the relative permeability of a certain liquid is defined as the format as shown in the following equation: where K ri is the relative permeability of liquid i, dimensionless; u i is the velocity of liquid i during multiphase flow, m/s; μ i is the viscosity of liquid i, Pa·s; and ▽P i is the pressure gradient on liquid i, Pa/m. The pressure gradient on liquid i is correlated to the capillary force on which and the absolute driving pressure gradient, as shown in the following equation: where P c,i is the capillary force on liquid i, Pa; P a is the absolute driving pressure, Pa; and L is the length of the porous media, m.  Table 1. While studying the impact of wetting order on two-phase relative permeability, Light oil 2 # was used as flooding phase to flood the mineral water since the microfluidic chips were hydrophobic. Meanwhile, the reason why Light oil 2 # as flooding phase was adopted was to maintain the capillary force on either flooding or displaced phase as constant variable. Based on the properties of the experimental fluid, the three-phase porous flow process performed in this research was considered an isothermal incompressible two-dimensional flow [21,[38][39][40].
The overview of the flooding experiment and data measurement and record is presented in Figure 2. In particular, the driving module, pressure monitoring module, experiment visualization module, and data record module were established. The adopted equipment and materials included two constant-speed microinjection pumps for liquid injection, medical plastic syringes, alloy four-way valve, 16 kPa capsule pressure gauge, PE lines, microfluidic chips, optical microscope with electron lens, waste liquid collection test tube, mobile workstation, and experimental recording camera [41][42][43][44]. The left and lower inlets of the four-way valve were connected to the water pump and nitrogen pump, respectively, while the outlet at the top were connected to the pressure gauge and the right outlet connected to the inlet of the microfluidic chip. Before the experiment began, the microfluidic chip was saturated by the displaced phase. The injection rate was also set in the microinjection pump, which corresponded to the injection rate at the inlet of microfluidic chip [36,[45][46][47].
To quantitatively analyze the contribution of each parameter to relative permeability, the Sobol sensitivity analysis method was adopted. The Sobol method is based on the idea of model decomposition, yielding the sensitivity of parameters 1, 2, and higher, respectively. Usually, 1 sensitivity reflects the main effect of parameters, while 2 and higher sensitivity consider more. Compared with other sensitivity analysis methods, the Sobol method has a relatively stable sampling method, which can grade the sensitivity to the contribution proportion of the output variance through parameters and is a more efficient method to quantitatively identify the sensitivity of different parameters. The specific model of Sobol sensitivity analysis is shown in equations (5)- (9).
2.3. Image Enhancement and Recognition. Before the saturation recognition and extraction, the images require to be enhanced for highlighting the features while weakening the white noise inside. In particular, smoothing is required to eliminate noise interference in the image or to enhance contrast and sometimes to emphasize the edges and details of the image. For oil-water two-phase microfluidic experimental images, the grayscale distribution of the image is relatively concentrated, resulting in the segmentation difficulty of two-phase saturation. Histogram equalization is achieved by adjusting the gray order distribution of the image so that the distribution on the 0~255 gray order is more balanced, which is an effective method to improve the contrast of the image and simplify the segmentation of oil and water saturation. Shown in Figure 3 is a schematic diagram of the histogram equalization principle. Generally, images obtained from oil-water two-phase microfluidic experiments are suitable for adopting the histogram equalization method to enhance image details. After the image enhancement is done by histogram equalization, the next step is the saturation recognition and extraction. The convolution neural network (CNN) is adopted in this study for oil and water saturation  3 Geofluids recognition and extraction from microfluidic experimental images. The schematic diagram of the CNN is shown in Figure 4. The CNN consists of the following five parts: the input layer, convolution layer, pooling layer, fully connected layer, and the output layer. The key advantage of this method is that it could extract local data features through convolution and pooling operations. Besides, as a supervised intelligent method, the CNN is with high reliability and robustness.

Deep Learning Model.
A narrow definition of deep learning is the neural network with multilayers. Accordingly, the CNN mentioned above and the DNN which is introduced later are both classified as the deep learning model. In this    4 Geofluids study, the deep neural network (DNN) model was proposed for effectively extracting the linear and nonlinear characteristics of the data. The schematic diagram of the DNN for two-phase relative permeability prediction is shown in Figure 5, and the fundamental theories of the DNN are described from equation (10) to equation (14). Specifically, equation (10) to equation (12), respectively, show the operational criterion between the input layer and the first hidden layer, present hidden layer and next hidden layer, and the last hidden layer and output layer, while equation (13) to equation (14) show the activation functions of tanh() and sigmoid(). The parameter matrix of A and b is determined after the DNN is well-trained and validated [48][49][50][51][52].
where X is the input matrix of this study consisting of saturation, wetting order, and pore diversity; H is the hidden layer matrix; A is the weight matrix while b is the bias matrix, both called the parameter matrix; n is the layer order of the hidden layer; N is the amount of hidden layers; and Y is the output matrix, corresponding to the relative permeability in this study. In order to control the error of deep learning models during the training learning process, loss function is usually used to reflect the regression training effect of the model. The commonly used loss functions include mean square error (MSE), as shown in equation (15). According to the law of gradient descent and back-propagation of regression error, the parameter matrix A and b are adjusted and a model with high accuracy is finally obtained.
where M is the total number of the output variable which is the product of variable dimensions and feature numbers; y i represents the ith output variable, while the superscript or and re represent original value and regressed value, respectively. For neural networks with multiple input variables, different variables may have different units and values. To eliminate this effect and maintain the relative relationship between the values of the same variables, it is necessary to normalize the input dataset via the following equation: where X ′ is the normalized input matrix; X is the original input matrix; and X max and X min are the maximum and minimum values of the input variables.

Characterizations of Two-Phase Flow in Micropores.
In this study, 12 sets of microfluidic experiments with different pore structure characteristics, wetting order, and injection rate conditions were designed. The experimental results of microfluidic two-phase flow experiments are shown in Figure 6.  According to Figure 6, it could be found that the in addition to the saturation, the wetting order and pore diversity of pores did significantly impact on the two-phase flow in micropores. Hence, the saturation, wetting order, and pore diversity should be contained in the relative permeability model comprehensively.
Though the impact of saturation on relative permeability is hardly possible to visually observe, the effects of wetting order and pore diversity are significantly visible. In particular, at the mineral water flooding condition, it could be seen that the higher pore diversity was conducive to enhance the displacement of displaced phase generally. It is worth noting that the relationship between injection rate and saturation is nonlinear, while at the medium injection rate, 100 μL/min, the most residual displaced phase was left in pores. On the contrary, at the light crude oil flooding condition, the most complete flooding was done at the lowest pore diversity.
The reasons why such phenomena occurred are that on the one hand, the capillary effect is evident during the twophase flow process in micropores. The pores in microfluidic chips were hydrophobic determined by the materials. When the wetting order was set to be mineral flooding, the mineral water occupied the large pores initially and mainly and seldom permitted into fine pores due to the resistance conducted by capillary force on mineral water. Conversely, when the wetting order was set to be light crude oil flooding, the light crude oil occupied the fine pores initially and immediately and through which the light crude oil escaped instead of occupying the large pores. On the other hand, the saturation of both flooding and displaced phases was governed by Darcy's law of porous flow and capillary effect. Therefore, at a low injection rate particularly 50 μL/min in this study, the capillary effect played the domain role that large pores were more completely occupied. At a high injec-tion rate particularly 150 μL/min in this study, the Darcy law of porous flow performed more significant that flooding phase could permit into partial fine pores with high flooding pressure. Eventually, at the medium injection rate, particularly 100 μL/min in this study, both capillary effect and Darcy's law of porous flow failed to take advantage of themselves resulting in the most suboptimal flooding performance.
According to the microfluidic two-phase flow experiments, the two-phase flow saturation-relative permeability curves were plotted as shown in Figure 7. Specifically, curves from Figure 7 According to Figure 7, it could be found that at the wetting order of mineral water flooding, the equivalent points of relative permeability were all in the interval where the displaced phase saturation was greater than or equal to 0.8. However, at the wetting order of light crude oil flooding, there was no equivalent point of the two phases, while the two-relative permeability interval is shorter than the wetting order of mineral water flooding.

Sensitivity Analysis of Variable Effects on Relative
Permeability. The Sobol full-order weight model was applied to perform the sensitivity analysis of the saturation, wetting order, and pore diversity impact on relative permeability as shown in Figure 8. Notably, due to the saturation of the flooding and displaced phase satisfy the constraints of 1, the present study only considered the displaced phase saturation as the input variable for the Sobol full-order weight model. According to the results of the analysis shown in Figure 8, the saturation has the greatest effect on both the relative permeability of flooding phase and displaced phase. The wetting order was the second key impact factor of the relative permeability followed the saturation. Although the effect of the pore structure characteristics (coefficient of diversity) on the relative permeability was minimal among the three variables, the contribution difference from the saturation was not higher than 50%. Overall, phase Hidden layers Inputs (saturation, wetting order, geometry diversity) Outputs (relative permeability) Input layer Output layer Figure 5: Schematic diagram of the deep neural network (DNN) for two-phase relative permeability prediction. 6 Geofluids saturation, wetting order, and pore structure characteristics could be considered key factors in the two-phase flow of oil and water in micropores.

Performance of Intelligent Relative Permeability Model.
The training set of the deep learning-based intelligent relative permeability model was initially divided by the ratio of 8 : 2. The activation function adopted to the model was the tanh() function, and 5 hidden layers were set. The training process and validation results of the intelligent relative permeability model of flooding phase are shown in Figure 9(a), and those of the displaced phase are shown in Figure 9(b). According to Figures 9(a) and 9(b), it can be found that the training process and validation results of the intel-ligent relative permeability model of both the flooding phase and displaced phase performed well. Furthermore, Figures 10(a) and 10(b) reveal the specific loss (mean square error, MSE was adopted in this study) at each epoch corresponding to the training process of the intelligent relative permeability model of the flooding phase and displaced phase, respectively. It could be concluded that the intelligent relative permeability models proposed in this study are reliable and accurate.

Optimization of Intelligent Relative Permeability Model.
The intelligent relative permeability model was first optimized by adjusting the dividing ratio of the training set and the test set. As could be seen from the optimization 500 m Mineral water/media matrix Light crude oil   Figure 8: Sobol sensitivity analysis of saturation, wetting order, and pore diversity impact on relative permeability. 8 Geofluids    Figure 11(a), the lowest validation loss (MSE) for relative permeability of the flooding phase was at the ratio of 7 : 3 while that for the displaced phase was at the ratio of 6 : 4 compared to the ratio of 8 : 2 for the initial model. Moreover, as the proportion of the training set increased along with the test set scale decreased, the verification loss of the displaced phase relative permeability continuously improved, while that of the flooding phase showed a parabolic trend of falling first and then rising.
Subsequently, the intelligent relative permeability model was optimized by adjusting the number of hidden layers of the deep neural network as well as the activation function. The optimization results in Figure 11(b) show that the adoption of 3 or 7 hidden layers does not bring an obvious optimization effect for the model compared to the initial neural network structure of 5 hidden layers. However, it is worth noting that the tanh() activation function performed 40% more accurate than the sigmoid() activation function while adopting the equivalent 5 hidden layers.

Conclusion
Relative permeability is a key index in resource exploitation, energy development, environmental monitoring, and other fields. However, the current determination methods of relative permeability are inefficient and invisible without considering wetting order and pore structure characteristics either. In this study, microfluidic experiments were designed for figuring out key factors impacting on the two-phase relative permeability. The optimized intelligent image recognition was established for saturation extraction. The deep learning was conducted for the prediction of two-phase permeability based on the inputs from microfluidic experiments and image recognition and optimized.
Results revealed that phase saturation, wetting order, and pore topology were the key factors influencing the two-phase relative permeability, with the importance of 38.22%, 34.84%, and 26.94%, respectively. The deep learning model for relative permeability prediction performed well, with MSE < 0:05 and operational efficiency of 3 ms/epoch. Aiming at relative permeability model optimization, on the one hand, the dividing ratio of training set and testing set for flooding phase relative permeability prediction achieved the highest prediction accuracy at 7 : 3, while that for displaced phase was 6 : 4. On the other hand, tanh() activation function performed 40% more accurate than the sigmoid() activation function.

Data Availability
Data is available on request. Please contact the corresponding author for the underlying data supporting the results of the research.

Conflicts of Interest
The authors declare that there is no conflict of interest regarding the publication of this article.