Skip to content

heyufan1995/self-domain-adapted-network

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Self domain adapted network

The source code for the paper:

Self domain adapted network (MICCAI2020)
Autoencoder Based Self-Supervised Test-Time Adaptation for Medical Image Analysis(MEDIA2021)

Enviroment setup (optional)

Download Nvidia docker for pytorch

docker pull nvcr.io/nvidia/pytorch:20.03-py3

Create a Dockerfile (already provided)

FROM nvcr.io/nvidian/pytorch:20.03-py3
RUN pip install nibabel
RUN pip install monai
RUN pip install scikit-image
RUN pip install tifffile

Then

docker build -f Dockerfile -t nvcr.io/nvidian/pytorch:20.03-py3-tt .

Run into Docker:

sudo docker run -it --gpus all --pid=host --shm-size 8G -v /home/yufan/Projects/:/workspace/Projects/ nvcr.io/nvidian/pytorch:20.03-py3-tt

Dataset

OCTDataset (download)

MRIDataset (IXI download, JHU currently unavailable due to privacy issue)

Usage

Offline Training

  1. Train Task model (segmentation/synthesis UNet) on source domain (on GPU 0). The datasets/dataset.py need to be modified for your own processed dataset. Also change the data and code path in the bash script.
bash ./scripts/train_oct.sh 0 tnet
  1. Train Auto-encoders on source domain (on GPU 0). Change the tnet_checkpoint_XX.pth to the best validation model. Also change the data and code path in the bash script.
bash ./scripts/train_oct.sh 0 aenet

Test-Time Adaptation

  1. Test on target domain. The network is adapted to each single 3D test subject with their names listed in a txt file --sub_name (subject_01, subject_02 xxx), and the 2D images are extracted and saved as png (subject_01_0.png, subject_01_1.png xxx) in the --vimg_path folder. If convergence is not good, try add --sepochs=5 in the test_oct.sh to stablize the convergence (pre-train the pixel-level adaptor).
bash ./scripts/test_oct.sh 0

Citation

Please cite:

@inproceedings{he2020self,
  title={Self domain adapted network},
  author={He, Yufan and Carass, Aaron and Zuo, Lianrui and Dewey, Blake E and Prince, Jerry L},
  booktitle={International Conference on Medical Image Computing and Computer-Assisted Intervention},
  pages={437--446},
  year={2020},
  organization={Springer}
}

@article{he2021autoencoder,
  title={Autoencoder Based Self-Supervised Test-Time Adaptation for Medical Image Analysis},
  author={He, Yufan and Carass, Aaron and Zuo, Lianrui and Dewey, Blake E and Prince, Jerry L},
  journal={Medical Image Analysis},
  pages={102136},
  year={2021},
  publisher={Elsevier}
}

About

MICCAI2020: self domain adapted network

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published