A method for simulating bubble flow based on generative adversarial networks
Generating diverse bubble images and flow routes by GAN-based method, the problem of insufficient data in bubble flow trajectory tracking is solved, tracking accuracy and versatility is improved, and reliable trajectory information is provided for subsequent measurement of transmission characteristics between gas and liquid.
Patent Information
- Application Number
- CN202310236628.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-13
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2043-03-13
AI Technical Summary
During the bubble flow trajectory tracking process, the bubble data obtained by experiments are usually limited, resulting in insufficient data diversity and affecting the tracking effect.
Using a generative adversarial network (GAN)-based method, a more diverse single bubble image is generated by generating adversarial networks, the training data set is expanded, and the bubble flow is designed using a random walk algorithm to simulate bubble flow.
It improves the tracking accuracy and versatility of the algorithm, provides a set of reliable bubble trajectory information, solves the problem of insufficient data, and enhances the basis for subsequent measurement of transmission characteristics between gas and liquid.
Smart Images

Figure CN116245047B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method for simulating gas-liquid two-phase flow, especially the generation of bubble flow in liquid. Specifically, it generates images of single bubbles based on a generative adversarial network, designs the flow routes of bubbles according to bubble behavioristics and random walk algorithms, and obtains simulated bubble flow, belonging to the field of computer vision. Background Art
[0002] The gas-liquid two-phase flow state formed by the gas phase flowing in the liquid phase in a discontinuous bubble shape is called bubble flow. It is a special gas-liquid two-phase flow state, usually existing when the gas velocity is relatively low and the gas volume is relatively small. Bubble flow widely exists in nature, industrial production, and underwater navigation fields. For example, in the industrial production process, presenting the gas-liquid two-phase in the state of bubble flow is a very efficient gas-liquid mass transfer and heat transfer method. It can fully disperse the gas phase in the liquid phase, greatly increasing the two-phase contact area, and thus greatly improving the mass and energy exchange rate between the two phases. Therefore, it has been widely used in process industries such as chemical engineering. In the underwater navigation field, when the external environmental pressure drops, a layered bubble flow is formed through multiple exhaust holes set on the surface of the vehicle body to discharge the gas inside the vehicle body, which can effectively reduce the underwater load of the vehicle body and thus improve the force characteristics of the vehicle body. In the above application scenarios, the momentum, energy, and mass transfer characteristics between the gas phase and the liquid phase are often the primary concerns, and the physical quantities to be measured include gas holdup, gas-liquid interface area, bubble morphology, gas-liquid velocity, etc. It is difficult to directly measure the above physical quantities through experimental methods, and the methods are relatively complex. Currently, intelligent recognition and trajectory tracking methods are mostly used. Therefore, tracking the trajectory of bubble flow is one of the most important preliminary works in the study of bubble transport characteristics.
[0003] In practical problems involving bubble flow trajectory tracking, the bubble data obtained through experiments are often limited. Even when the data volume is sufficient to support the algorithm requirements, there may be a problem of insufficient data diversity. These situations will affect the tracking effect of bubble flow. For bubble flow in liquid, reliable motion trajectory information is the basis for subsequent measurement of gas-liquid two-phase transport characteristics. Therefore, the present invention will propose a bubble flow simulation method, which can not only expand the training data set of the algorithm, solve the problem of insufficient experimental data, but also increase the data diversity during the training process, improving the tracking accuracy and generality of the algorithm. Summary of the Invention
[0004] The object of the present invention is to provide a method for simulating bubble flow based on Generative Adversarial Networks (GAN). This method solves the problem of insufficient training data during the tracking process of bubble flow trajectories, and by increasing the diversity of training data, overcomes the problem of insufficient information content in the training data, improves the tracking accuracy and generality of the algorithm, and achieves the purpose of providing a set of reliable trajectory information for subsequent research.
[0005] The object of the present invention is achieved as follows:
[0006] A method for simulating bubble flow based on a generative adversarial network, comprising the following steps:
[0007] Step 1: Cut the experimental bubble flow video into multi-bubble images, and preprocess the multi-bubble images. The preprocessing includes NLM denoising method, grayscale processing, grayscale linear transformation, and image binarization;
[0008] Step 2: Extract the contour information of the bubbles in the multi-bubble images. Use the Canny edge detection operator to perform edge detection on the images, and then use the findContours function to extract the bubble contour coordinate information in the images;
[0009] Step 3: Make a training dataset of single-bubble images. According to the bubble contour coordinate information output in Step 2, extract single-bubble images, and process the image sizes into a unified size to obtain a training dataset of single-bubble images;
[0010] Step 4: Train the generative adversarial network to generate more diverse single-bubble images. Input the dataset obtained in Step 3 into the generative adversarial network. By training the network, generate realistic bubble images to obtain a database containing bubbles with rich shapes;
[0011] Step 5: Design the flow route of the bubbles based on the random walk algorithm. Randomly select a certain number of bubble images with different shapes from the bubble database. According to the bubble dynamics behavior, design the flow route of the bubbles based on the random walk algorithm to obtain simulated multi-bubble images;
[0012] Step 6: Generate bubble flow; according to the frame rate of the original bubble flow video, use a Python program to generate bubble flow from the simulated multi-bubble images.
[0013] Specifically, Step 3 is as follows: According to the bubble contour coordinate information output by the findContours function in Step 2, find the maximum and minimum values of the horizontal and vertical coordinates of each bubble respectively, and crop the single bubbles in the original dataset. The maximum and minimum values of the horizontal and vertical coordinates corresponding to the i-th bubble in one frame of the image are shown in the following list:
[0014] Contour i = [x min ,x max ,y min ,y max
[0015] wherein, x min ,x max ,y min ,y max respectively represent the minimum value of the abscissa, the maximum value of the abscissa, the minimum value of the ordinate, and the maximum value of the ordinate.
[0016] Step 5 is specifically as follows:
[0017] 5.1. Material selection: Randomly select N bubbles from the generated single-bubble image training database as the materials required for generating the bubble flow;
[0018] 5.2. Background image generation: Generate 900 images of 576×1024 as the background, and the color is white;
[0019] 5.3. Position initialization: For each bubble, randomly set the initial position on the background image, and the initial position list is as follows:
[0020] Start = [[x 10 ,y 10 ,[x 20 ,y 20 ,[x 30 ,y 30 ,...,[x i0 ,y i0
[0021] wherein, [x i0 ,y i0 (i = 1, 2,..., N) is the initial value of the center point coordinates of the i-th bubble on the background image, and each bubble is pasted at the corresponding position according to the initial position;
[0022] 5.4. Based on the analysis of the dynamic behavior of bubbles and the random walk algorithm, design the flow route of bubbles: Since bubbles will swing randomly during the flow process, their movement process is not a straight upward movement. Assume that the swing direction can be four directions: up, down, left, and right. In the horizontal direction, assume that the probability that the abscissa pixel value of bubble i decreases at each moment is a, the probability that it does not change is b, and the probability that it increases is c. In the vertical direction, assume that the probability that the ordinate pixel value of bubble i decreases at each moment is d, the probability that it does not change is e, and the probability that it increases is f. The algorithm design is as follows:
[0023]
[0024] Among them, (x ik , y ik ) is the center point coordinate value of the i-th bubble at the k-th moment, (x i(k-1) , y i(k-1) ) is the center point coordinate value of the i-th bubble at the (k - 1)-th moment, j is the abscissa swing value, the probability that it is -1 is a, the probability that it is 0 is b, the probability that it is 1 is c, l is the ordinate swing value, the probability that it is -1 is d, the probability that it is 0 is e, the probability that it is 1 is f, and ε is the random swing amount, and its value is 1;
[0025] 5.5. Generate the random movement trajectory of the bubble; for the same bubble, take the center point coordinates in each frame of the background image to obtain the random movement trajectory image of the bubble.
[0026] Compared with the prior art, the beneficial effects of the present invention are:
[0027] The present invention proposes a technology for simulating gas-liquid two-phase flow; on the one hand, it can expand the training data set of the algorithm, reduce the time consumption of obtaining training data through the experimental process, and efficiently solve the problem of insufficient training data; on the other hand, the simulated bubble flow has relatively rich diversity. Using it to train the algorithm can improve the performance and versatility of the algorithm, enhance the tracking ability of the algorithm, and thus obtain reliable bubble trajectory information in the actual tracking process. This technology is beneficial to accurately grasping the results of the tracking algorithm and is of great significance for measuring the relevant characteristics of the subsequent bubble flow. Description of the Drawings
[0028] Figure 1a -d is the bubble image after image preprocessing; among them Figure 1a is the multi-bubble image after the image NLM denoising method, Figure 1b is the multi-bubble image after image grayscale conversion, Figure 1c is the multi-bubble image after image gray linear transformation, Figure 1d is the multi-bubble image after image binarization;
[0029] Figure 2a -c is the image of the multi-bubble image edge detection and drawing process; Figure 2a is the Canny edge detection, Figure 2b is the image edge drawing, Figure 2c is the improved image edge drawing;
[0030] Figure 3a -c is a partial single-bubble image generated by the GAN network;
[0031] Figure 4a -e is an image of a certain frame in the simulated bubble flow and a partial real trajectory image of the bubble; among them Figure 4aTo simulate an image frame in a bubble flow, Figure 4b is Figure 1a the true trajectory of bubble 1 in Figure 4c is Figure 1a the true trajectory of bubble 2 in Figure 4d is Figure 1a the true trajectory of bubble 3 in Figure 4e is Figure 1a the true trajectory of bubble 4 in;
[0032] Figure 5 This is the overall flowchart of the present invention. Specific embodiments
[0033] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0034] In this embodiment, the data used comes from a two-phase flow experiment conducted on a simulated closed loop. The vertical rise and fall of the gas-liquid two-phase flow are controlled by adjusting the pipeline valves. An integrated air compressor generates compressed air and stores it in a compressed air tank with a volume of 300 L. The compressed air enters the bubble generator through a solenoid valve, then enters the experimental section and the gas-water separator, and finally is discharged into the atmosphere. The total length of the experimental section is about 3.7 m, which is composed of organic glass pipe sections with different lengths and an inner diameter of 50.8 mm connected by a collection window. The collection window adopts a planar design and can perform high-speed photography. The collection frequency is 30 fps, the width * height is 576 * 1024 pixels, the flow rate of water is 2 m / s, the direction is vertically upward, and the bubble flow rate is similar to the water flow rate.
[0035] A method for simulating bubble flow based on a generative adversarial network includes the following steps:
[0036] Step 1: Preprocessing of the original multi-bubble image. First, the bubble flow video obtained from the experiment is cut into multi-bubble images. In image analysis, the quality of the image directly affects the effect and accuracy of the recognition algorithm. Therefore, preprocessing is required before image analysis. Since the original dataset images have problems such as dark brightness and background noise, the image preprocessing link of the present invention includes NLM denoising method, grayscale processing, grayscale linear transformation, and image binarization for the multi-bubble image dataset. After the image preprocessing process, the multi-bubble image is as Figure 1a shown in -d.
[0037] Step 2: Extract the contour information of the bubbles in the multi-bubble image. Use the Canny edge detection operator for edge detection, then use the findContours function in the OpenCV library to extract the contour coordinate information, and finally use the drawContours function for edge drawing. Due to the influence of factors such as the liquid surface and background, the edge extraction process needs to be improved. The edge detection and drawing process of the multi-bubble image is as Figure 2a shown in -c.
[0038] Step 3: Create a training dataset for single bubble images. According to the bubble contour coordinate information output by the findContours function in Step 2, find the maximum and minimum values of the horizontal and vertical coordinates of each bubble respectively, and crop the single bubbles in the original dataset. The maximum and minimum values of the horizontal and vertical coordinates corresponding to the i-th bubble in one frame of the image are shown in the following list:
[0039] Contour i =[x min ,x max ,y min ,y max
[0040] where x min ,x max ,y min ,y max represent the minimum value of the horizontal coordinate, the maximum value of the horizontal coordinate, the minimum value of the vertical coordinate, and the maximum value of the vertical coordinate respectively.
[0041] To meet the requirement of consistent training data size for input to the generative adversarial network, process the size of the single bubble images into a unified size. First, take the grayscale value of the first pixel in the upper left corner of the single bubble image as the background color, generate a 32×32 background image, make the center of the cropped bubble image coincide with the center of the background image, and perform background filling. Perform the above operations on all bubble images to obtain the training dataset required by the generative adversarial network.
[0042] Step 4: Train the generative adversarial network to generate more diverse single bubble images. Through Step 3, obtain the training dataset for single bubble images (a total of 18,475 bubble images), input it into the GAN network for training, and generate a database of single bubble images with diverse shapes and higher resolutions. To obtain diverse generated data, set the generated image sizes to 32×32, 64×64, and 96×96 respectively. Since it is necessary to sample from the generated database of single bubble images to generate bubble flow images later, in order to reduce the error caused by occlusion between image backgrounds, the present invention sets the generated image size to 32×32 to reduce the influence of irrelevant factors on the recognition process. When the size is 32×32, some single bubble images generated by the GAN network are as shown in Figure 3a -c. In addition, since the background colors of the generated bubble images are different, it is necessary to perform binarization processing on them to unify the background color.
[0043] Step 5: Design the flow route of the bubbles based on the random walk algorithm. The specific process is as follows:
[0044] 1. Material selection. Randomly select N bubbles from the generated single-bubble image database as the materials required for generating the bubble flow.
[0045] 2. Background image generation. To be as consistent as possible with the original multi-bubble image data, generate 900 images of 576×1024 as the background, with the color being white.
[0046] 3. Position initialization. For each bubble, randomly set the initial position on the background image. In the original multi-bubble image data, the vertical coordinate spacing of the initial position of each bubble is at least 30 pixel values. To satisfy the characteristics of the original dataset as much as possible, the vertical coordinate spacing of the initial position of each bubble in the simulated bubble flow should also be at least 30 pixel values. The initial position list is as follows:
[0047] Start = [[x 10 ,y 10 ,[x 20 ,y 20 ,[x 30 ,y 30 ,...,[x i0 ,y i0
[0048] Among them, [x i0 ,y i0 (i = 1, 2,..., N) is the initial value of the center point coordinates of the i-th bubble on the background image. Paste each bubble at the corresponding position according to the initial position.
[0049] 4. Based on the analysis of bubble dynamic behavior and the random walk algorithm, design the flow route of the bubbles. Since the bubbles will swing randomly during the flow process, their movement process is not a straight upward movement. Now assume that the swing directions can be up, down, left, and right. In the original data experimental device, the gas-liquid two-phase flow proceeds from bottom to top. According to the research on bubble dynamic behavior, it is found that the swing probabilities in the four directions are not the same. Horizontally, the present invention assumes that the probability that the abscissa pixel value of bubble i decreases at each moment is a, the probability that it does not change is b, and the probability that it increases is c (the image pixel values change from small to large from left to right). Vertically, the present invention assumes that the probability that the ordinate pixel value of bubble i decreases at each moment is d, the probability that it does not change is e, and the probability that it increases is f (the image pixel values change from small to large from high to low). According to the above regulations, the algorithm is designed as follows:
[0050]
[0051] Among them, (x ik ,y ik ) is the center point coordinate value of the i-th bubble at the k-th moment, (xi(k-1) , y i(k-1) ) is the center point coordinate value of the i-th bubble at the (k - 1)th moment. j is the horizontal coordinate swing value, the probability that it is -1 is a, the probability that it is 0 is b, and the probability that it is 1 is c. l is the vertical coordinate swing value, the probability that it is -1 is d, the probability that it is 0 is e, and the probability that it is 1 is f. ε is the random swing amount, and its value is 1.
[0052] 5. Generate the random movement trajectory of the bubbles. For the same bubble, take the center point coordinates in each frame of the background image to obtain the random movement trajectory image of the bubble. According to the statistical results of the original data, when N = 9, a = 45%, b = 10%, c = 45%, d = 80%, e = 15%, f = 5%, the simulation effect of a certain frame in the bubble flow is shown in Figure 4(a). The real trajectory information of the four framed bubbles in Figure 4(e) is shown in Figures 4(b), 4(c), 4(d), and 4(e) respectively.
[0053] Step Six: Generate the simulated bubble flow. According to the FPS (Frames Per Seconds) of the original dataset video, use a Python program to generate the simulated bubble flow from the ordered bubble sequence images obtained above. A certain frame of the bubble flow is shown in Figure 4(a).
[0054] Step Seven: Evaluate the authenticity of the simulated bubble flow. In the present invention, the generated simulated bubble flow is compared with the original bubble flow for similarity from three aspects.
[0055] I. The flow trajectory of the bubbles. In the simulated bubble flow, the real flow trajectory of each bubble is designed based on the random walk algorithm on the basis of analyzing and studying the original bubble flow, fully meeting the regularity of the bubble flow and the randomness within a certain range.
[0056] II. The flow velocity of the bubbles. The frame rate of the original bubble flow is 30 FPS, and the rising velocity of each bubble increases from small to large, with an average velocity of 40 pixel / s. The frame rate of the simulated bubble flow is consistent with that of the original bubble flow, and the average velocity magnitude is the same, fluctuating up and down within a small range to meet the bubble movement law.
[0057] III. The shape and size of the bubbles. In the original bubble flow, the shapes of each bubble are different during the movement process. To meet this condition, during the selection of the materials for the simulated bubble flow, try to select single bubble images with various shapes to meet the requirements of the subsequent process. In addition, the average size of a single bubble is also consistent with that of the original bubble flow.
[0058] Considering the above analysis, the simulated bubble flow can vividly represent the structure and movement process of the original bubble flow. Therefore, the simulated bubble flow provided by this method can be used as the training data set for the tracking algorithm, and due to the diversity of the simulated bubble flow, it can help to achieve the purpose of optimizing the algorithm and enhancing the robustness and generality of the algorithm.
Claims
1. A method for simulating bubble flow based on a generative adversarial network, characterized in that It includes the following steps: Step 1: Cut the bubble flow video obtained from the experiment into multi-bubble images, and preprocess the multi-bubble images. The preprocessing includes NLM denoising method, grayscale processing, grayscale linear transformation, and image binarization; Step 2: Extract the contour information of the bubbles in the multi-bubble images. Use the Canny edge detection operator to perform edge detection on the images, and then use the findContours function to extract the bubble contour coordinate information in the images; Step 3: Make a training dataset of single-bubble images. According to the bubble contour coordinate information output in Step 2, extract single-bubble images and process the image sizes into a unified size to obtain a training dataset of single-bubble images; Step 4: Train a generative adversarial network to generate more diverse single-bubble images. Input the dataset obtained in Step 3 into the generative adversarial network. By training the network, generate realistic bubble images to obtain a database containing bubbles with rich shapes; Step 5: Design the flow route of the bubbles based on the random walk algorithm. Randomly select a certain number of bubble images with different shapes from the bubble database. According to the bubble dynamics behavior, design the flow route of the bubbles based on the random walk algorithm to obtain simulated multi-bubble images; Step 6: Generate a bubble flow; According to the frame rate of the original bubble flow video, use a Python program to generate a bubble flow from the simulated multi-bubble images.
2. The method for simulating bubble flow based on a generative adversarial network according to claim 1, characterized in that The specific content of Step 3 is as follows: According to the bubble contour coordinate information output by the findContours function in Step 2, find the maximum and minimum values of the horizontal and vertical coordinates of each bubble respectively, and crop the single bubbles in the original dataset. The maximum and minimum values of the horizontal and vertical coordinates of the i-th bubble in one frame of the image are shown in the following list: Contour i = [x min , x max , y min , y max Among them, x min , x max , y min , y max respectively represent the minimum value of the abscissa, the maximum value of the abscissa, the minimum value of the ordinate, and the maximum value of the ordinate.
3. The method for simulating bubble flow based on a generative adversarial network according to claim 1, characterized in that The specific content of Step 5 is as follows: 5.
1. Material selection: Randomly select N bubbles from the generated training database of single bubble images as the materials required for generating the bubble flow; 5.
2. Background image generation: Generate 900 images of 576×1024 as the background, with the color being white; 5.
3. Position initialization: For each bubble, randomly set the initial position on the background image. The initial position list is as follows: Start = [[x 10 , y 10 ,[x 20 , y 20 ,[x 30 , y 30 ,…,[x i0 , y i0 Wherein, [x i0 ,y i0 (i = 1, 2, …, N) is the initial value of the center point coordinates of the i-th bubble on the background image, and each bubble is pasted at the corresponding position according to the initial position; 5.
4. Based on the analysis of bubble dynamic behavior and the random walk algorithm, design the flow route of the bubbles: Since the bubbles will swing randomly during the flow process, their movement process is not a straight upward movement. Assume that the swing directions can be up, down, left, and right. Horizontally, assume that the probability that the abscissa pixel value of bubble i decreases at each moment is a, the probability that it does not change is b, and the probability that it increases is c. Vertically, assume that the probability that the ordinate pixel value of bubble i decreases at each moment is d, the probability that it does not change is e, and the probability that it increases is f. The algorithm design is as follows: Wherein, (x ik , y ik ) is the center point coordinate value of the i-th bubble at the k-th moment, (x i(k-1) , y i(k-1) ) is the center point coordinate value of the i-th bubble at the (k - 1)-th moment. j is the abscissa swing value, the probability that it is -1 is a, the probability that it is 0 is b, and the probability that it is 1 is c. l is the ordinate swing value, the probability that it is -1 is d, the probability that it is 0 is e, and the probability that it is 1 is f. ε is the random swing amount, and its value is 1; 5.
5. Generate a random movement trajectory of the bubbles; for the same bubble, obtain the center point coordinates of the bubble in each frame of the background image to obtain a random movement trajectory image of the bubble.
Citation Information
Patent Citations
A product image rapid generation method based on a series confrontation network
CN109840924A
Underwater bubble image generation method based on conditional generative adversarial network
CN112465923A