2.1 Install Python3.x (recommend using Anaconda)
> $pip install -r requirements.txt
> $git clone https://github.com/MYUNGJE/SAGAN.git
> $cd SAGAN
1) The piglet dataset we used in the SAGAN paper is now open for download in here
2) The file extension of this dataset is DICOM. Therefore, the extension should be converted to PNG. We used mritopng to convert images.
│ data
│ ├── data
│ │ ├── train
│ │ │ ├── input x697 (randomly selected 123 images for Validation)
│ │ │ ├── label x697 (randomly selected 123 images for Validation)
│ │ ├── test
│ │ │ ├── input x123
│ │ │ ├── label x123
*Validation dataset randomly selected 123 images from the train dataset and excluded them from the train dataset.
> $python sa_main.py --is_test=False --output_dir='./output_dir'
> $python sa_main.py --is_test=True --test_dir='./test_inputs_dir' --model_dir='./model_dir' --output_dir='./test_result_output_dir' --mn=0 --fn=4000
> $python main.py --is_convert=True --test_dir='./test_inputs_dir' --model_dir='./model_dir' --output_dir='./test_result_output_dir' --mn=0
│ src
│ ├── sa_Tensorflow_utils.py
│ ├── sa_convert.py
│ ├── sa_dataset.py
│ ├── sa_main.py
│ ├── sa_model.py
│ ├── sa_solver.py
│ ├── sa_utils.py
-- sa_convert.py outputs a generated image by inputting a single image or a folder containing many images (evaluation result is omitted)
https://doi.org/10.1007/s10278-018-0056-0 , journal of Digital imaging, October 2018
https://arxiv.org/pdf/1708.06453.pdf, arxiv, October 2017
https://github.com/xinario/SAGAN, This repo provides the trained denoising model and testing code.
[https://github.com/xinario/defocus_segmentation], This repo provides the S network algorithm hints (See lbpSharpness.py)
Pix2Pix, arXiv, November 2018
3) If you want to change the weights of the two loss values, you can change the values of lambda1 (seg loss) and lambda2 (gan loss) in the flags.
4) The three images used in the test are in test_imgs (gan _ 1 + seg _ 100) ... / input file and are the average of the three results.
PSNR | SSIM | |
---|---|---|
gan1+seg90 | 38.67, 40.02, 39.89, 40.11, 40.35 | 0.964, 0.974, 0.972, 0.974, 0.974 |
gan1+seg100 | 38.70, 38.80, 39.59, 40.48, 41.64 | 0.967, 0.969, 0.971, 0.975, 0.977 |
gan2+seg100 | 38.34, 39.64, 38.98, 39.91, 41.20 | 0.967, 0.971, 0.97, 0.971, 0.975 |
gan5+seg90 | 37.74, 37.36, 38.67, 39.07, 39.05 | 0.948, 0.95, 0.961, 0.962, 0.96 |
gan5+seg100 | 37.81, 38.36, 39.51, 39.35, 40.59 | 0.955, 0.952, 0.967, 0.96, 0.97 |
gan10+seg90 | 37.09, 38.41, 38.55, 38.89, 39.41 | 0.947, 0.946, 0.946, 0.954, 0.965 |
gan10+seg100 | 37.13, 38.63, 38.83, 39.06, 39.76 | 0.938, 0.956, 0.956, 0.959, 0.958 |