Skip to content

dae416/DeepBubbleVelocimetry

Repository files navigation

DeepBubbleVelocimetry for evaluating the bubble velocity field

This is a project of Multiphase flow & Flow visualization Lab. The purpose of the project is to obtain the bubble velocity field from experimental images using CNN-based optical flow model. More information can be found in the paper (Choi et al. 2022).

The codes are based on PWC_Net (Sun et al. 2018) with the pre-trained weights. The tensorflow version can be found here.

The output of the model is as follows:

  • velocity field (two dimensional array in techplot format, or it can be read through wordpad or text in Window OS)
  • velocity field contour (png)

The repository includes:

  • Source code of implementation of PWC-Net based on the finetuned weights.
  • Source code to generate the velocity field (techplot file) and its contour (png).

The examples of the result is shown below:

  • Application for bubble plume with various void fractions Example1

  • Comparison with the PTV and CNN-based optical flow for dense bubble plume Example2

  • Effect of the training (it is seen that the horizontal vectors from the weakly trained model are inaccurate) Example3

Tested environment

This code was tested on the below environment.

  • NVIDIA RTX 2080 ti
  • Driver 440.95.01
  • CUDA 10.2
  • cuDNN 7.6.5
  • Python 3.7
  • TensorFlow 1.14.0
  • Keras 2.2.5 (If compatibility issue occurs, please refer to the original PWC-Net link)

Preparing the input

Prepare two consecutive bubble images (format of JPG or PNG or TIF) and one mask image.

  • For example, Img_0001.png, Img_0002.png, and msk_0001.png
  • (Here, the square size is recommended, e.g., 300 x 300 pixels)

Example4 Example5 Example6

How to test your own bubble image/video

  1. Clone this repository

  2. Install dependencies (If compatibility issue occurs, please refer to the original PWC-Net link)

  3. Download trained weights from this link.

  4. Run prediction script (CNN_OpticalFlow.ipynb) in Code/ directory to obtain the velocity field (supports only 3-channel jpg image).

Generating the synthetic bubble images

  • Code is attached in the "SyntheticBubbleImage" folder.
  • The density, velocity, magnitude of deformation (or the light noise) can be controlled using code.
  • Output of the code is as follows: Two consecutive bubble images and one flow file (visualized by color contour below).

Synthetic Bubble Image Example

Any comments/questions are welcome. Please contact to dae416@snu.ac.kr