----A Pytorch implementation of Noise-Powered Disentangled Representation for Unsupervised Speckle Reduction of Optical Coherence Tomography Images.
data
train_valid: the folder to store data for training and validation.test: the folder to store test data.
dataset
dataset.py: python script to build pytorchDatasetandDataLoader.
models
base_model.py: the father class implementing the network building, setup input, forward computation, backpropagation, network saving and loading, learning rate schedulers, and visualization of losses and metrics.drgan_model.py: containing the forward and backward process of our proposed model.drgan_nets.py: the implementation of our proposed network achitectures, such asEncoder,Decoderetc.
run
trainer.py: a basic template python file for training from scratch, or resuming training, and validation theModel.tester.py: a basic template python file for testing theModel.
lib
help_functions.py: the python file can be used to store and modify the model initilization strategies and optimizer scheduler settings.metrics.py: the python file can be used to store and modify the evaluation metrics.visualizer.py: the python file can be used for visualization of the losses and images.
main.py: the script for running the code (train/validation/test).
- if you want to train the model from scratch, run
python main.py --mode train --start_epoch 1
- if you want to resume the training process, run
python main.py --mode train --start_epoch epoch_you_want_to_resume
- if you want to test the model, run
python main.py --mode test --load_epoch parameters_epoch_you_want_to_test
configs.py: the python file can be used to store and modify the hyper-parameters for training, validation and testing process.
- Clone this repo:
git clone https://github.com/tsmotlp/DRGAN-OCT
cd DRGAN
- Install PyTorch 1.0+ and other dependencies (e.g., Pillow, torchvision, visdom)
if you want to train and test DRGAN on your own data, your just need to:
- prepare you own train, validation and test data into folder
data. - modify the hyper-parameters in
configs.pyto make it suitable for your own data. - follow the instructions of
main.py. - To view training results and loss plots, run
python -m visdom.serverand click the URL http://localhost:8097.
If you use this code for your research, please cite our paper.
@ARTICLE{9296372,
author={Y. {Huang} and W. {Xia} and Z. {Lu} and Y. {Liu} and H. {Chen} and J. {Zhou} and L. {Fang} and Y. {Zhang}},
journal={IEEE Transactions on Medical Imaging},
title={Noise-Powered Disentangled Representation for Unsupervised Speckle Reduction of Optical Coherence Tomography Images},
year={2020},
volume={},
number={},
pages={1-1},
doi={10.1109/TMI.2020.3045207}}
if you have any questions, please email to: [email protected].