Deep learning phase unwrapping with a U-Net

A demonstrate of "Deep learning spatial phase unwrapping: a comparative review" and "One-step robust deep learning phase unwrapping".

Preparation

  1. Install CUDA

  2. Install PyTorch

  3. Install dependencies

pip install -r requirements.txt

Datasets

Download dataset (without noise) from here to the current path and unzip. The file structure is the following:

train_in
└── 000001.mat
...
└── 020000.mat
train_gt
└── 000001.mat
...
└── 020000.mat
test_in
└── 000001.mat
...
└── 002000.mat
test_gt
└── 000001.mat
...
└── 000421.mat
test_in_real
└── 000001.mat
...
└── 000421.mat
test_gt_real
└── 000001.mat
...
└── 000421.mat

Of course, datasets train_in, train_gt, test_in and test_gt can also be obtained by running dataset_generation.m with MATLAB , whose parameters can be adjusted according to actual needs. (The size range of the noise can be controlled by adjusting the parameter noise_max.)

Network traning

Run main_train.py to start training the neural network.

python main_train.py

After training, two files (loss and others.csv and weights.pth) will be saved in the folder model_weights

Network testing

Run main_test.py to do some test.

python main_test.py

Error statistics

Run error_evaluation.m with MATLAB to calculate RMSEs for each test result.

More informarion

Details about the code and dataset can be found in this paper and its Supplementary Materials.