Code Monkey home page Code Monkey logo

self-domain-adapted-network's Introduction

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}
}

self-domain-adapted-network's People

Contributors

yufanhe avatar

Stargazers

Hanling Wang avatar Gongyu Zhang avatar liuna avatar 杨志毅 avatar JZ avatar Ran Gu avatar Xinya Liu avatar  avatar ZIYUAN (Jacob) ZHAO avatar Pengfei Guo avatar Yanyu Xu avatar  avatar Kyuhee Jo avatar Gabriele Valvano avatar  avatar Mingyuan Luo avatar xin yang avatar

Watchers

Gabriele Valvano avatar  avatar Yufan He avatar

Forkers

armbrustsamuel

self-domain-adapted-network's Issues

About the role of AEnet

Hi, excellent work. But I have some questions about AEnet:
I found that AEnet was not used in the testing phase. What is the function of all AEnet?

image

image

questions about the reported results

Hi, thanks for sharing your excellent work. After reading your paper, I am a little confused about the reported performance of the TTT method. It seems that the TTT results are even worse than the non-adaptation baseline. How did you implement the TTT method? directly input the oct images into the UNet encoder? Cause I find that applying random cropping to the rotation prediction task can improve the performance.

mismatch results of Tent (fully test time adaptation) on OCT segmentation

Hi, thanks for sharing your code. I think your idea is very interesting. However, I have one question related to your MIA paper Table 8. Indeed, I am trying to reproduce your main results on oct segmentation task. For your method, I can achieve around 82.50% dice score.
But for Tent (fully test time adaptation via entropy minimization), I only achieve 81.23% dice score. And I found that the performance is quite sensitive to the model selection and random seeds. Do you have any comment on this ? Or would you like to share your implementation of Tent on oct segmentation task. Sorry for bothering you.

validation of segmentation method

Hi, thanks for sharing your great work. I have read your MICCAI paper.
The paper said your segmentation method was validated on two datasets. However, I can only find the source train dataset. I am wondering whether the test dataset for your adaptation method is public.

How to use the code with different data

Hello! thanks for sharing this code and congratulation on the paper acceptance at MEDIA!

I would like to reuse your code and try the model on different datasets. However, I'm not sure which part of the code I should modify. At this line, it seems you are importing a file that is missing from the repo!

Please, could you help me and point out what are the functions I need to modify to be able to run the code on a different dataset? For example, let's assume I have a dataset under the folder /path/to/dataset/DATA and that under it there are images and segmentation masks having names in the list: [image_0, mask_0, image_1, mask_1, ...., image_N, mask_N], and that I have written a function to load images and masks as: image, mask = load_image_and_mask(image_filename, mask_filename).

How could I include this function in your code?

Thanks a lot for any feedback,
G.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.