This repository provides the official PyTorch implementation of the following paper:
Unsupervised-Cross-Domain-Learning-for-Noise-Removal-from-a-Single-Image
To install requirements:
conda env create -n [your env name] -f environment.yaml
conda activate [your env name]
- Download DIV2K dataset for training in here
- Randomly split the DIV2K dataset into Clean/Noisy set. Please refer the .txt files in
split_data
. - Place the splitted dataset(DIV2K_C and DIV2K_N) in
./dataset
directory.
dataset
└─── DIV2K_C
└─── DIV2K_N
└─── test
- Use
gen_dataset_synthetic.py
to package dataset in the h5py format. - After that, run this command:
sh ./scripts/train_awgn_sigma15.sh # AWGN with a noise level = 15
sh ./scripts/train_awgn_sigma25.sh # AWGN with a noise level = 25
sh ./scripts/train_awgn_sigma50.sh # AWGN with a noise level = 50
- After finishing the training,
.pth
file is stored in./exp/[exp_name]/[seed_number]/saved_models/
directory.
- Download SIDD-Medium Dataset for training in here
- Radnomly split the SIDD-Medium Dataset into Clean/Noisy set. Please refer the .txt files in
split_data
. - Place the splitted dataset(SIDD_C and SIDD_N) in
./dataset
directory.
dataset
└─── SIDD_C
└─── SIDD_N
└─── test
- Use
gen_dataset_real.py
to package dataset in the h5py format. - After that, run this command:
sh ./scripts/train_real.sh
- After finishing the training,
.pth
file is stored in./exp/[exp_name]/[seed_number]/saved_models/
directory.
dataset
└─── LDCT_C
└─── LDCT_N
└─── test
- Use
gen_dataset_real.py
to package dataset in the h5py format. - After that, run this command:
sh ./scripts/train_ldct.sh
- Download CBSD68 dataset for evaluation in here
- Place the dataset in
./dataset/test
directory.
dataset
└─── train
└─── test
└─── CBSD68
└─── SIDD_test
└─── LDCT_test
- After that, run this command:
sh ./scripts/test_awgn_sigma15.sh # AWGN with a noise level = 15
sh ./scripts/test_awgn_sigma25.sh # AWGN with a noise level = 25
sh ./scripts/test_awgn_sigma50.sh # AWGN with a noise level = 50
- Download the SIDD test dataset for evaluation in here
- Place the dataset in
./dataset/test
directory.
dataset
└─── train
└─── test
└─── CBSD68
└─── SIDD_test
└─── LDCT_test
- After that, run this command:
sh ./scripts/test_real.sh
- Download the LDCT test dataset for evaluation in here
- Place the dataset in
./dataset/test
directory.
dataset
└─── train
└─── test
└─── CBSD68
└─── SIDD_test
└─── LDCT_test
- After that, run this command:
sh ./scripts/test_ldct.sh
We provide pre-trained models in ./checkpoints
directory.
checkpoints
| best_sigma15.pth # pre-trained model (AWGN with a noise level = 15)
| best_sigma25.pth # pre-trained model (AWGN with a noise level = 25)
| best_sigma50.pth # pre-trained model (AWGN with a noise level = 50)
| best_SIDD.pth # pre-trained model (Real-World noise)
| best_LDCT.pth # pre-trained model (LDCT noise)
This code is built on UID-FDK,U-GAT-IT,CARN, SSD-GAN. We thank the authors for sharing their codes.
If you find these codes useful, please cite our related papers, shown as follows.
[1] H.-X. Tsai and L.-W. Kang, "Unsupervised cross domain learning for noise removal from a single image," Proc. IEEE International Conference on Imaging Systems and Techniques, Kaohsiung, Taiwan, 2022.
[2] H.-X. Tsai and L.-W. Kang, "Cross domain deep learning for noise removal from LDCT images," Proc. IEEE International Conference on Consumer Electronics-Taiwan, Taipei, Taiwan, 2022, pp. 475-476.
If you have any questions, feel free to contact me